public abstract class XSLTCrosswalk extends SelfNamedPlugin
This is the superclass of the XSLT dissemination and submission crosswalks. These classes let you can create many different crosswalks between DSpace internal data and any XML without changing any code, just XSL transformation (XSLT) stylesheets. Each configured stylesheet appears as a new plugin name, although they all share the same plugin implementation class.
The XML transformation must produce (for submission) or expect (for dissemination) a document in DIM - DSpace Intermediate Metadata format. See http://wiki.dspace.org/DspaceIntermediateMetadata for details.
A submission crosswalk is described by a configuration key like
crosswalk.submission.PluginName.stylesheet = pathThe alias names the Plugin name, and the path value is the pathname (relative to
dspace.dir/config)
of the crosswalk stylesheet, e.g. "mycrosswalk.xslt"
For example, this configures a crosswalk named "LOM" using a stylesheet
in config/crosswalks/d-lom.xsl under the DSpace "home" directory:
crosswalk.submission.stylesheet.LOM = crosswalks/d-lom.xsl
A dissemination crosswalk is described by a configuration key like
crosswalk.dissemination.PluginName.stylesheet = pathThe alias names the Plugin name, and the path value is the pathname (relative to
dspace.dir/config)
of the crosswalk stylesheet, e.g. "mycrosswalk.xslt"
You can have two names point to the same crosswalk, just add two configuration entries with the same path, e.g.
crosswalk.submission.MyFormat.stylesheet = crosswalks/myformat.xslt
crosswalk.submission.almost_DC.stylesheet = crosswalks/myformat.xslt
NOTE: This plugin will automatically reload any XSL stylesheet that was modified since it was last loaded. This lets you edit and test stylesheets without restarting DSpace.
You must use the PluginService to instantiate an
XSLT crosswalk plugin, e.g.
IngestionCrosswalk xwalk = CoreServiceFactory.getInstance().getPluginService().getPlugin(IngestionCrosswalk.class, "LOM");
Since there is significant overhead in reading the properties file to
configure the crosswalk, and a crosswalk instance may be used any number
of times, we recommend caching one instance of the crosswalk for each
alias and simply reusing those instances. The PluginService
does this automatically.
| Modifier and Type | Field and Description |
|---|---|
protected static String |
CONFIG_PREFIX
Prefix for all lines in the config file for XSLT plugins.
|
static org.jdom.Namespace |
DIM_NS
DSpace XML Namespace in JDOM form.
|
| Constructor and Description |
|---|
XSLTCrosswalk() |
| Modifier and Type | Method and Description |
|---|---|
protected Transformer |
getTransformer(String direction)
Initialize the Transformation stylesheet from configured stylesheet file.
|
protected static String[] |
makeAliases(String direction)
Derive list of plugin name from DSpace configuration entries
for crosswalks.
|
getPluginInstanceName, getPluginNames, setPluginInstanceNamepublic static final org.jdom.Namespace DIM_NS
protected static final String CONFIG_PREFIX
protected static String[] makeAliases(String direction)
direction - "dissemination" or "submission", so it looks for keys like
crosswalk.submission.{NAME}.stylesheetprotected Transformer getTransformer(String direction)
direction - the direction of xwalk, either "submission" or
"dissemination"Copyright © 2016 DuraSpace. All Rights Reserved.