com.ptc.windchill.cadx.common.util
Class ServletSessionCookieUtilities

java.lang.Object
  extended bycom.ptc.windchill.cadx.common.util.ServletSessionCookieUtilities

public class ServletSessionCookieUtilities
extends Object

This class provides convenience methods to save and retrieve key/value pairs using ServletSessionCookie object model.


Field Summary
static String ADDITIONAL_FORM_DATA_TO_REFERER_COOKIE_KEY
           
static String ON_RELOAD_FORM_DATA_COOKIE_KEY
           
static String ON_SUBMIT_FORM_DATA_COOKIE_KEY
           
private static String RESOURCE
           
 
Constructor Summary
ServletSessionCookieUtilities()
           
 
Method Summary
private static Properties cleanupNotSerializableMappings(HTTPState a_HTTPState, Properties formData)
          Remove any non-serialization objects from the formData as it causes exception later in ServletSessionCookieManager.saveCookies() call.
static String createCookieKey(HTTPState a_HTTPState, String key)
          Create a session cookie key for the specified key in the standard page key format.
static Properties getFormDataFromSessionCookie(HTTPState a_HTTPState, String hiddenFieldsCookieId)
          Get the saved FormData from the specified ServletSessionCookie for the ON_RELOAD_FORM_DATA_COOKIE_KEY key.
static Properties getFormDataFromSessionCookie(HTTPState a_HTTPState, String cookieId, String cookieKey)
          For the specified cookieKey, Get the FormData object from the specified cookieId ServletSessionCookie.
static Object getValueFromSavedCookie(HTTPState a_HTTPState, String cookieId, String cookieKey)
          Get the value part of the key/value pair for the specified key from the saved session cookie for the specified cookie id.
static void removeCookie(HTTPState a_HTTPState, String cookieId)
           
static Object removeFormDataParamMapping(HTTPState a_HTTPState, String cookieId, String cookieKey, String paramKey)
          For the specified cookieId ServletSessionCookie & specified cookieKey, remove the key mapping from it's FormData Properties object for the specified paramKey.
static Object removeKeyMappingFromSavedCookie(HTTPState a_HTTPState, String cookieId, String cookieKey)
          Remove the key mapping for the specified key from the saved session cookie for the specified cookie id.
static void saveFormDataInSessionCookie(HTTPState a_HTTPState, String cookieId)
          Save the current page's current FormData in the specified cookieid ServletSessionCookie for the on reload FormData key/value pair.
static void saveFormDataInSessionCookie(HTTPState a_HTTPState, String cookieId, String cookieKey, Properties formData)
          For the specified cookieId & cookieKey, save the specified FormData in a ServletSessionCookie.
static void saveKeyAndValueInSessionCookie(HTTPState a_HTTPState, String cookieId, String key, Object cookieValue)
          For the specified cookie id, create the key/value pair using the specified key & value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

ON_RELOAD_FORM_DATA_COOKIE_KEY

public static final String ON_RELOAD_FORM_DATA_COOKIE_KEY
See Also:
Constant Field Values

ON_SUBMIT_FORM_DATA_COOKIE_KEY

public static final String ON_SUBMIT_FORM_DATA_COOKIE_KEY
See Also:
Constant Field Values

ADDITIONAL_FORM_DATA_TO_REFERER_COOKIE_KEY

public static final String ADDITIONAL_FORM_DATA_TO_REFERER_COOKIE_KEY
See Also:
Constant Field Values
Constructor Detail

ServletSessionCookieUtilities

public ServletSessionCookieUtilities()
Method Detail

saveKeyAndValueInSessionCookie

public static void saveKeyAndValueInSessionCookie(HTTPState a_HTTPState,
                                                  String cookieId,
                                                  String key,
                                                  Object cookieValue)
For the specified cookie id, create the key/value pair using the specified key & value.


createCookieKey

public static String createCookieKey(HTTPState a_HTTPState,
                                     String key)
Create a session cookie key for the specified key in the standard page key format.


getValueFromSavedCookie

public static Object getValueFromSavedCookie(HTTPState a_HTTPState,
                                             String cookieId,
                                             String cookieKey)
Get the value part of the key/value pair for the specified key from the saved session cookie for the specified cookie id.


saveFormDataInSessionCookie

public static void saveFormDataInSessionCookie(HTTPState a_HTTPState,
                                               String cookieId)
Save the current page's current FormData in the specified cookieid ServletSessionCookie for the on reload FormData key/value pair. This value could be later used during reloading of this page to ensure that it reloads with access to all the FormData parameters as it had during initial load of this page.


saveFormDataInSessionCookie

public static void saveFormDataInSessionCookie(HTTPState a_HTTPState,
                                               String cookieId,
                                               String cookieKey,
                                               Properties formData)
For the specified cookieId & cookieKey, save the specified FormData in a ServletSessionCookie.


getFormDataFromSessionCookie

public static Properties getFormDataFromSessionCookie(HTTPState a_HTTPState,
                                                      String hiddenFieldsCookieId)
Get the saved FormData from the specified ServletSessionCookie for the ON_RELOAD_FORM_DATA_COOKIE_KEY key. This value could be later used during reloading of this page to ensure that it reloads with access to all the FormData parameters as it had during initial load of this page.


getFormDataFromSessionCookie

public static Properties getFormDataFromSessionCookie(HTTPState a_HTTPState,
                                                      String cookieId,
                                                      String cookieKey)
For the specified cookieKey, Get the FormData object from the specified cookieId ServletSessionCookie.


removeCookie

public static void removeCookie(HTTPState a_HTTPState,
                                String cookieId)

removeKeyMappingFromSavedCookie

public static Object removeKeyMappingFromSavedCookie(HTTPState a_HTTPState,
                                                     String cookieId,
                                                     String cookieKey)
Remove the key mapping for the specified key from the saved session cookie for the specified cookie id. Resturns previous value associated with specified key, or null if there was no mapping for key


removeFormDataParamMapping

public static Object removeFormDataParamMapping(HTTPState a_HTTPState,
                                                String cookieId,
                                                String cookieKey,
                                                String paramKey)
For the specified cookieId ServletSessionCookie & specified cookieKey, remove the key mapping from it's FormData Properties object for the specified paramKey. Returns the value to which the key had been mapped in this Properties object, or null if the paramKey did not have a mapping.


cleanupNotSerializableMappings

private static Properties cleanupNotSerializableMappings(HTTPState a_HTTPState,
                                                         Properties formData)
Remove any non-serialization objects from the formData as it causes exception later in ServletSessionCookieManager.saveCookies() call.