Class ServletUtil

java.lang.Object
com.portal.web.ServletUtil

public class ServletUtil extends Object
WebKit servlet utility class.
  • Field Details

  • Constructor Details

    • ServletUtil

      public ServletUtil()
  • Method Details

    • logIn

      public static Object logIn(PPooledConnectionClientServices pCS)
      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 the HttpRequest object, maps the language parameters, and saves them in session.
      Parameters:
      req - the servlet request
    • gatherFormInput

      public static HashMap gatherFormInput(javax.servlet.http.HttpServletRequest request)
      Iterates through the form input sent to the servlet in the HttpRequest object.
      Parameters:
      request - the servlet request
      Returns:
      All input data in a HashMap.
    • setLightDataForAll

      public static void setLightDataForAll(Map formInput, PIAComponentCollection col, String caller)
      Performs setLightData on a collection of field beans.
      Parameters:
      formInput - map of all input data
      col - the collection of field beans
      caller - 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 beans
      errorData - 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

      public static boolean checkError(Map errorMap, PLightComponentHelper lc)
      Determines whether a field bean exists in the errorMap.
      Parameters:
      errorMap - a map of the field beans in error, with an error message
      lc - the field bean to search for in the errorMap
      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 its PModelHandle.
      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 collection
      name - a String with the name of the field bean
      fieldDesc - a String to use for both the modelFieldDescription and displayFieldDescription
      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 collection
      name - a String with the name of the field bean
      inputFieldDesc - a String to use for the modelFieldDescription
      outputFieldDesc - a String to use for the displayFieldDescription
      Returns:
      The field bean.
    • convertStrToArgs

      public static Object[] convertStrToArgs(String str)
      Builds the arguments for PInfranetMessageFormat.
      Parameters:
      str - a String that contains the arguments to parse
      Returns:
      The parsed arguments.
    • validateDate

      public static String validateDate(String str)
      Builds the arguments for PInfranetMessageFormat.
      Parameters:
      str - a String 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 services
      brand - the brand resource ID specified in the properties file
      session - the HttpSession
      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 model
      session - HttpSession
      Returns:
      service name
      Throws:
      RemoteException