org.apache.cocoon.portal.impl
Class PortalServiceImpl

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.cocoon.portal.impl.PortalServiceImpl
All Implemented Interfaces:
Configurable, Contextualizable, Disposable, LogEnabled, PortalService, Serviceable, ThreadSafe

public class PortalServiceImpl
extends AbstractLogEnabled
implements Serviceable, ThreadSafe, PortalService, Contextualizable, Disposable, Configurable

Default implementation of a portal service using a session to store custom information.

Version:
$Id: PortalServiceImpl.java 325961 2005-10-17 19:03:10Z cziegeler $

Field Summary
protected  String attributePrefix
          The attribute prefix used to prefix attributes in the session and request.
protected  Context context
          The component context.
protected  String defaultLayoutKey
          The default layout key.
protected static String KEY
           
protected  ServiceManager manager
          The service locator.
protected  PortalComponentManager portalComponentManager
          The manager for some core portal components.
protected  String portalName
          The name of the portal.
protected  List skinList
          The list of skins.
 
Fields inherited from interface org.apache.cocoon.portal.PortalService
ROLE
 
Constructor Summary
PortalServiceImpl()
           
 
Method Summary
 void configure(Configuration config)
           
 void contextualize(Context context)
           
 void dispose()
           
 Object getAttribute(String key)
          Return the value of an attribute.
 Iterator getAttributeNames()
          Return the names of all attributes.
 PortalComponentManager getComponentManager()
          Return the component manager for the current portal
 String getDefaultLayoutKey()
          Get the default layout key
 Layout getEntryLayout(String layoutKey)
           
 Map getObjectModel()
          Return the current object model.
 String getPortalName()
          The name of the portal - as defined in the portal configuration.
 List getSkinDescriptions()
          Return all skins
 Object getTemporaryAttribute(String key)
          Return the value of a temporary attribute.
 Iterator getTemporaryAttributeNames()
          Return the names of all temporary attributes.
 Object removeAttribute(String key)
          Remove an attribute.
 Object removeTemporaryAttribute(String key)
          Remove a temporary attribute.
 void service(ServiceManager serviceManager)
           
 void setAttribute(String key, Object value)
          Set an attribute.
 void setDefaultLayoutKey(String layoutKey)
          Change the default layout key for most functions
 void setEntryLayout(String layoutKey, Layout object)
          FIXME this is for the full-screen function
 void setTemporaryAttribute(String key, Object value)
          Set a temporary attribute.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected Context context
The component context.


manager

protected ServiceManager manager
The service locator.


portalComponentManager

protected PortalComponentManager portalComponentManager
The manager for some core portal components.


skinList

protected List skinList
The list of skins.


portalName

protected String portalName
The name of the portal.


defaultLayoutKey

protected String defaultLayoutKey
The default layout key.


attributePrefix

protected String attributePrefix
The attribute prefix used to prefix attributes in the session and request.


KEY

protected static final String KEY
Constructor Detail

PortalServiceImpl

public PortalServiceImpl()
Method Detail

service

public void service(ServiceManager serviceManager)
             throws ServiceException
Specified by:
service in interface Serviceable
Throws:
ServiceException
See Also:
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)

getPortalName

public String getPortalName()
Description copied from interface: PortalService
The name of the portal - as defined in the portal configuration.

Specified by:
getPortalName in interface PortalService
See Also:
PortalService.getPortalName()

getAttribute

public Object getAttribute(String key)
Description copied from interface: PortalService
Return the value of an attribute.

Specified by:
getAttribute in interface PortalService
Parameters:
key - The key of the attribute
Returns:
The value of the attribute or null.
See Also:
PortalService.getAttribute(java.lang.String)

setAttribute

public void setAttribute(String key,
                         Object value)
Description copied from interface: PortalService
Set an attribute.

Specified by:
setAttribute in interface PortalService
Parameters:
key - The key of the attribute
value - The new value
See Also:
PortalService.setAttribute(java.lang.String, java.lang.Object)

removeAttribute

public Object removeAttribute(String key)
Description copied from interface: PortalService
Remove an attribute.

Specified by:
removeAttribute in interface PortalService
Parameters:
key - The key of the attribute
See Also:
PortalService.removeAttribute(java.lang.String)

getAttributeNames

public Iterator getAttributeNames()
Description copied from interface: PortalService
Return the names of all attributes.

Specified by:
getAttributeNames in interface PortalService
See Also:
PortalService.getAttributeNames()

getTemporaryAttribute

public Object getTemporaryAttribute(String key)
Description copied from interface: PortalService
Return the value of a temporary attribute.

Specified by:
getTemporaryAttribute in interface PortalService
Parameters:
key - The key of the attribute
Returns:
The value of the attribute or null.
See Also:
PortalService.getTemporaryAttribute(java.lang.String)

setTemporaryAttribute

public void setTemporaryAttribute(String key,
                                  Object value)
Description copied from interface: PortalService
Set a temporary attribute.

Specified by:
setTemporaryAttribute in interface PortalService
Parameters:
key - The key of the attribute
value - The new value
See Also:
PortalService.setTemporaryAttribute(java.lang.String, java.lang.Object)

removeTemporaryAttribute

public Object removeTemporaryAttribute(String key)
Description copied from interface: PortalService
Remove a temporary attribute.

Specified by:
removeTemporaryAttribute in interface PortalService
Parameters:
key - The key of the attribute
See Also:
PortalService.removeTemporaryAttribute(java.lang.String)

getTemporaryAttributeNames

public Iterator getTemporaryAttributeNames()
Description copied from interface: PortalService
Return the names of all temporary attributes.

Specified by:
getTemporaryAttributeNames in interface PortalService
See Also:
PortalService.getTemporaryAttributeNames()

getComponentManager

public PortalComponentManager getComponentManager()
Description copied from interface: PortalService
Return the component manager for the current portal

Specified by:
getComponentManager in interface PortalService
See Also:
PortalService.getComponentManager()

contextualize

public void contextualize(Context context)
                   throws ContextException
Specified by:
contextualize in interface Contextualizable
Throws:
ContextException
See Also:
Contextualizable.contextualize(org.apache.avalon.framework.context.Context)

dispose

public void dispose()
Specified by:
dispose in interface Disposable
See Also:
Disposable.dispose()

configure

public void configure(Configuration config)
               throws ConfigurationException
Specified by:
configure in interface Configurable
Throws:
ConfigurationException
See Also:
Configurable.configure(org.apache.avalon.framework.configuration.Configuration)

setEntryLayout

public void setEntryLayout(String layoutKey,
                           Layout object)
Description copied from interface: PortalService
FIXME this is for the full-screen function

Specified by:
setEntryLayout in interface PortalService
Parameters:
layoutKey - TODO
See Also:
PortalService.setEntryLayout(java.lang.String, org.apache.cocoon.portal.layout.Layout)

getEntryLayout

public Layout getEntryLayout(String layoutKey)
Specified by:
getEntryLayout in interface PortalService
See Also:
PortalService.getEntryLayout(java.lang.String)

setDefaultLayoutKey

public void setDefaultLayoutKey(String layoutKey)
Description copied from interface: PortalService
Change the default layout key for most functions

Specified by:
setDefaultLayoutKey in interface PortalService
See Also:
PortalService.setDefaultLayoutKey(java.lang.String)

getDefaultLayoutKey

public String getDefaultLayoutKey()
Description copied from interface: PortalService
Get the default layout key

Specified by:
getDefaultLayoutKey in interface PortalService
See Also:
PortalService.getDefaultLayoutKey()

getSkinDescriptions

public List getSkinDescriptions()
Description copied from interface: PortalService
Return all skins

Specified by:
getSkinDescriptions in interface PortalService
See Also:
PortalService.getSkinDescriptions()

getObjectModel

public Map getObjectModel()
Description copied from interface: PortalService
Return the current object model.

Specified by:
getObjectModel in interface PortalService
See Also:
PortalService.getObjectModel()


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.