com.filenet.wcm.apps.server.util.compounddocument

Class CompoundDocumentUtil

  1. java.lang.Object
  2. extended bycom.filenet.wcm.apps.server.util.compounddocument.CompoundDocumentUtil

  1. public class CompoundDocumentUtil
  2. extends java.lang.Object
Utility class to support getting attachment information for the eProcess page.

Field Summary

Modifier and Type Field and Description
  1. static
  2. java.lang.String
EMPTY_XML
Empty XML String
  1. static
  2. java.lang.String
RUNTIME_UPDATE_EXCEPTION_KEY

Method Summary

Modifier and Type Method and Description
  1. static
  2. boolean
canEditCompoundDocument(WcmSitePrefs sitePrefs,com.filenet.wcm.toolkit.server.dp.CompoundDocumentDataProvider cddp,java.lang.String objectStoreName,java.lang.String classId)
  1. static
  2. com.filenet.wcm.apps.server.presentation.util.ActionDefinition
getAddChildAction(AccessRoles accessRoles)
  1. static
  2. com.filenet.api.collection.IndependentObjectSet
getChildComponentRelationships(com.filenet.wcm.toolkit.server.dp.CompoundDocumentDataProvider cddp,java.lang.String objectStoreName,java.lang.String parentId,boolean ascending,int maxElements)
Queries the server for the component relationships and theirs assocated child documents.
  1. static
  2. org.w3c.dom.Document
getChildDocumentsXML(java.util.List crList,int pageSize,int currentPage,java.lang.String titleProperty)
Returns the child document XML used in rendering the child document list view.
  1. static
  2. java.lang.String
getChoiceName(org.w3c.dom.Document choiceXML,java.lang.String value)
Helper method to look up the name of a choice list item given its value.
  1. static
  2. java.util.Map
getClassDescriptionMap(com.filenet.wcm.toolkit.server.dp.CompoundDocumentDataProvider cddp,CompoundDocumentObjectStorePrefs cdObjectStorePrefs)
Gets a map of the API class description objects using on the classes defined by the compound document object store pref.
  1. static
  2. java.lang.String
getClassId(com.filenet.api.core.ComponentRelationship cr)
  1. static
  2. java.util.List
getComponentRelationshipList(CompoundDocumentState cdState)
Returns a list of ComponentRelationshipRef objects for the current page of the child document list view.
  1. static
  2. org.w3c.dom.Document
getComponentRelationshipPropertiesXML(org.w3c.dom.Document propDescXML,ComponentRelationshipRef crRef)
  1. static
  2. org.w3c.dom.Document
getComponentRelationshipPropertiesXML(org.w3c.dom.Document propDescsXML,org.w3c.dom.Document propertiesXML)
  1. static
  2. ComponentRelationshipRef
getComponentRelationshipRef(com.filenet.api.core.ComponentRelationship cr)
Creates and returns a new ComponentRelationshipRef object.
  1. static
  2. ComponentRelationshipRef
getComponentRelationshipRef(org.w3c.dom.Document propDescXML,CompoundDocumentPrefs cdPref,com.filenet.api.core.ComponentRelationship cr)
Creates and returns a new ComponentRelationshipRef object.
  1. static
  2. org.w3c.dom.Document
getComponentRelationshipsXML(java.util.List crList,int pageSize,int currentPage,java.util.Locale locale)
Returns the component relationship XML used in rendering the child document list view.
  1. static
  2. int
getItemIndex(CompoundDocumentState cdState,int index)
Gets the item list index given the xml item position.
  1. static
  2. ComponentRelationshipRef
getLastComponentRelationshipObjectRef(com.filenet.wcm.toolkit.server.dp.CompoundDocumentDataProvider cddp,java.lang.String objectStoreName,java.lang.String parentId)
Queries the server the last component relationship object in the selected compound document.
  1. static
  2. int
getLinkToType(ComponentRelationshipRef crRef)
Helper method to get the Link To type.
  1. static
  2. java.lang.String
getObjectStoreName(com.filenet.wcm.toolkit.server.dp.CompoundDocumentDataProvider cddp,java.lang.String objectStoreIndentifier)
  1. static
  2. java.util.List
getParentComponentRelationshipList(CompoundDocumentState cdState)
Returns a list of ComponentRelationshipRef objects for the current page of the parent document list view.
  1. static
  2. com.filenet.api.collection.RepositoryRowSet
getParentDocuments(com.filenet.wcm.toolkit.server.dp.CompoundDocumentDataProvider cddp,java.lang.String objectStoreName,java.lang.String childId,java.lang.String titleProperty,java.lang.String orderByProperty,boolean ascending,int maxElements)
Queries the server for the parentes documents of the specified child document.
  1. static
  2. org.w3c.dom.Document
getParentDocumentsXML(java.util.List crList,int pageSize,int currentPage,java.lang.String titleProperty)
Returns the parent document XML used in rendering the parent document list view.
  1. static
  2. java.lang.String
getStringValue(java.lang.Object value)
  1. static
  2. java.lang.String
lookupClassName(java.util.Map classDescMap,java.lang.String classId)
Looks up a singe class name.
  1. static
  2. int
moveDown(CompoundDocumentState cdState,int index)
Moves the selected item down one position in the compound document structure.
  1. static
  2. int
moveFirst(CompoundDocumentState cdState,int index)
Moves the selected item to the first position in the compound document structure.
  1. static
  2. int
moveLast(CompoundDocumentState cdState,int index)
Moves the selected item to the last position in the compound document structure.
  1. static
  2. int
moveUp(CompoundDocumentState cdState,int index)
Moves the selected item up one position in the compound document structure.
  1. static
  2. void
reOrderList(CompoundDocumentState cdState,int startingIndex,int startingOrderNumber,int offSet)
Reorders the component relationship list starting from the specified starting index and starting order number.
  1. static
  2. org.apache.commons.collections.map.ListOrderedMap
updateComponentRelationshipItems(com.filenet.wcm.toolkit.server.dp.CompoundDocumentDataProvider cddp,CompoundDocumentState cdState,java.util.Locale locale)
Helper method for saving data back to the server.
  1. static
  2. boolean
updateComponentRelationshipItems(com.filenet.wcm.toolkit.server.dp.CompoundDocumentDataProvider cddp,WcmAuthoringState authorState,CompoundDocumentState cdState,java.util.Locale locale)
Helper method for saving changes back to the server for all new, modified, moved or removed component relationship objects within an add document or checkin document wizard.
  1. static
  2. boolean
validateComponentRelationship(java.util.List exceptionList,ComponentRelationshipRef crRef,java.util.Locale locale)
Helper method to validate the submitted component relationship data.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

RUNTIME_UPDATE_EXCEPTION_KEY

  1. public static final java.lang.String RUNTIME_UPDATE_EXCEPTION_KEY
See Also:

EMPTY_XML

  1. public static final java.lang.String EMPTY_XML
Empty XML String
See Also:

Method Detail

getComponentRelationshipPropertiesXML

  1. public static org.w3c.dom.Document getComponentRelationshipPropertiesXML( org.w3c.dom.Document propDescXML,
  2. ComponentRelationshipRef crRef)
  3. throws java.lang.Exception
Throws:
java.lang.Exception

getComponentRelationshipPropertiesXML

  1. public static org.w3c.dom.Document getComponentRelationshipPropertiesXML( org.w3c.dom.Document propDescsXML,
  2. org.w3c.dom.Document propertiesXML)
  3. throws java.lang.Exception
Throws:
java.lang.Exception

getStringValue

  1. public static java.lang.String getStringValue( java.lang.Object value)

getObjectStoreName

  1. public static java.lang.String getObjectStoreName( com.filenet.wcm.toolkit.server.dp.CompoundDocumentDataProvider cddp,
  2. java.lang.String objectStoreIndentifier)
  3. throws java.lang.Exception
Throws:
java.lang.Exception

getItemIndex

  1. public static int getItemIndex( CompoundDocumentState cdState,
  2. int index)
  3. throws java.lang.Exception
Gets the item list index given the xml item position.
Parameters:
cdState - The compound document state object.
index - The xml position of the selected component relationship item.
Returns:
int The item index in the componet relationship list.
Throws:
java.lang.Exception

getChildDocumentsXML

  1. public static org.w3c.dom.Document getChildDocumentsXML( java.util.List crList,
  2. int pageSize,
  3. int currentPage,
  4. java.lang.String titleProperty)
  5. throws java.lang.Exception
Returns the child document XML used in rendering the child document list view.
Parameters:
crList - The list holding the component relationship objects.
pageSize - The current listview page size.
currentPage - The listivew current page.
titleProperty - The title property.
Returns:
Document The child document XML for the selected page.
Throws:
java.lang.Exception - All exceptions.

getComponentRelationshipsXML

  1. public static org.w3c.dom.Document getComponentRelationshipsXML( java.util.List crList,
  2. int pageSize,
  3. int currentPage,
  4. java.util.Locale locale)
  5. throws java.lang.Exception
Returns the component relationship XML used in rendering the child document list view.
Parameters:
crList - The list holding the component relationship objects.
pageSize - The current listview page size.
currentPage - The listivew current page.
Returns:
Document The component relationship XML for the selected page.
Throws:
java.lang.Exception - All exceptions.

getParentDocumentsXML

  1. public static org.w3c.dom.Document getParentDocumentsXML( java.util.List crList,
  2. int pageSize,
  3. int currentPage,
  4. java.lang.String titleProperty)
  5. throws java.lang.Exception
Returns the parent document XML used in rendering the parent document list view.
Parameters:
crList - The list holding the component relationship objects.
titleProperty - The title property.
Returns:
Document The child document XML for the selected page.
Throws:
java.lang.Exception - All exceptions.

getComponentRelationshipRef

  1. public static ComponentRelationshipRef getComponentRelationshipRef( com.filenet.api.core.ComponentRelationship cr)
Creates and returns a new ComponentRelationshipRef object. The object will be initialized with properties from the ComponentRelationship object.
Parameters:
cr - ComponentRelationship The API component relationship object.
Returns:
ComponentRelationshipRef The object holding the component relationship data.

getClassId

  1. public static java.lang.String getClassId( com.filenet.api.core.ComponentRelationship cr)

getComponentRelationshipRef

  1. public static ComponentRelationshipRef getComponentRelationshipRef( org.w3c.dom.Document propDescXML,
  2. CompoundDocumentPrefs cdPref,
  3. com.filenet.api.core.ComponentRelationship cr)
  4. throws java.lang.Exception
Creates and returns a new ComponentRelationshipRef object. The object will be initialized with properties from the ComponentRelationship object and the property descriptions XML.
Parameters:
cr - ComponentRelationship The API component relationship object.
Returns:
ComponentRelationshipRef The object holding the component relationship data.
Throws:
java.lang.Exception

getChoiceName

  1. public static java.lang.String getChoiceName( org.w3c.dom.Document choiceXML,
  2. java.lang.String value)
  3. throws java.lang.Exception
Helper method to look up the name of a choice list item given its value.
Parameters:
choiceXML - Document The choice list XML.
value - String The choice value.
Returns:
String The choice name.
Throws:
java.lang.Exception - All exception

moveFirst

  1. public static int moveFirst(CompoundDocumentState cdState,
  2. int index)
  3. throws java.lang.Exception
Moves the selected item to the first position in the compound document structure.
Parameters:
cdState - The compound document state object.
index - The index of the select component relationship object.
Returns:
int The new item index in the componet relationship list.
Throws:
java.lang.Exception

moveUp

  1. public static int moveUp(CompoundDocumentState cdState,
  2. int index)
  3. throws java.lang.Exception
Moves the selected item up one position in the compound document structure.
Parameters:
cdState - The compound document state object.
index - The index of the select component relationship object.
Returns:
int The new item index in the componet relationship list.
Throws:
java.lang.Exception - All exceptions.

reOrderList

  1. public static void reOrderList( CompoundDocumentState cdState,
  2. int startingIndex,
  3. int startingOrderNumber,
  4. int offSet)
  5. throws java.lang.Exception
Reorders the component relationship list starting from the specified starting index and starting order number.
Parameters:
cdState - The compound document state object.
startingIndex - The starting index to begin the reordering.
startingOrderNumber - The starting order nubmer use for reordering.
Throws:
java.lang.Exception - All exceptions

moveDown

  1. public static int moveDown(CompoundDocumentState cdState,
  2. int index)
  3. throws java.lang.Exception
Moves the selected item down one position in the compound document structure.
Parameters:
cdState - The compound document state object.
index - The index of the select component relationship object.
Returns:
int The new item index in the componet relationship list.
Throws:
java.lang.Exception - All exceptions.

moveLast

  1. public static int moveLast(CompoundDocumentState cdState,
  2. int index)
  3. throws java.lang.Exception
Moves the selected item to the last position in the compound document structure.
Parameters:
cdState - The compound document state object.
index - The index of the select component relationship object.
Returns:
int The new item index in the componet relationship list.
Throws:
java.lang.Exception - All exceptions.

getChildComponentRelationships

  1. public static com.filenet.api.collection.IndependentObjectSet getChildComponentRelationships( com.filenet.wcm.toolkit.server.dp.CompoundDocumentDataProvider cddp,
  2. java.lang.String objectStoreName,
  3. java.lang.String parentId,
  4. boolean ascending,
  5. int maxElements)
  6. throws java.lang.Exception
Queries the server for the component relationships and theirs assocated child documents.
Parameters:
cddp - CompoundDocumentDataProvider The compound document data provider.
objectStoreName - String The object store name or id.
parentId - String The id of the parent document.
ascending - boolean true to return the component relationship collection back in ascending order based on the component sort order number.
maxElements - int The number of items returned from the query.
Returns:
EngineCollection The collection of engine objects.
Throws:
java.lang.Exception - All exceptions.

getParentDocuments

  1. public static com.filenet.api.collection.RepositoryRowSet getParentDocuments( com.filenet.wcm.toolkit.server.dp.CompoundDocumentDataProvider cddp,
  2. java.lang.String objectStoreName,
  3. java.lang.String childId,
  4. java.lang.String titleProperty,
  5. java.lang.String orderByProperty,
  6. boolean ascending,
  7. int maxElements)
  8. throws java.lang.Exception
Queries the server for the parentes documents of the specified child document.
Parameters:
cddp - CompoundDocumentDataProvider The compound document data provider.
objectStoreName - String The object store name or id.
childId - String The id of the child document.
titleProperty - String The document property that is currently displayed as the title of the document by the parent document list view.
orderByProperty - String The property used to order the query result.
ascending - boolean true to return the component relationship collection back in ascending order based on the component sort order number.
maxElements - int The number of items returned from the query.
Returns:
RepositoryRowSet The set of repository rows.
Throws:
java.lang.Exception - All exceptions.

getLastComponentRelationshipObjectRef

  1. public static ComponentRelationshipRef getLastComponentRelationshipObjectRef( com.filenet.wcm.toolkit.server.dp.CompoundDocumentDataProvider cddp,
  2. java.lang.String objectStoreName,
  3. java.lang.String parentId)
  4. throws java.lang.Exception
Queries the server the last component relationship object in the selected compound document.
Parameters:
cddp - CompoundDocumentDataProvider The compound document data provider.
objectStoreName - String The object store name or id.
parentId - String The id of the parent document.
Returns:
ComponentRelationship The last component relationship object in the compound document structure.
Throws:
java.lang.Exception - All exceptions.

getLinkToType

  1. public static int getLinkToType( ComponentRelationshipRef crRef)
Helper method to get the Link To type.
Parameters:
crRef - ComponentRelationshipRef The selected ComponentRelationshipRef object.
Returns:
int The Link To type based on the current component relationship type.

getComponentRelationshipList

  1. public static java.util.List getComponentRelationshipList( CompoundDocumentState cdState)
  2. throws java.lang.Exception
Returns a list of ComponentRelationshipRef objects for the current page of the child document list view.
Parameters:
cdState - CompoundDocumentState The compound document state object.
Returns:
List A list of ComponentRelationshipRef objects for the current list view page.
Throws:
java.lang.Exception - All exceptions

getParentComponentRelationshipList

  1. public static java.util.List getParentComponentRelationshipList( CompoundDocumentState cdState)
  2. throws java.lang.Exception
Returns a list of ComponentRelationshipRef objects for the current page of the parent document list view.
Parameters:
cdState - CompoundDocumentState The compound document state object.
Returns:
List A list of ComponentRelationshipRef objects for the current list view page.
Throws:
java.lang.Exception - All exceptions

validateComponentRelationship

  1. public static boolean validateComponentRelationship( java.util.List exceptionList,
  2. ComponentRelationshipRef crRef,
  3. java.util.Locale locale)
Helper method to validate the submitted component relationship data.
Parameters:
exceptionList - List The list contains the invalid properties settings.
crRef - ComponentRelationshipRef The selected ComponentRelationshipRef object.
locale - Locale The client locale.
Returns:
boolean true if the submitted data is valid.

updateComponentRelationshipItems

  1. public static boolean updateComponentRelationshipItems( com.filenet.wcm.toolkit.server.dp.CompoundDocumentDataProvider cddp,
  2. WcmAuthoringState authorState,
  3. CompoundDocumentState cdState,
  4. java.util.Locale locale)
  5. throws java.lang.Exception
Helper method for saving changes back to the server for all new, modified, moved or removed component relationship objects within an add document or checkin document wizard. This wil be done in an update batch where all updates are done in one server call. The user will automatically be redirected to an error page when one ore more items fail to update.
Parameters:
cddp - CompoundDocumentDataProvider The compound document data provider.
authorState - WcmAuthoringState The authoring state object.
cdState - CompoundDocumentState The compound document state object.
locale - Locale The client locale.
Returns:
boolean true if nothing failed to update.
Throws:
java.lang.Exception - All exceptions.

updateComponentRelationshipItems

  1. public static org.apache.commons.collections.map.ListOrderedMap updateComponentRelationshipItems( com.filenet.wcm.toolkit.server.dp.CompoundDocumentDataProvider cddp,
  2. CompoundDocumentState cdState,
  3. java.util.Locale locale)
  4. throws java.lang.Exception
Helper method for saving data back to the server. This wil be done in an update batch where all updates are done in one server call.
Parameters:
cddp - CompoundDocumentDataProvider The compound document data provider.
cdState - CompoundDocumentState The compound document state object.
locale - Locale The client locale.
Returns:
boolean true if nothing failed to update.
Throws:
java.lang.Exception - All exceptions.

getAddChildAction

  1. public static com.filenet.wcm.apps.server.presentation.util.ActionDefinition getAddChildAction( AccessRoles accessRoles)

canEditCompoundDocument

  1. public static boolean canEditCompoundDocument( WcmSitePrefs sitePrefs,
  2. com.filenet.wcm.toolkit.server.dp.CompoundDocumentDataProvider cddp,
  3. java.lang.String objectStoreName,
  4. java.lang.String classId)
  5. throws java.lang.Exception
Throws:
java.lang.Exception

getClassDescriptionMap

  1. public static java.util.Map getClassDescriptionMap( com.filenet.wcm.toolkit.server.dp.CompoundDocumentDataProvider cddp,
  2. CompoundDocumentObjectStorePrefs cdObjectStorePrefs)
  3. throws java.lang.Exception
Gets a map of the API class description objects using on the classes defined by the compound document object store pref.
Returns:
Map A map of class descriptions.
Throws:
java.lang.Exception

lookupClassName

  1. public static java.lang.String lookupClassName( java.util.Map classDescMap,
  2. java.lang.String classId)
  3. throws java.lang.Exception
Looks up a singe class name.
Parameters:
classDescMap - A map of API class description object.
classId - The class id.
Returns:
display name for the specified class. If the class description is not found then returns the id.
Throws:
java.lang.Exception