org.jasig.portal
Class UserPreferencesManager

java.lang.Object
  extended by org.jasig.portal.UserPreferencesManager
All Implemented Interfaces:
IUserPreferencesManager
Direct Known Subclasses:
GuestUserPreferencesManager

public class UserPreferencesManager
extends java.lang.Object
implements IUserPreferencesManager

UserPreferencesManager is responsible for keeping: user id, user layout, user preferences and stylesheet descriptions. For method descriptions please see IUserPreferencesManager.

Version:
$Revision: 1.35.2.4 $
Author:
Peter Kharchenko pkharchenko@interactivebusiness.com

Field Summary
private  UserPreferences complete_up
           
private static boolean DEFAULT_SAVE_USER_PREFERENCES_AT_LOGOUT
          Default value for saveUserPreferencesAtLogout.
private static org.apache.commons.logging.Log log
           
(package private)  IPerson m_person
           
private static boolean saveUserPreferencesAtLogout
           
private  StructureStylesheetDescription ssd
           
private  ThemeStylesheetDescription tsd
           
(package private) static PropsMatcher uaMatcher
           
private  IUserLayoutManager ulm
           
(package private)  IUserLayoutStore ulsdb
           
private  boolean unmapped_user_agent
           
private static java.lang.String USER_PREFERENCES_KEY
           
 
Constructor Summary
UserPreferencesManager(javax.servlet.http.HttpServletRequest req, IPerson person)
          Constructor does the following 1.
UserPreferencesManager(javax.servlet.http.HttpServletRequest req, IPerson person, LocaleManager localeManager)
          Constructor does the following 1.
UserPreferencesManager(IPerson person)
          A simpler constructor, that only initialises the person object.
 
Method Summary
 void finishedSession(javax.servlet.http.HttpSessionBindingEvent bindingEvent)
           
protected  java.lang.String getChannelPublishId(java.lang.String channelSubscribeId)
          Returns a global channel Id given a channel instance Id
 UserProfile getCurrentProfile()
          Returns current profile.
 IPerson getPerson()
          Returns current person object
 StructureStylesheetDescription getStructureStylesheetDescription()
          Returns current structure stylesheet description
 ThemeStylesheetDescription getThemeStylesheetDescription()
          Returns current theme stylesheet description
 IUserLayoutManager getUserLayoutManager()
          Returns IUserLayoutManager object for performing layout-related operations.
 UserPreferences getUserPreferences()
          Returns current user preferences.
 UserPreferences getUserPreferencesCopy()
          Returns a copy of the user preferences
 boolean isUserAgentUnmapped()
          Determine if the user agent associated with this session has been successfuly mapped to a profile
 void processUserPreferencesParameters(javax.servlet.http.HttpServletRequest req)
           
 void setNewUserLayoutAndUserPreferences(IUserLayoutManager newUlm, UserPreferences newPreferences)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

USER_PREFERENCES_KEY

private static final java.lang.String USER_PREFERENCES_KEY

DEFAULT_SAVE_USER_PREFERENCES_AT_LOGOUT

private static final boolean DEFAULT_SAVE_USER_PREFERENCES_AT_LOGOUT
Default value for saveUserPreferencesAtLogout. This value will be used when the corresponding property cannot be loaded.

See Also:
Constant Field Values

uaMatcher

static PropsMatcher uaMatcher

ulm

private IUserLayoutManager ulm

complete_up

private UserPreferences complete_up

tsd

private ThemeStylesheetDescription tsd

ssd

private StructureStylesheetDescription ssd

unmapped_user_agent

private boolean unmapped_user_agent

m_person

IPerson m_person

ulsdb

IUserLayoutStore ulsdb

saveUserPreferencesAtLogout

private static final boolean saveUserPreferencesAtLogout
Constructor Detail

UserPreferencesManager

public UserPreferencesManager(javax.servlet.http.HttpServletRequest req,
                              IPerson person)
                       throws PortalException
Constructor does the following 1. Read layout.properties 2. read userLayout from the database

Parameters:
req - the servlet request object
person - the person object
Throws:
PortalException

UserPreferencesManager

public UserPreferencesManager(javax.servlet.http.HttpServletRequest req,
                              IPerson person,
                              LocaleManager localeManager)
                       throws PortalException
Constructor does the following 1. Read layout.properties 2. read userLayout from the database

Parameters:
req - the servlet request object
person - the person object
localeManager - the locale manager
Throws:
PortalException

UserPreferencesManager

public UserPreferencesManager(IPerson person)
A simpler constructor, that only initialises the person object. Needed for ancestors.

Parameters:
person - an IPerson object.
Method Detail

processUserPreferencesParameters

public void processUserPreferencesParameters(javax.servlet.http.HttpServletRequest req)
Specified by:
processUserPreferencesParameters in interface IUserPreferencesManager

getPerson

public IPerson getPerson()
Returns current person object

Specified by:
getPerson in interface IUserPreferencesManager
Returns:
current IPerson

getChannelPublishId

protected java.lang.String getChannelPublishId(java.lang.String channelSubscribeId)
                                        throws PortalException
Returns a global channel Id given a channel instance Id

Parameters:
channelSubscribeId - subscribe id of a channel
Returns:
channel global id
Throws:
PortalException

isUserAgentUnmapped

public boolean isUserAgentUnmapped()
Description copied from interface: IUserPreferencesManager
Determine if the user agent associated with this session has been successfuly mapped to a profile

Specified by:
isUserAgentUnmapped in interface IUserPreferencesManager
Returns:
true if no mapping was found

setNewUserLayoutAndUserPreferences

public void setNewUserLayoutAndUserPreferences(IUserLayoutManager newUlm,
                                               UserPreferences newPreferences)
                                        throws PortalException
Specified by:
setNewUserLayoutAndUserPreferences in interface IUserPreferencesManager
Throws:
PortalException

getUserLayoutManager

public IUserLayoutManager getUserLayoutManager()
Description copied from interface: IUserPreferencesManager
Returns IUserLayoutManager object for performing layout-related operations.

Specified by:
getUserLayoutManager in interface IUserPreferencesManager
Returns:
an IUserLayoutManager value

finishedSession

public void finishedSession(javax.servlet.http.HttpSessionBindingEvent bindingEvent)
Specified by:
finishedSession in interface IUserPreferencesManager

getUserPreferencesCopy

public UserPreferences getUserPreferencesCopy()
Description copied from interface: IUserPreferencesManager
Returns a copy of the user preferences

Specified by:
getUserPreferencesCopy in interface IUserPreferencesManager
Returns:
a copy of the UserPreferences object

getCurrentProfile

public UserProfile getCurrentProfile()
Description copied from interface: IUserPreferencesManager
Returns current profile.

Specified by:
getCurrentProfile in interface IUserPreferencesManager
Returns:
current UserProfile

getThemeStylesheetDescription

public ThemeStylesheetDescription getThemeStylesheetDescription()
                                                         throws java.lang.Exception
Description copied from interface: IUserPreferencesManager
Returns current theme stylesheet description

Specified by:
getThemeStylesheetDescription in interface IUserPreferencesManager
Returns:
current ThemeStylesheetDescription
Throws:
java.lang.Exception

getStructureStylesheetDescription

public StructureStylesheetDescription getStructureStylesheetDescription()
                                                                 throws java.lang.Exception
Description copied from interface: IUserPreferencesManager
Returns current structure stylesheet description

Specified by:
getStructureStylesheetDescription in interface IUserPreferencesManager
Returns:
current StructureStylesheetDescription
Throws:
java.lang.Exception

getUserPreferences

public UserPreferences getUserPreferences()
Description copied from interface: IUserPreferencesManager
Returns current user preferences.

Specified by:
getUserPreferences in interface IUserPreferencesManager
Returns:
current UserPreferences