planetj.dataengine
Class RequestManager

java.lang.Object
  |
  +--planetj.dataengine.RequestManager
All Implemented Interfaces:
INavigation

public final class RequestManager
extends Object
implements INavigation

Helper class for working with HttpServletRequest attributes and parameters.


Field Summary
static String className
          Class name.
 
Fields inherited from interface planetj.dataengine.INavigation
CHILD_PREFIX, GROUP_ATTRIBUTES, GROUP_ID, INITIAL_GROUP_ID, INITIAL_PAGE_ID, INITIAL_REQUEST_ID, NAVIGATION_CHECKED, NAVIGATION_OBJECT_LIST_PREFIX, NEW_GROUP_ID, NEW_REQUEST_ID, NEW_SESSION_ID, PAGE_ATTRIBUTES, PAGE_ID, PARENT_PREFIX, PERSISTENT_ATTRIBUTES, PREVIOUS_ATTRIBUTES, PREVIOUS_GROUP_ID, PREVIOUS_PAGE_ID, PREVIOUS_REQUEST_ID, REQUEST_ID, RESET_GROUP_ID, RESET_NAVIGATION_IDS, RESET_NAVIGATION_IDS_COMPLETED, RESET_PAGE_ID, RESET_REQUEST_ID, RESET_SESSION_ID, SESSION_ID
 
Constructor Summary
RequestManager()
           
 
Method Summary
static Object getAttribute(String key, javax.servlet.http.HttpServletRequest request)
          Gets an attribute out of the request.
static IMagicRequest getCurrentMagicRequest(javax.servlet.http.HttpServletRequest req)
          Gets the "current" magic request.
static String getParameter(String key, javax.servlet.http.HttpServletRequest request)
          Gets an parameter out of the request.
static String[] getParameterValues(String key, javax.servlet.http.HttpServletRequest request)
          Gets a parameters out of the request.
static Object getPreviousAttribute(String key, javax.servlet.http.HttpServletRequest request)
          Gets a non persistent attribute from the previous request.
static double getUniqueMagicKey(javax.servlet.http.HttpServletRequest request)
          Return a # unique for this request that is used as the key for the magic request.
static byte getWindowType(javax.servlet.http.HttpServletRequest req)
          Gets the current window type (constants are defined in IDataEngine)
static boolean isLauchedFromBuilder(javax.servlet.http.HttpServletRequest req)
          Checks if the current application was launched from the builder
static boolean isOperationEditingAllowed(javax.servlet.http.HttpServletRequest req)
          Checks if the current application should have editable operations
static Object removeAttribute(String key, javax.servlet.http.HttpServletRequest request)
          Removes an attribute from the request
static void setGroupAttribute(String key, Object value, javax.servlet.http.HttpServletRequest request)
          Sets an attribute on the request that will be persisted for a given group of requests.
static void setMode(String mode, javax.servlet.http.HttpServletRequest request)
          Sets the current mode of the request.
static void setPageAttribute(String key, Object value, javax.servlet.http.HttpServletRequest request)
          Sets an attribute on the request that is associated with this page.
static void setPersistentAttribute(String key, Object value, javax.servlet.http.HttpServletRequest request)
          Sets an attribute on the request that will be persisted.
static void setPreviousAttribute(String name, Object value, javax.servlet.http.HttpServletRequest request)
          Puts an attribute from the previous request into map.
static void setTransientAttribute(String key, Object value, javax.servlet.http.HttpServletRequest request)
          Sets an attribute on the request that will not be automatically transferred to another request.
static void setWindowType(byte windowType, javax.servlet.http.HttpServletRequest req)
          Sets the current window type (constants are defined in IDataEngine)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

className

public static final String className
Class name.

Constructor Detail

RequestManager

public RequestManager()
Method Detail

getAttribute

public static Object getAttribute(String key,
                                  javax.servlet.http.HttpServletRequest request)
Gets an attribute out of the request.


getCurrentMagicRequest

public static IMagicRequest getCurrentMagicRequest(javax.servlet.http.HttpServletRequest req)
Gets the "current" magic request. This is the magic request stored in the previous attributes which is currently running (or about to run or has just finish running).


getParameter

public static String getParameter(String key,
                                  javax.servlet.http.HttpServletRequest request)
Gets an parameter out of the request.


getParameterValues

public static String[] getParameterValues(String key,
                                          javax.servlet.http.HttpServletRequest request)
Gets a parameters out of the request.


getPreviousAttribute

public static Object getPreviousAttribute(String key,
                                          javax.servlet.http.HttpServletRequest request)
Gets a non persistent attribute from the previous request. (e.g. a MagicRequest from the previous page, or a Row from the previous page)


getUniqueMagicKey

public static double getUniqueMagicKey(javax.servlet.http.HttpServletRequest request)
Return a # unique for this request that is used as the key for the magic request.


getWindowType

public static byte getWindowType(javax.servlet.http.HttpServletRequest req)
Gets the current window type (constants are defined in IDataEngine)


isLauchedFromBuilder

public static boolean isLauchedFromBuilder(javax.servlet.http.HttpServletRequest req)
Checks if the current application was launched from the builder


isOperationEditingAllowed

public static boolean isOperationEditingAllowed(javax.servlet.http.HttpServletRequest req)
Checks if the current application should have editable operations


removeAttribute

public static Object removeAttribute(String key,
                                     javax.servlet.http.HttpServletRequest request)
Removes an attribute from the request


setGroupAttribute

public static void setGroupAttribute(String key,
                                     Object value,
                                     javax.servlet.http.HttpServletRequest request)
Sets an attribute on the request that will be persisted for a given group of requests. For example, if the user is navigating through a wizard and attributes need to be carried through each page, they should be set as a group attribute.


setMode

public static void setMode(String mode,
                           javax.servlet.http.HttpServletRequest request)
Sets the current mode of the request.


setPageAttribute

public static void setPageAttribute(String key,
                                    Object value,
                                    javax.servlet.http.HttpServletRequest request)
Sets an attribute on the request that is associated with this page. If the user navigates away from the page displayed from this request, and then returns via the "Cancel" button or other backwards navigation, any attributes stored in the request with this method will be restored to the request.


setPersistentAttribute

public static void setPersistentAttribute(String key,
                                          Object value,
                                          javax.servlet.http.HttpServletRequest request)
Sets an attribute on the request that will be persisted. For example, if the user navigates via a MagicRequest, any attribute set via this method will be propagated to the next HttpServletRequest.


setPreviousAttribute

public static void setPreviousAttribute(String name,
                                        Object value,
                                        javax.servlet.http.HttpServletRequest request)
Puts an attribute from the previous request into map. Values are not set on the request.

Parameters:
name - a String specifying the name of the attribute
value - the Object to be stored

setTransientAttribute

public static void setTransientAttribute(String key,
                                         Object value,
                                         javax.servlet.http.HttpServletRequest request)
Sets an attribute on the request that will not be automatically transferred to another request. This is how request attributes "normally" work.


setWindowType

public static void setWindowType(byte windowType,
                                 javax.servlet.http.HttpServletRequest req)
                          throws CMException
Sets the current window type (constants are defined in IDataEngine)

CMException