org.dspace.app.xmlui.utils
Class RequestUtils

java.lang.Object
  extended by org.dspace.app.xmlui.utils.RequestUtils

public class RequestUtils
extends Object

General utilities for common operations on Request objects.

Author:
Scott Phillips

Constructor Summary
RequestUtils()
           
 
Method Summary
static List<String> getCompositeFieldValues(org.apache.cocoon.environment.Request request, String compositeFieldName, String componentFieldName)
          Get values for a field from a DRI multi value field, since a field may have multiple values this method will check for fieldName + "_n" untill it does not find any more values.
static List<String> getFieldValues(org.apache.cocoon.environment.Request request, String fieldName)
          Get values from a DRI multi value field, since a field may have multiple values this method will check for fieldName + "_n" untill it does not find any more values.
static int getIntParameter(org.apache.cocoon.environment.Request request, String param)
          Obtain a parameter from the given request as an int.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestUtils

public RequestUtils()
Method Detail

getCompositeFieldValues

public static List<String> getCompositeFieldValues(org.apache.cocoon.environment.Request request,
                                                   String compositeFieldName,
                                                   String componentFieldName)
Get values for a field from a DRI multi value field, since a field may have multiple values this method will check for fieldName + "_n" untill it does not find any more values. The result is a list of all values for a field. If the value has been seleted to be removed then it is removed from the list.

Parameters:
request - the request containing the form information
compositeFieldName - The fieldName of the composite field.
componentFieldName - The fieldName of the component field
Returns:
a List of Strings

getFieldValues

public static List<String> getFieldValues(org.apache.cocoon.environment.Request request,
                                          String fieldName)
Get values from a DRI multi value field, since a field may have multiple values this method will check for fieldName + "_n" untill it does not find any more values. The result is a list of all values for a field. If the value has been seleted to be removed then it is removed from the list.

Parameters:
request - the request containing the form information
fieldName - The fieldName of the composite field.
Returns:
a List of Strings

getIntParameter

public static int getIntParameter(org.apache.cocoon.environment.Request request,
                                  String param)
Obtain a parameter from the given request as an int. -1 is returned if the parameter is garbled or does not exist.

Parameters:
request - the HTTP request
param - the name of the parameter
Returns:
the integer value of the parameter, or -1


Copyright © 2012 DuraSpace. All Rights Reserved.