com.filenet.wcm.toolkit.server.util
Class WcmAuthoringUtil

java.lang.Object
  extended bycom.filenet.wcm.toolkit.server.base.WcmDpContainer
      extended bycom.filenet.wcm.toolkit.server.base.WcmModule
          extended bycom.filenet.wcm.toolkit.server.util.WcmAuthoringUtil
All Implemented Interfaces:
WcmModuleInterface

public class WcmAuthoringUtil
extends WcmModule

This helper class is used by WcmAuthoringDataProvider and provides XML item-retrieval functions.


Field Summary
 
Fields inherited from class com.filenet.wcm.toolkit.server.base.WcmModule
locale, NAME_DELIMITER
 
Constructor Summary
WcmAuthoringUtil()
          Deprecated. - This class contains only static methods. There is no reason to construct or register it.
 
Method Summary
static org.w3c.dom.Document addGroupToGroupList(org.w3c.dom.Document doc, java.lang.String name, java.lang.String displayName, java.lang.String shortName, java.lang.String id)
          Adds a specified group to object store groups list
static org.w3c.dom.Document addObjectStoreToList(org.w3c.dom.Document o, java.lang.String id, java.lang.String name)
           
static org.w3c.dom.Document addRealmToList(org.w3c.dom.Document o, java.lang.String id, java.lang.String name, boolean bDefault)
           
static org.w3c.dom.Document addUserToUserList(org.w3c.dom.Document doc, java.lang.String name, java.lang.String displayName, java.lang.String shortName, java.lang.String id)
          Adds a specified user to object store users list
static boolean containRealm(org.w3c.dom.Document o, java.lang.String realmId)
           
static org.w3c.dom.Document createEmptyDocumentPermissionXML()
          Returns an empty document object permission XML.
static org.w3c.dom.Document createObjectStoresXML()
           
static org.w3c.dom.Document createRealmsXML()
          Returns an empty realm xml
static org.w3c.dom.Node getGroupsNode(org.w3c.dom.Document permissions)
          Returns groups node.
static org.w3c.dom.NodeList getPermissionsNodeList(org.w3c.dom.Document permissions)
          Returns Permissions node list.
static org.w3c.dom.Document getPermissionsNormalized(WcmAuthoringDataProvider adp, WcmEntryTemplate entryTemplate)
          Gets the permission XML from the entry template and updates the grantee data as needed.
static org.w3c.dom.NodeList getPropertiesNodeList(org.w3c.dom.Document properties)
          Returns Properties node list..
static org.w3c.dom.Node getUsersNode(org.w3c.dom.Document permissions)
          Returns Users node.
static org.w3c.dom.Document hideClassesFromClassDescriptions(org.w3c.dom.Document doc, java.util.Set hiddenClasses)
          Hides the specified classes from the class XML.
static void removeBuildinGroupFromGroupList(org.w3c.dom.Document doc)
          Removes the BUILDIN groups from the group list
static org.w3c.dom.Document removeReservationObjectFromList(org.w3c.dom.Document doc)
          Remove reservation object from versions list.
static boolean updatePermissionXML(WcmDataStore dataStore, org.w3c.dom.Document permissionXML)
          Updates the permission XML with grantee data from the server.
 
Methods inherited from class com.filenet.wcm.toolkit.server.base.WcmModule
addChild, addChild, addChild, cleanup, debugTrace, getClassProperty, getClassProperty, getClassPropertyKeys, getConfiguration, getController, getDataStore, getModuleProperty, getModuleProperty, getModuleProperty, getModuleProperty, getModulePropertyKeys, getName, getParent, getWindowProperty, getWindowProperty, initialize, persist, queryDataProvider, setClassProperty, setClassProperty, setController, setModuleProperty, setModuleProperty, setName, setParent, setPortletParent, setWindowProperty
 
Methods inherited from class com.filenet.wcm.toolkit.server.base.WcmDpContainer
addDataProvider, addDataProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.filenet.wcm.toolkit.server.base.WcmModuleInterface
addDataProvider
 

Constructor Detail

WcmAuthoringUtil

public WcmAuthoringUtil()
                 throws java.lang.Exception
Deprecated. - This class contains only static methods. There is no reason to construct or register it.

Method Detail

getPropertiesNodeList

public static org.w3c.dom.NodeList getPropertiesNodeList(org.w3c.dom.Document properties)
                                                  throws java.lang.Exception
Returns Properties node list..

Parameters:
properties - The XML DOM object that contains the object's properties
Returns:
NodeList Property nodes.
Throws:
java.lang.Exception - All errors.

getPermissionsNodeList

public static org.w3c.dom.NodeList getPermissionsNodeList(org.w3c.dom.Document permissions)
                                                   throws java.lang.Exception
Returns Permissions node list.

Parameters:
permissions - The XML DOM object that contains the object's permissions
Returns:
NodeList Permission nodes.
Throws:
java.lang.Exception - All errors.

getUsersNode

public static org.w3c.dom.Node getUsersNode(org.w3c.dom.Document permissions)
                                     throws java.lang.Exception
Returns Users node.

Parameters:
permissions - The XML DOM object that contains the object store's users list
Returns:
Node Users node.
Throws:
java.lang.Exception - All errors.

getGroupsNode

public static org.w3c.dom.Node getGroupsNode(org.w3c.dom.Document permissions)
                                      throws java.lang.Exception
Returns groups node.

Parameters:
permissions - The XML DOM object that contains the object store's groups list
Returns:
Node Groups node.
Throws:
java.lang.Exception - All errors.

removeBuildinGroupFromGroupList

public static void removeBuildinGroupFromGroupList(org.w3c.dom.Document doc)
                                            throws java.lang.Exception
Removes the BUILDIN groups from the group list

Parameters:
doc - Group list.
Throws:
java.lang.Exception - All errors.

addGroupToGroupList

public static org.w3c.dom.Document addGroupToGroupList(org.w3c.dom.Document doc,
                                                       java.lang.String name,
                                                       java.lang.String displayName,
                                                       java.lang.String shortName,
                                                       java.lang.String id)
                                                throws java.lang.Exception
Adds a specified group to object store groups list

Parameters:
doc - Groups list.
name - Name added to groups list.
displayName - Display name added to groups list
shortName - hort name added to users list
id - Id added to groups list.
Returns:
Document Group xml with a new group entry.
Throws:
java.lang.Exception - All errors.

addUserToUserList

public static org.w3c.dom.Document addUserToUserList(org.w3c.dom.Document doc,
                                                     java.lang.String name,
                                                     java.lang.String displayName,
                                                     java.lang.String shortName,
                                                     java.lang.String id)
                                              throws java.lang.Exception
Adds a specified user to object store users list

Parameters:
doc - Users list.
name - Name added to users list.
displayName - Display name added to users list
shortName - Short name added to users list
id - Id added to users list.
Returns:
Document The user xml with a new user entry.
Throws:
java.lang.Exception - All errors.

removeReservationObjectFromList

public static org.w3c.dom.Document removeReservationObjectFromList(org.w3c.dom.Document doc)
                                                            throws java.lang.Exception
Remove reservation object from versions list.

Parameters:
doc - Versions list.
Returns:
Document The passed in xml with the reservation object entry removed.
Throws:
java.lang.Exception - All errors.

createRealmsXML

public static org.w3c.dom.Document createRealmsXML()
                                            throws java.lang.Exception
Returns an empty realm xml

Returns:
Document A new realm xml.
Throws:
java.lang.Exception - All errors.

containRealm

public static boolean containRealm(org.w3c.dom.Document o,
                                   java.lang.String realmId)
                            throws java.lang.Exception
Throws:
java.lang.Exception

addRealmToList

public static org.w3c.dom.Document addRealmToList(org.w3c.dom.Document o,
                                                  java.lang.String id,
                                                  java.lang.String name,
                                                  boolean bDefault)
                                           throws java.lang.Exception
Throws:
java.lang.Exception

createObjectStoresXML

public static org.w3c.dom.Document createObjectStoresXML()
                                                  throws java.lang.Exception
Throws:
java.lang.Exception

createEmptyDocumentPermissionXML

public static org.w3c.dom.Document createEmptyDocumentPermissionXML()
                                                             throws java.lang.Exception
Returns an empty document object permission XML.

Returns:
Document The document permission XML.
Throws:
java.lang.Exception - All errors.

addObjectStoreToList

public static org.w3c.dom.Document addObjectStoreToList(org.w3c.dom.Document o,
                                                        java.lang.String id,
                                                        java.lang.String name)
                                                 throws java.lang.Exception
Throws:
java.lang.Exception

hideClassesFromClassDescriptions

public static org.w3c.dom.Document hideClassesFromClassDescriptions(org.w3c.dom.Document doc,
                                                                    java.util.Set hiddenClasses)
                                                             throws java.lang.Exception
Hides the specified classes from the class XML.

Parameters:
doc - Class descriptions xml.
hiddenClasses - Set holding the set of class symname.
Throws:
java.lang.Exception - All errors.

getPermissionsNormalized

public static org.w3c.dom.Document getPermissionsNormalized(WcmAuthoringDataProvider adp,
                                                            WcmEntryTemplate entryTemplate)
                                                     throws java.lang.Exception
Gets the permission XML from the entry template and updates the grantee data as needed. If all grantees are invalid then return the default class permission XML.

Parameters:
adp - The authoring data provider.
entryTemplate - The entry template object holding the entry template data.
Returns:
Document The permission XML with valid grantee data.
Throws:
java.lang.Exception - All errors.

updatePermissionXML

public static boolean updatePermissionXML(WcmDataStore dataStore,
                                          org.w3c.dom.Document permissionXML)
                                   throws java.lang.Exception
Updates the permission XML with grantee data from the server. Changed grantee will be updated and non existed grantee will be removed from XML.

Parameters:
dataStore - The application data store.
permissionXML - The permission XML
Returns:
true if the permission XML has been updated.
Throws:
java.lang.Exception - All errors.


© Copyright IBM Corp. 2002, 2007. All Rights Reserved.