Class PortletUtils
- java.lang.Object
-
- org.gatein.pc.portlet.impl.jsr168.PortletUtils
-
public class PortletUtils extends Object
- Version:
- $Revision: 1.1 $
- Author:
- Julien Viet
-
-
Constructor Summary
Constructors Constructor Description PortletUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.portlet.PortletModedecodePortletMode(String portletModeName)Creates aPortletModeobject based on the specified name.static javax.portlet.WindowStatedecodeWindowState(String windowStateName)Creates aWindowStateobject based on the specified name.static StringgenerateNamespaceFrom(String windowId)Generates a namespace suitable for Portlet prefixing of tokens that need to be unique in an aggregated page.static StringgetPortalContextPath(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)static <U extends javax.portlet.PortletRequest>
Uunwrap(javax.portlet.PortletRequest wrapped, Class<U> unwrapped)static <U extends javax.portlet.PortletResponse>
Uunwrap(javax.portlet.PortletResponse wrapped, Class<U> unwrapped)
-
-
-
Field Detail
-
PREFIX
public static final String PREFIX
- See Also:
- Constant Field Values
-
SUFFIX
public static final String SUFFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
decodeWindowState
public static javax.portlet.WindowState decodeWindowState(String windowStateName)
Creates aWindowStateobject 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 aPortletModeobject 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)
-
-