| java.lang.Object org.jasig.portal.channels.groupsmanager.GroupsManagerXML
GroupsManagerXML | public class GroupsManagerXML implements GroupsManagerConstants(Code) | | Contains a groups of static methods used to centralize the generation and
retrieval of xml elements for groups and entities.
author: Don Fracapane version: $Revision: 36656 $ |
Method Summary | |
public static void | clearPropertiesCache(IGroupMember gm) Removes all EntityProperites for a GroupMember from the Entity Property cache. | public static Element | createElement(String name, Document xmlDoc, boolean setGrpDefault) Creates an element for the provided Document. | public static void | createPermissions(CGroupsManagerSessionData sessionData, IEntityGroup childEntGrp) | public static Element | createRdfElement(IEntityGroup entGrp, Document xmlDoc) | public static void | expandGroupElementXML(Element expandedElem, CGroupsManagerUnrestrictedSessionData sd) | public static Element | getAuthorizationXml(ChannelStaticData sd, Element apRoot, Document xmlDoc) Returns an element holding the user's permissions used to determine access
privileges in the Groups Manager channel. | public static Element | getElementById(Document aDoc, String id) Returns an element from an xml document for a unique id. | public static Element | getElementByTagNameAndId(Document aDoc, String tagname, String id) | public static String | getElementValueForTagName(Element anElem, String tagname) | public static String | getEntityName(Class typClass, String aKey) | public static String | getEntityName(String className, String aKey) | public static HashMap | getEntityTypes() Returns a HashMap of entity types. | public static Element | getEntityTypesXml(Document xmlDoc) Returns an element holding the entity types used in uPortal. | public static Element | getExpandedElementForTagNameAndKey(Document aDoc, String tagname, String key) Returns an Element with the expanded attribute set to true from a
Document for a tagname and IGroupMember key. | public static Element | getGroupMemberXml(IGroupMember gm, boolean isContextExpanded, Element anElem, CGroupsManagerUnrestrictedSessionData sd) Returns an Element for an IGroupMember. | public static Document | getGroupsManagerXml(CGroupsManagerSessionData sessionData) Returns a Document with an element for each IEntityType that has a root group. | public static Document | getNewDocument() | public static synchronized String | getNextUid() Returns the next sequential identifier which is used to uniquely
identify an element. | public static java.util.Iterator | getNodesById(Document aDoc, String id) Even though we know we will find a single element, we sometimes want
it returned in an iterator in order to streamline processing. | public static java.util.Iterator | getNodesByTagNameAndKey(Document aDoc, String tagname, String key) | public static java.util.Iterator | getNodesByTagNameAndKey(Element anElem, String tagname, String key) | public static Element | getPermissionXml(Document xmlDoc, String prmPrincipal, String prmActivity, String prmType, String prmTarget) Returns an element for a permission. | public static String | getTagName(IGroupMember gm) | public static IGroupsManagerWrapper | getWrapper(String type) Returns a group member wrapper. | public static boolean | isPersistentGroup(Element anElem) Group elements that hold search results are non-persistent and should be treated differently. | public static void | refreshAllNodes(CGroupsManagerUnrestrictedSessionData sd, IEntityGroup entGrp) Updates all nodes for the same IEntityGroup with information about the IEntityGroup. | public static void | refreshAllNodesIfRequired(CGroupsManagerUnrestrictedSessionData sd, Element anElem) Updates all nodes representing the same IEntityGroup that is represented by the
anElem, if the anElem is out of date with the IEntityGroup. | public static void | refreshAllNodesRecursivelyIfRequired(CGroupsManagerUnrestrictedSessionData sd, Element parentElem) Updates all nodes representing the same IEntityGroup that is represented by the
anElem, if the anElem is out of date with the IEntityGroup. | public static void | refreshElement(Element updElem, IEntityGroup entGrp) Updates an Element with information about the IEntityGroup. | public static boolean | refreshRequired(Element chkElem, IEntityGroup entGrp) Updates an Element with information about the IEntityGroup. | public static void | removeElementsForTagName(Element anElem, String tagname) | public static void | removePropertyElements(Document model, IGroupMember gm, boolean clearCache) Removes all property elements for an IGroupMember and optionally clears the Entity Property cache. | public static IEntity | retrieveEntity(String aKey, String aType) Returns an IEntity for the key. | public static IEntityGroup | retrieveGroup(String aKey) Returns an IEntityGroup for the key. | public static IGroupMember | retrieveGroupMemberForElement(Element gmElem) | public static IGroupMember | retrieveGroupMemberForElementId(Document aDoc, String id) |
clearPropertiesCache | public static void clearPropertiesCache(IGroupMember gm)(Code) | | Removes all EntityProperites for a GroupMember from the Entity Property cache.
Parameters: gm - IGroupMember |
createElement | public static Element createElement(String name, Document xmlDoc, boolean setGrpDefault)(Code) | | Creates an element for the provided Document. Alternatively, can
set default values.
Parameters: name - Parameters: xmlDoc - Parameters: setGrpDefault - Element |
createPermissions | public static void createPermissions(CGroupsManagerSessionData sessionData, IEntityGroup childEntGrp) throws Exception(Code) | | Creates permissions to a group for the current user and generates permission elements
Parameters: sessionData - CGroupsManagerSessionData Parameters: childEntGrp - IEntityGroup throws: Exception - |
createRdfElement | public static Element createRdfElement(IEntityGroup entGrp, Document xmlDoc)(Code) | | Returns an RDF element for the provided Document
Parameters: entGrp - IEntityGroup Parameters: xmlDoc - Document Element |
getAuthorizationXml | public static Element getAuthorizationXml(ChannelStaticData sd, Element apRoot, Document xmlDoc)(Code) | | Returns an element holding the user's permissions used to determine access
privileges in the Groups Manager channel.
Parameters: sd - Parameters: apRoot - Parameters: xmlDoc - Element |
getElementById | public static Element getElementById(Document aDoc, String id)(Code) | | Returns an element from an xml document for a unique id. An error is
displayed if more than one element is found.
Parameters: aDoc - Parameters: id - Element |
getElementByTagNameAndId | public static Element getElementByTagNameAndId(Document aDoc, String tagname, String id)(Code) | | Returns an Element from a Document for a tagname and element id
Parameters: aDoc - Parameters: tagname - Parameters: id - Element |
getElementValueForTagName | public static String getElementValueForTagName(Element anElem, String tagname)(Code) | | Returns the value of an element for a given name
Parameters: anElem - Element Parameters: tagname - String String |
getEntityName | public static String getEntityName(Class typClass, String aKey)(Code) | | Returns a name from the EntityNameFinderService, for a key and class
Parameters: typClass - Parameters: aKey - String |
getEntityName | public static String getEntityName(String className, String aKey)(Code) | | Returns a name from the EntityNameFinderService, for a key and classname
Parameters: className - Parameters: aKey - String |
getEntityTypes | public static HashMap getEntityTypes()(Code) | | Returns a HashMap of entity types. These are the entity types that can be added
to a group. We determine this by retrieving all entity types from the EntityTypes
class and using the GroupService class to determine which types have a root
group.
HashMap |
getEntityTypesXml | public static Element getEntityTypesXml(Document xmlDoc)(Code) | | Returns an element holding the entity types used in uPortal.
Parameters: xmlDoc - Element |
getExpandedElementForTagNameAndKey | public static Element getExpandedElementForTagNameAndKey(Document aDoc, String tagname, String key)(Code) | | Returns an Element with the expanded attribute set to true from a
Document for a tagname and IGroupMember key. This could be used for
cloning elements that have already be expanded thereby avoiding the extra
time required to retrieve and create an element.
Parameters: aDoc - Parameters: tagname - Parameters: key - Element |
getGroupMemberXml | public static Element getGroupMemberXml(IGroupMember gm, boolean isContextExpanded, Element anElem, CGroupsManagerUnrestrictedSessionData sd)(Code) | | Returns an Element for an IGroupMember. If an element is passed in,
it is acted upon (eg. expand the group), otherwise a new one is created.
Parameters: gm - Parameters: isContextExpanded - Parameters: anElem - Parameters: sd - CGroupsManagerUnrestrictedSessionData Element |
getGroupsManagerXml | public static Document getGroupsManagerXml(CGroupsManagerSessionData sessionData)(Code) | | Returns a Document with an element for each IEntityType that has a root group.
Parameters: sessionData - CGroupsManagerSessionData Document |
getNewDocument | public static Document getNewDocument()(Code) | | Returns a new Document
Document |
getNextUid | public static synchronized String getNextUid()(Code) | | Returns the next sequential identifier which is used to uniquely
identify an element. This identifier is held in the Element "id" attribute.
"0" is reserved for the Element holding the root group element.
String |
getNodesById | public static java.util.Iterator getNodesById(Document aDoc, String id)(Code) | | Even though we know we will find a single element, we sometimes want
it returned in an iterator in order to streamline processing.
Parameters: aDoc - Parameters: id - iterator |
getNodesByTagNameAndKey | public static java.util.Iterator getNodesByTagNameAndKey(Document aDoc, String tagname, String key)(Code) | | Returns an iterator of Nodes for a Document for a tagname and IGroupMember key
Parameters: aDoc - Parameters: tagname - Parameters: key - Iterator |
getNodesByTagNameAndKey | public static java.util.Iterator getNodesByTagNameAndKey(Element anElem, String tagname, String key)(Code) | | Returns an iterator of Nodes for an Element for a tagname and IGroupMember key
Parameters: anElem - Parameters: tagname - Parameters: key - Iterator |
getPermissionXml | public static Element getPermissionXml(Document xmlDoc, String prmPrincipal, String prmActivity, String prmType, String prmTarget)(Code) | | Returns an element for a permission.
Parameters: xmlDoc - Parameters: prmPrincipal - Parameters: prmActivity - Parameters: prmType - Parameters: prmTarget - Element |
getTagName | public static String getTagName(IGroupMember gm)(Code) | | Returns the xml tagname for a GroupMember
Parameters: gm - IGroupMember String |
isPersistentGroup | public static boolean isPersistentGroup(Element anElem)(Code) | | Group elements that hold search results are non-persistent and should be treated differently.
For example, they do not have a "key" attribute so code that attempts to retreive
a GroupMember should not be attempted.
Parameters: anElem - Element boolean |
refreshAllNodes | public static void refreshAllNodes(CGroupsManagerUnrestrictedSessionData sd, IEntityGroup entGrp)(Code) | | Updates all nodes for the same IEntityGroup with information about the IEntityGroup.
Parameters: sd - CGroupsManagerUnrestrictedSessionData Parameters: entGrp - IEntityGroup |
refreshAllNodesIfRequired | public static void refreshAllNodesIfRequired(CGroupsManagerUnrestrictedSessionData sd, Element anElem)(Code) | | Updates all nodes representing the same IEntityGroup that is represented by the
anElem, if the anElem is out of date with the IEntityGroup.
Parameters: sd - CGroupsManagerUnrestrictedSessionData Parameters: anElem - Element |
refreshAllNodesRecursivelyIfRequired | public static void refreshAllNodesRecursivelyIfRequired(CGroupsManagerUnrestrictedSessionData sd, Element parentElem)(Code) | | Updates all nodes representing the same IEntityGroup that is represented by the
anElem, if the anElem is out of date with the IEntityGroup. Additionally, we
do the same for each child node (one level down at this time).
Parameters: sd - CGroupsManagerUnrestrictedSessionData Parameters: parentElem - Element |
refreshElement | public static void refreshElement(Element updElem, IEntityGroup entGrp)(Code) | | Updates an Element with information about the IEntityGroup.
Parameters: updElem - Element Parameters: entGrp - IEntityGroup |
refreshRequired | public static boolean refreshRequired(Element chkElem, IEntityGroup entGrp)(Code) | | Updates an Element with information about the IEntityGroup.
Parameters: chkElem - Element Parameters: entGrp - IEntityGroup boolean |
removeElementsForTagName | public static void removeElementsForTagName(Element anElem, String tagname)(Code) | | Removes all elements with the tagname from an element
Parameters: anElem - Element Parameters: tagname - String |
removePropertyElements | public static void removePropertyElements(Document model, IGroupMember gm, boolean clearCache)(Code) | | Removes all property elements for an IGroupMember and optionally clears the Entity Property cache.
Parameters: model - Element Parameters: gm - IGroupMember Parameters: clearCache - boolean |
retrieveEntity | public static IEntity retrieveEntity(String aKey, String aType)(Code) | | Returns an IEntity for the key.
Parameters: aKey - Parameters: aType - IEntity |
retrieveGroup | public static IEntityGroup retrieveGroup(String aKey)(Code) | | Returns an IEntityGroup for the key.
Parameters: aKey - IEntityGroup |
retrieveGroupMemberForElement | public static IGroupMember retrieveGroupMemberForElement(Element gmElem)(Code) | | Returns the IGroupMember represented by an Element
Parameters: gmElem - IGroupMember |
retrieveGroupMemberForElementId | public static IGroupMember retrieveGroupMemberForElementId(Document aDoc, String id)(Code) | | Returns the IGroupMember represented by an Element
Parameters: aDoc - Parameters: id - IGroupMember |
|
|