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

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

public class XMLFilter
extends java.lang.Object

Provides static methods to filter XML


Method Summary
static void filterDocumentsByMimeTypes(org.w3c.dom.Document doc, java.lang.String[] mimeTypes)
          Removes documents that are not of the specified mime types from the objectset.
static org.w3c.dom.Document filterFoldersByClassId(org.w3c.dom.Document docFolders, java.lang.String classId)
          Exclude any folder its class id is not the same as classId.
static void removeDocumentsByClassId(org.w3c.dom.Document doc, java.lang.String classId)
          Removes documents from XML with the specified class id
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

filterFoldersByClassId

public static org.w3c.dom.Document filterFoldersByClassId(org.w3c.dom.Document docFolders,
                                                          java.lang.String classId)
                                                   throws java.lang.Exception
Exclude any folder its class id is not the same as classId.

Parameters:
docFolders - Input folders DOM object
classId - class id of folder
Returns:
Filtered folders DOM object
Throws:
java.lang.Exception

removeDocumentsByClassId

public static void removeDocumentsByClassId(org.w3c.dom.Document doc,
                                            java.lang.String classId)
                                     throws java.lang.Exception
Removes documents from XML with the specified class id

Parameters:
doc -
classId -
Throws:
java.lang.Exception

filterDocumentsByMimeTypes

public static void filterDocumentsByMimeTypes(org.w3c.dom.Document doc,
                                              java.lang.String[] mimeTypes)
                                       throws java.lang.Exception
Removes documents that are not of the specified mime types from the objectset. If mimeTypes parameter is null or empty or * / * (no spaces), nothing is removed. Objects that are not documents are not removed.

Parameters:
doc - DOM Document object
mimeTypes - String array of mimeTypes to be removed
Throws:
java.lang.Exception - if some unexpected XPath error occurs, usually does not happen


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