|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.mx.util.JBossNotificationBroadcasterSupport org.jboss.system.ServiceMBeanSupport org.jboss.portal.jems.as.system.AbstractJBossService org.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
Field Summary | |
private ServerRegistrationID |
defaultID
|
private java.util.Map |
exactLayoutNames
|
private java.util.Map |
exactRenderSetNames
|
private java.util.Map |
exactStrategyNames
|
private java.util.Map |
layoutNames
|
private java.util.Map |
layouts
|
private static org.apache.log4j.Logger |
log
|
private java.util.Map |
renderSetNames
|
private java.util.Map |
renderSets
|
private java.util.Map |
strategies
|
private java.util.Map |
strategyNames
|
Fields inherited from class org.jboss.system.ServiceMBeanSupport |
server, SERVICE_CONTROLLER_SIG, serviceName |
Fields inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport |
|
Fields inherited from interface org.jboss.system.ServiceMBean |
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED |
Constructor Summary | |
LayoutServiceImpl()
|
Method Summary | |
void |
addLayout(RuntimeContext runtimeContext,
PortalLayoutMetaData layoutMD)
Add a layout. |
void |
addRenderSet(RuntimeContext runtimeContext,
RenderSetMetaData renderSetMD)
Register a renderSet with this service |
void |
addStrategy(RuntimeContext runtimeContext,
LayoutStrategyMetaData strategyMD)
Register a a portal layout strategy with this service |
protected void |
createService()
|
protected void |
destroyService()
|
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(LayoutInfo info,
HTTPStreamInfo streamInfo,
MarkupResult result)
Get the PortalRenderSet to use for the provided layout, page and media type. |
PortalRenderSet |
getRenderSet(ServerRegistrationID id,
MediaType mediaType)
Retrieves the render set for this Layout. |
PortalRenderSet |
getRenderSet(java.lang.String renderSetName,
MediaType mediaType)
Get the render set for the provided layout. |
private PortalRenderSet |
getRenderSetFromProperties(MediaType contentType,
java.util.Map properties)
Get the render set property from the provided properties (if one is present), and then get the render set for that property and media type from the layout service. |
java.util.Collection |
getRenderSets()
Retrieves the set of the ServerRegistrationID for registred render set |
java.util.Collection |
getStrategies()
Get a Set of all available portal layout strategies |
LayoutStrategy |
getStrategy(ServerRegistrationID id,
MediaType mediaType)
Retrieves the strategy for this 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). |
protected void |
startService()
|
protected void |
stopService()
|
Methods inherited from class org.jboss.portal.jems.as.system.AbstractJBossService |
create, destroy, getState, getStateString, start, stop |
Methods inherited from class org.jboss.system.ServiceMBeanSupport |
getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister |
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport |
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.system.Service |
create, destroy, start, stop |
Field Detail |
private static org.apache.log4j.Logger log
private java.util.Map layouts
private java.util.Map layoutNames
private java.util.Map exactLayoutNames
private java.util.Map strategies
private java.util.Map strategyNames
private java.util.Map exactStrategyNames
private java.util.Map renderSets
private java.util.Map renderSetNames
private java.util.Map exactRenderSetNames
private ServerRegistrationID defaultID
Constructor Detail |
public LayoutServiceImpl()
Method Detail |
protected void createService() throws java.lang.Exception
java.lang.Exception
Service.create()
protected void destroyService()
Service.destroy()
protected void startService() throws java.lang.Exception
java.lang.Exception
Service.start()
protected void stopService()
Service.stop()
public void addLayout(RuntimeContext runtimeContext, PortalLayoutMetaData layoutMD) throws LayoutException
LayoutService
addLayout
in interface LayoutService
LayoutException
public void setDefaultLayout(java.lang.String name) throws LayoutException
LayoutService
setDefaultLayout
in interface LayoutService
name
- the name of the layout to set as default
LayoutException
LayoutService.setDefaultLayout(String)
public PortalLayout getLayout(ServerRegistrationID id, boolean defaultOnNull)
LayoutServiceInfo
getLayout
in interface LayoutServiceInfo
id
- 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
LayoutServiceInfo.getLayout(org.jboss.portal.theme.ServerRegistrationID,boolean)
public PortalLayout getLayout(java.lang.String name, boolean defaultOnNull)
LayoutServiceInfo
getLayout
in interface LayoutServiceInfo
name
- 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
LayoutServiceInfo.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 LayoutService
appID
- the name of the application that hosts the layout(s) to be removed
LayoutException
LayoutService.removeLayouts(String)
public void addStrategy(RuntimeContext runtimeContext, LayoutStrategyMetaData strategyMD) throws LayoutException
LayoutService
addStrategy
in interface LayoutService
LayoutException
public LayoutStrategy getStrategy(java.lang.String strategyName, MediaType mediaType)
LayoutServiceInfo
getStrategy
in interface LayoutServiceInfo
strategyName
- the name of the strategy to getmediaType
- the media type (content-type) to get the strategy for
LayoutServiceInfo.getStrategy(String,org.jboss.portal.common.MediaType)
public LayoutStrategy getStrategy(ServerRegistrationID id, MediaType mediaType)
LayoutServiceInfo
getStrategy
in interface LayoutServiceInfo
id
- the registration id of the strategy to retrieve.mediaType
- the media type that must be supported by the strategy to be retrieved
null
otherwise.public void removeStrategies(java.lang.String appId) throws LayoutException
LayoutService
removeStrategies
in interface LayoutService
appId
- the name of the application that hosts the strategie(s) to be removed
LayoutException
LayoutService.removeStrategies(String)
public void addRenderSet(RuntimeContext runtimeContext, RenderSetMetaData renderSetMD) throws LayoutException
LayoutService
addRenderSet
in interface LayoutService
LayoutException
public PortalRenderSet getRenderSet(java.lang.String renderSetName, MediaType mediaType)
LayoutServiceInfo
getRenderSet
in interface LayoutServiceInfo
renderSetName
- the name of the renderSet to findmediaType
- the mediatype for which to find the renderSet
LayoutServiceInfo.getRenderSet(String,org.jboss.portal.common.MediaType)
public PortalRenderSet getRenderSet(ServerRegistrationID id, MediaType mediaType)
LayoutServiceInfo
getRenderSet
in interface LayoutServiceInfo
id
- the registration id of the RenderSet to retrieve.mediaType
- the media type that must be supported by the RenderSet to be retrieved
null
otherwise.public void removeRenderSets(java.lang.String appId) throws LayoutException
LayoutService
removeRenderSets
in interface LayoutService
appId
- the name of the application that hosts the render set(s) to be removed
LayoutException
LayoutService.removeRenderSets(String)
public java.util.Collection getLayouts()
LayoutServiceInfo
getLayouts
in interface LayoutServiceInfo
LayoutServiceInfo.getLayouts()
public java.util.Collection getStrategies()
LayoutServiceInfo
getStrategies
in interface LayoutServiceInfo
LayoutServiceInfo.getStrategies()
public java.util.Collection getRenderSets()
LayoutServiceInfo
getRenderSets
in interface LayoutServiceInfo
LayoutServiceInfo.getRenderSets()
public PortalRenderSet getRenderSet(LayoutInfo info, HTTPStreamInfo streamInfo, MarkupResult result)
The render set can be defined specifically for a layout, a page, or a portal. The one defined for the layout overwrites the one defined for the page, which in turn overwrites the one defined for the portal. The render set is defined for a specific content type (media type), which will be determined from the provided HttpStreamInfo.
getRenderSet
in interface LayoutServiceInfo
info
- result
-
private PortalRenderSet getRenderSetFromProperties(MediaType contentType, java.util.Map properties)
contentType
- properties
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |