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 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.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.static boolean
checkError
(Map errorMap, PLightComponentHelper lc) Determines whether a field bean exists in theerrorMap
.static Object[]
convertStrToArgs
(String str) Builds the arguments forPInfranetMessageFormat
.static HashMap
gatherFormInput
(javax.servlet.http.HttpServletRequest request) Iterates through the form input sent to the servlet in theHttpRequest
object.static PModelHandle
getModelFromSession
(javax.servlet.http.HttpSession session) Validates the session and, if valid, returns itsPModelHandle
.static String
getServiceName
(PModelHandle service, javax.servlet.http.HttpSession session) A helper function to retrieve service name from the service modelstatic Object
Logs into Infranet.static HashMap
parseErrorData
(PIAComponentCollection col, com.portal.app.util.CustomerValErrorData[] errorData) Performs error parsing.static HashMap
parseErrorDataEnhanced
(PIAComponentCollection col, com.portal.app.util.CustomerValErrorData[] errorData) static void
saveBrandModel
(PPooledConnectionClientServices pCS, String brand, javax.servlet.http.HttpSession session) Retrieves the brand model handle from the properties file.static void
saveLocaleInfo
(javax.servlet.http.HttpServletRequest req) Reads the HTTP headers from theHttpRequest
object, maps the language parameters, and saves them in session.static void
setLightDataForAll
(Map formInput, PIAComponentCollection col, String caller) PerformssetLightData
on a collection of field beans.static String
validateDate
(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 theHttpRequest
object, 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 theHttpRequest
object.- Parameters:
request
- the servlet request- Returns:
- All input data in a
HashMap
.
-
setLightDataForAll
PerformssetLightData
on 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
PModelHandle
for 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
- aString
with the name of the field beanfieldDesc
- aString
to use for both themodelFieldDescription
anddisplayFieldDescription
- 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
- aString
with the name of the field beaninputFieldDesc
- aString
to use for themodelFieldDescription
outputFieldDesc
- aString
to use for thedisplayFieldDescription
- Returns:
- The field bean.
-
convertStrToArgs
Builds the arguments forPInfranetMessageFormat
.- Parameters:
str
- aString
that contains the arguments to parse- Returns:
- The parsed arguments.
-
validateDate
Builds the arguments forPInfranetMessageFormat
.- Parameters:
str
- aString
that 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
-