com.filenet.wcm.toolkit.server.util.xml
Class WcmXMLSorter

java.lang.Object
  extended bycom.filenet.wcm.toolkit.server.util.xml.WcmXMLSorter

public class WcmXMLSorter
extends java.lang.Object

Utility class that handles sorting of the XML returned by Java Api.


Nested Class Summary
static class WcmXMLSorter.WcmSortedItem
           
 
Field Summary
protected static java.text.Collator collator
           
protected  java.lang.String customObjectNameProperty
           
protected  java.lang.String documentNameProperty
           
protected  java.lang.String folderNameProperty
           
protected  java.lang.String keyProperty
           
protected static java.lang.String OBJECT_STORE_NAME_PROPERTY
           
protected  org.w3c.dom.Document sortedDocument
           
protected  boolean sortOrder
           
protected  java.lang.String[] versionStatusLabels
           
protected static java.lang.Double zeroDouble
           
protected static java.lang.Integer zeroInteger
           
 
Constructor Summary
WcmXMLSorter()
           
 
Method Summary
protected  org.w3c.dom.Element findPropertyByName(org.w3c.dom.NodeList oPropertyNodes, java.lang.String sPropertyName)
           
protected static java.lang.Double getDouble(java.lang.String value)
           
protected static java.lang.Integer getInteger(java.lang.String value)
           
protected  java.lang.String getNameProperty(java.lang.String sObjectType)
           
protected  java.lang.String getPropertyDataType(org.w3c.dom.Element oPropertyElement)
           
protected  org.w3c.dom.Element getPropertyElement(org.w3c.dom.Element oElement, java.lang.String sPropertyName)
           
protected  java.lang.String getPropertySymName(org.w3c.dom.Element oPropertyElement)
           
protected  java.lang.String getPropertyValue(org.w3c.dom.Element oPropertyElement)
           
 void setCustomObjectNameProperty(java.lang.String sValue)
          Sets the property to be used as sort key for custom objects.
 void setDocument(org.w3c.dom.Document oDoc)
          Sets the XML Document to be sorted.
 void setDocumentNameProperty(java.lang.String sValue)
          Sets the property to be used as sort key for documents.
 void setFolderNameProperty(java.lang.String sValue)
          Sets the property to be used as sort key for folders.
 void setKeyProperty(java.lang.String value)
           
 void setSortOrder(boolean accending)
           
 void setVersionStatusLabels(java.lang.String[] labels)
           
 void sortXML()
          Sorts the XML Document previously set by setDocument() method.
 void sortXML(org.w3c.dom.Document oDoc)
          Sorts the XML Document.
 void sortXML(org.w3c.dom.Document oDoc, java.lang.String sFolderNameProperty, java.lang.String sDocumentNameProperty)
          Deprecated. use the method that takes sCustomObjectNameProperty Sorts the XML Document using the specified folder name property and document name property.
 void sortXML(org.w3c.dom.Document oDoc, java.lang.String sFolderNameProperty, java.lang.String sDocumentNameProperty, java.lang.String sCustomObjectNameProperty)
          Sorts the XML Document using the specified folder name property and document name property.
 void sortXML(org.w3c.dom.Node contextNode, java.lang.String sortKeyTag)
          Sorts XML using specified tag as the sort key.
 void sortXML(org.w3c.dom.Node contextNode, java.lang.String sortKeyTag, boolean unique)
          Sorts XML using specified tag as the sort key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OBJECT_STORE_NAME_PROPERTY

protected static final java.lang.String OBJECT_STORE_NAME_PROPERTY
See Also:
Constant Field Values

collator

protected static final java.text.Collator collator

zeroInteger

protected static final java.lang.Integer zeroInteger

zeroDouble

protected static final java.lang.Double zeroDouble

folderNameProperty

protected java.lang.String folderNameProperty

documentNameProperty

protected java.lang.String documentNameProperty

customObjectNameProperty

protected java.lang.String customObjectNameProperty

sortedDocument

protected org.w3c.dom.Document sortedDocument

keyProperty

protected java.lang.String keyProperty

sortOrder

protected boolean sortOrder

versionStatusLabels

protected java.lang.String[] versionStatusLabels
Constructor Detail

WcmXMLSorter

public WcmXMLSorter()
Method Detail

setVersionStatusLabels

public void setVersionStatusLabels(java.lang.String[] labels)

setKeyProperty

public void setKeyProperty(java.lang.String value)

setSortOrder

public void setSortOrder(boolean accending)

sortXML

public void sortXML(org.w3c.dom.Document oDoc,
                    java.lang.String sFolderNameProperty,
                    java.lang.String sDocumentNameProperty)
Deprecated. use the method that takes sCustomObjectNameProperty Sorts the XML Document using the specified folder name property and document name property.

Parameters:
oDoc - XML Document to be sorted
sFolderNameProperty - property to be used as sort key for folders
sDocumentNameProperty - property to be used as sort key for documents

sortXML

public void sortXML(org.w3c.dom.Document oDoc,
                    java.lang.String sFolderNameProperty,
                    java.lang.String sDocumentNameProperty,
                    java.lang.String sCustomObjectNameProperty)
Sorts the XML Document using the specified folder name property and document name property.

Parameters:
oDoc - XML Document to be sorted
sFolderNameProperty - property to be used as sort key for folders
sDocumentNameProperty - property to be used as sort key for documents
sCustomObjectNameProperty - property to be used as sort key for custom objects

sortXML

public void sortXML(org.w3c.dom.Document oDoc)
Sorts the XML Document.

Parameters:
oDoc - XML Document to be sorted

setFolderNameProperty

public void setFolderNameProperty(java.lang.String sValue)
Sets the property to be used as sort key for folders.

Parameters:
sValue - property to be used as sort key for folders

setDocumentNameProperty

public void setDocumentNameProperty(java.lang.String sValue)
Sets the property to be used as sort key for documents.

Parameters:
sValue - property to be used as sort key for documents

setCustomObjectNameProperty

public void setCustomObjectNameProperty(java.lang.String sValue)
Sets the property to be used as sort key for custom objects.

Parameters:
sValue - property to be used as sort key for custom objects

setDocument

public void setDocument(org.w3c.dom.Document oDoc)
Sets the XML Document to be sorted.

Parameters:
oDoc - XML Document to be sorted

sortXML

public void sortXML()
Sorts the XML Document previously set by setDocument() method.


sortXML

public void sortXML(org.w3c.dom.Node contextNode,
                    java.lang.String sortKeyTag)
Sorts XML using specified tag as the sort key.

Parameters:
contextNode - XML Element to sort
sortKeyTag - tag to be used as the sort key

sortXML

public void sortXML(org.w3c.dom.Node contextNode,
                    java.lang.String sortKeyTag,
                    boolean unique)
Sorts XML using specified tag as the sort key.

Parameters:
contextNode - XML Element to sort
sortKeyTag - tag to be used as the sort key
unique - only return unique item back.

getNameProperty

protected java.lang.String getNameProperty(java.lang.String sObjectType)

getPropertyElement

protected org.w3c.dom.Element getPropertyElement(org.w3c.dom.Element oElement,
                                                 java.lang.String sPropertyName)

getPropertySymName

protected java.lang.String getPropertySymName(org.w3c.dom.Element oPropertyElement)

getPropertyValue

protected java.lang.String getPropertyValue(org.w3c.dom.Element oPropertyElement)

getPropertyDataType

protected java.lang.String getPropertyDataType(org.w3c.dom.Element oPropertyElement)

findPropertyByName

protected org.w3c.dom.Element findPropertyByName(org.w3c.dom.NodeList oPropertyNodes,
                                                 java.lang.String sPropertyName)

getInteger

protected static java.lang.Integer getInteger(java.lang.String value)

getDouble

protected static java.lang.Double getDouble(java.lang.String value)


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