org.jasig.portal.layout.simple
Class RDBMUserLayoutStore

java.lang.Object
  extended by org.jasig.portal.layout.simple.RDBMUserLayoutStore
All Implemented Interfaces:
IUserLayoutStore
Direct Known Subclasses:
RDBMDistributedLayoutStore

public abstract class RDBMUserLayoutStore
extends Object
implements IUserLayoutStore

SQL implementation for the 2.x relational database model. Prior to uPortal 2.5, this class existed in the org.jasig.portal package. It was moved to its present package to express that it is part of the Simple Layout Manager implementation.

Version:
$Revision: 21145 $ $Date: 2010-07-19 15:19:16 -0500 (Mon, 19 Jul 2010) $
Author:
George Lindholm

Field Summary
protected static String channelPrefix
           
protected  IChannelRegistryStore channelRegistryStore
           
protected  ICounterStore counterStore
           
protected static int DEBUG
           
protected static String folderPrefix
           
protected static boolean localeAware
           
protected  org.apache.commons.logging.Log log
           
protected  IPersonManager personManager
           
 
Constructor Summary
RDBMUserLayoutStore()
           
 
Method Summary
 Integer addStructureStylesheetDescription(String stylesheetDescriptionURI, String stylesheetURI)
          Add a structure stylesheet description
 Integer addStructureStylesheetDescription(StructureStylesheetDescription ssd)
          Registers a NEW structure stylesheet with the database.
 UserProfile addSystemProfile(UserProfile profile)
          add a new system profile to the database.
 Integer addThemeStylesheetDescription(String stylesheetDescriptionURI, String stylesheetURI)
          Add theme stylesheet description
 Integer addThemeStylesheetDescription(ThemeStylesheetDescription tsd)
          Registers a NEW theme stylesheet with the database.
 UserProfile addUserProfile(IPerson person, UserProfile profile)
          Add a user profile
protected static boolean channelApproved(Date approvedDate)
          Checks if a channel has been approved
protected  void createLayout(HashMap layoutStructure, Document doc, Element root, int structId)
          Create a layout
 void deleteSystemProfile(int profileId)
          remove system profile from the database
 void deleteUserProfile(IPerson person, int profileId)
          remove user profile from the database
static void dumpDoc(Node node, String indent)
          Dump a document tree structure on stdout
 String generateNewChannelSubscribeId(IPerson person)
          Return the next available channel structure id for a user
 String generateNewFolderId(IPerson person)
          Return the next available folder structure id for a user
protected  int getLayoutID(int userId, int profileId)
          Returns the current layout ID for the user and profile.
 Hashtable getMimeTypeList()
          CoreStyleSheet
protected  String getNextStructId(IPerson person, String prefix)
          Return the next available structure id for a user
protected  String getStructId(int structId, int chanId)
          Return the Structure ID tag
protected abstract  Element getStructure(Document doc, LayoutStructure ls)
           
 StructureStylesheetDescription getStructureStylesheetDescription(int stylesheetId)
          Obtain structure stylesheet description object for a given structure stylesheet id.
 Integer getStructureStylesheetId(String ssName)
          Obtain ID for known structure stylesheet name
 Hashtable getStructureStylesheetList()
          Obtain a list of strcture stylesheet descriptions registered on the system
 Hashtable getStructureStylesheetList(String mimeType)
          Obtain a list of structure stylesheet descriptions that have stylesheets for a given mime type.
abstract  StructureStylesheetUserPreferences getStructureStylesheetUserPreferences(IPerson person, int profileId, int stylesheetId)
          Obtain structure stylesheet user preferences
 UserProfile getSystemProfile(String userAgent)
          retreive a system profile associated with a given browser
 UserProfile getSystemProfileByFname(String profileFname)
           
 UserProfile getSystemProfileById(int profileId)
          Obtain a system profile
 Hashtable getSystemProfileList()
          obtain a list of system profiles
 ThemeStylesheetDescription getThemeStylesheetDescription(int stylesheetId)
          Obtain theme stylesheet description object for a given theme stylesheet id.
 Integer getThemeStylesheetId(String tsName)
          Obtain ID for known theme stylesheet name
 Hashtable getThemeStylesheetList()
          Obtain a list of theme stylesheet descriptions registered on the system
 Hashtable getThemeStylesheetList(int structureStylesheetId)
          Obtain a list of theme stylesheet descriptions for a given structure stylesheet
abstract  ThemeStylesheetUserPreferences getThemeStylesheetUserPreferences(IPerson person, int profileId, int stylesheetId)
          Obtain theme stylesheet user preferences
 Document getUserLayout(IPerson person, UserProfile profile)
          Retrieve a user layout document.
 UserPreferences getUserPreferences(IPerson person, String profileFname)
           
 UserPreferences getUserPreferences(IPerson person, UserProfile profile)
          Retreive the entire UserPreferences object
 UserProfile getUserProfile(IPerson person, String userAgent)
          Obtain user profile associated with a particular browser
 UserProfile getUserProfileByFname(IPerson person, String profileFname)
          Obtains a user profile by profile functional name.
 UserProfile getUserProfileById(IPerson person, int profileId)
          Obtains a user profile by profile id.
 Hashtable getUserProfileList(IPerson person)
          retreive a list of profiles associated with a user
 void putUserPreferences(IPerson person, UserPreferences up)
          save user preferences
 void removeStructureStylesheetDescription(int stylesheetId)
          removes stylesheet description
 void removeThemeStylesheetDescription(int stylesheetId)
          Removes theme stylesheet
protected abstract  int saveStructure(Node node, PreparedStatement structStmt, PreparedStatement parmStmt)
           
abstract  void setStructureStylesheetUserPreferences(IPerson person, int profileId, StructureStylesheetUserPreferences ssup)
          Save structure stylesheet user pferences
 void setSystemBrowserMapping(String userAgent, int profileId)
          establish system profile browser mapping
abstract  void setThemeStylesheetUserPreferences(IPerson person, int profileId, ThemeStylesheetUserPreferences tsup)
          Save theme stylesheet user preferences
 void setUserBrowserMapping(IPerson person, String userAgent, int profileId)
          establish a browser - user profile mapping
 void setUserLayout(IPerson person, UserProfile profile, Document layoutXML, boolean channelsAdded)
          Save the user layout.
 boolean updateStructureStylesheetDescription(String stylesheetDescriptionURI, String stylesheetURI, int stylesheetId)
          Update the structure stylesheet description
 void updateStructureStylesheetDescription(StructureStylesheetDescription ssd)
          Updates an existing structure stylesheet description with a new one.
 void updateSystemProfile(UserProfile profile)
          update system profile
 boolean updateThemeStylesheetDescription(String stylesheetDescriptionURI, String stylesheetURI, int stylesheetId)
          Update the theme stylesheet description.
 void updateThemeStylesheetDescription(ThemeStylesheetDescription tsd)
          Updates an existing structure stylesheet description with a new one.
 void updateUserProfile(IPerson person, UserProfile profile)
          update user profile
protected static boolean xmlBool(String value)
          convert true/false into Y/N for database
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jasig.portal.layout.IUserLayoutStore
exportLayout, importLayout
 

Field Detail

log

protected final org.apache.commons.logging.Log log

DEBUG

protected static int DEBUG

channelPrefix

protected static final String channelPrefix
See Also:
Constant Field Values

folderPrefix

protected static final String folderPrefix
See Also:
Constant Field Values

channelRegistryStore

protected final IChannelRegistryStore channelRegistryStore

counterStore

protected final ICounterStore counterStore

personManager

protected final IPersonManager personManager

localeAware

protected static final boolean localeAware
Constructor Detail

RDBMUserLayoutStore

public RDBMUserLayoutStore()
                    throws Exception
Throws:
Exception
Method Detail

addStructureStylesheetDescription

public Integer addStructureStylesheetDescription(StructureStylesheetDescription ssd)
                                          throws Exception
Registers a NEW structure stylesheet with the database.

Parameters:
ssd - the Stylesheet description object
Returns:
an Integer id for the registered Stylesheet description object
Throws:
Exception

addThemeStylesheetDescription

public Integer addThemeStylesheetDescription(ThemeStylesheetDescription tsd)
                                      throws Exception
Registers a NEW theme stylesheet with the database.

Parameters:
tsd - Stylesheet description object
Returns:
an Integer id of the registered Theme Stylesheet if successful; null otherwise.
Throws:
Exception

updateThemeStylesheetDescription

public boolean updateThemeStylesheetDescription(String stylesheetDescriptionURI,
                                                String stylesheetURI,
                                                int stylesheetId)
Update the theme stylesheet description.

Specified by:
updateThemeStylesheetDescription in interface IUserLayoutStore
Parameters:
stylesheetDescriptionURI -
stylesheetURI -
stylesheetId -
Returns:
true if update succeeded, otherwise false

updateStructureStylesheetDescription

public boolean updateStructureStylesheetDescription(String stylesheetDescriptionURI,
                                                    String stylesheetURI,
                                                    int stylesheetId)
Update the structure stylesheet description

Specified by:
updateStructureStylesheetDescription in interface IUserLayoutStore
Parameters:
stylesheetDescriptionURI -
stylesheetURI -
stylesheetId -
Returns:
true if update succeeded, otherwise false

addStructureStylesheetDescription

public Integer addStructureStylesheetDescription(String stylesheetDescriptionURI,
                                                 String stylesheetURI)
Add a structure stylesheet description

Specified by:
addStructureStylesheetDescription in interface IUserLayoutStore
Parameters:
stylesheetDescriptionURI -
stylesheetURI -
Returns:
an Integer id of the registered Structure Stylesheet description object if successful; null otherwise.

addThemeStylesheetDescription

public Integer addThemeStylesheetDescription(String stylesheetDescriptionURI,
                                             String stylesheetURI)
Add theme stylesheet description

Specified by:
addThemeStylesheetDescription in interface IUserLayoutStore
Parameters:
stylesheetDescriptionURI -
stylesheetURI -
Returns:
an Integer id of the registered Theme Stylesheet if successful; null otherwise.

addUserProfile

public UserProfile addUserProfile(IPerson person,
                                  UserProfile profile)
                           throws Exception
Add a user profile

Specified by:
addUserProfile in interface IUserLayoutStore
Parameters:
person -
profile -
Returns:
userProfile
Throws:
Exception

channelApproved

protected static boolean channelApproved(Date approvedDate)
Checks if a channel has been approved

Parameters:
approvedDate -
Returns:
boolean Channel is approved

createLayout

protected final void createLayout(HashMap layoutStructure,
                                  Document doc,
                                  Element root,
                                  int structId)
                           throws SQLException,
                                  Exception
Create a layout

Parameters:
layoutStructure -
doc -
root -
structId -
Throws:
SQLException
Exception

xmlBool

protected static final boolean xmlBool(String value)
convert true/false into Y/N for database

Parameters:
value - to check

deleteUserProfile

public void deleteUserProfile(IPerson person,
                              int profileId)
                       throws Exception
Description copied from interface: IUserLayoutStore
remove user profile from the database

Specified by:
deleteUserProfile in interface IUserLayoutStore
Parameters:
person - User
profileId - profile id
Throws:
Exception

dumpDoc

public static final void dumpDoc(Node node,
                                 String indent)
Dump a document tree structure on stdout

Parameters:
node -
indent -

getMimeTypeList

public Hashtable getMimeTypeList()
                          throws Exception
CoreStyleSheet

Specified by:
getMimeTypeList in interface IUserLayoutStore
Returns:
Returns a hasbtale mapping mime type strings to their word descriptions (simple String)
Throws:
Exception

generateNewChannelSubscribeId

public String generateNewChannelSubscribeId(IPerson person)
                                     throws Exception
Return the next available channel structure id for a user

Specified by:
generateNewChannelSubscribeId in interface IUserLayoutStore
Parameters:
person -
Returns:
the next available channel structure id
Throws:
Exception - if an error occurs

generateNewFolderId

public String generateNewFolderId(IPerson person)
                           throws Exception
Return the next available folder structure id for a user

Specified by:
generateNewFolderId in interface IUserLayoutStore
Parameters:
person -
Returns:
a String that is the next free structure ID
Throws:
Exception

getNextStructId

protected String getNextStructId(IPerson person,
                                 String prefix)
                          throws Exception
Return the next available structure id for a user

Parameters:
person -
prefix -
Returns:
next free structure ID
Throws:
Exception

getStructId

protected String getStructId(int structId,
                             int chanId)
Return the Structure ID tag

Parameters:
structId -
chanId -
Returns:
ID tag

getStructureStylesheetDescription

public StructureStylesheetDescription getStructureStylesheetDescription(int stylesheetId)
                                                                 throws Exception
Obtain structure stylesheet description object for a given structure stylesheet id.

Specified by:
getStructureStylesheetDescription in interface IUserLayoutStore
Parameters:
stylesheetId - the id of the structure stylesheet
Returns:
structure stylesheet description
Throws:
Exception

getStructureStylesheetId

public Integer getStructureStylesheetId(String ssName)
                                 throws Exception
Obtain ID for known structure stylesheet name

Parameters:
ssName - name of the structure stylesheet
Returns:
id or null if no stylesheet matches the name given.
Throws:
Exception

getStructureStylesheetList

public Hashtable getStructureStylesheetList(String mimeType)
                                     throws Exception
Obtain a list of structure stylesheet descriptions that have stylesheets for a given mime type.

Specified by:
getStructureStylesheetList in interface IUserLayoutStore
Parameters:
mimeType -
Returns:
a mapping from stylesheet names to structure stylesheet description objects
Throws:
Exception

getStructureStylesheetList

public Hashtable getStructureStylesheetList()
                                     throws Exception
Obtain a list of strcture stylesheet descriptions registered on the system

Specified by:
getStructureStylesheetList in interface IUserLayoutStore
Returns:
a Hashtable mapping stylesheet id (Integer objects) to StructureStylesheetDescription objects
Throws:
Exception

getStructureStylesheetUserPreferences

public abstract StructureStylesheetUserPreferences getStructureStylesheetUserPreferences(IPerson person,
                                                                                         int profileId,
                                                                                         int stylesheetId)
                                                                                  throws Exception
Description copied from interface: IUserLayoutStore
Obtain structure stylesheet user preferences

Specified by:
getStructureStylesheetUserPreferences in interface IUserLayoutStore
Parameters:
person - User
profileId - profile id
stylesheetId - structure stylesheet id
Returns:
structure stylesheet user preferences. null is returned only if userId, profileId or stylesheet with an appropriate name do not exist. If all of the parameters are valid, but the user does not have any user preference settings associated with this stylesheet, return contains stylesheet preference object filled in with the defaults defined in stylesheet description.
Throws:
Exception

getThemeStylesheetDescription

public ThemeStylesheetDescription getThemeStylesheetDescription(int stylesheetId)
                                                         throws Exception
Obtain theme stylesheet description object for a given theme stylesheet id.

Specified by:
getThemeStylesheetDescription in interface IUserLayoutStore
Parameters:
stylesheetId - the id of the theme stylesheet
Returns:
theme stylesheet description
Throws:
Exception

getThemeStylesheetId

public Integer getThemeStylesheetId(String tsName)
                             throws Exception
Obtain ID for known theme stylesheet name

Parameters:
tsName - name of the theme stylesheet
Returns:
id or null if no theme matches the name given.
Throws:
Exception

getThemeStylesheetList

public Hashtable getThemeStylesheetList(int structureStylesheetId)
                                 throws Exception
Obtain a list of theme stylesheet descriptions for a given structure stylesheet

Specified by:
getThemeStylesheetList in interface IUserLayoutStore
Parameters:
structureStylesheetId -
Returns:
a map of stylesheet names to theme stylesheet description objects
Throws:
Exception

getThemeStylesheetList

public Hashtable getThemeStylesheetList()
                                 throws Exception
Obtain a list of theme stylesheet descriptions registered on the system

Specified by:
getThemeStylesheetList in interface IUserLayoutStore
Returns:
a Hashtable mapping stylesheet id (Integer objects) to ThemeStylesheetDescription objects
Throws:
Exception

getThemeStylesheetUserPreferences

public abstract ThemeStylesheetUserPreferences getThemeStylesheetUserPreferences(IPerson person,
                                                                                 int profileId,
                                                                                 int stylesheetId)
                                                                          throws Exception
Description copied from interface: IUserLayoutStore
Obtain theme stylesheet user preferences

Specified by:
getThemeStylesheetUserPreferences in interface IUserLayoutStore
Parameters:
person - User
profileId - profile id
stylesheetId - theme stylesheet id
Returns:
theme stylesheet user preferences. null is returned only if userId, profileId or stylesheet with an appropriate name do not exist. If all of the parameters are valid, but the user does not have any user preference settings associated with this stylesheet, return contains stylesheet preference object filled in with the defaults defined in stylesheet description.
Throws:
Exception

getUserLayout

public Document getUserLayout(IPerson person,
                              UserProfile profile)
                       throws Exception
Description copied from interface: IUserLayoutStore
Retrieve a user layout document.

Specified by:
getUserLayout in interface IUserLayoutStore
Parameters:
person - an IPerson object specifying the user
profile - a user profile
Returns:
a Document containing user layout (conforms to userLayout.dtd)
Throws:
Exception - if an error occurs

getUserProfileById

public UserProfile getUserProfileById(IPerson person,
                                      int profileId)
                               throws Exception
Description copied from interface: IUserLayoutStore
Obtains a user profile by profile id.

Specified by:
getUserProfileById in interface IUserLayoutStore
Parameters:
person - an IPerson object representing the user
profileId - profile id
Throws:
Exception

getUserProfileByFname

public UserProfile getUserProfileByFname(IPerson person,
                                         String profileFname)
                                  throws Exception
Description copied from interface: IUserLayoutStore
Obtains a user profile by profile functional name.

Specified by:
getUserProfileByFname in interface IUserLayoutStore
Parameters:
person - an IPerson object representing the user
profileFname - profile functional name
Throws:
Exception

getUserProfileList

public Hashtable getUserProfileList(IPerson person)
                             throws Exception
Description copied from interface: IUserLayoutStore
retreive a list of profiles associated with a user

Specified by:
getUserProfileList in interface IUserLayoutStore
Parameters:
person - User
Returns:
a Hashtable mapping user profile ids (Integer objects) to the UserProfile objects
Throws:
Exception

removeStructureStylesheetDescription

public void removeStructureStylesheetDescription(int stylesheetId)
                                          throws Exception
Description copied from interface: IUserLayoutStore
removes stylesheet description

Specified by:
removeStructureStylesheetDescription in interface IUserLayoutStore
Parameters:
stylesheetId - id of the stylesheet
Throws:
Exception

removeThemeStylesheetDescription

public void removeThemeStylesheetDescription(int stylesheetId)
                                      throws Exception
Description copied from interface: IUserLayoutStore
Removes theme stylesheet

Specified by:
removeThemeStylesheetDescription in interface IUserLayoutStore
Parameters:
stylesheetId - id of the stylesheet
Throws:
Exception

getStructure

protected abstract Element getStructure(Document doc,
                                        LayoutStructure ls)
                                 throws Exception
Throws:
Exception

saveStructure

protected abstract int saveStructure(Node node,
                                     PreparedStatement structStmt,
                                     PreparedStatement parmStmt)
                              throws Exception
Throws:
Exception

setStructureStylesheetUserPreferences

public abstract void setStructureStylesheetUserPreferences(IPerson person,
                                                           int profileId,
                                                           StructureStylesheetUserPreferences ssup)
                                                    throws Exception
Description copied from interface: IUserLayoutStore
Save structure stylesheet user pferences

Specified by:
setStructureStylesheetUserPreferences in interface IUserLayoutStore
Parameters:
person - User
profileId - profile id
ssup - structure stylesheet user preferences
Throws:
Exception

setThemeStylesheetUserPreferences

public abstract void setThemeStylesheetUserPreferences(IPerson person,
                                                       int profileId,
                                                       ThemeStylesheetUserPreferences tsup)
                                                throws Exception
Description copied from interface: IUserLayoutStore
Save theme stylesheet user preferences

Specified by:
setThemeStylesheetUserPreferences in interface IUserLayoutStore
Parameters:
person - User
profileId - profile id
tsup - structure stylesheet user preferneces
Throws:
Exception

setUserBrowserMapping

public void setUserBrowserMapping(IPerson person,
                                  String userAgent,
                                  int profileId)
                           throws Exception
Description copied from interface: IUserLayoutStore
establish a browser - user profile mapping

Specified by:
setUserBrowserMapping in interface IUserLayoutStore
Parameters:
person - User
userAgent - User-Agent header string
profileId - profile id to which given user agent will be mapped
Throws:
Exception

setUserLayout

public void setUserLayout(IPerson person,
                          UserProfile profile,
                          Document layoutXML,
                          boolean channelsAdded)
                   throws Exception
Save the user layout.

Specified by:
setUserLayout in interface IUserLayoutStore
Parameters:
person -
profile -
layoutXML -
channelsAdded - a boolean flag specifying if new channels have been added to the current user layout (for performance optimization purposes)
Throws:
Exception

updateStructureStylesheetDescription

public void updateStructureStylesheetDescription(StructureStylesheetDescription ssd)
                                          throws Exception
Updates an existing structure stylesheet description with a new one. Old stylesheet description is found based on the Id provided in the parameter structure.

Parameters:
ssd - new stylesheet description
Throws:
Exception

updateThemeStylesheetDescription

public void updateThemeStylesheetDescription(ThemeStylesheetDescription tsd)
                                      throws Exception
Updates an existing structure stylesheet description with a new one. Old stylesheet description is found based on the Id provided in the parameter structure.

Parameters:
tsd - new theme stylesheet description
Throws:
Exception

updateUserProfile

public void updateUserProfile(IPerson person,
                              UserProfile profile)
                       throws Exception
Description copied from interface: IUserLayoutStore
update user profile

Specified by:
updateUserProfile in interface IUserLayoutStore
Parameters:
person - User
profile - profile update
Throws:
Exception

setSystemBrowserMapping

public void setSystemBrowserMapping(String userAgent,
                                    int profileId)
                             throws Exception
Description copied from interface: IUserLayoutStore
establish system profile browser mapping

Specified by:
setSystemBrowserMapping in interface IUserLayoutStore
Parameters:
userAgent - User-Agent header string
profileId - profile id of a profile to which given user-agent will be mapped
Throws:
Exception

getUserProfile

public UserProfile getUserProfile(IPerson person,
                                  String userAgent)
                           throws Exception
Description copied from interface: IUserLayoutStore
Obtain user profile associated with a particular browser

Specified by:
getUserProfile in interface IUserLayoutStore
Parameters:
person - User
userAgent - User-Agent header string
Returns:
user profile or null if no user profiles are associated with the given user agent.
Throws:
Exception

getSystemProfile

public UserProfile getSystemProfile(String userAgent)
                             throws Exception
Description copied from interface: IUserLayoutStore
retreive a system profile associated with a given browser

Specified by:
getSystemProfile in interface IUserLayoutStore
Parameters:
userAgent - User-Agent header string
Returns:
profile object
Throws:
Exception

getSystemProfileById

public UserProfile getSystemProfileById(int profileId)
                                 throws Exception
Description copied from interface: IUserLayoutStore
Obtain a system profile

Specified by:
getSystemProfileById in interface IUserLayoutStore
Parameters:
profileId - system profile id
Throws:
Exception

getSystemProfileByFname

public UserProfile getSystemProfileByFname(String profileFname)
                                    throws Exception
Specified by:
getSystemProfileByFname in interface IUserLayoutStore
Throws:
Exception

getSystemProfileList

public Hashtable getSystemProfileList()
                               throws Exception
Description copied from interface: IUserLayoutStore
obtain a list of system profiles

Specified by:
getSystemProfileList in interface IUserLayoutStore
Returns:
a Hashtable mapping system profile ids (Integer objects) to the UserProfile objects
Throws:
Exception

updateSystemProfile

public void updateSystemProfile(UserProfile profile)
                         throws Exception
Description copied from interface: IUserLayoutStore
update system profile

Specified by:
updateSystemProfile in interface IUserLayoutStore
Parameters:
profile - profile object
Throws:
Exception

addSystemProfile

public UserProfile addSystemProfile(UserProfile profile)
                             throws Exception
Description copied from interface: IUserLayoutStore
add a new system profile to the database. During this process, a new profile id will be assigned to the profile.

Specified by:
addSystemProfile in interface IUserLayoutStore
Parameters:
profile - profile object (profile id within will be overwritten)
Returns:
profile with an newly assigned id
Throws:
Exception

deleteSystemProfile

public void deleteSystemProfile(int profileId)
                         throws Exception
Description copied from interface: IUserLayoutStore
remove system profile from the database

Specified by:
deleteSystemProfile in interface IUserLayoutStore
Parameters:
profileId - profile id
Throws:
Exception

getUserPreferences

public UserPreferences getUserPreferences(IPerson person,
                                          String profileFname)
                                   throws Exception
Throws:
Exception

getUserPreferences

public UserPreferences getUserPreferences(IPerson person,
                                          UserProfile profile)
                                   throws Exception
Description copied from interface: IUserLayoutStore
Retreive the entire UserPreferences object

Specified by:
getUserPreferences in interface IUserLayoutStore
Parameters:
person - User
profile - profile
Returns:
user preferences
Throws:
Exception

putUserPreferences

public void putUserPreferences(IPerson person,
                               UserPreferences up)
                        throws Exception
Description copied from interface: IUserLayoutStore
save user preferences

Specified by:
putUserPreferences in interface IUserLayoutStore
Parameters:
person - User
up - user preferences object
Throws:
Exception

getLayoutID

protected int getLayoutID(int userId,
                          int profileId)
                   throws SQLException
Returns the current layout ID for the user and profile. If the profile doesn't exist or the layout_id field is null 0 is returned.

Parameters:
userId - The userId for the profile
profileId - The profileId for the profile
Returns:
The layout_id field or 0 if it does not exist or is null
Throws:
SQLException


Copyright © 2010 Jasig. All Rights Reserved.