public class DocContentMap
extends java.lang.Object
Note: why isn't NodeComparator
used to compare? see
more info on
NodeComparator
Modifier and Type | Method and Description |
---|---|
static void |
cmpMaps(java.util.Map map1,
java.util.Map map2)
Compares two docContent Maps - used for debugging and testing.
|
static void |
cmpValLists(java.util.List list1,
java.util.List list2)
compare the values of a doc field for the cashed and active docs
|
static void |
cmpVals(java.util.List list1,
java.util.List list2)
Debugging method to compare two value-lists.
|
static java.util.Map |
getDocContentMap(org.dom4j.Document doc,
MetaDataFramework framework)
Returns a representation of a metadata record that can be compared with
another record to determine if there are differences in content.
|
java.util.Map |
getDocContentMap(java.io.File file)
Returns a content map of the provided file, assuming it belongs to the
MetaDataFramework of this DocContentMap instance.
|
org.dom4j.Document |
getDocument()
Gets the document attribute of the DocContentMap object
|
static void |
main(java.lang.String[] args)
The main program for the DocContentMap class
|
static void |
prtmap(java.util.Map map)
Utility method to print the contents of a contentMap
|
public org.dom4j.Document getDocument()
public static java.util.Map getDocContentMap(org.dom4j.Document doc, MetaDataFramework framework)
The DocContentMap has an entry for each normalized (i.e., containing no indexing info) xpath having a value. The entries are a sorted list of the values for that xpath. As a map with sorted entries, this representation allows records to be compared using the Map "equals" method.
DocContentMaps are used to determine if a metadata has been edited in the metadata editor so the user can be warned of unsaved changes before exiting.
doc
- a Document
representing a metadata
recordframework
- the MetaDataFramework for the metadata recordpublic java.util.Map getDocContentMap(java.io.File file)
file
- Description of the Parameterpublic static void main(java.lang.String[] args) throws java.lang.Exception
args
- The command line argumentsjava.lang.Exception
- Description of the Exceptionpublic static void prtmap(java.util.Map map)
map
- Description of the Parameterpublic static void cmpMaps(java.util.Map map1, java.util.Map map2)
map1
- Description of the Parametermap2
- Description of the Parameterpublic static void cmpVals(java.util.List list1, java.util.List list2)
list1
- Description of the Parameterlist2
- Description of the Parameterpublic static void cmpValLists(java.util.List list1, java.util.List list2)