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

LayoutService - JBOSS Portal 2.2 API 英文版文档


org.jboss.portal.theme
Interface LayoutService

All Known Implementing Classes:
LayoutServiceImpl

public interface LayoutService

TODO: A description of this class.


Method Summary
 void addLayout(LayoutRegistrationMetaData metaData)
          Add a layout.
 void addRenderSet(PortalRenderSet renderSet)
          Register a renderSet with this service
 void addStrategy(AbstractLayoutStrategy strategy)
          Register a a portal layout strategy with this service
 PortalLayout getLayout(ServerRegistrationID id, boolean defaultOnNull)
          Get the layout for the provided registration id.
 PortalLayout getLayout(java.lang.String name, boolean defaultOnNull)
          Get the layout for the provided name.
 java.util.Collection getLayouts()
          Get a Set of portal layouts
 PortalRenderSet getRenderSet(PortalLayout layout, MediaType mediaType)
          Get the render set for the provided layout.
 PortalRenderSet getRenderSet(java.lang.String renderSetName, MediaType mediaType)
          Get the render set for the provided layout.
 java.util.Collection getRenderSets()
          Get a Set of all available portal layout renderSets
 java.util.Collection getStrategies()
          Get a Set of all available portal layout strategies
 LayoutStrategy getStrategy(PortalLayout layout, MediaType mediaType)
          Get the layout strategy that was defined for the provided layout.
 LayoutStrategy getStrategy(java.lang.String strategyName, MediaType mediaType)
          Get the layout strategy that matches the provided name and media type
 void removeLayouts(java.lang.String appID)
          Remove all layouts that are hosted in the provided application.
 void removeRenderSets(java.lang.String appID)
          Remove all rendersets that are hosted in the provided application.
 void removeStrategies(java.lang.String appID)
          Remove all strategies that are hosted in the provided application.
 void setDefaultLayout(java.lang.String name)
          Set the default layout (on a global level).
 

Method Detail

addLayout

public void addLayout(LayoutRegistrationMetaData metaData)
               throws LayoutException
Add a layout.

Parameters:
metaData - the meta information about the layout
Throws:
LayoutException

setDefaultLayout

public void setDefaultLayout(java.lang.String name)
                      throws LayoutException
Set the default layout (on a global level).

Parameters:
name - the name of the layout to set as default
Throws:
LayoutException

getLayout

public PortalLayout getLayout(ServerRegistrationID id,
                              boolean defaultOnNull)
Get the layout for the provided registration id.

Parameters:
id - the registration id of the layout to get
defaultOnNull - true, if the default layout (if any is defined) should be returned in case the requested layout is not found
Returns:
the requested layout , of the default layout, or null

getLayout

public PortalLayout getLayout(java.lang.String name,
                              boolean defaultOnNull)
Get the layout for the provided name.

Parameters:
name - the name of the layout to request
defaultOnNull - true, if the default layout (if any is defined) should be returned in case the requested layout is not found
Returns:
the requested layout , of the default layout, or null

removeLayouts

public void removeLayouts(java.lang.String appID)
                   throws LayoutException
Remove all layouts that are hosted in the provided application.

Parameters:
appID - the name of the application that hosts the layout(s) to be removed
Throws:
LayoutException

addStrategy

public void addStrategy(AbstractLayoutStrategy strategy)
Register a a portal layout strategy with this service

Parameters:
strategy - the strategy to register

getStrategy

public LayoutStrategy getStrategy(PortalLayout layout,
                                  MediaType mediaType)
Get the layout strategy that was defined for the provided layout.

In the layout descriptor (portal-layouts.xml) a strategy can be defined to be used in conjunction with every layout that is defined in this file. The layout must be defined per media type. The portal provides a default implementation on a strategy which can be accessed by passing null as the layout.

Parameters:
layout - the layout to get the strategy for (or null for the default layout strategy)
mediaType - the media type (content type ; mime type) of the strategy
Returns:
an implementation of a LayoutStrategy or null if no strategy was found

getStrategy

public LayoutStrategy getStrategy(java.lang.String strategyName,
                                  MediaType mediaType)
Get the layout strategy that matches the provided name and media type

Parameters:
strategyName - the name of the strategy to get
mediaType - the media type (content-type) to get the strategy for
Returns:
the layout strategy that matches the provided name and mediatype, or null if no such strategy is registered

removeStrategies

public void removeStrategies(java.lang.String appID)
                      throws LayoutException
Remove all strategies that are hosted in the provided application.

Parameters:
appID - the name of the application that hosts the strategie(s) to be removed
Throws:
LayoutException

addRenderSet

public void addRenderSet(PortalRenderSet renderSet)
Register a renderSet with this service

Parameters:
renderSet - the renderSet to register

getRenderSet

public PortalRenderSet getRenderSet(PortalLayout layout,
                                    MediaType mediaType)
Get the render set for the provided layout.

Parameters:
layout - the layout to query for an anonymous render set (defined only for this layout)
mediaType - the media type to get the render set for
Returns:
the anonymous render set for the provided layout and media type, or null

getRenderSet

public PortalRenderSet getRenderSet(java.lang.String renderSetName,
                                    MediaType mediaType)
Get the render set for the provided layout.

Parameters:
renderSetName - the name of the renderSet to find
mediaType - the mediatype for which to find the renderSet
Returns:
the registered renderSet for the provided name and media type, or null if no such renderSet is registered

removeRenderSets

public void removeRenderSets(java.lang.String appID)
                      throws LayoutException
Remove all rendersets that are hosted in the provided application.

Parameters:
appID - the name of the application that hosts the render set(s) to be removed
Throws:
LayoutException

getLayouts

public java.util.Collection getLayouts()
Get a Set of portal layouts

Returns:
a Set of portal layouts

getStrategies

public java.util.Collection getStrategies()
Get a Set of all available portal layout strategies

Returns:
a Set of portal layout strategies

getRenderSets

public java.util.Collection getRenderSets()
Get a Set of all available portal layout renderSets

Returns:
a Set of portal layout renderSets