|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jafer.osid.ModsUtils
public class ModsUtils
Extracts a set of fields from a DOM document in MODS 3.0 format and returns them in a Map for display purposes. We should load this class in a factory so it can be customised for different implementations (later if required)
Constructor Summary | |
---|---|
ModsUtils()
|
Method Summary | |
---|---|
static org.w3c.dom.Node |
addAnnotation(org.w3c.dom.Node docroot,
java.lang.String annotation)
|
static org.w3c.dom.Node |
addModCollection(org.w3c.dom.Document doc)
Creates a mods collection element in the document |
private void |
dumpNodeList(org.w3c.dom.NodeList list)
|
static java.lang.String |
getField(java.util.Map fields,
java.lang.String fieldName)
|
static java.util.Map |
getFields(org.w3c.dom.Element modsroot)
Extract Mods 3.0 Reource fields from DOM object and return as a Map |
private static java.lang.String |
getOwner(org.w3c.dom.Element modsroot)
Retrieves the owner's displayForm or namePart if exists. |
static java.util.List |
getRelatedDocIds(org.w3c.dom.Element mdcroot)
Retrieves RL's constituent docId's as relatedItems. |
static java.lang.String |
stripLastChar(java.lang.String str)
|
static java.lang.String |
toModsRecordXml(java.util.Map fields,
java.lang.String docId,
java.lang.String origin,
java.lang.String mdctype,
java.util.List refDocIds)
Generates a mods record. |
static void |
updateAnnotation(org.w3c.dom.Element modsElement,
java.lang.String annotation)
Updates the mods records first annotation with supplied text or creates one if none found |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ModsUtils()
Method Detail |
---|
public static java.util.Map getFields(org.w3c.dom.Element modsroot)
public static java.lang.String stripLastChar(java.lang.String str)
public static org.w3c.dom.Node addModCollection(org.w3c.dom.Document doc)
doc
-
public static void updateAnnotation(org.w3c.dom.Element modsElement, java.lang.String annotation)
modsElement
- the mods element to updateannotation
- The new annotation text to setpublic static org.w3c.dom.Node addAnnotation(org.w3c.dom.Node docroot, java.lang.String annotation)
public static java.lang.String toModsRecordXml(java.util.Map fields, java.lang.String docId, java.lang.String origin, java.lang.String mdctype, java.util.List refDocIds)
fields
- - fields to generatedocId
- - the docId representing this mods document's db identifierorigin
- - value identifying the mods record source (i.e. which
collection it comes from)mdctype
- - enumerated mdc type signifying mdc record type (header
or list item)refDocIds
- - a list of consituent docid's if this mods record is a
RL header (may be null if not)private void dumpNodeList(org.w3c.dom.NodeList list)
private static java.lang.String getOwner(org.w3c.dom.Element modsroot)
public static java.util.List getRelatedDocIds(org.w3c.dom.Element mdcroot)
public static java.lang.String getField(java.util.Map fields, java.lang.String fieldName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |