|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.portal.theme.impl.LayoutServiceImpl
Implementaion of the layout server.
The layout server is a registry of all available layouts. The server also allows access to all available render sets and layout strategies. Render sets and layout strategies can be independent (named), or children of a layout. Accordingly, the layout server provides accessor methods to get strategies and render set by name, or by layout. Render sets and layout strategies can, and must, be defined for a specific media type (mime type).
PortalLayout,
PortalRenderSet,
LayoutStrategy,
MediaType| Constructor Summary | |
LayoutServiceImpl()
|
|
| 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 |
void |
create()
|
void |
destroy()
|
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 |
removeLayout(ServerRegistrationID id)
Remove the layout identified by the provided registration id. |
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). |
void |
start()
|
void |
stop()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public LayoutServiceImpl()
| Method Detail |
public void create()
throws java.lang.Exception
create in interface org.jboss.system.Servicejava.lang.ExceptionService.create()public void destroy()
destroy in interface org.jboss.system.ServiceService.destroy()
public void start()
throws java.lang.Exception
start in interface org.jboss.system.Servicejava.lang.ExceptionService.start()public void stop()
stop in interface org.jboss.system.ServiceService.stop()public void addLayout(LayoutRegistrationMetaData metaData) throws LayoutException
LayoutService
addLayout in interface LayoutServicemetaData - the meta information about the layout
LayoutExceptionLayoutService.addLayout(LayoutRegistrationMetaData)
public void setDefaultLayout(java.lang.String name)
throws LayoutException
LayoutService
setDefaultLayout in interface LayoutServicename - the name of the layout to set as default
LayoutExceptionLayoutService.setDefaultLayout(String)public PortalLayout getLayout(ServerRegistrationID id, boolean defaultOnNull)
LayoutService
getLayout in interface LayoutServiceid - the registration id of the layout to getdefaultOnNull - true, if the default layout (if any is defined) should be
returned in case the requested layout is not found
LayoutService.getLayout(org.jboss.portal.theme.ServerRegistrationID, boolean)public PortalLayout getLayout(java.lang.String name, boolean defaultOnNull)
LayoutService
getLayout in interface LayoutServicename - the name of the layout to requestdefaultOnNull - true, if the default layout (if any is defined) should be
returned in case the requested layout is not found
LayoutService.getLayout(String, boolean)public void removeLayout(ServerRegistrationID id) throws LayoutException
id - the id of the layout that needs to be removed
LayoutException
public void removeLayouts(java.lang.String appID)
throws LayoutException
LayoutService
removeLayouts in interface LayoutServiceappID - the name of the application that hosts the layout(s) to be removed
LayoutExceptionLayoutService.removeLayouts(String)public void addStrategy(AbstractLayoutStrategy strategy)
LayoutService
addStrategy in interface LayoutServicestrategy - the strategy to registerLayoutService.addStrategy(org.jboss.portal.theme.strategy.AbstractLayoutStrategy)public LayoutStrategy getStrategy(PortalLayout layout, MediaType mediaType)
LayoutServiceIn 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.
getStrategy in interface LayoutServicelayout - 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
LayoutService.getStrategy(org.jboss.portal.theme.PortalLayout, org.jboss.portal.common.MediaType)public LayoutStrategy getStrategy(java.lang.String strategyName, MediaType mediaType)
LayoutService
getStrategy in interface LayoutServicestrategyName - the name of the strategy to getmediaType - the media type (content-type) to get the strategy for
LayoutService.getStrategy(String, org.jboss.portal.common.MediaType)
public void removeStrategies(java.lang.String appID)
throws LayoutException
LayoutService
removeStrategies in interface LayoutServiceappID - the name of the application that hosts the strategie(s) to be removed
LayoutExceptionLayoutService.removeStrategies(String)public void addRenderSet(PortalRenderSet renderSet)
LayoutService
addRenderSet in interface LayoutServicerenderSet - the renderSet to registerLayoutService.addRenderSet(org.jboss.portal.theme.render.PortalRenderSet)public PortalRenderSet getRenderSet(PortalLayout layout, MediaType mediaType)
LayoutService
getRenderSet in interface LayoutServicelayout - the layout to query for an anonymous render set (defined only for this layout)mediaType - the media type to get the render set for
LayoutService.getRenderSet(org.jboss.portal.theme.PortalLayout, org.jboss.portal.common.MediaType)public PortalRenderSet getRenderSet(java.lang.String renderSetName, MediaType mediaType)
LayoutService
getRenderSet in interface LayoutServicerenderSetName - the name of the renderSet to findmediaType - the mediatype for which to find the renderSet
LayoutService.getRenderSet(String, org.jboss.portal.common.MediaType)
public void removeRenderSets(java.lang.String appID)
throws LayoutException
LayoutService
removeRenderSets in interface LayoutServiceappID - the name of the application that hosts the render set(s) to be removed
LayoutExceptionLayoutService.removeRenderSets(String)public java.util.Collection getLayouts()
LayoutService
getLayouts in interface LayoutServiceLayoutService.getLayouts()public java.util.Collection getStrategies()
LayoutService
getStrategies in interface LayoutServiceLayoutService.getStrategies()public java.util.Collection getRenderSets()
LayoutService
getRenderSets in interface LayoutServiceLayoutService.getRenderSets()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||