Package com.portal.web
Class ServletUtil
java.lang.Object
com.portal.web.ServletUtil
WebKit servlet utility class.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PLightComponentHelperaddComponent(PIAComponentCollection col, String name, String fieldDesc) Adds a field bean to a component collection, using the same description for both model and display fields.static PLightComponentHelperaddComponent(PIAComponentCollection col, String name, String inputFieldDesc, String outputFieldDesc) Adds a field bean to a component collection, using the specified model and display field descriptions.static booleancheckError(Map errorMap, PLightComponentHelper lc) Determines whether a field bean exists in theerrorMap.static Object[]convertStrToArgs(String str) Builds the arguments forPInfranetMessageFormat.static HashMapgatherFormInput(javax.servlet.http.HttpServletRequest request) Iterates through the form input sent to the servlet in theHttpRequestobject.static PModelHandlegetModelFromSession(javax.servlet.http.HttpSession session) Validates the session and, if valid, returns itsPModelHandle.static StringgetServiceName(PModelHandle service, javax.servlet.http.HttpSession session) A helper function to retrieve service name from the service modelstatic ObjectLogs into Infranet.static HashMapparseErrorData(PIAComponentCollection col, com.portal.app.util.CustomerValErrorData[] errorData) Performs error parsing.static HashMapparseErrorDataEnhanced(PIAComponentCollection col, com.portal.app.util.CustomerValErrorData[] errorData) static voidsaveBrandModel(PPooledConnectionClientServices pCS, String brand, javax.servlet.http.HttpSession session) Retrieves the brand model handle from the properties file.static voidsaveLocaleInfo(javax.servlet.http.HttpServletRequest req) Reads the HTTP headers from theHttpRequestobject, maps the language parameters, and saves them in session.static voidsetLightDataForAll(Map formInput, PIAComponentCollection col, String caller) PerformssetLightDataon a collection of field beans.static StringvalidateDate(String str) Builds the arguments forPInfranetMessageFormat.
-
Field Details
-
BUNDLE
- See Also:
-
POST_METHOD
- See Also:
-
GET_METHOD
- See Also:
-
LOCALE
- See Also:
-
CHARSET
- See Also:
-
BRAND
- See Also:
-
CONTENT_LANGUAGE
- See Also:
-
VARY
- See Also:
-
ACCEPT_LANGUAGE
- See Also:
-
ACCEPT_CHARSET
- See Also:
-
EXCEPTION
- See Also:
-
CONNECTION
- See Also:
-
PARENT_SERVICE
- See Also:
-
-
Constructor Details
-
ServletUtil
public ServletUtil()
-
-
Method Details
-
logIn
Logs into Infranet.- Parameters:
pCS- the pooled client connection services- Returns:
- A connection key.
-
saveLocaleInfo
public static void saveLocaleInfo(javax.servlet.http.HttpServletRequest req) Reads the HTTP headers from theHttpRequestobject, maps the language parameters, and saves them in session.- Parameters:
req- the servlet request
-
gatherFormInput
Iterates through the form input sent to the servlet in theHttpRequestobject.- Parameters:
request- the servlet request- Returns:
- All input data in a
HashMap.
-
setLightDataForAll
PerformssetLightDataon a collection of field beans.- Parameters:
formInput- map of all input datacol- the collection of field beanscaller- caller information to log
-
parseErrorData
public static HashMap parseErrorData(PIAComponentCollection col, com.portal.app.util.CustomerValErrorData[] errorData) Performs error parsing.- Parameters:
col- a collection of field beanserrorData- error data- Returns:
- A map of the field beans in error, with an error message.
-
parseErrorDataEnhanced
public static HashMap parseErrorDataEnhanced(PIAComponentCollection col, com.portal.app.util.CustomerValErrorData[] errorData) -
checkError
Determines whether a field bean exists in theerrorMap.- Parameters:
errorMap- a map of the field beans in error, with an error messagelc- the field bean to search for in theerrorMap- Returns:
- True, if the field bean exists in the
errorMap; false otherwise.
-
getModelFromSession
public static PModelHandle getModelFromSession(javax.servlet.http.HttpSession session) throws InvalidSessionException Validates the session and, if valid, returns itsPModelHandle.- Parameters:
session- the HTTP session- Returns:
- The
PModelHandlefor the validated session. - Throws:
InvalidSessionException- thrown if the session has expired or the model handle is null
-
addComponent
public static PLightComponentHelper addComponent(PIAComponentCollection col, String name, String fieldDesc) Adds a field bean to a component collection, using the same description for both model and display fields.- Parameters:
col- the component collectionname- aStringwith the name of the field beanfieldDesc- aStringto use for both themodelFieldDescriptionanddisplayFieldDescription- Returns:
- The field bean.
-
addComponent
public static PLightComponentHelper addComponent(PIAComponentCollection col, String name, String inputFieldDesc, String outputFieldDesc) Adds a field bean to a component collection, using the specified model and display field descriptions.- Parameters:
col- the component collectionname- aStringwith the name of the field beaninputFieldDesc- aStringto use for themodelFieldDescriptionoutputFieldDesc- aStringto use for thedisplayFieldDescription- Returns:
- The field bean.
-
convertStrToArgs
Builds the arguments forPInfranetMessageFormat.- Parameters:
str- aStringthat contains the arguments to parse- Returns:
- The parsed arguments.
-
validateDate
Builds the arguments forPInfranetMessageFormat.- Parameters:
str- aStringthat contains the arguments to parse- Returns:
- The parsed arguments.
-
saveBrandModel
public static void saveBrandModel(PPooledConnectionClientServices pCS, String brand, javax.servlet.http.HttpSession session) throws RemoteException Retrieves the brand model handle from the properties file.- Parameters:
pCS- the pooled client connection servicesbrand- the brand resource ID specified in the properties filesession- theHttpSession- Throws:
RemoteException
-
getServiceName
public static String getServiceName(PModelHandle service, javax.servlet.http.HttpSession session) throws RemoteException A helper function to retrieve service name from the service model- Parameters:
service- service modelsession- HttpSession- Returns:
- service name
- Throws:
RemoteException
-