org.jasig.portal.layout.dlm
Class EditManager

java.lang.Object
  extended by org.jasig.portal.layout.dlm.EditManager

public class EditManager
extends java.lang.Object

Handles ILF node edit directives recorded in the PLF.

Since:
uPortal 2.5
Version:
$Revision: 1.7 $ $Date: 2005/05/12 15:59:43 $

Field Summary
private static RDBMDistributedLayoutStore dls
           
static java.lang.String RCS_ID
           
 
Constructor Summary
EditManager()
           
 
Method Summary
private static void addDirective(org.w3c.dom.Element plfNode, java.lang.String attributeName, java.lang.String type, IPerson person)
          Create and append an edit directive to the edit set if not there.
(package private) static void addEditDirective(org.w3c.dom.Element plfNode, java.lang.String attributeName, IPerson person)
          Create and append an edit directive to the edit set if not there.
static void addPrefsDirective(org.w3c.dom.Element plfNode, java.lang.String attributeName, IPerson person)
          Create and append a user preferences edit directive to the edit set if not there.
static boolean applyEditSet(org.w3c.dom.Element plfChild, org.w3c.dom.Element original)
          Evaluate whether attribute changes exist in the ilfChild and if so apply them.
private static RDBMDistributedLayoutStore getDLS()
          Hands back the single instance of RDBMDistributedLayoutStore.
private static org.w3c.dom.Element getEditSet(org.w3c.dom.Element node, org.w3c.dom.Document plf, IPerson person, boolean create)
          Get the edit set if any stored in the passed in node.
static void removePreferenceDirective(IPerson person, java.lang.String elementId, java.lang.String attributeName)
          Searches for a dlm:pref command which indicates that a user preference was change and if found removes it from the user's PLF.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RCS_ID

public static final java.lang.String RCS_ID
See Also:
Constant Field Values

dls

private static RDBMDistributedLayoutStore dls
Constructor Detail

EditManager

public EditManager()
Method Detail

getDLS

private static RDBMDistributedLayoutStore getDLS()
Hands back the single instance of RDBMDistributedLayoutStore. There is already a method for aquiring a single instance of the configured layout store so we delegate over there so that all references refer to the same instance. This method is solely for convenience so that we don't have to keep calling UserLayoutStoreFactory and casting the resulting class.


getEditSet

private static org.w3c.dom.Element getEditSet(org.w3c.dom.Element node,
                                              org.w3c.dom.Document plf,
                                              IPerson person,
                                              boolean create)
                                       throws PortalException
Get the edit set if any stored in the passed in node. If not found and if the create flag is true then create a new edit set and add it as a child to the passed in node. Then return it.

Throws:
PortalException

addEditDirective

static void addEditDirective(org.w3c.dom.Element plfNode,
                             java.lang.String attributeName,
                             IPerson person)
                      throws PortalException
Create and append an edit directive to the edit set if not there. This only records that the attribute was changed and the value in the plf copy node should be used, if allowed, during the merge at login time.

Throws:
PortalException

addPrefsDirective

public static void addPrefsDirective(org.w3c.dom.Element plfNode,
                                     java.lang.String attributeName,
                                     IPerson person)
                              throws PortalException
Create and append a user preferences edit directive to the edit set if not there. This only records that the attribute was changed. The value will be in the user preferences object for the user.

Throws:
PortalException

addDirective

private static void addDirective(org.w3c.dom.Element plfNode,
                                 java.lang.String attributeName,
                                 java.lang.String type,
                                 IPerson person)
                          throws PortalException
Create and append an edit directive to the edit set if not there.

Throws:
PortalException

applyEditSet

public static boolean applyEditSet(org.w3c.dom.Element plfChild,
                                   org.w3c.dom.Element original)
Evaluate whether attribute changes exist in the ilfChild and if so apply them. Returns true if some changes existed. If changes existed but matched those in the original node then they are not applicable, are removed from the editSet, and false is returned.


removePreferenceDirective

public static void removePreferenceDirective(IPerson person,
                                             java.lang.String elementId,
                                             java.lang.String attributeName)
Searches for a dlm:pref command which indicates that a user preference was change and if found removes it from the user's PLF.