Class CommonHandlers


  • public class CommonHandlers
    extends Object
    • Constructor Summary

      Constructors 
      Constructor Description
      CommonHandlers()
      Creates a new instance of CommonHandlers
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void convertDateTimeFormat​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)  
      static void convertMillisToReadable​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      This handler converts the milliseconds to readable format
      static void createAttributeMap​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      This handler creates a map with the given keys and values
      static Map<String,​Serializable> createPageSession​(jakarta.faces.context.FacesContext ctx, jakarta.faces.component.UIViewRoot root)  
      static List filterAdminObjects​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext context)
      This handler filters out AdminObjects from a list-jms-resources, only return Connection Factories.
      static void filterMap​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)  
      static List filterProtocols​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext context)
      This handler filters out not required protocols from the list of protocols available
      static void filterTable​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)  
      void getCurrentTime​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      Returns the current system time formatted
      static void getFieldLengths​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      This handler will be called from baseLayout.xhtml to load the maximum field lengths (maximum number of characters that a user can enter in each field).
      static void getListElement​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      This handler returns String[] of the given java.util.List
      static void getRequestValue​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      This handler returns the requestParameter value based on the key.
      void handleError​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)  
      static void initClusterSessionAttribute​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      This handler will be called during initialization when Cluster Support is detected.
      static void initProductInfoAttributes​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      This function is called in login.jsf to set the various product specific attributes such as the product GIFs and product names.
      static void initSessionAttributes​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      This handler will be called during initialization for doing any initialization.
      static void isAIX​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)  
      static void logout​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      This method kills the session, and logs out
      void longAdd​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      This method adds two long integers together.
      static void navigate​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext context)
      This handler is different than JSFT's default navigate handler in that it forces the request to NOT be a "partial request".
      static void onlyDas​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)  
      static void redirect​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext context)
      This handler redirects to the given page.
      static void removeEmptyProps​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      Remove the properties if the key(name) is empty.
      static void removeListElement​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      This handler removes the given element from the list
      static void selectiveEncode​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      This handler returns the encoded String using the type specified.
      static void setComponentRequired​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      This method sets the required attribute of a UI component .
      static void setPartialRequest​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext context)
      This handler allows the "partialRequest" flag to be set.
      static void setValueExpression​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      This handler sets a property on an object which is stored in an existing key For example "advance.lazyConnectionEnlistment".
      static void testExists​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      Test if a particular attribute exists.
    • Constructor Detail

      • CommonHandlers

        public CommonHandlers()
        Creates a new instance of CommonHandlers
    • Method Detail

      • initClusterSessionAttribute

        public static void initClusterSessionAttribute​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)

        This handler will be called during initialization when Cluster Support is detected.

      • initSessionAttributes

        public static void initSessionAttributes​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)

        This handler will be called during initialization for doing any initialization.

      • getFieldLengths

        public static void getFieldLengths​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)

        This handler will be called from baseLayout.xhtml to load the maximum field lengths (maximum number of characters that a user can enter in each field).

      • initProductInfoAttributes

        public static void initProductInfoAttributes​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
        This function is called in login.jsf to set the various product specific attributes such as the product GIFs and product names. A similar function is called for Sailfin to set Sailfin specific product GIFs and name. The function is defined in com.sun.extensions.comms.SipUtilities
      • getListElement

        public static void getListElement​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)

        This handler returns String[] of the given java.util.List

        Output value: "selectedIndex" -- Type: Object/

        Parameters:
        handlerCtx - The HandlerContext.
      • removeListElement

        public static void removeListElement​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)

        This handler removes the given element from the list

        Output value: "finalList" -- Type: List/

        Parameters:
        handlerCtx - The HandlerContext.
      • convertMillisToReadable

        public static void convertMillisToReadable​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)

        This handler converts the milliseconds to readable format

        Output value: "readableString" -- Type: String/

        Parameters:
        handlerCtx - The HandlerContext.
      • createAttributeMap

        public static void createAttributeMap​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)

        This handler creates a map with the given keys and values

        Output value: "map" -- Type: Map/

        Parameters:
        handlerCtx - The HandlerContext.
      • selectiveEncode

        public static void selectiveEncode​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)

        This handler returns the encoded String using the type specified.

        If type is not specified, it defaults to UTF-8.

        Input value: "value" -- Type: String

        Input value: "delim" -- Type: String

        Input Value: "type" -- Type: String

        Output Value: "value" -- Type: String

        Parameters:
        handlerCtx - The HandlerContext.
      • logout

        public static void logout​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)

        This method kills the session, and logs out

        Server Domain Attributes Page.

        Input value: "page" -- Type: java.lang.String

        Parameters:
        handlerCtx - The HandlerContext.
      • setComponentRequired

        public static void setComponentRequired​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)

        This method sets the required attribute of a UI component .

        Input value: "id" -- Type: java.lang.String

        Input value: "required" -- Type: java.lang.String

        Parameters:
        handlerCtx - The HandlerContext.
      • testExists

        public static void testExists​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)

        Test if a particular attribute exists. It will look at request scope, then page, then session.

      • removeEmptyProps

        public static void removeEmptyProps​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)

        Remove the properties if the key(name) is empty.

      • getRequestValue

        public static void getRequestValue​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)

        This handler returns the requestParameter value based on the key. If it doesn't exists, then it will look at the request attribute. If there is no request attribute, it will return the default, if specified.

        This method will "html escape" any <, >, or & characters that appear in a String from the QUERY_STRING. This is to help prevent XSS vulnerabilities.

        orig without escape is available, but be very cautious when using it.

        Input value: "key" -- Type: String

        Output value: "value" -- Type: String

        Output value: "orig" -- Type: String

      • longAdd

        public void longAdd​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
        This method adds two long integers together. The 2 longs should be stored in "long1" and "long2". The result will be stored as "result".
      • getCurrentTime

        public void getCurrentTime​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)

        Returns the current system time formatted

        Output value: "Time" -- Type: String

      • handleError

        public void handleError​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      • onlyDas

        public static void onlyDas​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      • setValueExpression

        public static void setValueExpression​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)

        This handler sets a property on an object which is stored in an existing key For example "advance.lazyConnectionEnlistment". Note: This does not evaluate the EL expression. Its value (e.g., "#{advance.lazyConnectionEnlistment}") is passed as is to the EL API.

      • convertDateTimeFormat

        public static void convertDateTimeFormat​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      • setPartialRequest

        public static void setPartialRequest​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext context)

        This handler allows the "partialRequest" flag to be set. This was added to work-a-round a bug in JSF where the behavior was inconsistent between FF and other browsers. Namely it recognized redirects as "partial" requets in other browsers due to the header being preserved across the redirect, but not in FF.

      • navigate

        public static void navigate​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext context)

        This handler is different than JSFT's default navigate handler in that it forces the request to NOT be a "partial request". The effect is that no wrapping of the response will be done. This is normally done in JSF2 in order to work with the jsf.js JS code that handles the response. In the Admin Console, we typically do not use this JS, so this is not desirable behavior.

        Input value: "page" -- Type: Object (should be a String or a UIViewRoot).

        See JSFTemplating's built-in navigate handler for more info.

        Parameters:
        context - The HandlerContext.
      • redirect

        public static void redirect​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext context)

        This handler redirects to the given page.

        Input value: "page" -- Type: String

        Parameters:
        context - The HandlerContext.
      • filterTable

        public static void filterTable​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      • filterMap

        public static void filterMap​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      • isAIX

        public static void isAIX​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
      • filterProtocols

        public static List filterProtocols​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext context)

        This handler filters out not required protocols from the list of protocols available

      • filterAdminObjects

        public static List filterAdminObjects​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext context)

        This handler filters out AdminObjects from a list-jms-resources, only return Connection Factories.

      • createPageSession

        public static Map<String,​Serializable> createPageSession​(jakarta.faces.context.FacesContext ctx,
                                                                       jakarta.faces.component.UIViewRoot root)