public class SFXFileReader
extends java.lang.Object
This class reads the [dspace]/config/sfx.xml configuration file, which contains pairs of DSpace item metadata values and OpenURL parameter names. Then it takes an item and constructs an OpenURL for it with values of parameters filled in from the paired metadata fields.
| Constructor and Description |
|---|
SFXFileReader() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
doNodes(org.w3c.dom.Node node,
Item item)
Process the item, mapping each of its metadata fields defined in the
configuration file to an OpenURL parameter
|
static java.lang.String |
getAttribute(org.w3c.dom.Node e,
java.lang.String name)
Returns the value of the node's attribute named
|
static org.w3c.dom.Node |
getElement(org.w3c.dom.Node node)
Returns element node
|
static java.lang.String |
getValue(org.w3c.dom.Node node)
Returns the value found in the Text node (if any) in the
node list that's passed in.
|
static boolean |
isEmptyTextNode(org.w3c.dom.Node nd)
Is Empty text Node
|
static java.lang.String |
loadSFXFile(java.lang.String fileName,
Item item)
Loads the SFX configuration file
|
static org.w3c.dom.Document |
parseFile(java.lang.String fileName)
Parses XML file and returns XML document.
|
public static java.lang.String loadSFXFile(java.lang.String fileName,
Item item)
throws java.io.IOException
fileName - The name of the SFX configuration fileitem - The item to process, from which metadata values will be takenjava.io.IOExceptionpublic static org.w3c.dom.Document parseFile(java.lang.String fileName)
fileName - XML file to parsepublic static java.lang.String doNodes(org.w3c.dom.Node node,
Item item)
throws java.io.IOException
node - DOM node of the mapping pair in the XML file (field element)item - The item to process, from which metadata values will be takenjava.io.IOExceptionpublic static org.w3c.dom.Node getElement(org.w3c.dom.Node node)
node - element (it is XML tag)public static boolean isEmptyTextNode(org.w3c.dom.Node nd)
public static java.lang.String getAttribute(org.w3c.dom.Node e,
java.lang.String name)
public static java.lang.String getValue(org.w3c.dom.Node node)
Copyright © 2013 DuraSpace. All Rights Reserved.