org.apache.cocoon.webapps.portal.components
Class PortalManagerImpl

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.webapps.portal.components.PortalManagerImpl
All Implemented Interfaces:
Poolable, Recyclable, Disposable, Component, Composable, Recomposable, Contextualizable, LogEnabled, PortalManager

public final class PortalManagerImpl
extends AbstractLogEnabled
implements Disposable, Composable, Recomposable, Recyclable, Contextualizable, Component, PortalManager

This is the basis portal component

Version:
CVS $Id: PortalManagerImpl.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Carsten Ziegeler

Field Summary
protected  Context componentContext
          The context
protected  boolean initialized
          Are we already setup for this request?
protected  ComponentManager manager
          The component manager
protected  SourceResolver resolver
          The current source resolver
 
Fields inherited from interface org.apache.cocoon.webapps.portal.components.PortalManager
ATTRIBUTE_ADMIN_COPLETS, ATTRIBUTE_ADMIN_ID, ATTRIBUTE_ADMIN_ROLE, ATTRIBUTE_ADMIN_STATE, ATTRIBUTE_PORTAL_ID, ATTRIBUTE_PORTAL_ROLE, BUILDTYPE_VALUE_BASIC, BUILDTYPE_VALUE_GLOBAL, BUILDTYPE_VALUE_ID, BUILDTYPE_VALUE_ROLE, REQ_CMD_CLOSE, REQ_CMD_CUSTOMIZE, REQ_CMD_DELETE, REQ_CMD_HIDE, REQ_CMD_MAXIMIZE, REQ_CMD_MINIMIZE, REQ_CMD_MOVE, REQ_CMD_MOVEROW, REQ_CMD_NEW, REQ_CMD_OPEN, REQ_CMD_SAVEPROFILE, REQ_CMD_SHOW, REQ_CMD_UPDATE, REQ_PARAMETER_ADMIN_COPLETS, REQ_PARAMETER_CMD, REQ_PARAMETER_CONF, REQ_PARAMETER_COPLET, REQ_PARAMETER_ID, REQ_PARAMETER_PROFILE, REQ_PARAMETER_ROLE, REQ_PARAMETER_STATE, ROLE
 
Constructor Summary
PortalManagerImpl()
           
 
Method Summary
protected  void buildProfile(String type, String role, String id, boolean adminProfile)
          Building the profile.
 boolean checkAuthentication(Redirector redirector, String copletID)
          Check the authentication for the coplet.
 void compose(ComponentManager manager)
           
 void configurationTest()
          Configure portal and check if it is allowed to see this coplet (if it is one).
 void contextualize(Context context)
           
 void dispose()
           
protected  AuthenticationManager getAuthenticationManager()
          Get the authentication manager
 SessionContext getContext(boolean create)
          Get the portal context of the current application
protected  ContextManager getContextManager()
          Get the ContextManager component
protected  MediaManager getMediaManager()
          Get the media manager
 String getMediaType()
          Get the current media type
 String getProfileID(String type, String role, String id, boolean adminProfile)
          Builds the key for caching
protected  Store getProfileStore()
          Get the profile store
protected  RequestState getRequestState()
          Get the current authentication state
protected  SessionManager getSessionManager()
          Get the SessionManager component
 Element getStatusProfile()
          Get the status profile
protected  TransactionManager getTransactionManager()
          Get the ContextManager component
 void recompose(ComponentManager manager)
           
 void recycle()
           
 Map retrieveProfile(String profileID)
          Retrieve the profil
protected  void sendEvents(XMLConsumer consumer, Node node)
          Send SAX events to the next pipeline component.
protected  void setup()
          Setup this component
 void showAdminConf(XMLConsumer consumer)
          Show the admin configuration page.
 void showPortal(XMLConsumer consumer, boolean configMode, boolean adminProfile)
          Show the portal.
 void streamConfiguration(XMLConsumer consumer, String requestURI, String profileID, String media, String contextID)
          Include Portal URI into stream
static void streamLayoutProfile(XMLConsumer consumer, Map portalLayouts, Map copletLayouts, String mediaType)
          Stream all layout information for the current portal to the consumer.
 
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

manager

protected ComponentManager manager
The component manager


resolver

protected SourceResolver resolver
The current source resolver


componentContext

protected Context componentContext
The context


initialized

protected boolean initialized
Are we already setup for this request?

Constructor Detail

PortalManagerImpl

public PortalManagerImpl()
Method Detail

recycle

public void recycle()
Specified by:
recycle in interface Recyclable

getRequestState

protected RequestState getRequestState()
Get the current authentication state


compose

public void compose(ComponentManager manager)
             throws ComponentException
Specified by:
compose in interface Composable
Throws:
ComponentException

recompose

public void recompose(ComponentManager manager)
               throws ComponentException
Specified by:
recompose in interface Recomposable
Throws:
ComponentException

dispose

public void dispose()
Specified by:
dispose in interface Disposable

contextualize

public void contextualize(Context context)
                   throws ContextException
Specified by:
contextualize in interface Contextualizable
Throws:
ContextException

getProfileStore

protected Store getProfileStore()
                         throws ProcessingException
Get the profile store

Throws:
ProcessingException

getAuthenticationManager

protected AuthenticationManager getAuthenticationManager()
                                                  throws ProcessingException
Get the authentication manager

Throws:
ProcessingException

getMediaManager

protected MediaManager getMediaManager()
                                throws ProcessingException
Get the media manager

Throws:
ProcessingException

setup

protected void setup()
              throws ProcessingException
Setup this component

Throws:
ProcessingException

configurationTest

public void configurationTest()
                       throws ProcessingException,
                              IOException,
                              SAXException
Description copied from interface: PortalManager
Configure portal and check if it is allowed to see this coplet (if it is one). This is only a public wrapper for the getConfiguration method.

Specified by:
configurationTest in interface PortalManager
Throws:
ProcessingException
IOException
SAXException

getContext

public SessionContext getContext(boolean create)
                          throws ProcessingException,
                                 IOException,
                                 SAXException
Description copied from interface: PortalManager
Get the portal context of the current application

Specified by:
getContext in interface PortalManager
Throws:
ProcessingException
IOException
SAXException

streamConfiguration

public void streamConfiguration(XMLConsumer consumer,
                                String requestURI,
                                String profileID,
                                String media,
                                String contextID)
                         throws IOException,
                                SAXException,
                                ProcessingException
Description copied from interface: PortalManager
Include Portal URI into stream

Specified by:
streamConfiguration in interface PortalManager
Throws:
IOException
SAXException
ProcessingException

showAdminConf

public void showAdminConf(XMLConsumer consumer)
                   throws SAXException,
                          ProcessingException,
                          IOException
Description copied from interface: PortalManager
Show the admin configuration page.

Specified by:
showAdminConf in interface PortalManager
Throws:
SAXException
ProcessingException
IOException

getStatusProfile

public Element getStatusProfile()
                         throws SAXException,
                                IOException,
                                ProcessingException
Description copied from interface: PortalManager
Get the status profile

Specified by:
getStatusProfile in interface PortalManager
Throws:
SAXException
IOException
ProcessingException

showPortal

public void showPortal(XMLConsumer consumer,
                       boolean configMode,
                       boolean adminProfile)
                throws SAXException,
                       ProcessingException,
                       IOException
Description copied from interface: PortalManager
Show the portal. The portal is included in the current stream.

Specified by:
showPortal in interface PortalManager
Throws:
SAXException
ProcessingException
IOException

streamLayoutProfile

public static void streamLayoutProfile(XMLConsumer consumer,
                                       Map portalLayouts,
                                       Map copletLayouts,
                                       String mediaType)
                                throws SAXException
Stream all layout information for the current portal to the consumer. The resulting XML: ... ...

Throws:
SAXException

buildProfile

protected void buildProfile(String type,
                            String role,
                            String id,
                            boolean adminProfile)
                     throws ProcessingException,
                            IOException,
                            SAXException
Building the profile. This includes several steps which are declared in detail inside this method...

Throws:
ProcessingException
IOException
SAXException

getProfileID

public String getProfileID(String type,
                           String role,
                           String id,
                           boolean adminProfile)
                    throws ProcessingException
Description copied from interface: PortalManager
Builds the key for caching

Specified by:
getProfileID in interface PortalManager
Throws:
ProcessingException

retrieveProfile

public Map retrieveProfile(String profileID)
                    throws ProcessingException
Description copied from interface: PortalManager
Retrieve the profil

Specified by:
retrieveProfile in interface PortalManager
Throws:
ProcessingException

getMediaType

public String getMediaType()
                    throws ProcessingException
Description copied from interface: PortalManager
Get the current media type

Specified by:
getMediaType in interface PortalManager
Throws:
ProcessingException

checkAuthentication

public boolean checkAuthentication(Redirector redirector,
                                   String copletID)
                            throws SAXException,
                                   IOException,
                                   ProcessingException
Description copied from interface: PortalManager
Check the authentication for the coplet. If it is not available do a redirect

Specified by:
checkAuthentication in interface PortalManager
Throws:
SAXException
IOException
ProcessingException

sendEvents

protected void sendEvents(XMLConsumer consumer,
                          Node node)
                   throws SAXException
Send SAX events to the next pipeline component. The node is parsed and the events are send to the next component in the pipeline.

Parameters:
node - The tree to be included.
Throws:
SAXException

getSessionManager

protected SessionManager getSessionManager()
                                    throws ProcessingException
Get the SessionManager component

Throws:
ProcessingException

getContextManager

protected ContextManager getContextManager()
                                    throws ProcessingException
Get the ContextManager component

Throws:
ProcessingException

getTransactionManager

protected TransactionManager getTransactionManager()
                                            throws ProcessingException
Get the ContextManager component

Throws:
ProcessingException


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.