Class PortletUtils


  • public class PortletUtils
    extends Object
    Version:
    $Revision: 1.1 $
    Author:
    Julien Viet
    • Constructor Detail

      • PortletUtils

        public PortletUtils()
    • Method Detail

      • decodeWindowState

        public static javax.portlet.WindowState decodeWindowState​(String windowStateName)
        Creates a WindowState object based on the specified name.
        Parameters:
        windowStateName - the name of the window state
        Returns:
        one of the standard WindowStates if the specified name matches one of them or a new WindowState.
        See Also:
        WindowState
      • decodePortletMode

        public static javax.portlet.PortletMode decodePortletMode​(String portletModeName)
        Creates a PortletMode object based on the specified name.
        Parameters:
        portletModeName - the name of the portlet mode
        Returns:
        one of the standard PortletModes if the specified name matches one of them or a new PortletMode.
        See Also:
        PortletMode
      • generateNamespaceFrom

        public static String generateNamespaceFrom​(String windowId)
        Generates a namespace suitable for Portlet prefixing of tokens that need to be unique in an aggregated page.
        Parameters:
        windowId - the window id
        Returns:
        the namespace value
        Since:
        2.6
      • getPortalContextPath

        public static String getPortalContextPath​(javax.servlet.http.HttpServletRequest request)
        Returns the original context path before dispatch is made This will ensure to get the original root path in all Servlet Containers (Tomcat / JBoss / Wildfly)
        Parameters:
        request - HTTP Request
        Returns:
        the root path retrieved from HTTP request URI
      • unwrap

        public static <U extends javax.portlet.PortletRequest> U unwrap​(javax.portlet.PortletRequest wrapped,
                                                                        Class<U> unwrapped)
      • unwrap

        public static <U extends javax.portlet.PortletResponse> U unwrap​(javax.portlet.PortletResponse wrapped,
                                                                         Class<U> unwrapped)