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 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: 19776 $
Author:
Peter Kharchenko pkharchenko@interactivebusiness.com

Field Summary
protected static org.apache.commons.logging.Log logger
           
 
Constructor Summary
UserPreferencesManager(HttpServletRequest req, IPerson person)
          Constructor does the following 1.
UserPreferencesManager(HttpServletRequest req, IPerson person, LocaleManager localeManager)
          Constructor does the following 1.
 
Method Summary
 void finishedSession(HttpSession session)
           
protected  String getChannelPublishId(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
static PropsMatcher getUserAgentMatcher()
           
 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 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

logger

protected static final org.apache.commons.logging.Log logger
Constructor Detail

UserPreferencesManager

public UserPreferencesManager(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(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
Method Detail

getUserAgentMatcher

public static PropsMatcher getUserAgentMatcher()
Returns:
lazily initialized access to the UserAgentMatcher TODO this should be re-written & tested in a static initializer or injected

getPerson

public IPerson getPerson()
Returns current person object

Specified by:
getPerson in interface IUserPreferencesManager
Returns:
current IPerson

getChannelPublishId

protected String getChannelPublishId(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(HttpSession session)
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 Exception
Description copied from interface: IUserPreferencesManager
Returns current theme stylesheet description

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

getStructureStylesheetDescription

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

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

getUserPreferences

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

Specified by:
getUserPreferences in interface IUserPreferencesManager
Returns:
current UserPreferences


Copyright © 2010 Jasig. All Rights Reserved.