Package org.dspace.content.crosswalk
Class XSLTDisseminationCrosswalk
java.lang.Object
org.dspace.core.SelfNamedPlugin
org.dspace.content.crosswalk.XSLTCrosswalk
org.dspace.content.crosswalk.XSLTDisseminationCrosswalk
- All Implemented Interfaces:
DisseminationCrosswalk,ParameterizedDisseminationCrosswalk,NameAwarePlugin
public class XSLTDisseminationCrosswalk
extends XSLTCrosswalk
implements ParameterizedDisseminationCrosswalk
Configurable XSLT-driven dissemination Crosswalk
See the XSLTCrosswalk superclass for details on configuration.
Additional Configuration of Dissemination crosswalk:
The disseminator also needs to be configured with an XML Namespace (including prefix and URI) and an XML Schema for output format. This is configured on additional properties in the DSpace Configuration, i.e.:crosswalk.dissemination.PluginName.namespace.Prefix = namespace-URI crosswalk.dissemination.PluginName.schemaLocation = schemaLocation value crosswalk.dissemination.PluginName.preferList = boolean (default is false)For example:
crosswalk.dissemination.qdc.namespace.dc = http://purl.org/dc/elements/1.1/
crosswalk.dissemination.qdc.namespace.dcterms = http://purl.org/dc/terms/
crosswalk.dissemination.qdc.schemaLocation = \
http://purl.org/dc/elements/1.1/ http://dublincore.org/schemas/xmls/qdc/2003/04/02/qualifieddc.xsd
crosswalk.dissemination.qdc.preferList = true
- Author:
- Larry Stone, Scott Phillips, Pascal-Nicolas Becker
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final CollectionServiceprotected static final CommunityServiceprotected static final ConfigurationServiceprotected static final ItemServiceFields inherited from class org.dspace.content.crosswalk.XSLTCrosswalk
CONFIG_PREFIX, DIM_NSFields inherited from interface org.dspace.content.crosswalk.DisseminationCrosswalk
XSI_NS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermine is this crosswalk can disseminate the given object.static org.jdom2.ElementcreateDIM(DSpaceObject dso) Generate an intermediate representation of a DSpace object.static org.jdom2.ElementcreateDIM(DSpaceObject dso, List<MetadataValueDTO> dcvs) Generate an intermediate representation of a DSpace object.org.jdom2.ElementdisseminateElement(Context context, DSpaceObject dso) Execute crosswalk, returning one XML root element as a JDOMElementobject.org.jdom2.ElementdisseminateElement(Context context, DSpaceObject dso, Map<String, String> parameters) Execute crosswalk, returning one XML root element as a JDOMElementobject.List<org.jdom2.Element>disseminateList(Context context, DSpaceObject dso) Disseminate the DSpace item, collection, or community.org.jdom2.Namespace[]Return the namespace used by this crosswalk.static String[]Return the schema location used by this crosswalk.protected static List<MetadataValueDTO>item2Metadata(Item item) static voidSimple command-line rig for testing the DIM output of a stylesheet.booleanreturn true if this crosswalk prefers the list form over an single element, otherwise false.Methods inherited from class org.dspace.content.crosswalk.XSLTCrosswalk
getTransformer, makeAliasesMethods inherited from class org.dspace.core.SelfNamedPlugin
getPluginInstanceName, setPluginInstanceName
-
Field Details
-
communityService
-
collectionService
-
itemService
-
configurationService
-
-
Constructor Details
-
XSLTDisseminationCrosswalk
public XSLTDisseminationCrosswalk()
-
-
Method Details
-
getPluginNames
-
getNamespaces
public org.jdom2.Namespace[] getNamespaces()Return the namespace used by this crosswalk.- Specified by:
getNamespacesin interfaceDisseminationCrosswalk- Returns:
- array of namespaces, which may be empty.
- See Also:
-
getSchemaLocation
Return the schema location used by this crosswalk.- Specified by:
getSchemaLocationin interfaceDisseminationCrosswalk- Returns:
- SchemaLocation string, including URI namespace, followed by whitespace and URI of XML schema document, or empty string if unknown.
- See Also:
-
disseminateElement
public org.jdom2.Element disseminateElement(Context context, DSpaceObject dso) throws CrosswalkException, IOException, SQLException, AuthorizeException Description copied from interface:DisseminationCrosswalkExecute crosswalk, returning one XML root element as a JDOMElementobject. This is typically the root element of a document.- Specified by:
disseminateElementin interfaceDisseminationCrosswalk- Parameters:
context- contextdso- the DSpace Object whose metadata to export.- Returns:
- root Element of the target metadata, never
null - Throws:
CrosswalkInternalException- (CrosswalkException) failure of the crosswalk itself.CrosswalkObjectNotSupported- (CrosswalkException) Cannot crosswalk this kind of DSpace object.IOException- I/O failure in services this callsSQLException- Database failure in services this callsAuthorizeException- current user not authorized for this operation.CrosswalkException
-
disseminateElement
public org.jdom2.Element disseminateElement(Context context, DSpaceObject dso, Map<String, String> parameters) throws CrosswalkException, IOException, SQLException, AuthorizeExceptionDescription copied from interface:ParameterizedDisseminationCrosswalkExecute crosswalk, returning one XML root element as a JDOMElementobject. This is typically the root element of a document.- Specified by:
disseminateElementin interfaceParameterizedDisseminationCrosswalk- Parameters:
context- The relevant DSpace Context.dso- the DSpace Object whose metadata to export.parameters- names and values of parameters to be passed into the transform.- Returns:
- root Element of the target metadata, never
null. - Throws:
CrosswalkInternalException- (CrosswalkException) failure of the crosswalk itself.CrosswalkObjectNotSupported- (CrosswalkException) Cannot crosswalk this kind of DSpace object.IOException- I/O failure in services this callsSQLException- Database failure in services this callsAuthorizeException- current user not authorized for this operation.CrosswalkException
-
disseminateList
public List<org.jdom2.Element> disseminateList(Context context, DSpaceObject dso) throws CrosswalkException, IOException, SQLException, AuthorizeException Disseminate the DSpace item, collection, or community.- Specified by:
disseminateListin interfaceDisseminationCrosswalk- Parameters:
context- contextdso- the DSpace Object whose metadata to export.- Returns:
- List of Elements
- Throws:
CrosswalkException- crosswalk errorIOException- if IO errorSQLException- if database errorAuthorizeException- if authorization error- See Also:
-
canDisseminate
Determine is this crosswalk can disseminate the given object.- Specified by:
canDisseminatein interfaceDisseminationCrosswalk- Parameters:
dso- dspace object, e.g. anItem.- Returns:
- true when disseminator is capable of producing metadata.
- See Also:
-
preferList
public boolean preferList()return true if this crosswalk prefers the list form over an single element, otherwise false.- Specified by:
preferListin interfaceDisseminationCrosswalk- Returns:
- true when disseminator prefers you call disseminateList().
- See Also:
-
createDIM
Generate an intermediate representation of a DSpace object.- Parameters:
dso- The DSpace object to build a representation of.dcvs- list of metadata- Returns:
- element
-
createDIM
Generate an intermediate representation of a DSpace object.- Parameters:
dso- The dspace object to build a representation of.- Returns:
- element
-
item2Metadata
-
main
Simple command-line rig for testing the DIM output of a stylesheet. Usage:java XSLTDisseminationCrosswalk <crosswalk-name> <handle> [output-file]- Parameters:
argv- the command line arguments given- Throws:
Exception- if error
-