|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.portal.impl.AbstractComponent
org.apache.cocoon.portal.profile.impl.AbstractProfileManager
org.apache.cocoon.portal.profile.impl.GroupBasedProfileManager
This profile manager uses a group based approach: The coplet-base-data and the coplet-data are global, these are shared between all users. If the user has his own set of coplet-instance-datas/layouts these are loaded. If the user has not an own set, the group set is loaded - therefore each user has belong to exactly one group. In the case that the user does not belong to a group, a global profile is loaded. This profile manager does not check for changes of the profile, which means for example once a global profile is loaded, it is used until Cocoon is restarted. (This will be changed later on) THIS IS A WORK IN PROGRESS - IT'S NOT FINISHED YET
Nested Class Summary | |
protected static class |
GroupBasedProfileManager.ProfileInfo
|
Field Summary | |
static String |
CATEGORY_GLOBAL
|
static String |
CATEGORY_GROUP
|
static String |
CATEGORY_USER
|
protected boolean |
checkForChanges
Check for changes? |
protected Context |
context
The component context |
protected GroupBasedProfileManager.ProfileInfo |
copletBaseDatas
|
protected GroupBasedProfileManager.ProfileInfo |
copletDatas
|
protected static String |
KEY_PREFIX
|
protected static Map |
MAP_FOR_BASE_DATA
|
protected Parameters |
parameters
The parameters for the profile configuration. |
Fields inherited from class org.apache.cocoon.portal.profile.impl.AbstractProfileManager |
USER_ATTRIBUTE |
Fields inherited from class org.apache.cocoon.portal.impl.AbstractComponent |
manager, portalService |
Fields inherited from interface org.apache.cocoon.portal.profile.ProfileManager |
ROLE |
Constructor Summary | |
GroupBasedProfileManager()
|
Method Summary | |
protected Map |
buildKey(String category,
String profileType,
PortalUser info,
boolean load,
String layoutKey)
|
void |
contextualize(Context context)
|
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 boolean |
getCopletInstanceDatas(ProfileLS loader,
ProfileImpl profile,
PortalUser info,
String category,
String layoutKey)
|
protected Map |
getGlobalBaseDatas(ProfileLS loader,
PortalUser info,
String layoutKey)
|
protected Map |
getGlobalDatas(ProfileLS loader,
PortalUser info,
ProfileImpl profile,
String layoutKey)
|
protected boolean |
getLayout(ProfileLS loader,
ProfileImpl profile,
PortalUser info,
String category,
String layoutKey)
|
Layout |
getPortalLayout(String layoutKey,
String layoutId)
Get the portal layout defined by the layout key. |
PortalUser |
getUser()
Get current user information |
protected ProfileImpl |
getUserProfile(String layoutKey)
|
void |
inform(CopletInstanceDataAddedEvent event,
PortalService service)
Receives a coplet instance data added event. |
void |
inform(CopletInstanceDataRemovedEvent event,
PortalService service)
Receives a coplet instance data added event. |
protected Profile |
loadProfile(String layoutKey)
Load the profile |
protected void |
login(PortalUser user)
This method is invoked when a user logs in. |
protected void |
logout(PortalUser user)
This method is invoked when a user logs out. |
void |
parameterize(Parameters params)
|
protected void |
prepareObject(Object object)
Prepares the object by using the specified factory. |
void |
register(Layout layout)
New layouts have to be registered using this method. |
protected void |
removeUserProfiles()
|
void |
saveUserCopletInstanceDatas(String layoutKey)
Save the coplet instance data |
void |
saveUserLayout(String layoutKey)
Save the layout |
protected void |
storeUserProfile(String layoutKey,
Profile profile)
|
void |
unregister(Layout layout)
New layouts have to be unregistered using this method. |
Methods inherited from class org.apache.cocoon.portal.profile.impl.AbstractProfileManager |
getProfile, inform, saveUserProfiles |
Methods inherited from class org.apache.cocoon.portal.impl.AbstractComponent |
dispose, initialize, service |
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 |
Methods inherited from interface org.apache.avalon.framework.activity.Disposable |
dispose |
Field Detail |
public static final String CATEGORY_GLOBAL
public static final String CATEGORY_GROUP
public static final String CATEGORY_USER
protected static final Map MAP_FOR_BASE_DATA
protected static final String KEY_PREFIX
protected final GroupBasedProfileManager.ProfileInfo copletBaseDatas
protected final GroupBasedProfileManager.ProfileInfo copletDatas
protected Context context
protected boolean checkForChanges
protected Parameters parameters
Constructor Detail |
public GroupBasedProfileManager()
Method Detail |
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
contextualize
in class AbstractComponent
ContextException
Contextualizable.contextualize(org.apache.avalon.framework.context.Context)
public void parameterize(Parameters params) throws ParameterException
parameterize
in interface Parameterizable
ParameterException
Parameterizable.parameterize(org.apache.avalon.framework.parameters.Parameters)
protected ProfileImpl getUserProfile(String layoutKey)
protected void removeUserProfiles()
protected void storeUserProfile(String layoutKey, Profile profile)
protected void prepareObject(Object object) throws ProcessingException
ProcessingException
protected void login(PortalUser user)
AbstractProfileManager
login
in class AbstractProfileManager
AbstractProfileManager.login(org.apache.cocoon.portal.profile.PortalUser)
protected void logout(PortalUser user)
AbstractProfileManager
logout
in class AbstractProfileManager
AbstractProfileManager.logout(org.apache.cocoon.portal.profile.PortalUser)
public CopletInstanceData getCopletInstanceData(String copletID)
getCopletInstanceData
in interface ProfileManager
ProfileManager.getCopletInstanceData(java.lang.String)
public CopletData getCopletData(String copletDataId)
ProfileManager
getCopletData
in interface ProfileManager
ProfileManager.getCopletData(java.lang.String)
public List getCopletInstanceData(CopletData data)
getCopletInstanceData
in interface ProfileManager
ProfileManager.getCopletInstanceData(org.apache.cocoon.portal.coplet.CopletData)
public void inform(CopletInstanceDataAddedEvent event, PortalService service)
Receiver
public void inform(CopletInstanceDataRemovedEvent event, PortalService service)
Receiver
public void register(Layout layout)
ProfileManager
register
in interface ProfileManager
register
in class AbstractProfileManager
ProfileManager.register(org.apache.cocoon.portal.layout.Layout)
public void unregister(Layout layout)
ProfileManager
unregister
in interface ProfileManager
unregister
in class AbstractProfileManager
ProfileManager.unregister(org.apache.cocoon.portal.layout.Layout)
public Layout getPortalLayout(String layoutKey, String layoutId)
ProfileManager
getPortalLayout
in interface ProfileManager
layoutKey
- A key describing the layout or null for the defaultlayoutId
- The id of a layout object or null for the root object
ProfileManager.getPortalLayout(java.lang.String, java.lang.String)
public Collection getCopletDatas()
ProfileManager
getCopletDatas
in interface ProfileManager
ProfileManager.getCopletDatas()
public Collection getCopletInstanceDatas()
ProfileManager
getCopletInstanceDatas
in interface ProfileManager
ProfileManager.getCopletInstanceDatas()
protected Profile loadProfile(String layoutKey) throws Exception
Exception
protected Map getGlobalBaseDatas(ProfileLS loader, PortalUser info, String layoutKey) throws Exception
Exception
protected Map getGlobalDatas(ProfileLS loader, PortalUser info, ProfileImpl profile, String layoutKey) throws Exception
Exception
protected boolean getCopletInstanceDatas(ProfileLS loader, ProfileImpl profile, PortalUser info, String category, String layoutKey) throws Exception
Exception
protected boolean getLayout(ProfileLS loader, ProfileImpl profile, PortalUser info, String category, String layoutKey) throws Exception
Exception
protected Map buildKey(String category, String profileType, PortalUser info, boolean load, String layoutKey) throws ParameterException
ParameterException
public PortalUser getUser()
ProfileManager
getUser
in interface ProfileManager
ProfileManager.getUser()
public void saveUserCopletInstanceDatas(String layoutKey)
ProfileManager
saveUserCopletInstanceDatas
in interface ProfileManager
saveUserCopletInstanceDatas
in class AbstractProfileManager
ProfileManager.saveUserCopletInstanceDatas(java.lang.String)
public void saveUserLayout(String layoutKey)
ProfileManager
saveUserLayout
in interface ProfileManager
saveUserLayout
in class AbstractProfileManager
ProfileManager.saveUserLayout(java.lang.String)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |