org.jboss.portal.server.impl
Class LayoutServerImpl

java.lang.Object
  extended by org.jboss.portal.server.impl.LayoutServerImpl
All Implemented Interfaces:
LayoutServer, org.jboss.system.Service

public class LayoutServerImpl
extends java.lang.Object
implements LayoutServer, org.jboss.system.Service

TODO: A description of this class.


Constructor Summary
LayoutServerImpl()
           
 
Method Summary
 void addDefaultRenderSet(java.lang.String renderSetName, PortalRenderSet renderSet)
           
 void addDefaultStrategy(java.lang.String strategyName, LayoutStrategy strategy)
           
 void addLayout(LayoutRegistrationMetaData metaData)
          Add a layout.
 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.
 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.
 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)
           
 void removeLayout(java.lang.String name)
           
 void removeLayouts(java.lang.String appName)
          Remove all layouts 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

LayoutServerImpl

public LayoutServerImpl()
Method Detail

create

public void create()
            throws java.lang.Exception
Specified by:
create in interface org.jboss.system.Service
Throws:
java.lang.Exception

destroy

public void destroy()
Specified by:
destroy in interface org.jboss.system.Service

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface org.jboss.system.Service
Throws:
java.lang.Exception

stop

public void stop()
Specified by:
stop in interface org.jboss.system.Service

addLayout

public void addLayout(LayoutRegistrationMetaData metaData)
               throws LayoutException
Description copied from interface: LayoutServer
Add a layout.

Specified by:
addLayout in interface LayoutServer
Parameters:
metaData - the meta information about the layout
Throws:
LayoutException

setDefaultLayout

public void setDefaultLayout(java.lang.String name)
                      throws LayoutException
Description copied from interface: LayoutServer
Set the default layout (on a global level).

Specified by:
setDefaultLayout in interface LayoutServer
Parameters:
name - the name of the layout to set as default
Throws:
LayoutException

getLayout

public PortalLayout getLayout(ServerRegistrationID id,
                              boolean defaultOnNull)
Description copied from interface: LayoutServer
Get the layout for the provided registration id.

Specified by:
getLayout in interface LayoutServer
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)
Description copied from interface: LayoutServer
Get the layout for the provided name.

Specified by:
getLayout in interface LayoutServer
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

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 of a strategy which can be accessed by passing null as the layout. The default will also be returned if no strategy was found for the provided layout.

Specified by:
getStrategy in interface LayoutServer
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)
Specified by:
getStrategy in interface LayoutServer
Parameters:
strategyName -
mediaType -
Returns:

getRenderSet

public PortalRenderSet getRenderSet(PortalLayout layout,
                                    MediaType mediaType)
Description copied from interface: LayoutServer
Get the render set for the provided layout.

Specified by:
getRenderSet in interface LayoutServer
Parameters:
layout -
mediaType -
Returns:

getRenderSet

public PortalRenderSet getRenderSet(java.lang.String renderSetName,
                                    MediaType mediaType)
Description copied from interface: LayoutServer
Get the render set for the provided layout.

Specified by:
getRenderSet in interface LayoutServer
Returns:

addDefaultRenderSet

public void addDefaultRenderSet(java.lang.String renderSetName,
                                PortalRenderSet renderSet)
Specified by:
addDefaultRenderSet in interface LayoutServer
Parameters:
renderSetName -
renderSet -

addDefaultStrategy

public void addDefaultStrategy(java.lang.String strategyName,
                               LayoutStrategy strategy)
Specified by:
addDefaultStrategy in interface LayoutServer
Parameters:
strategyName -
strategy -

removeLayout

public void removeLayout(java.lang.String name)
                  throws LayoutException
Throws:
LayoutException

removeLayouts

public void removeLayouts(java.lang.String appName)
                   throws LayoutException
Description copied from interface: LayoutServer
Remove all layouts that are hosted in the provided application.

Specified by:
removeLayouts in interface LayoutServer
Parameters:
appName - the name of the application that hosts the layout(s) to be removed
Throws:
LayoutException