uPortal 2.4.1
API Documentation

org.jasig.portal
Class RDBMUserLayoutStore

java.lang.Object
  extended byorg.jasig.portal.RDBMUserLayoutStore
All Implemented Interfaces:
IUserLayoutStore
Direct Known Subclasses:
AggregatedUserLayoutStore, OracleUserLayoutStore

public class RDBMUserLayoutStore
extends java.lang.Object
implements IUserLayoutStore

SQL implementation for the 2.x relational database model

Version:
$Revision: 1.171.2.3 $
Author:
George Lindholm

Constructor Summary
RDBMUserLayoutStore()
           
 
Method Summary
 java.lang.Integer addStructureStylesheetDescription(java.lang.String stylesheetDescriptionURI, java.lang.String stylesheetURI)
          Add a structure stylesheet description
 java.lang.Integer addStructureStylesheetDescription(StructureStylesheetDescription ssd)
          Registers a NEW structure stylesheet with the database.
 UserProfile addSystemProfile(UserProfile profile)
          add a new system profile to the database.
 java.lang.Integer addThemeStylesheetDescription(java.lang.String stylesheetDescriptionURI, java.lang.String stylesheetURI)
          Add theme stylesheet description
 java.lang.Integer addThemeStylesheetDescription(ThemeStylesheetDescription tsd)
          Registers a NEW theme stylesheet with the database.
 UserProfile addUserProfile(IPerson person, UserProfile profile)
          Add a user profile
 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(org.w3c.dom.Node node, java.lang.String indent)
          Dump a document tree structure on stdout
 java.lang.String generateNewChannelSubscribeId(IPerson person)
          Return the next available channel structure id for a user
 java.lang.String generateNewFolderId(IPerson person)
          Return the next available folder structure id for a user
 java.util.Hashtable getMimeTypeList()
          CoreStyleSheet
 StructureStylesheetDescription getStructureStylesheetDescription(int stylesheetId)
          Obtain structure stylesheet description object for a given structure stylesheet id.
 java.lang.Integer getStructureStylesheetId(java.lang.String ssName)
          Obtain ID for known structure stylesheet name
 java.util.Hashtable getStructureStylesheetList()
          Obtain a list of strcture stylesheet descriptions registered on the system
 java.util.Hashtable getStructureStylesheetList(java.lang.String mimeType)
          Obtain a list of structure stylesheet descriptions that have stylesheets for a given mime type.
 StructureStylesheetUserPreferences getStructureStylesheetUserPreferences(IPerson person, int profileId, int stylesheetId)
          Obtain structure stylesheet user preferences
 UserProfile getSystemProfile(java.lang.String userAgent)
          retreive a system profile associated with a given browser
 UserProfile getSystemProfileById(int profileId)
          Obtain a system profile
 java.util.Hashtable getSystemProfileList()
          obtain a list of system profiles
 ThemeStylesheetDescription getThemeStylesheetDescription(int stylesheetId)
          Obtain theme stylesheet description object for a given theme stylesheet id.
 java.lang.Integer getThemeStylesheetId(java.lang.String tsName)
          Obtain ID for known theme stylesheet name
 java.util.Hashtable getThemeStylesheetList()
          Obtain a list of theme stylesheet descriptions registered on the system
 java.util.Hashtable getThemeStylesheetList(int structureStylesheetId)
          Obtain a list of theme stylesheet descriptions for a given structure stylesheet
 ThemeStylesheetUserPreferences getThemeStylesheetUserPreferences(IPerson person, int profileId, int stylesheetId)
          Obtain theme stylesheet user preferences
 org.w3c.dom.Document getUserLayout(IPerson person, UserProfile profile)
          Retreive a user layout document.
 UserPreferences getUserPreferences(IPerson person, int profileId)
           
 UserPreferences getUserPreferences(IPerson person, UserProfile profile)
          Retreive the entire UserPreferences object
 UserProfile getUserProfile(IPerson person, java.lang.String userAgent)
          Obtain user profile associated with a particular browser
 UserProfile getUserProfileById(IPerson person, int profileId)
          Obtains a user profile by profile id.
 java.util.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
 void setStructureStylesheetUserPreferences(IPerson person, int profileId, StructureStylesheetUserPreferences ssup)
          Save structure stylesheet user pferences
 void setSystemBrowserMapping(java.lang.String userAgent, int profileId)
          establish system profile browser mapping
 void setThemeStylesheetUserPreferences(IPerson person, int profileId, ThemeStylesheetUserPreferences tsup)
          Save theme stylesheet user preferences
 void setUserBrowserMapping(IPerson person, java.lang.String userAgent, int profileId)
          establish a browser - user profile mapping
 void setUserLayout(IPerson person, UserProfile profile, org.w3c.dom.Document layoutXML, boolean channelsAdded)
          Save the user layout.
 boolean updateStructureStylesheetDescription(java.lang.String stylesheetDescriptionURI, java.lang.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(java.lang.String stylesheetDescriptionURI, java.lang.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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RDBMUserLayoutStore

public RDBMUserLayoutStore()
                    throws java.lang.Exception
Method Detail

addStructureStylesheetDescription

public java.lang.Integer addStructureStylesheetDescription(StructureStylesheetDescription ssd)
                                                    throws java.lang.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:
java.lang.Exception

addThemeStylesheetDescription

public java.lang.Integer addThemeStylesheetDescription(ThemeStylesheetDescription tsd)
                                                throws java.lang.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:
java.lang.Exception

updateThemeStylesheetDescription

public boolean updateThemeStylesheetDescription(java.lang.String stylesheetDescriptionURI,
                                                java.lang.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(java.lang.String stylesheetDescriptionURI,
                                                    java.lang.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 java.lang.Integer addStructureStylesheetDescription(java.lang.String stylesheetDescriptionURI,
                                                           java.lang.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 java.lang.Integer addThemeStylesheetDescription(java.lang.String stylesheetDescriptionURI,
                                                       java.lang.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 java.lang.Exception
Add a user profile

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

deleteUserProfile

public void deleteUserProfile(IPerson person,
                              int profileId)
                       throws java.lang.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:
java.lang.Exception

dumpDoc

public static final void dumpDoc(org.w3c.dom.Node node,
                                 java.lang.String indent)
Dump a document tree structure on stdout

Parameters:
node -
indent -

getMimeTypeList

public java.util.Hashtable getMimeTypeList()
                                    throws java.lang.Exception
CoreStyleSheet

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

generateNewChannelSubscribeId

public java.lang.String generateNewChannelSubscribeId(IPerson person)
                                               throws java.lang.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:
java.lang.Exception - if an error occurs

generateNewFolderId

public java.lang.String generateNewFolderId(IPerson person)
                                     throws java.lang.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:
java.lang.Exception

getStructureStylesheetDescription

public StructureStylesheetDescription getStructureStylesheetDescription(int stylesheetId)
                                                                 throws java.lang.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:
java.lang.Exception

getStructureStylesheetId

public java.lang.Integer getStructureStylesheetId(java.lang.String ssName)
                                           throws java.lang.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:
java.lang.Exception

getStructureStylesheetList

public java.util.Hashtable getStructureStylesheetList(java.lang.String mimeType)
                                               throws java.lang.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:
java.lang.Exception

getStructureStylesheetList

public java.util.Hashtable getStructureStylesheetList()
                                               throws java.lang.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:
java.lang.Exception

getStructureStylesheetUserPreferences

public StructureStylesheetUserPreferences getStructureStylesheetUserPreferences(IPerson person,
                                                                                int profileId,
                                                                                int stylesheetId)
                                                                         throws java.lang.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:
java.lang.Exception

getThemeStylesheetDescription

public ThemeStylesheetDescription getThemeStylesheetDescription(int stylesheetId)
                                                         throws java.lang.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:
java.lang.Exception

getThemeStylesheetId

public java.lang.Integer getThemeStylesheetId(java.lang.String tsName)
                                       throws java.lang.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:
java.lang.Exception

getThemeStylesheetList

public java.util.Hashtable getThemeStylesheetList(int structureStylesheetId)
                                           throws java.lang.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:
java.lang.Exception

getThemeStylesheetList

public java.util.Hashtable getThemeStylesheetList()
                                           throws java.lang.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:
java.lang.Exception

getThemeStylesheetUserPreferences

public ThemeStylesheetUserPreferences getThemeStylesheetUserPreferences(IPerson person,
                                                                        int profileId,
                                                                        int stylesheetId)
                                                                 throws java.lang.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:
java.lang.Exception

getUserLayout

public org.w3c.dom.Document getUserLayout(IPerson person,
                                          UserProfile profile)
                                   throws java.lang.Exception
Description copied from interface: IUserLayoutStore
Retreive 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:
java.lang.Exception - if an error occurs

getUserProfileById

public UserProfile getUserProfileById(IPerson person,
                                      int profileId)
                               throws java.lang.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:
java.lang.Exception

getUserProfileList

public java.util.Hashtable getUserProfileList(IPerson person)
                                       throws java.lang.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:
java.lang.Exception

removeStructureStylesheetDescription

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

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

removeThemeStylesheetDescription

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

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

setStructureStylesheetUserPreferences

public void setStructureStylesheetUserPreferences(IPerson person,
                                                  int profileId,
                                                  StructureStylesheetUserPreferences ssup)
                                           throws java.lang.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:
java.lang.Exception

setThemeStylesheetUserPreferences

public void setThemeStylesheetUserPreferences(IPerson person,
                                              int profileId,
                                              ThemeStylesheetUserPreferences tsup)
                                       throws java.lang.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:
java.lang.Exception

setUserBrowserMapping

public void setUserBrowserMapping(IPerson person,
                                  java.lang.String userAgent,
                                  int profileId)
                           throws java.lang.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:
java.lang.Exception

setUserLayout

public void setUserLayout(IPerson person,
                          UserProfile profile,
                          org.w3c.dom.Document layoutXML,
                          boolean channelsAdded)
                   throws java.lang.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:
java.lang.Exception

updateStructureStylesheetDescription

public void updateStructureStylesheetDescription(StructureStylesheetDescription ssd)
                                          throws java.lang.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:
java.lang.Exception

updateThemeStylesheetDescription

public void updateThemeStylesheetDescription(ThemeStylesheetDescription tsd)
                                      throws java.lang.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:
java.lang.Exception

updateUserProfile

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

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

setSystemBrowserMapping

public void setSystemBrowserMapping(java.lang.String userAgent,
                                    int profileId)
                             throws java.lang.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:
java.lang.Exception

getUserProfile

public UserProfile getUserProfile(IPerson person,
                                  java.lang.String userAgent)
                           throws java.lang.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:
java.lang.Exception

getSystemProfile

public UserProfile getSystemProfile(java.lang.String userAgent)
                             throws java.lang.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:
java.lang.Exception

getSystemProfileById

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

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

getSystemProfileList

public java.util.Hashtable getSystemProfileList()
                                         throws java.lang.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:
java.lang.Exception

updateSystemProfile

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

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

addSystemProfile

public UserProfile addSystemProfile(UserProfile profile)
                             throws java.lang.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:
java.lang.Exception

deleteSystemProfile

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

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

getUserPreferences

public UserPreferences getUserPreferences(IPerson person,
                                          int profileId)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

getUserPreferences

public UserPreferences getUserPreferences(IPerson person,
                                          UserProfile profile)
                                   throws java.lang.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:
java.lang.Exception

putUserPreferences

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

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

uPortal 2.4.1
API Documentation