|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport
org.jboss.system.ServiceMBeanSupport
org.jboss.portal.jems.as.system.AbstractJBossService
org.jboss.portal.theme.impl.LayoutServiceImpl
public class 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. Render sets can be independent (named), or children of a layout. Accordingly, the layout server provides accessor methods to get render set by name, or by layout. Render sets can, and must, be defined for a specific media type (mime type).
PortalLayout
,
PortalRenderSet
,
MediaType
Field Summary |
---|
Fields inherited from class org.jboss.system.ServiceMBeanSupport |
---|
server, SERVICE_CONTROLLER_SIG, serviceName |
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 |
protected void |
createService()
|
protected void |
destroyService()
|
PortalLayout |
getDefaultLayout()
|
java.lang.String |
getDefaultRenderSetName()
|
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. |
PortalLayout |
getLayoutById(java.lang.String layoutIdString)
|
java.util.Collection |
getLayouts()
Get a Set of portal layouts |
PortalRenderSet |
getRenderSet(LayoutInfo info,
ContentInfo streamInfo,
java.lang.String renderSetName)
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. |
java.util.Collection |
getRenderSets()
Retrieves the set of the ServerRegistrationID for registred render set |
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 |
setDefaultLayoutName(java.lang.String name)
Set the default layout (on a global level). |
void |
setDefaultRenderSetName(java.lang.String name)
|
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 |
Constructor Detail |
---|
public LayoutServiceImpl()
Method Detail |
---|
protected void createService() throws java.lang.Exception
createService
in class org.jboss.system.ServiceMBeanSupport
java.lang.Exception
Service.create()
protected void destroyService()
destroyService
in class org.jboss.system.ServiceMBeanSupport
Service.destroy()
protected void startService() throws java.lang.Exception
startService
in class org.jboss.system.ServiceMBeanSupport
java.lang.Exception
Service.start()
protected void stopService()
stopService
in class org.jboss.system.ServiceMBeanSupport
Service.stop()
public void addLayout(RuntimeContext runtimeContext, PortalLayoutMetaData layoutMD) throws LayoutException
LayoutService
addLayout
in interface LayoutService
LayoutException
public void setDefaultLayoutName(java.lang.String name)
LayoutService
setDefaultLayoutName
in interface LayoutService
name
- the name of the layout to set as defaultpublic PortalLayout getDefaultLayout()
getDefaultLayout
in interface LayoutService
LayoutService.getDefaultLayout()
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 PortalLayout getLayoutById(java.lang.String layoutIdString)
getLayoutById
in interface LayoutServiceInfo
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 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.util.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 getRenderSets()
LayoutServiceInfo
getRenderSets
in interface LayoutServiceInfo
LayoutServiceInfo.getRenderSets()
public void setDefaultRenderSetName(java.lang.String name)
setDefaultRenderSetName
in interface LayoutService
public java.lang.String getDefaultRenderSetName()
getDefaultRenderSetName
in interface LayoutService
public PortalRenderSet getRenderSet(LayoutInfo info, ContentInfo streamInfo, java.lang.String renderSetName)
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |