Package org.dlese.dpc.schemedit
Class DocContentMap
java.lang.Object
org.dlese.dpc.schemedit.DocContentMap
Utilities for comparing metadata records for content-based equality (rather
than structural equality).
Note: why isn't NodeComparator used to compare? see
more info on
NodeComparator
- Author:
- ostwald
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidCompares two docContent Maps - used for debugging and testing.static voidcmpValLists(List list1, List list2) compare the values of a doc field for the cashed and active docsstatic voidDebugging method to compare two value-lists.getDocContentMap(File file) Returns a content map of the provided file, assuming it belongs to the MetaDataFramework of this DocContentMap instance.static MapgetDocContentMap(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.org.dom4j.DocumentGets the document attribute of the DocContentMap objectstatic voidThe main program for the DocContentMap classstatic voidUtility method to print the contents of a contentMap
-
Method Details
-
getDocument
public org.dom4j.Document getDocument()Gets the document attribute of the DocContentMap object- Returns:
- The document value
-
getDocContentMap
Returns a representation of a metadata record that can be compared with another record to determine if there are differences in content.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.
- Parameters:
doc- aDocumentrepresenting a metadata recordframework- the MetaDataFramework for the metadata record- Returns:
- The docContentMap value
-
getDocContentMap
Returns a content map of the provided file, assuming it belongs to the MetaDataFramework of this DocContentMap instance.- Parameters:
file- Description of the Parameter- Returns:
- The docContentMap value
-
main
The main program for the DocContentMap class- Parameters:
args- The command line arguments- Throws:
Exception- Description of the Exception
-
prtmap
Utility method to print the contents of a contentMap- Parameters:
map- Description of the Parameter
-
cmpMaps
Compares two docContent Maps - used for debugging and testing.- Parameters:
map1- Description of the Parametermap2- Description of the Parameter
-
cmpVals
Debugging method to compare two value-lists.- Parameters:
list1- Description of the Parameterlist2- Description of the Parameter
-
cmpValLists
compare the values of a doc field for the cashed and active docs
-