org.apache.cocoon.portal.profile.impl
Class SiteProfileManager

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.portal.profile.impl.AbstractProfileManager
          extended by org.apache.cocoon.portal.profile.impl.SiteProfileManager
All Implemented Interfaces:
Disposable, Initializable, Component, Contextualizable, LogEnabled, Parameterizable, Serviceable, ThreadSafe, ProfileManager

public class SiteProfileManager
extends AbstractProfileManager
implements Parameterizable, Contextualizable, Initializable, Disposable

Version:
CVS $Id: SiteProfileManager.html 1304258 2012-03-23 10:09:27Z ilgrosso $

Nested Class Summary
protected static class SiteProfileManager.ProfileInfo
           
protected static class SiteProfileManager.UserProfileInfo
           
 
Field Summary
static String CATEGORY_GLOBAL
           
protected  Context context
          The component context
protected  SiteProfileManager.ProfileInfo copletBaseDatas
           
protected  SiteProfileManager.ProfileInfo copletDatas
           
protected  Map profiles
          The per site profiles.
protected  UserInfoProvider provider
          The userinfo provider - the connection to the authentication mechanism
protected  String siteExpression
          Site expression to detect the current site.
protected  String userInfoProviderClassName
          The class name of the userinfo provider
protected  VariableResolverFactory variableFactory
          Variable resolver factory.
protected  VariableResolver variableResolver
          Variable resolver.
 
Fields inherited from class org.apache.cocoon.portal.profile.impl.AbstractProfileManager
manager
 
Fields inherited from interface org.apache.cocoon.portal.profile.ProfileManager
ROLE
 
Constructor Summary
SiteProfileManager()
           
 
Method Summary
protected  Map buildKey(String category, String profileType, UserInfo info, boolean load)
           
 void contextualize(Context context)
           
 void dispose()
           
 CopletData getCopletData(String copletDataId)
          Return the coplet data object
 Collection getCopletDatas()
          Get all coplets
 List getCopletInstanceData(CopletData data)
           
 CopletInstanceData getCopletInstanceData(String copletID)
           
 Collection getCopletInstanceDatas()
          Get all instances
protected  Map getGlobalBaseDatas(ProfileLS loader, UserInfo info, PortalService service)
           
protected  Map getGlobalDatas(ProfileLS loader, UserInfo info, PortalService service, UserProfile profile)
           
 Layout getPortalLayout(String layoutKey, String layoutId)
          Get the portal layout defined by the layout key.
protected  String getSiteName()
           
protected  void getSiteProfile(ProfileLS loader, UserInfo info, PortalService service, SiteProfileManager.UserProfileInfo storedProfile)
           
 PortalUser getUser()
          Get current user information
protected  UserProfile getUserProfile(String layoutKey)
           
 void initialize()
           
protected  UserProfile loadProfile(String layoutKey)
          Load the profile
 void login()
          This method is invoked when the user logs into the portal.
 void parameterize(Parameters params)
           
protected  void prepareObject(Object object, PortalService service)
          Prepares the object by using the specified factory.
 void register(CopletInstanceData coplet)
          New coplet instance datas have to be registered using this method.
 void register(Layout layout)
          New layouts have to be registered using this method.
 void service(ServiceManager manager)
           
 void storeProfile(Layout rootLayout, String layoutKey)
          Store the provided profile under the layoutKey.
 void unregister(CopletInstanceData coplet)
          Removed coplet instance datas have to be unregistered using this method.
 void unregister(Layout layout)
          New layouts have to be unregistered using this method.
 
Methods inherited from class org.apache.cocoon.portal.profile.impl.AbstractProfileManager
logout, saveUserCopletInstanceDatas, saveUserLayout, saveUserProfiles
 
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

CATEGORY_GLOBAL

public static final String CATEGORY_GLOBAL
See Also:
Constant Field Values

copletBaseDatas

protected SiteProfileManager.ProfileInfo copletBaseDatas

copletDatas

protected SiteProfileManager.ProfileInfo copletDatas

provider

protected UserInfoProvider provider
The userinfo provider - the connection to the authentication mechanism


userInfoProviderClassName

protected String userInfoProviderClassName
The class name of the userinfo provider


context

protected Context context
The component context


profiles

protected final Map profiles
The per site profiles.


siteExpression

protected String siteExpression
Site expression to detect the current site.


variableFactory

protected VariableResolverFactory variableFactory
Variable resolver factory.


variableResolver

protected VariableResolver variableResolver
Variable resolver.

Constructor Detail

SiteProfileManager

public SiteProfileManager()
Method Detail

contextualize

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

service

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

parameterize

public void parameterize(Parameters params)
                  throws ParameterException
Specified by:
parameterize in interface Parameterizable
Throws:
ParameterException

initialize

public void initialize()
                throws Exception
Specified by:
initialize in interface Initializable
Throws:
Exception

dispose

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

getSiteName

protected String getSiteName()

getUserProfile

protected UserProfile getUserProfile(String layoutKey)

prepareObject

protected void prepareObject(Object object,
                             PortalService service)
                      throws ProcessingException
Prepares the object by using the specified factory.

Throws:
ProcessingException

login

public void login()
Description copied from interface: ProfileManager
This method is invoked when the user logs into the portal.

Specified by:
login in interface ProfileManager
Overrides:
login in class AbstractProfileManager

getCopletInstanceData

public CopletInstanceData getCopletInstanceData(String copletID)
Specified by:
getCopletInstanceData in interface ProfileManager

getCopletData

public CopletData getCopletData(String copletDataId)
Description copied from interface: ProfileManager
Return the coplet data object

Specified by:
getCopletData in interface ProfileManager

getCopletInstanceData

public List getCopletInstanceData(CopletData data)
Specified by:
getCopletInstanceData in interface ProfileManager

register

public void register(CopletInstanceData coplet)
Description copied from interface: ProfileManager
New coplet instance datas have to be registered using this method.

Specified by:
register in interface ProfileManager
Overrides:
register in class AbstractProfileManager

unregister

public void unregister(CopletInstanceData coplet)
Description copied from interface: ProfileManager
Removed coplet instance datas have to be unregistered using this method.

Specified by:
unregister in interface ProfileManager
Overrides:
unregister in class AbstractProfileManager

register

public void register(Layout layout)
Description copied from interface: ProfileManager
New layouts have to be registered using this method.

Specified by:
register in interface ProfileManager
Overrides:
register in class AbstractProfileManager

unregister

public void unregister(Layout layout)
Description copied from interface: ProfileManager
New layouts have to be unregistered using this method.

Specified by:
unregister in interface ProfileManager
Overrides:
unregister in class AbstractProfileManager

getPortalLayout

public Layout getPortalLayout(String layoutKey,
                              String layoutId)
Description copied from interface: ProfileManager
Get the portal layout defined by the layout key. This usually addresses the layout profile. With the optional subKey it's possible to retrieve a specific layout object in the profile defined by the layout key.

Specified by:
getPortalLayout in interface ProfileManager
Parameters:
layoutKey - A key describing the layout or null for the default
layoutId - The id of a layout object or null for the root object
Returns:
The layout

getCopletDatas

public Collection getCopletDatas()
Description copied from interface: ProfileManager
Get all coplets

Specified by:
getCopletDatas in interface ProfileManager

getCopletInstanceDatas

public Collection getCopletInstanceDatas()
Description copied from interface: ProfileManager
Get all instances

Specified by:
getCopletInstanceDatas in interface ProfileManager

loadProfile

protected UserProfile loadProfile(String layoutKey)
                           throws Exception
Load the profile

Throws:
Exception

getGlobalBaseDatas

protected Map getGlobalBaseDatas(ProfileLS loader,
                                 UserInfo info,
                                 PortalService service)
                          throws Exception
Throws:
Exception

getGlobalDatas

protected Map getGlobalDatas(ProfileLS loader,
                             UserInfo info,
                             PortalService service,
                             UserProfile profile)
                      throws Exception
Throws:
Exception

getSiteProfile

protected void getSiteProfile(ProfileLS loader,
                              UserInfo info,
                              PortalService service,
                              SiteProfileManager.UserProfileInfo storedProfile)
                       throws Exception
Throws:
Exception

buildKey

protected Map buildKey(String category,
                       String profileType,
                       UserInfo info,
                       boolean load)

storeProfile

public void storeProfile(Layout rootLayout,
                         String layoutKey)
Description copied from interface: ProfileManager
Store the provided profile under the layoutKey. This method can be used to overwrite a profile with another one.

Specified by:
storeProfile in interface ProfileManager

getUser

public PortalUser getUser()
Description copied from interface: ProfileManager
Get current user information

Specified by:
getUser in interface ProfileManager


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