|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.portal.layout.simple.RDBMUserLayoutStore
public class RDBMUserLayoutStore
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.
| Nested Class Summary | |
|---|---|
private class |
RDBMUserLayoutStore.SystemUser
|
| Field Summary | |
|---|---|
protected static java.lang.String |
channelPrefix
|
protected IChannelRegistryStore |
crs
|
protected ICounterStore |
csdb
|
protected static int |
DEBUG
|
protected static java.lang.String |
folderPrefix
|
protected static boolean |
localeAware
|
protected org.apache.commons.logging.Log |
log
|
private IPerson |
systemUser
|
| 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 |
protected static boolean |
channelApproved(java.util.Date approvedDate)
Checks if a channel has been approved |
protected void |
createLayout(java.util.HashMap layoutStructure,
org.w3c.dom.Document doc,
org.w3c.dom.Element root,
int structId)
Create a layout |
void |
deleteSystemProfile(int profileId)
remove system profile from the database |
private void |
deleteUserProfile(int userId,
int profileId)
|
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 |
private java.lang.String |
getDescription(org.w3c.dom.Document descr)
|
private org.w3c.dom.Document |
getDOM(java.lang.String uri)
|
protected int |
getLayoutID(int userId,
int profileId)
Returns the current layout ID for the user and profile. |
java.util.Hashtable |
getMimeTypeList()
CoreStyleSheet |
private java.lang.String |
getName(org.w3c.dom.Document descr)
|
protected java.lang.String |
getNextStructId(IPerson person,
java.lang.String prefix)
Return the next available structure id for a user |
private java.lang.String |
getRootElementTextValue(org.w3c.dom.Document descr,
java.lang.String elementName)
|
protected java.lang.String |
getStructId(int structId,
int chanId)
Return the Structure ID tag |
protected org.w3c.dom.Element |
getStructure(org.w3c.dom.Document doc,
LayoutStructure ls)
|
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 |
private int |
getSystemBrowserMapping(java.lang.String userAgent)
|
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 |
private java.lang.String |
getTextChildNodeValue(org.w3c.dom.Node node)
|
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 |
private int |
getUserBrowserMapping(IPerson person,
java.lang.String userAgent)
UserPreferences |
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 |
private java.util.Vector |
getVectorOfSimpleTextElementValues(org.w3c.dom.Document descr,
java.lang.String elementName)
|
private void |
populateChannelAttributeTable(org.w3c.dom.Document descr,
CoreXSLTStylesheetDescription cxsd)
|
private void |
populateFolderAttributeTable(org.w3c.dom.Document descr,
StructureStylesheetDescription cxsd)
|
private void |
populateParameterTable(org.w3c.dom.Document descr,
CoreStylesheetDescription csd)
|
void |
putUserPreferences(IPerson person,
UserPreferences up)
save user preferences |
private void |
removeStructureChannelAttribute(int stylesheetId,
java.lang.String pName,
java.sql.Connection con)
Remove (with cleanup) a structure stylesheet channel attribute |
private void |
removeStructureFolderAttribute(int stylesheetId,
java.lang.String pName,
java.sql.Connection con)
Remove (with cleanup) a structure stylesheet folder attribute |
void |
removeStructureStylesheetDescription(int stylesheetId)
removes stylesheet description |
private void |
removeStructureStylesheetParam(int stylesheetId,
java.lang.String pName,
java.sql.Connection con)
Remove (with cleanup) a structure stylesheet param |
private void |
removeThemeChannelAttribute(int stylesheetId,
java.lang.String pName,
java.sql.Connection con)
Remove (with cleanup) a theme stylesheet channel attribute |
void |
removeThemeStylesheetDescription(int stylesheetId)
Removes theme stylesheet |
private void |
removeThemeStylesheetParam(int stylesheetId,
java.lang.String pName,
java.sql.Connection con)
Remove (with cleanup) a theme stylesheet param |
protected int |
saveStructure(org.w3c.dom.Node node,
java.sql.PreparedStatement structStmt,
java.sql.PreparedStatement parmStmt)
|
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 |
protected static boolean |
xmlBool(java.lang.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 |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log log
protected static int DEBUG
protected static final java.lang.String channelPrefix
protected static final java.lang.String folderPrefix
protected IChannelRegistryStore crs
protected ICounterStore csdb
protected static final boolean localeAware
private IPerson systemUser
| Constructor Detail |
|---|
public RDBMUserLayoutStore()
throws java.lang.Exception
java.lang.Exception| Method Detail |
|---|
public java.lang.Integer addStructureStylesheetDescription(StructureStylesheetDescription ssd)
throws java.lang.Exception
ssd - the Stylesheet description object
Integer id for the registered Stylesheet description object
java.lang.Exception
public java.lang.Integer addThemeStylesheetDescription(ThemeStylesheetDescription tsd)
throws java.lang.Exception
tsd - Stylesheet description object
Integer id of the registered Theme Stylesheet if successful;
null otherwise.
java.lang.Exception
public boolean updateThemeStylesheetDescription(java.lang.String stylesheetDescriptionURI,
java.lang.String stylesheetURI,
int stylesheetId)
updateThemeStylesheetDescription in interface IUserLayoutStorestylesheetDescriptionURI - stylesheetURI - stylesheetId -
public boolean updateStructureStylesheetDescription(java.lang.String stylesheetDescriptionURI,
java.lang.String stylesheetURI,
int stylesheetId)
updateStructureStylesheetDescription in interface IUserLayoutStorestylesheetDescriptionURI - stylesheetURI - stylesheetId -
public java.lang.Integer addStructureStylesheetDescription(java.lang.String stylesheetDescriptionURI,
java.lang.String stylesheetURI)
addStructureStylesheetDescription in interface IUserLayoutStorestylesheetDescriptionURI - stylesheetURI -
Integer id of the registered Structure Stylesheet description object if successful;
null otherwise.
public java.lang.Integer addThemeStylesheetDescription(java.lang.String stylesheetDescriptionURI,
java.lang.String stylesheetURI)
addThemeStylesheetDescription in interface IUserLayoutStorestylesheetDescriptionURI - stylesheetURI -
Integer id of the registered Theme Stylesheet if successful;
null otherwise.
public UserProfile addUserProfile(IPerson person,
UserProfile profile)
throws java.lang.Exception
addUserProfile in interface IUserLayoutStoreperson - profile -
java.lang.Exceptionprotected static boolean channelApproved(java.util.Date approvedDate)
approvedDate -
protected final void createLayout(java.util.HashMap layoutStructure,
org.w3c.dom.Document doc,
org.w3c.dom.Element root,
int structId)
throws java.sql.SQLException,
java.lang.Exception
layoutStructure - doc - root - structId -
java.sql.SQLException
java.lang.Exceptionprotected static final boolean xmlBool(java.lang.String value)
value - to check
public void deleteUserProfile(IPerson person,
int profileId)
throws java.lang.Exception
IUserLayoutStore
deleteUserProfile in interface IUserLayoutStoreperson - UserprofileId - profile id
java.lang.Exception
private org.w3c.dom.Document getDOM(java.lang.String uri)
throws java.lang.Exception
java.lang.Exception
private void deleteUserProfile(int userId,
int profileId)
throws java.lang.Exception
java.lang.Exception
public static final void dumpDoc(org.w3c.dom.Node node,
java.lang.String indent)
node - indent -
public java.util.Hashtable getMimeTypeList()
throws java.lang.Exception
getMimeTypeList in interface IUserLayoutStorejava.lang.Exception
public java.lang.String generateNewChannelSubscribeId(IPerson person)
throws java.lang.Exception
generateNewChannelSubscribeId in interface IUserLayoutStoreperson -
java.lang.Exception - if an error occurs
public java.lang.String generateNewFolderId(IPerson person)
throws java.lang.Exception
generateNewFolderId in interface IUserLayoutStoreperson -
String that is the next free structure ID
java.lang.Exception
protected java.lang.String getNextStructId(IPerson person,
java.lang.String prefix)
throws java.lang.Exception
person - prefix -
java.lang.Exception
protected java.lang.String getStructId(int structId,
int chanId)
structId - chanId -
public StructureStylesheetDescription getStructureStylesheetDescription(int stylesheetId)
throws java.lang.Exception
getStructureStylesheetDescription in interface IUserLayoutStorestylesheetId - the id of the structure stylesheet
java.lang.Exception
public java.lang.Integer getStructureStylesheetId(java.lang.String ssName)
throws java.lang.Exception
ssName - name of the structure stylesheet
java.lang.Exception
public java.util.Hashtable getStructureStylesheetList(java.lang.String mimeType)
throws java.lang.Exception
getStructureStylesheetList in interface IUserLayoutStoremimeType -
java.lang.Exception
public java.util.Hashtable getStructureStylesheetList()
throws java.lang.Exception
getStructureStylesheetList in interface IUserLayoutStoreHashtable mapping stylesheet id (Integer objects) to StructureStylesheetDescription objects
java.lang.Exception
public StructureStylesheetUserPreferences getStructureStylesheetUserPreferences(IPerson person,
int profileId,
int stylesheetId)
throws java.lang.Exception
IUserLayoutStore
getStructureStylesheetUserPreferences in interface IUserLayoutStoreperson - UserprofileId - profile idstylesheetId - structure stylesheet id
java.lang.Exception
public ThemeStylesheetDescription getThemeStylesheetDescription(int stylesheetId)
throws java.lang.Exception
getThemeStylesheetDescription in interface IUserLayoutStorestylesheetId - the id of the theme stylesheet
java.lang.Exception
public java.lang.Integer getThemeStylesheetId(java.lang.String tsName)
throws java.lang.Exception
tsName - name of the theme stylesheet
java.lang.Exception
public java.util.Hashtable getThemeStylesheetList(int structureStylesheetId)
throws java.lang.Exception
getThemeStylesheetList in interface IUserLayoutStorestructureStylesheetId -
java.lang.Exception
public java.util.Hashtable getThemeStylesheetList()
throws java.lang.Exception
getThemeStylesheetList in interface IUserLayoutStoreHashtable mapping stylesheet id (Integer objects) to ThemeStylesheetDescription objects
java.lang.Exception
public ThemeStylesheetUserPreferences getThemeStylesheetUserPreferences(IPerson person,
int profileId,
int stylesheetId)
throws java.lang.Exception
IUserLayoutStore
getThemeStylesheetUserPreferences in interface IUserLayoutStoreperson - UserprofileId - profile idstylesheetId - theme stylesheet id
java.lang.Exceptionprivate java.lang.String getName(org.w3c.dom.Document descr)
private java.lang.String getRootElementTextValue(org.w3c.dom.Document descr,
java.lang.String elementName)
private java.lang.String getDescription(org.w3c.dom.Document descr)
private void populateParameterTable(org.w3c.dom.Document descr,
CoreStylesheetDescription csd)
private void populateFolderAttributeTable(org.w3c.dom.Document descr,
StructureStylesheetDescription cxsd)
private void populateChannelAttributeTable(org.w3c.dom.Document descr,
CoreXSLTStylesheetDescription cxsd)
private java.util.Vector getVectorOfSimpleTextElementValues(org.w3c.dom.Document descr,
java.lang.String elementName)
private java.lang.String getTextChildNodeValue(org.w3c.dom.Node node)
private int getUserBrowserMapping(IPerson person,
java.lang.String userAgent)
throws java.lang.Exception
java.lang.Exception
public org.w3c.dom.Document getUserLayout(IPerson person,
UserProfile profile)
throws java.lang.Exception
IUserLayoutStore
getUserLayout in interface IUserLayoutStoreperson - an IPerson object specifying the userprofile - a user profile
Document containing user layout (conforms to userLayout.dtd)
java.lang.Exception - if an error occurs
public UserProfile getUserProfileById(IPerson person,
int profileId)
throws java.lang.Exception
IUserLayoutStore
getUserProfileById in interface IUserLayoutStoreperson - an IPerson object representing the userprofileId - profile id
java.lang.Exception
public java.util.Hashtable getUserProfileList(IPerson person)
throws java.lang.Exception
IUserLayoutStore
getUserProfileList in interface IUserLayoutStoreperson - User
Hashtable mapping user profile ids (Integer objects) to the UserProfile objects
java.lang.Exception
private void removeStructureChannelAttribute(int stylesheetId,
java.lang.String pName,
java.sql.Connection con)
throws java.sql.SQLException
stylesheetId - id of the structure stylesheetpName - name of the attributecon - active database connection
java.sql.SQLException
private void removeStructureFolderAttribute(int stylesheetId,
java.lang.String pName,
java.sql.Connection con)
throws java.sql.SQLException
stylesheetId - id of the structure stylesheetpName - name of the attributecon - active database connection
java.sql.SQLException
public void removeStructureStylesheetDescription(int stylesheetId)
throws java.lang.Exception
IUserLayoutStore
removeStructureStylesheetDescription in interface IUserLayoutStorestylesheetId - id of the stylesheet
java.lang.Exception
private void removeStructureStylesheetParam(int stylesheetId,
java.lang.String pName,
java.sql.Connection con)
throws java.sql.SQLException
stylesheetId - id of the structure stylesheetpName - name of the parametercon - active database connection
java.sql.SQLException
private void removeThemeChannelAttribute(int stylesheetId,
java.lang.String pName,
java.sql.Connection con)
throws java.sql.SQLException
stylesheetId - id of the theme stylesheetpName - name of the attributecon - active database connection
java.sql.SQLException
public void removeThemeStylesheetDescription(int stylesheetId)
throws java.lang.Exception
IUserLayoutStore
removeThemeStylesheetDescription in interface IUserLayoutStorestylesheetId - id of the stylesheet
java.lang.Exception
private void removeThemeStylesheetParam(int stylesheetId,
java.lang.String pName,
java.sql.Connection con)
throws java.sql.SQLException
stylesheetId - id of the theme stylesheetpName - name of the parametercon - active database connection
java.sql.SQLException
protected org.w3c.dom.Element getStructure(org.w3c.dom.Document doc,
LayoutStructure ls)
throws java.lang.Exception
java.lang.Exception
protected int saveStructure(org.w3c.dom.Node node,
java.sql.PreparedStatement structStmt,
java.sql.PreparedStatement parmStmt)
throws java.sql.SQLException
java.sql.SQLException
public void setStructureStylesheetUserPreferences(IPerson person,
int profileId,
StructureStylesheetUserPreferences ssup)
throws java.lang.Exception
IUserLayoutStore
setStructureStylesheetUserPreferences in interface IUserLayoutStoreperson - UserprofileId - profile idssup - structure stylesheet user preferences
java.lang.Exception
public void setThemeStylesheetUserPreferences(IPerson person,
int profileId,
ThemeStylesheetUserPreferences tsup)
throws java.lang.Exception
IUserLayoutStore
setThemeStylesheetUserPreferences in interface IUserLayoutStoreperson - UserprofileId - profile idtsup - structure stylesheet user preferneces
java.lang.Exception
public void setUserBrowserMapping(IPerson person,
java.lang.String userAgent,
int profileId)
throws java.lang.Exception
IUserLayoutStore
setUserBrowserMapping in interface IUserLayoutStoreperson - UseruserAgent - User-Agent header stringprofileId - profile id to which given user agent will be mapped
java.lang.Exception
public void setUserLayout(IPerson person,
UserProfile profile,
org.w3c.dom.Document layoutXML,
boolean channelsAdded)
throws java.lang.Exception
setUserLayout in interface IUserLayoutStoreperson - profile - layoutXML - channelsAdded - a boolean flag specifying if new channels have been added to the current user layout (for performance optimization purposes)
java.lang.Exception
public void updateStructureStylesheetDescription(StructureStylesheetDescription ssd)
throws java.lang.Exception
ssd - new stylesheet description
java.lang.Exception
public void updateThemeStylesheetDescription(ThemeStylesheetDescription tsd)
throws java.lang.Exception
tsd - new theme stylesheet description
java.lang.Exception
public void updateUserProfile(IPerson person,
UserProfile profile)
throws java.lang.Exception
IUserLayoutStore
updateUserProfile in interface IUserLayoutStoreperson - Userprofile - profile update
java.lang.Exception
public void setSystemBrowserMapping(java.lang.String userAgent,
int profileId)
throws java.lang.Exception
IUserLayoutStore
setSystemBrowserMapping in interface IUserLayoutStoreuserAgent - User-Agent header stringprofileId - profile id of a profile to which given
user-agent will be mapped
java.lang.Exception
private int getSystemBrowserMapping(java.lang.String userAgent)
throws java.lang.Exception
java.lang.Exception
public UserProfile getUserProfile(IPerson person,
java.lang.String userAgent)
throws java.lang.Exception
IUserLayoutStore
getUserProfile in interface IUserLayoutStoreperson - UseruserAgent - User-Agent header string
null if no user profiles are associated with the given user agent.
java.lang.Exception
public UserProfile getSystemProfile(java.lang.String userAgent)
throws java.lang.Exception
IUserLayoutStore
getSystemProfile in interface IUserLayoutStoreuserAgent - User-Agent header string
java.lang.Exception
public UserProfile getSystemProfileById(int profileId)
throws java.lang.Exception
IUserLayoutStore
getSystemProfileById in interface IUserLayoutStoreprofileId - system profile id
java.lang.Exception
public java.util.Hashtable getSystemProfileList()
throws java.lang.Exception
IUserLayoutStore
getSystemProfileList in interface IUserLayoutStoreHashtable mapping system profile ids (Integer objects) to the UserProfile objects
java.lang.Exception
public void updateSystemProfile(UserProfile profile)
throws java.lang.Exception
IUserLayoutStore
updateSystemProfile in interface IUserLayoutStoreprofile - profile object
java.lang.Exception
public UserProfile addSystemProfile(UserProfile profile)
throws java.lang.Exception
IUserLayoutStore
addSystemProfile in interface IUserLayoutStoreprofile - profile object (profile id within will be overwritten)
java.lang.Exception
public void deleteSystemProfile(int profileId)
throws java.lang.Exception
IUserLayoutStore
deleteSystemProfile in interface IUserLayoutStoreprofileId - profile id
java.lang.Exception
public UserPreferences getUserPreferences(IPerson person,
int profileId)
throws java.lang.Exception
java.lang.Exception
public UserPreferences getUserPreferences(IPerson person,
UserProfile profile)
throws java.lang.Exception
IUserLayoutStore
getUserPreferences in interface IUserLayoutStoreperson - Userprofile - profile
java.lang.Exception
public void putUserPreferences(IPerson person,
UserPreferences up)
throws java.lang.Exception
IUserLayoutStore
putUserPreferences in interface IUserLayoutStoreperson - Userup - user preferences object
java.lang.Exception
protected int getLayoutID(int userId,
int profileId)
throws java.sql.SQLException
userId - The userId for the profileprofileId - The profileId for the profile
java.sql.SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||