Collaboration API Documentation

com.filenet.bso.api.util
Class BsoXMLUtil

java.lang.Object
  |
  +--com.filenet.bso.api.util.BsoXMLUtil

public class BsoXMLUtil
extends java.lang.Object

Utility class for working with XML and DOM.


Field Summary
static java.lang.String CONTENTRANKING_ELEMNAME
           
static java.lang.String COUNT_ELEMNAME
           
static java.lang.String DATATYPE_ELEMNAME
           
static java.lang.String DOCUMENT_ELEMNAME
           
static java.lang.String FALSE_INTBOOLTXT
           
static java.lang.String FALSE_RESULTVALTXT
           
static java.lang.String FOLDER_ELEMNAME
           
static java.lang.String ID_ELEMNAME
           
static java.lang.String ISRESERVED_ELEMNAME
           
static java.lang.String MIMETYPE_ELEMNAME
           
static java.lang.String NAME_ELEMNAME
           
static java.lang.String OBJECTSET_ELEMNAME
           
static java.lang.String PROPERTIES_ELEMNAME
           
static java.lang.String PROPERTY_ELEMNAME
           
static java.lang.String RESPONSE_ELEMNAME
           
static java.lang.String SYMNAME_ELEMNAME
           
static java.lang.String TRUE_INTBOOLTXT
           
static java.lang.String TRUE_RESULTVALTXT
           
static java.lang.String TYPE_ELEMNAME
           
static java.lang.String VALUE_ELEMNAME
           
static java.lang.String VALUES_ELEMNAME
           
static java.lang.String VERSERID_ELEMNAME
           
static java.lang.String WCM_APPS_NAMESPACE
           
static java.lang.String WCM_APPS_NAMESPACEPREFIX
           
 
Method Summary
static java.lang.String encodeForXML(java.lang.String str)
          Encodes special characters in a string and returns another string suitable for XML.
static void endDocumentElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix)
           
static void endFolderElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix)
           
static void endObjsetAndResponseElements(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix)
          Call this method to end both an objectset element and the response root element.
static void endObjsetElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix)
          Call this method to end an objectset element.
static void endPropertiesElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix)
           
static void endResponseElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix)
          Call this method to end a response root element.
static java.lang.String formatSearchResultValueForXML(java.lang.String resultDataType, java.lang.String resultValue)
          Formats a value, as returned in the search results XML, in an appropriate manner to be part of other XML.
static org.w3c.dom.Element getChildElement(org.w3c.dom.Element oParent, java.lang.String sChildElementName)
           
static java.lang.String getChildElementText(org.w3c.dom.Element oParent, java.lang.String sChildElementName)
           
static org.w3c.dom.Node getChildNode(org.w3c.dom.Node oNode, java.lang.String sChildToFind)
           
static org.w3c.dom.Document getDocumentFromInputStream(java.io.InputStream inputStream)
          Returns a DOM Document given XML from an InputStream.
static org.w3c.dom.Document getDocumentFromReader(java.io.Reader reader)
          Returns a DOM Document given XML from a Reader.
static org.w3c.dom.Document getDocumentFromString(java.lang.String xml)
          Returns a DOM Document given XML from a String.
static java.lang.String getElementText(org.w3c.dom.Element oElement)
           
static org.w3c.dom.Node getNamedNode(org.w3c.dom.NodeList oNodes, java.lang.String sNameToFind)
           
static BsoXMLSerializer getXMLSerializer(java.io.OutputStream os, int indent)
          Returns a default BsoXMLSerializer instance using the given OutputStream object.
static BsoXMLSerializer getXMLSerializer(java.io.Writer w, int indent)
          Returns a default BsoXMLSerializer instance using the given Writer object.
static java.lang.String saveToString(org.w3c.dom.Node oNode)
           
static void serializeCharacters(BsoXMLSerializer s, int intValue)
          Writes out character data representing an integer value.
static void serializeCharacters(BsoXMLSerializer s, java.lang.String strValue)
          Writes out character data representing a string value.
static void serializeDocumentElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix, BsoSearchResultRow[] rows, java.lang.String[] propNames, java.lang.String contentClassKey)
           
static void serializeDocumentElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix, BsoSearchResultRow row, java.lang.String[] propNames, java.lang.String contentClassKey)
          Writes a document element from a BsoSearchResultRow object obtained from parsing some search results XML.
static void serializeDocumentElementFromRowOrRows(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix, java.lang.Object rowOrRows, java.lang.String[] propNames, java.lang.String contentClassKey)
           
static void serializeFolderElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix, BsoSearchResultRow[] rows, java.lang.String[] propNames)
           
static void serializeFolderElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix, BsoSearchResultRow row, java.lang.String[] propNames)
          Writes a folder element from a BsoSearchResultRow object obtained from parsing some search results XML.
static void serializeFolderElementFromRowOrRows(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix, java.lang.Object rowOrRows, java.lang.String[] propNames)
           
static boolean serializeOptionalRankElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix, BsoSearchResultRow[] rows, java.lang.String contentClassKey)
           
static boolean serializeOptionalRankElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix, BsoSearchResultRow row, java.lang.String contentClassKey)
          Optionally writes a <contentranking> element from a BsoSearchResultRow object.
static boolean serializeOptionalRankElementFromRowOrRows(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix, java.lang.Object rowOrRows, java.lang.String contentClassKey)
           
static void serializePropertiesElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix, BsoSearchResultRow[] rows, java.lang.String[] propNames)
          Writes a properties element where properties may be based on multiple query result rows from different contexts of a query.
static void serializePropertiesElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix, BsoSearchResultRow row, java.lang.String[] propNames)
          Writes a properties element with properties taken from a BsoSearchResultRow object obtained from parsing some search results XML.
static void serializePropertiesElementFromRowOrRows(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix, java.lang.Object rowOrRows, java.lang.String[] propNames)
          Convenience method to write a properties element whether based on a single query result row or multiple rows from different contexts of the query.
static void serializePropertyElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String propName, java.lang.String columnType, java.lang.String columnValue)
           
static void serializeSimpleContentElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix, java.lang.String elemName, java.lang.String text)
          Writes out an element with simple textual content.
static void startDocumentElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix, BsoSearchResultRow[] rows, java.lang.String[] propNames, java.lang.String contentClassKey)
           
static void startDocumentElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix, BsoSearchResultRow row, java.lang.String[] propNames, java.lang.String contentClassKey)
          Starts writing a document element.
static void startDocumentElementFromRowOrRows(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix, java.lang.Object rowOrRows, java.lang.String[] propNames, java.lang.String contentClassKey)
           
static void startFolderElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix, BsoSearchResultRow[] rows, java.lang.String[] propNames)
           
static void startFolderElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix, BsoSearchResultRow row, java.lang.String[] propNames)
          Starts writing a folder element.
static void startFolderElementFromRowOrRows(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix, java.lang.Object rowOrRows, java.lang.String[] propNames)
           
static void startObjsetElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix)
          Call this method to start an objectset element.
static void startPropertiesElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix)
           
static void startResponseAndObjsetElements(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix)
          Call this method to start a response root element followed by an objectset element.
static void startResponseElement(BsoXMLSerializer s, java.lang.String namespace, java.lang.String namespacePrefix)
          Call this method to start a response root element.
static void writeXML(java.io.Writer w, org.w3c.dom.Node node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WCM_APPS_NAMESPACE

public static final java.lang.String WCM_APPS_NAMESPACE

WCM_APPS_NAMESPACEPREFIX

public static final java.lang.String WCM_APPS_NAMESPACEPREFIX

RESPONSE_ELEMNAME

public static final java.lang.String RESPONSE_ELEMNAME

OBJECTSET_ELEMNAME

public static final java.lang.String OBJECTSET_ELEMNAME

DOCUMENT_ELEMNAME

public static final java.lang.String DOCUMENT_ELEMNAME

FOLDER_ELEMNAME

public static final java.lang.String FOLDER_ELEMNAME

ID_ELEMNAME

public static final java.lang.String ID_ELEMNAME

NAME_ELEMNAME

public static final java.lang.String NAME_ELEMNAME

TYPE_ELEMNAME

public static final java.lang.String TYPE_ELEMNAME

VERSERID_ELEMNAME

public static final java.lang.String VERSERID_ELEMNAME

MIMETYPE_ELEMNAME

public static final java.lang.String MIMETYPE_ELEMNAME

ISRESERVED_ELEMNAME

public static final java.lang.String ISRESERVED_ELEMNAME

PROPERTIES_ELEMNAME

public static final java.lang.String PROPERTIES_ELEMNAME

PROPERTY_ELEMNAME

public static final java.lang.String PROPERTY_ELEMNAME

SYMNAME_ELEMNAME

public static final java.lang.String SYMNAME_ELEMNAME

DATATYPE_ELEMNAME

public static final java.lang.String DATATYPE_ELEMNAME

VALUE_ELEMNAME

public static final java.lang.String VALUE_ELEMNAME

VALUES_ELEMNAME

public static final java.lang.String VALUES_ELEMNAME

COUNT_ELEMNAME

public static final java.lang.String COUNT_ELEMNAME

CONTENTRANKING_ELEMNAME

public static final java.lang.String CONTENTRANKING_ELEMNAME

TRUE_RESULTVALTXT

public static final java.lang.String TRUE_RESULTVALTXT

FALSE_RESULTVALTXT

public static final java.lang.String FALSE_RESULTVALTXT

TRUE_INTBOOLTXT

public static final java.lang.String TRUE_INTBOOLTXT

FALSE_INTBOOLTXT

public static final java.lang.String FALSE_INTBOOLTXT
Method Detail

getDocumentFromString

public static org.w3c.dom.Document getDocumentFromString(java.lang.String xml)
                                                  throws java.io.IOException,
                                                         org.xml.sax.SAXException,
                                                         javax.xml.parsers.ParserConfigurationException
Returns a DOM Document given XML from a String.

getDocumentFromReader

public static org.w3c.dom.Document getDocumentFromReader(java.io.Reader reader)
                                                  throws java.io.IOException,
                                                         org.xml.sax.SAXException,
                                                         javax.xml.parsers.ParserConfigurationException
Returns a DOM Document given XML from a Reader.

getDocumentFromInputStream

public static org.w3c.dom.Document getDocumentFromInputStream(java.io.InputStream inputStream)
                                                       throws java.io.IOException,
                                                              org.xml.sax.SAXException,
                                                              javax.xml.parsers.ParserConfigurationException
Returns a DOM Document given XML from an InputStream.

encodeForXML

public static java.lang.String encodeForXML(java.lang.String str)
Encodes special characters in a string and returns another string suitable for XML.

getXMLSerializer

public static BsoXMLSerializer getXMLSerializer(java.io.OutputStream os,
                                                int indent)
Returns a default BsoXMLSerializer instance using the given OutputStream object. The serializer will have the given indentation level. Passing in 0 disables indentation. (This appears to also disable line breaks altogether). The serializer has the default character encoding, UTF-8. It has a large line length so character data will not be automatically broken up into multiple lines.

getXMLSerializer

public static BsoXMLSerializer getXMLSerializer(java.io.Writer w,
                                                int indent)
Returns a default BsoXMLSerializer instance using the given Writer object. The serializer will have the given indentation level. Passing in 0 disables indentation. (This appears to also disable line breaks altogether). The serializer has the default character encoding, UTF-8. It has a large line length so character data will not be automatically broken up into multiple lines.

startResponseAndObjsetElements

public static void startResponseAndObjsetElements(BsoXMLSerializer s,
                                                  java.lang.String namespace,
                                                  java.lang.String namespacePrefix)
Call this method to start a response root element followed by an objectset element.
Parameters:
s - Required, the BsoXMLSerializer instance
namespace - Optional, The namespace the response and objectset elements are to be written with. In the future there might be similar namespaces that have these elements. Currently only the http://filenet.com/namespaces/wcm/apps/1.0 namespace is supported. This is automatically used if null is passed for this argument.
namespacePrefix - Optional, the prefix you want to map to the namespace. If you want to map it to the default namespace, pass in an empty string, "". If you pass in null for this argument, no namespace prefix is mapped. It is up to the caller to map the appropriate prefixes before calling this method.

startResponseElement

public static void startResponseElement(BsoXMLSerializer s,
                                        java.lang.String namespace,
                                        java.lang.String namespacePrefix)
Call this method to start a response root element.
Parameters:
s - Required, the BsoXMLSerializer instance
namespace - Optional, The namespace the response element is to be written with. In the future there might be similar namespaces that have these elements. Currently only the http://filenet.com/namespaces/wcm/apps/1.0 namespace is supported. This is automatically used if null is passed for this argument.
namespacePrefix - Optional, the prefix you want to map to the namespace If you want to map it to the default namespace, pass in an empty string, "". If you pass in null for this argument, no namespace prefix is mapped. It is up to the caller to map the appropriate prefixes before calling this method.

startObjsetElement

public static void startObjsetElement(BsoXMLSerializer s,
                                      java.lang.String namespace,
                                      java.lang.String namespacePrefix)
Call this method to start an objectset element.
Parameters:
s - Required, the BsoXMLSerializer instance
namespace - Optional, The namespace the objectset element is to be written with. In the future there might be similar namespaces that have these elements. Currently only the http://filenet.com/namespaces/wcm/apps/1.0 namespace is supported. This is automatically used if null is passed for this argument.
namespacePrefix - Optional, the prefix you want to map to the namespace. If you want to map it to the default namespace, pass in an empty string, "". If you pass in null for this argument, no namespace prefix is mapped. It is up to the caller to map the appropriate prefixes before calling this method.

endObjsetAndResponseElements

public static void endObjsetAndResponseElements(BsoXMLSerializer s,
                                                java.lang.String namespace,
                                                java.lang.String namespacePrefix)
Call this method to end both an objectset element and the response root element. If you passed in a namespace prefix to map in startResponseAndObjsetElements(), be sure to pass in the same prefix for this call to unmap that prefix.
Parameters:
s - Required, the BsoXMLSerializer instance
namespace - Optional, The namespace of the elements. In the future there might be similar namespaces that have these elements. Currently only the http://filenet.com/namespaces/wcm/apps/1.0 namespace is supported. This is automatically used if null is passed for this argument.
namespacePrefix - Optional, the prefix you want to unmap from the namespace. If you want to unmap it from the default namespace, pass in an empty string, "". If you pass in null for this argument, no namespace prefix is unmapped.

endObjsetElement

public static void endObjsetElement(BsoXMLSerializer s,
                                    java.lang.String namespace,
                                    java.lang.String namespacePrefix)
Call this method to end an objectset element. If you passed in a namespace prefix to map in startObjsetElement(), be sure to pass in the same prefix for this call to unmap that prefix.
Parameters:
s - Required, the BsoXMLSerializer instance
namespace - Optional, The namespace of the element. In the future there might be similar namespaces that have these elements. Currently only the http://filenet.com/namespaces/wcm/apps/1.0 namespace is supported. This is automatically used if null is passed for this argument.
namespacePrefix - Optional, the prefix you want to unmap from the namespace. If you want to unmap it from the default namespace, pass in an empty string, "". If you pass in null for this argument, no namespace prefix is unmapped.

endResponseElement

public static void endResponseElement(BsoXMLSerializer s,
                                      java.lang.String namespace,
                                      java.lang.String namespacePrefix)
Call this method to end a response root element. If you passed in a namespace prefix to map in startResponseElement(), be sure to pass in the same prefix for this call to unmap that prefix.
Parameters:
s - Required, the BsoXMLSerializer instance
namespace - Optional, The namespace of the element. In the future there might be similar namespaces that have these elements. Currently only the http://filenet.com/namespaces/wcm/apps/1.0 namespace is supported. This is automatically used if null is passed for this argument.
namespacePrefix - Optional, the prefix you want to unmap from the namespace. If you want to unmap it from the default namespace, pass in an empty string, "". If you pass in null for this argument, no namespace prefix is unmapped.

serializePropertiesElement

public static void serializePropertiesElement(BsoXMLSerializer s,
                                              java.lang.String namespace,
                                              java.lang.String namespacePrefix,
                                              BsoSearchResultRow row,
                                              java.lang.String[] propNames)
Writes a properties element with properties taken from a BsoSearchResultRow object obtained from parsing some search results XML. If the namespacePrefix argument is specified, this method both maps and unmaps that prefix for this element.
Parameters:
s - Required, the BsoXMLSerializer instance
namespace - Optional, The namespace of the element. In the future there might be similar namespaces that have these elements. Currently only the http://filenet.com/namespaces/wcm/apps/1.0 namespace is supported. This is automatically used if null is passed for this argument.
namespacePrefix - Optional, the prefix you want to map and unmap to and from the namespace. If you want to map and unmap it to and from the default namespace, pass in an empty string, "". If you pass in null for this argument, no namespace prefix is mapped or unmapped. It is up to the caller to map and unmap the appropriate prefix.
row - Required, the BsoSearchResultRow object from which to obtain property values.
propNames - Optional, the names of properties to include. If null is passed in, an empty properties element is created.

serializePropertiesElement

public static void serializePropertiesElement(BsoXMLSerializer s,
                                              java.lang.String namespace,
                                              java.lang.String namespacePrefix,
                                              BsoSearchResultRow[] rows,
                                              java.lang.String[] propNames)
Writes a properties element where properties may be based on multiple query result rows from different contexts of a query.

serializePropertiesElementFromRowOrRows

public static void serializePropertiesElementFromRowOrRows(BsoXMLSerializer s,
                                                           java.lang.String namespace,
                                                           java.lang.String namespacePrefix,
                                                           java.lang.Object rowOrRows,
                                                           java.lang.String[] propNames)
Convenience method to write a properties element whether based on a single query result row or multiple rows from different contexts of the query.

startPropertiesElement

public static void startPropertiesElement(BsoXMLSerializer s,
                                          java.lang.String namespace,
                                          java.lang.String namespacePrefix)

serializePropertyElement

public static void serializePropertyElement(BsoXMLSerializer s,
                                            java.lang.String namespace,
                                            java.lang.String propName,
                                            java.lang.String columnType,
                                            java.lang.String columnValue)

endPropertiesElement

public static void endPropertiesElement(BsoXMLSerializer s,
                                        java.lang.String namespace,
                                        java.lang.String namespacePrefix)

serializeDocumentElement

public static void serializeDocumentElement(BsoXMLSerializer s,
                                            java.lang.String namespace,
                                            java.lang.String namespacePrefix,
                                            BsoSearchResultRow row,
                                            java.lang.String[] propNames,
                                            java.lang.String contentClassKey)
Writes a document element from a BsoSearchResultRow object obtained from parsing some search results XML. If the namespacePrefix argument is specified, this method both maps and unmaps that prefix for this element.
Parameters:
s - Required, the BsoXMLSerializer instance
namespace - Optional, The namespace of the element. In the future there might be similar namespaces that have these elements. Currently only the http://filenet.com/namespaces/wcm/apps/1.0 namespace is supported. This is automatically used if null is passed for this argument.
namespacePrefix - Optional, the prefix you want to map and unmap to and from the namespace. If you want to map and unmap it to and from the default namespace, pass in an empty string, "". If you pass in null for this argument, no namespace prefix is mapped or unmapped. It is up to the caller to map and unmap the appropriate prefix.
row - Required, the BsoSearchResultRow object from which to obtain property values.
propNames - Optional, the names of properties to include in a properties element. If null is passed in, an empty properties element is created.
contentClassKey - Optional. If specified, is the key that identifies the ContentSearch class in the query. If the row references one or more rows from that class, a <contentranking> element will be generated if Rank is one of the properties selected in the ContentSearch class.

serializeDocumentElement

public static void serializeDocumentElement(BsoXMLSerializer s,
                                            java.lang.String namespace,
                                            java.lang.String namespacePrefix,
                                            BsoSearchResultRow[] rows,
                                            java.lang.String[] propNames,
                                            java.lang.String contentClassKey)

serializeDocumentElementFromRowOrRows

public static void serializeDocumentElementFromRowOrRows(BsoXMLSerializer s,
                                                         java.lang.String namespace,
                                                         java.lang.String namespacePrefix,
                                                         java.lang.Object rowOrRows,
                                                         java.lang.String[] propNames,
                                                         java.lang.String contentClassKey)

startDocumentElement

public static void startDocumentElement(BsoXMLSerializer s,
                                        java.lang.String namespace,
                                        java.lang.String namespacePrefix,
                                        BsoSearchResultRow row,
                                        java.lang.String[] propNames,
                                        java.lang.String contentClassKey)
Starts writing a document element. This method writes all the XML that serializeDocumentElement writes except the closing </document> element. This is useful if the calling code wants to include other elements inside the <document> element. Call endDocumentElement to write out the closing element.

startDocumentElement

public static void startDocumentElement(BsoXMLSerializer s,
                                        java.lang.String namespace,
                                        java.lang.String namespacePrefix,
                                        BsoSearchResultRow[] rows,
                                        java.lang.String[] propNames,
                                        java.lang.String contentClassKey)

startDocumentElementFromRowOrRows

public static void startDocumentElementFromRowOrRows(BsoXMLSerializer s,
                                                     java.lang.String namespace,
                                                     java.lang.String namespacePrefix,
                                                     java.lang.Object rowOrRows,
                                                     java.lang.String[] propNames,
                                                     java.lang.String contentClassKey)

endDocumentElement

public static void endDocumentElement(BsoXMLSerializer s,
                                      java.lang.String namespace,
                                      java.lang.String namespacePrefix)

serializeOptionalRankElement

public static boolean serializeOptionalRankElement(BsoXMLSerializer s,
                                                   java.lang.String namespace,
                                                   java.lang.String namespacePrefix,
                                                   BsoSearchResultRow row,
                                                   java.lang.String contentClassKey)
Optionally writes a <contentranking> element from a BsoSearchResultRow object. The element is written if the row references rows from the ContentSearch class and the Rank property was selected from that class. The contentClassKey argument is the key used to identify the ContentSearch class.
Parameters:
s - Required, the BsoXMLSerializer instance
namespace - Optional, the namespace of the element. Currently only the http://filenet.com/namespaces/wcm/apps/1.0 namespace is supported. This is automatically used if null is passed for this argument.
namespacePrefix - Optional, the prefix you want to map and unmap to and from the namespace. Pass in an empty string to map and unmap it to and from the default namespace. If you pass in null, no namespace prefix is mapped or unmapped. It is up to the caller to map and unmap the appropriate prefix.
row - Required, the BsoSearchResultRow object from which to obtain the content ranking information.
contentClassKey - Required, the key that identifies the ContentSearch class in the query.
Returns:
true if the content ranking context was present and the element was written out. Otherwise false.

serializeOptionalRankElement

public static boolean serializeOptionalRankElement(BsoXMLSerializer s,
                                                   java.lang.String namespace,
                                                   java.lang.String namespacePrefix,
                                                   BsoSearchResultRow[] rows,
                                                   java.lang.String contentClassKey)

serializeOptionalRankElementFromRowOrRows

public static boolean serializeOptionalRankElementFromRowOrRows(BsoXMLSerializer s,
                                                                java.lang.String namespace,
                                                                java.lang.String namespacePrefix,
                                                                java.lang.Object rowOrRows,
                                                                java.lang.String contentClassKey)

serializeFolderElement

public static void serializeFolderElement(BsoXMLSerializer s,
                                          java.lang.String namespace,
                                          java.lang.String namespacePrefix,
                                          BsoSearchResultRow row,
                                          java.lang.String[] propNames)
Writes a folder element from a BsoSearchResultRow object obtained from parsing some search results XML. If the namespacePrefix argument is specified, this method both maps and unmaps that prefix for this element.
Parameters:
s - Required, the BsoXMLSerializer instance
namespace - Optional, The namespace of the element. In the future there might be similar namespaces that have these elements. Currently only the http://filenet.com/namespaces/wcm/apps/1.0 namespace is supported. This is automatically used if null is passed for this argument.
namespacePrefix - Optional, the prefix you want to map and unmap to and from the namespace. If you want to map and unmap it to and from the default namespace, pass in an empty string, "". If you pass in null for this argument, no namespace prefix is mapped or unmapped. It is up to the caller to map and unmap the appropriate prefix.
row - Required, the BsoSearchResultRow object from which to obtain property values.
propNames - Optional, the names of properties to include in a properties element. If null is passed in, an empty properties element is created.

serializeFolderElement

public static void serializeFolderElement(BsoXMLSerializer s,
                                          java.lang.String namespace,
                                          java.lang.String namespacePrefix,
                                          BsoSearchResultRow[] rows,
                                          java.lang.String[] propNames)

serializeFolderElementFromRowOrRows

public static void serializeFolderElementFromRowOrRows(BsoXMLSerializer s,
                                                       java.lang.String namespace,
                                                       java.lang.String namespacePrefix,
                                                       java.lang.Object rowOrRows,
                                                       java.lang.String[] propNames)

startFolderElement

public static void startFolderElement(BsoXMLSerializer s,
                                      java.lang.String namespace,
                                      java.lang.String namespacePrefix,
                                      BsoSearchResultRow row,
                                      java.lang.String[] propNames)
Starts writing a folder element. This method writes all the XML that serializeFolderElement writes except the closing </folder> element. This is useful if the calling code wants to include other elements inside the <folder> element. Call endFolderElement to write out the closing element.

startFolderElement

public static void startFolderElement(BsoXMLSerializer s,
                                      java.lang.String namespace,
                                      java.lang.String namespacePrefix,
                                      BsoSearchResultRow[] rows,
                                      java.lang.String[] propNames)

startFolderElementFromRowOrRows

public static void startFolderElementFromRowOrRows(BsoXMLSerializer s,
                                                   java.lang.String namespace,
                                                   java.lang.String namespacePrefix,
                                                   java.lang.Object rowOrRows,
                                                   java.lang.String[] propNames)

endFolderElement

public static void endFolderElement(BsoXMLSerializer s,
                                    java.lang.String namespace,
                                    java.lang.String namespacePrefix)

serializeSimpleContentElement

public static void serializeSimpleContentElement(BsoXMLSerializer s,
                                                 java.lang.String namespace,
                                                 java.lang.String namespacePrefix,
                                                 java.lang.String elemName,
                                                 java.lang.String text)
Writes out an element with simple textual content. If the namespacePrefix argument is specified, this method both maps and unmaps that prefix for this element.
Parameters:
s - Required, the BsoXMLSerializer instance
namespace - Optional, The namespace of the element. If null is passed, the http://filenet.com/namespaces/wcm/apps/1.0 namespace is automatically used.
namespacePrefix - Optional, the prefix you want to map and unmap to and from the namespace. If you want to map and unmap it to and from the default namespace, pass in an empty string, "". If you pass in null for this argument, no namespace prefix is mapped or unmapped. It is up to the caller to map and unmap the appropriate prefix.
elemName - The name of the element.
text - The text to include as element content.

serializeCharacters

public static void serializeCharacters(BsoXMLSerializer s,
                                       int intValue)
Writes out character data representing an integer value.
Parameters:
s - Required, the BsoXMLSerializer instance
intValue - The integer value to write out as character data.

serializeCharacters

public static void serializeCharacters(BsoXMLSerializer s,
                                       java.lang.String strValue)
Writes out character data representing a string value.
Parameters:
s - Required, the XMLSerializer instance
strValue - The string value to write out as character data.

formatSearchResultValueForXML

public static java.lang.String formatSearchResultValueForXML(java.lang.String resultDataType,
                                                             java.lang.String resultValue)
Formats a value, as returned in the search results XML, in an appropriate manner to be part of other XML.
Parameters:
resultDataType - The data type as returned in the results XML: string, dateTime, etc.
resultValue - The value as returned in the results XML.
Returns:
A new value, possibly modified from the original value.

getChildElement

public static org.w3c.dom.Element getChildElement(org.w3c.dom.Element oParent,
                                                  java.lang.String sChildElementName)

getChildElementText

public static java.lang.String getChildElementText(org.w3c.dom.Element oParent,
                                                   java.lang.String sChildElementName)

saveToString

public static java.lang.String saveToString(org.w3c.dom.Node oNode)
                                     throws java.io.IOException,
                                            org.xml.sax.SAXException

writeXML

public static void writeXML(java.io.Writer w,
                            org.w3c.dom.Node node)
                     throws org.xml.sax.SAXException,
                            java.io.IOException

getChildNode

public static org.w3c.dom.Node getChildNode(org.w3c.dom.Node oNode,
                                            java.lang.String sChildToFind)

getNamedNode

public static org.w3c.dom.Node getNamedNode(org.w3c.dom.NodeList oNodes,
                                            java.lang.String sNameToFind)

getElementText

public static java.lang.String getElementText(org.w3c.dom.Element oElement)

Collaboration API Documentation

Copyright © 2002 - 2004 FileNet Corporation. All rights reserved.