站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBOSS Portal 2.2 API 英文版文档

PortalLayout - JBOSS Portal 2.2 API 英文版文档


org.jboss.portal.theme
Interface PortalLayout

All Known Implementing Classes:
PortalLayoutImpl

public interface PortalLayout

A layout is a resource to lay out a portal page, that can be reached via a javax.servlet.RequestDispatcher.

A layout is lost likely a jsp page, but servlets could be used as well. The layout is not limited to exist in the portal's archive, it can be located in any deployed archive on the server.

Any layout that the portal will pick up needs to be defined in a layout descriptor. The Layout desciptor is an xml file in WEB-INF/ with the file name *-layouts.xml

A portal layout cooperates with a portal theme and a renderer set to render the markup of a portal page.

See Also:
Renderer, LayoutStrategy, PortalTheme

Method Summary
 java.lang.String getAppID()
          Get the name of the application (WAR) that contains the layout
 java.lang.String getContextPath()
          Return the context path of the war file in which the layout is deployed.
 java.lang.ClassLoader getLoader()
          Get the class loader for this layout, the loader of the portal web application.
 java.lang.String getName()
          Get the name of the layout.
 java.util.List getRegionNames()
          Get a list of region names are they are provided in the layout descriptor.
 PortalRenderSet getRenderSet(MediaType mediaType)
          Out of the render sets defined for this layout (in portal-layouts.xml), get the one that matches the requested content type.
 javax.servlet.ServletContext getServletContext()
          Get the servlet context in which the layout resides
 LayoutStrategy getStrategy(MediaType mediaType)
          Out of the portal strategies defined for this layout (if any), get the one that was defined for the provided media type.
 java.lang.String getURI()
          Get the uri, the location of the layout, relative to its context
 java.lang.String getURI(java.lang.String state)
          Get the uri, the location of the layout, relative to its context.
 

Method Detail

getServletContext

public javax.servlet.ServletContext getServletContext()
Get the servlet context in which the layout resides

Returns:
the servlet context in which the layout resides

getAppID

public java.lang.String getAppID()
Get the name of the application (WAR) that contains the layout

Returns:
the name of the application (WAR) that contains the layout

getName

public java.lang.String getName()
Get the name of the layout. The name of a layout is defined in the layout descriptor.

Returns:
the name of the layout

getURI

public java.lang.String getURI()
Get the uri, the location of the layout, relative to its context

Returns:
the uri of the layout relative to its context

getURI

public java.lang.String getURI(java.lang.String state)
Get the uri, the location of the layout, relative to its context.

Parameters:
state - an optional key to further separate URIs (for example for maximized window state). If a layout uri was defined for the provided state, that uri will be returned, otherwise the generic URI for this layout will be returned. If null is provided, the result is the same as calling getURI()
Returns:
the uri of the layout relative to its context
See Also:
getServletContext(), getURI()

getContextPath

public java.lang.String getContextPath()
Return the context path of the war file in which the layout is deployed.

Returns:
the context path of the war file in which the layout is deployed

getRenderSet

public PortalRenderSet getRenderSet(MediaType mediaType)
Out of the render sets defined for this layout (in portal-layouts.xml), get the one that matches the requested content type.

Parameters:
mediaType - the media type of the current request
Returns:
a PortalRenderSet for this layout and provided media/content type
See Also:
MediaType, PortalRenderSet

getLoader

public java.lang.ClassLoader getLoader()
Get the class loader for this layout, the loader of the portal web application.

Returns:
the class loader of the portal web application

getStrategy

public LayoutStrategy getStrategy(MediaType mediaType)
Out of the portal strategies defined for this layout (if any), get the one that was defined for the provided media type. (see also portal-layouts.xml)

Parameters:
mediaType - the media type (content type) for which to get the strategy for
Returns:
the strategy that was defined for this layout and media type, or null if no strategy was defined for the provided criteria.

getRegionNames

public java.util.List getRegionNames()
Get a list of region names are they are provided in the layout descriptor.

Returns:
the list of region names that this layout uses