org.kuali.rice.edl.impl
Class EDLXmlUtils

java.lang.Object
  extended by org.kuali.rice.edl.impl.EDLXmlUtils

public final class EDLXmlUtils
extends Object

Contains a bunch of dom utility methods.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
static String DATA_E
           
static String DOCID_E
           
static String EDL_E
           
static String EDLCONTENT_E
           
static String TYPE_E
           
static String VALIDATION_E
           
static String VERSION_E
           
 
Method Summary
static void addErrorsAndMessagesToDocument(Document doc, List errors, List messages, Map<String,String> fieldErrors)
          Adds the specified errors and messages to the <documentState> element of the given EDL doc
static void addGlobalErrorMessage(Document dom, String errorMessage)
           
static Element createChildElement(Element parentElement, String elementName)
           
static Element createFieldDataElement(Element parentVersionElement, MatchingParam matchingParam)
           
static Element createTextElementOnParent(Element parent, String childElementName, String text)
           
static Element getChildElement(Node parent, String name)
          Returns a node child with the specified tag name of the specified parent node, or null if no such child node is found.
static String getChildElementTextValue(Node parent, String name)
          Returns the text value of a child element with the given name, of the given parent element, or null if the child does not exist or does not have a child text node
static Element getDataFromEDLDocument(Element edlContent, boolean create)
           
static DocumentBuilder getDocumentBuilder()
          Returns a valid DocumentBuilder
static Element getDocumentStateElement(Document dom)
           
static Element getEDLContent(Document displayDoc, boolean create)
           
static Element getOrCreateChildElement(Element parent, String name, boolean create)
          Returns, and creates if absent, a child element
static Element getVersionFromData(Element dataElement, Integer versionCount)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EDL_E

public static final String EDL_E
See Also:
Constant Field Values

EDLCONTENT_E

public static final String EDLCONTENT_E
See Also:
Constant Field Values

DATA_E

public static final String DATA_E
See Also:
Constant Field Values

TYPE_E

public static final String TYPE_E
See Also:
Constant Field Values

VALIDATION_E

public static final String VALIDATION_E
See Also:
Constant Field Values

VERSION_E

public static final String VERSION_E
See Also:
Constant Field Values

DOCID_E

public static final String DOCID_E
See Also:
Constant Field Values
Method Detail

getDocumentBuilder

public static DocumentBuilder getDocumentBuilder()
Returns a valid DocumentBuilder

Returns:
a valid DocumentBuilder

createFieldDataElement

public static Element createFieldDataElement(Element parentVersionElement,
                                             MatchingParam matchingParam)

createChildElement

public static Element createChildElement(Element parentElement,
                                         String elementName)

getDocumentStateElement

public static Element getDocumentStateElement(Document dom)

addGlobalErrorMessage

public static void addGlobalErrorMessage(Document dom,
                                         String errorMessage)

createTextElementOnParent

public static Element createTextElementOnParent(Element parent,
                                                String childElementName,
                                                String text)

getVersionFromData

public static Element getVersionFromData(Element dataElement,
                                         Integer versionCount)

getDataFromEDLDocument

public static Element getDataFromEDLDocument(Element edlContent,
                                             boolean create)

getEDLContent

public static Element getEDLContent(Document displayDoc,
                                    boolean create)

getOrCreateChildElement

public static Element getOrCreateChildElement(Element parent,
                                              String name,
                                              boolean create)
Returns, and creates if absent, a child element

Parameters:
parent - the parent element
name - the name of the child element to create and/or return
Returns:
reference to the child element

getChildElement

public static Element getChildElement(Node parent,
                                      String name)
Returns a node child with the specified tag name of the specified parent node, or null if no such child node is found.

Parameters:
parent - the parent node
name - the name of the child node
Returns:
child node if found, null otherwise

getChildElementTextValue

public static String getChildElementTextValue(Node parent,
                                              String name)
Returns the text value of a child element with the given name, of the given parent element, or null if the child does not exist or does not have a child text node

Parameters:
parent - parent element
name - name of child element
Returns:
the text value of a child element with the given name, of the given parent element, or null if the child does not exist or does not have a child text node

addErrorsAndMessagesToDocument

public static void addErrorsAndMessagesToDocument(Document doc,
                                                  List errors,
                                                  List messages,
                                                  Map<String,String> fieldErrors)
Adds the specified errors and messages to the <documentState> element of the given EDL doc

Parameters:
doc - the EDL doc
errors - the list of error Strings
messages - the list of message Strings


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.