|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasig.portal.layout.simple.RDBMUserLayoutStore
org.jasig.portal.layout.dlm.RDBMDistributedLayoutStore
public class RDBMDistributedLayoutStore
This class extends RDBMUserLayoutStore and implements instantiating and storing layouts that conform to the design of the distribute layout management system. These layouts consist of two types: layout fragments that are the layouts owned by a user specified in dlm.xml, and composite view layouts which represent regular users with zero or more UI elements incorporated from layout fragments. Only a user's personal layout fragment is
Field Summary | |
---|---|
private FragmentActivator |
activator
|
private LayoutDecorator |
decorator
|
(package private) static java.lang.String |
DECORATOR_PROPERTY
|
private FragmentDefinition[] |
definitions
|
private java.lang.Object |
initializationLock
|
private boolean |
initialized
|
private static org.apache.commons.logging.Log |
LOG
|
private java.util.Map |
mLocks
Map of read/writer lock objects; one per unique person. |
private java.util.Properties |
properties
|
static java.lang.String |
RCS_ID
|
private static SmartCache |
ssdCache
|
private static int |
STRUCT
|
private java.lang.String |
systemDefaultUser
|
private boolean |
systemDefaultUserLoaded
|
(package private) static java.lang.String |
TEMPLATE_USER_NAME
|
private static int |
THEME
|
private static SmartCache |
tsdCache
|
Fields inherited from class org.jasig.portal.layout.simple.RDBMUserLayoutStore |
---|
channelPrefix, crs, csdb, DEBUG, folderPrefix, localeAware, log |
Constructor Summary | |
---|---|
RDBMDistributedLayoutStore()
|
Method Summary | |
---|---|
StructureStylesheetUserPreferences |
_getStructureStylesheetUserPreferences(IPerson person,
int profileId,
int stylesheetId)
|
private org.w3c.dom.Document |
_getUserLayout(IPerson person,
UserProfile profile)
Returns the layout for a user. |
private org.w3c.dom.Document |
_safeGetUserLayout(IPerson person,
UserProfile profile)
Handles locking and identifying proper root and namespaces that used to take place in super class. |
private void |
acquireReadLock(IPerson person)
|
(package private) void |
activationFinished()
Called by fragment activation after loading of all fragment layouts is complete to allow other threads requesting layouts via getUserLayout to continue. |
java.lang.Integer |
addStructureStylesheetDescription(StructureStylesheetDescription ssd)
Registers a NEW structure stylesheet with the database. |
java.lang.Integer |
addThemeStylesheetDescription(ThemeStylesheetDescription tsd)
Registers a NEW theme stylesheet with the database. |
private org.w3c.dom.Document |
getCompositeLayout(IPerson person,
UserProfile profile)
This method passed through the set of ordered fragments asking each one if it is applicable to this user. |
(package private) FragmentDefinition[] |
getDefinitions()
Gets the configured dlm fragment definitions. |
(package private) DistributedUserPreferences |
getDistributedSSUP(IPerson person,
int profileId,
int stylesheetId)
|
(package private) DistributedUserPreferences |
getDistributedTSUP(IPerson person,
int profileId,
int stylesheetId)
|
(package private) org.w3c.dom.Document |
getFragmentLayout(IPerson person,
UserProfile profile)
Convenience method for fragment activator to obtain raw layouts for fragments during initialization. |
double |
getFragmentPrecedence(int index)
Returns a double value indicating the precedence value declared for a fragment in the dlm.xml. |
java.lang.String |
getNextStructDirectiveId(IPerson person)
Generates a new struct id for directive elements that dlm places in the PLF version of the layout tree. |
private FragmentDefinition |
getOwnedFragment(IPerson person)
Returns the fragment owned by this user if any. |
private java.lang.String |
getPlfId(org.w3c.dom.Document PLF,
java.lang.String incdId)
When user preferences are stored in the database for changes made to an incorporated node the node id can not be used because it does not represent a row in the up_layout_struct table for the user. |
java.lang.String |
getProperty(java.lang.String name)
Returns the specified property loaded from dlm.xml or null if not found. |
int |
getPropertyCount()
Returns the number of properties loaded from the dlm.xml file. |
java.util.Enumeration |
getPropertyNames()
Returns an enumerator of the property names loaded from dlm.xml. |
private EDU.oswego.cs.dl.util.concurrent.ReadWriteLock |
getReadWriteLock(IPerson person)
|
protected org.w3c.dom.Element |
getStructure(org.w3c.dom.Document document,
LayoutStructure ls)
|
StructureStylesheetDescription |
getStructureStylesheetDescription(int stylesheetId)
Obtain structure stylesheet description object for a given structure stylesheet id. |
StructureStylesheetUserPreferences |
getStructureStylesheetUserPreferences(IPerson person,
int profileId,
int stylesheetId)
Obtain structure stylesheet user preferences |
ThemeStylesheetDescription |
getThemeStylesheetDescription(int stylesheetId)
Obtain theme stylesheet description object for a given theme stylesheet id. |
ThemeStylesheetUserPreferences |
getThemeStylesheetUserPreferences(IPerson person,
int profileId,
int stylesheetId)
Obtain theme stylesheet user preferences |
org.w3c.dom.Document |
getUserLayout(IPerson person,
UserProfile profile)
Returns the layout for a user decorated with any specified decorator. |
private void |
initializeFragmentCleaner()
Starts a Thread that is responsible for cleaning out the layout fragments periodically. |
private boolean |
isLayoutOwnerDefault(IPerson person)
Returns true is the user is the owner of a layout which is copied as the default for any fragment when first created. |
private void |
loadIncorporatedPreferences(IPerson person,
int which,
DistributedUserPreferences userPrefs,
DistributedUserPreferences incdPrefs)
|
private void |
releaseReadLock(IPerson person)
|
void |
removeStructureStylesheetDescription(int stylesheetId)
Removes a structure stylesheet description object for a given structure stylesheet id. |
void |
removeThemeStylesheetDescription(int stylesheetId)
Removes a theme stylesheet description object for a given theme stylesheet id. |
protected int |
saveStructure(org.w3c.dom.Node node,
java.sql.PreparedStatement structStmt,
java.sql.PreparedStatement parmStmt)
|
(package private) void |
setDefinitions(FragmentDefinition[] frags)
Sets the dlm fragment definitions. |
(package private) void |
setProperties(java.util.Properties props)
Sets the dlm propertys. |
void |
setStructureStylesheetUserPreferences(IPerson person,
int profileId,
StructureStylesheetUserPreferences ssup)
Save structure stylesheet user pferences |
void |
setThemeStylesheetUserPreferences(IPerson person,
int profileId,
ThemeStylesheetUserPreferences tsup)
Save theme stylesheet user preferences |
void |
setUserLayout(IPerson person,
UserProfile profile,
org.w3c.dom.Document layoutXML,
boolean channelsAdded)
This method overrides the same method in the super class to persist only layout information stored in the user's person layout fragment or PLF. |
(package private) void |
setUserLayout(IPerson person,
UserProfile profile,
org.w3c.dom.Document layoutXML,
boolean channelsAdded,
boolean updateFragmentCache)
This method overrides the same method in the super class to persist only layout information stored in the user's person layout fragment or PLF. |
private java.lang.String |
showChannelAttribs(ThemeStylesheetUserPreferences tsup)
|
private java.lang.String |
showFolderAttribs(StructureStylesheetUserPreferences ssup)
|
private void |
updateCachedLayout(org.w3c.dom.Document layout,
UserProfile profile,
FragmentDefinition fragment)
Replaces the layout Document stored on a fragment definition with a new version. |
private void |
updateFragmentSSUP(IPerson person,
DistributedUserPreferences ssup)
If the passed in user represents a layout owner then replace the cached structure stylesheet user preferences with the passed in one after modifying it for incorporation. |
void |
updateStructureStylesheetDescription(StructureStylesheetDescription ssd)
Updates an existing structure stylesheet description with a new one. |
void |
updateThemeStylesheetDescription(ThemeStylesheetDescription tsd)
Updates an existing structure stylesheet description with a new one. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String RCS_ID
private static final org.apache.commons.logging.Log LOG
private java.lang.String systemDefaultUser
private boolean systemDefaultUserLoaded
private java.util.Properties properties
private FragmentDefinition[] definitions
private LayoutDecorator decorator
private FragmentActivator activator
private java.lang.Object initializationLock
private boolean initialized
static final java.lang.String TEMPLATE_USER_NAME
static final java.lang.String DECORATOR_PROPERTY
private static final int THEME
private static final int STRUCT
private static SmartCache tsdCache
private static SmartCache ssdCache
private java.util.Map mLocks
Constructor Detail |
---|
public RDBMDistributedLayoutStore() throws java.lang.Exception
java.lang.Exception
Method Detail |
---|
private final EDU.oswego.cs.dl.util.concurrent.ReadWriteLock getReadWriteLock(IPerson person)
private void acquireReadLock(IPerson person) throws java.lang.InterruptedException
java.lang.InterruptedException
private void releaseReadLock(IPerson person)
public java.lang.Integer addStructureStylesheetDescription(StructureStylesheetDescription ssd) throws java.lang.Exception
addStructureStylesheetDescription
in class RDBMUserLayoutStore
tsd
- 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
addThemeStylesheetDescription
in class RDBMUserLayoutStore
tsd
- Stylesheet description object
Integer
id of the registered Theme Stylesheet if successful;
null
otherwise.
java.lang.Exception
public StructureStylesheetDescription getStructureStylesheetDescription(int stylesheetId) throws java.lang.Exception
getStructureStylesheetDescription
in interface IUserLayoutStore
getStructureStylesheetDescription
in class RDBMUserLayoutStore
stylesheetId
- the id of the structure stylesheet
java.lang.Exception
public ThemeStylesheetDescription getThemeStylesheetDescription(int stylesheetId) throws java.lang.Exception
getThemeStylesheetDescription
in interface IUserLayoutStore
getThemeStylesheetDescription
in class RDBMUserLayoutStore
stylesheetId
- the id of the theme stylesheet
java.lang.Exception
public void removeStructureStylesheetDescription(int stylesheetId) throws java.lang.Exception
removeStructureStylesheetDescription
in interface IUserLayoutStore
removeStructureStylesheetDescription
in class RDBMUserLayoutStore
stylesheetId
- id of the stylesheet
java.lang.Exception
public void removeThemeStylesheetDescription(int stylesheetId) throws java.lang.Exception
removeThemeStylesheetDescription
in interface IUserLayoutStore
removeThemeStylesheetDescription
in class RDBMUserLayoutStore
stylesheetId
- id of the stylesheet
java.lang.Exception
public void updateStructureStylesheetDescription(StructureStylesheetDescription ssd) throws java.lang.Exception
updateStructureStylesheetDescription
in class RDBMUserLayoutStore
ssd
- new stylesheet description
java.lang.Exception
public void updateThemeStylesheetDescription(ThemeStylesheetDescription tsd) throws java.lang.Exception
updateThemeStylesheetDescription
in class RDBMUserLayoutStore
ssd
- new stylesheet description
java.lang.Exception
private void initializeFragmentCleaner()
public double getFragmentPrecedence(int index)
public org.w3c.dom.Document getUserLayout(IPerson person, UserProfile profile) throws java.lang.Exception
getUserLayout
in interface IUserLayoutStore
getUserLayout
in class RDBMUserLayoutStore
person
- an IPerson
object specifying the userprofile
- a user profile
Document
containing user layout (conforms to userLayout.dtd)
java.lang.Exception
- if an error occursprivate org.w3c.dom.Document _safeGetUserLayout(IPerson person, UserProfile profile) throws java.lang.Exception
person
- profile
-
java.lang.Exception
private org.w3c.dom.Document _getUserLayout(IPerson person, UserProfile profile) throws java.lang.Exception
java.lang.Exception
org.w3c.dom.Document getFragmentLayout(IPerson person, UserProfile profile) throws java.lang.Exception
java.lang.Exception
void activationFinished()
public java.lang.String getNextStructDirectiveId(IPerson person) throws java.lang.Exception
java.lang.Exception
private void updateCachedLayout(org.w3c.dom.Document layout, UserProfile profile, FragmentDefinition fragment)
private boolean isLayoutOwnerDefault(IPerson person)
private FragmentDefinition getOwnedFragment(IPerson person)
private org.w3c.dom.Document getCompositeLayout(IPerson person, UserProfile profile) throws java.lang.Exception
java.lang.Exception
public void setUserLayout(IPerson person, UserProfile profile, org.w3c.dom.Document layoutXML, boolean channelsAdded) throws java.lang.Exception
setUserLayout
in interface IUserLayoutStore
setUserLayout
in class RDBMUserLayoutStore
person
- an IPerson
object specifying the userprofile
- a user profile for which the layout is being storedlayoutXML
- a Document
containing user layout (conforming to userLayout.dtd)channelsAdded
- a boolean flag specifying if new channels have been added to the current user layout (for performance optimization purposes)
java.lang.Exception
- if an error occursvoid setUserLayout(IPerson person, UserProfile profile, org.w3c.dom.Document layoutXML, boolean channelsAdded, boolean updateFragmentCache) throws java.lang.Exception
java.lang.Exception
public int getPropertyCount()
public java.util.Enumeration getPropertyNames()
public java.lang.String getProperty(java.lang.String name)
void setProperties(java.util.Properties props)
void setDefinitions(FragmentDefinition[] frags)
FragmentDefinition[] getDefinitions()
DistributedUserPreferences getDistributedSSUP(IPerson person, int profileId, int stylesheetId) throws java.lang.Exception
java.lang.Exception
DistributedUserPreferences getDistributedTSUP(IPerson person, int profileId, int stylesheetId) throws java.lang.Exception
java.lang.Exception
public StructureStylesheetUserPreferences _getStructureStylesheetUserPreferences(IPerson person, int profileId, int stylesheetId) throws java.lang.Exception
java.lang.Exception
public StructureStylesheetUserPreferences getStructureStylesheetUserPreferences(IPerson person, int profileId, int stylesheetId) throws java.lang.Exception
IUserLayoutStore
getStructureStylesheetUserPreferences
in interface IUserLayoutStore
getStructureStylesheetUserPreferences
in class RDBMUserLayoutStore
person
- UserprofileId
- profile idstylesheetId
- structure stylesheet id
java.lang.Exception
public ThemeStylesheetUserPreferences getThemeStylesheetUserPreferences(IPerson person, int profileId, int stylesheetId) throws java.lang.Exception
IUserLayoutStore
getThemeStylesheetUserPreferences
in interface IUserLayoutStore
getThemeStylesheetUserPreferences
in class RDBMUserLayoutStore
person
- UserprofileId
- profile idstylesheetId
- theme stylesheet id
java.lang.Exception
private void loadIncorporatedPreferences(IPerson person, int which, DistributedUserPreferences userPrefs, DistributedUserPreferences incdPrefs)
private java.lang.String showFolderAttribs(StructureStylesheetUserPreferences ssup)
private java.lang.String showChannelAttribs(ThemeStylesheetUserPreferences tsup)
private void updateFragmentSSUP(IPerson person, DistributedUserPreferences ssup)
private java.lang.String getPlfId(org.w3c.dom.Document PLF, java.lang.String incdId)
protected org.w3c.dom.Element getStructure(org.w3c.dom.Document document, LayoutStructure ls) throws java.lang.Exception
getStructure
in class RDBMUserLayoutStore
java.lang.Exception
protected int saveStructure(org.w3c.dom.Node node, java.sql.PreparedStatement structStmt, java.sql.PreparedStatement parmStmt) throws java.sql.SQLException
saveStructure
in class RDBMUserLayoutStore
java.sql.SQLException
public void setStructureStylesheetUserPreferences(IPerson person, int profileId, StructureStylesheetUserPreferences ssup) throws java.lang.Exception
IUserLayoutStore
setStructureStylesheetUserPreferences
in interface IUserLayoutStore
setStructureStylesheetUserPreferences
in class RDBMUserLayoutStore
person
- 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 IUserLayoutStore
setThemeStylesheetUserPreferences
in class RDBMUserLayoutStore
person
- UserprofileId
- profile idtsup
- structure stylesheet user preferneces
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |