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
public class XSLTDisseminationCrosswalk extends XSLTCrosswalk implements ParameterizedDisseminationCrosswalk
Configurable XSLT-driven dissemination CrosswalkSee 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:
XSLTCrosswalk
-
-
Field Summary
Fields Modifier and Type Field Description protected static CollectionServicecollectionServiceprotected static CommunityServicecommunityServiceprotected static ItemServiceitemService-
Fields inherited from class org.dspace.content.crosswalk.XSLTCrosswalk
CONFIG_PREFIX, DIM_NS
-
Fields inherited from interface org.dspace.content.crosswalk.DisseminationCrosswalk
XSI_NS
-
-
Constructor Summary
Constructors Constructor Description XSLTDisseminationCrosswalk()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanDisseminate(DSpaceObject dso)Determine is this crosswalk can dessiminate the given object.static org.jdom.ElementcreateDIM(DSpaceObject dso)Generate an intermediate representation of a DSpace object.static org.jdom.ElementcreateDIM(DSpaceObject dso, List<MetadataValueDTO> dcvs)Generate an intermediate representation of a DSpace object.org.jdom.ElementdisseminateElement(Context context, DSpaceObject dso)Execute crosswalk, returning one XML root element as a JDOMElementobject.org.jdom.ElementdisseminateElement(Context context, DSpaceObject dso, Map<String,String> parameters)Execute crosswalk, returning one XML root element as a JDOMElementobject.List<org.jdom.Element>disseminateList(Context context, DSpaceObject dso)Disseminate the DSpace item, collection, or community.org.jdom.Namespace[]getNamespaces()Return the namespace used by this crosswalk.static String[]getPluginNames()StringgetSchemaLocation()Return the schema location used by this crosswalk.protected static List<MetadataValueDTO>item2Metadata(Item item)static voidmain(String[] argv)Simple command-line rig for testing the DIM output of a stylesheet.booleanpreferList()return true if this crosswalk prefers the list form over an single element, otherwise false.-
Methods inherited from class org.dspace.content.crosswalk.XSLTCrosswalk
getTransformer, makeAliases
-
Methods inherited from class org.dspace.core.SelfNamedPlugin
getPluginInstanceName, setPluginInstanceName
-
-
-
-
Field Detail
-
communityService
protected static final CommunityService communityService
-
collectionService
protected static final CollectionService collectionService
-
itemService
protected static final ItemService itemService
-
-
Method Detail
-
getPluginNames
public static String[] getPluginNames()
-
getNamespaces
public org.jdom.Namespace[] getNamespaces()
Return the namespace used by this crosswalk.- Specified by:
getNamespacesin interfaceDisseminationCrosswalk- Returns:
- array of namespaces, which may be empty.
- See Also:
DisseminationCrosswalk
-
getSchemaLocation
public String 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:
DisseminationCrosswalk
-
disseminateElement
public org.jdom.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.jdom.Element disseminateElement(Context context, DSpaceObject dso, Map<String,String> parameters) throws CrosswalkException, IOException, SQLException, AuthorizeException
Description 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.jdom.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:
- results of crosswalk as list of XML elements.
- Throws:
CrosswalkException- crosswalk errorIOException- if IO errorSQLException- if database errorAuthorizeException- if authorization error- See Also:
DisseminationCrosswalk
-
canDisseminate
public boolean canDisseminate(DSpaceObject dso)
Determine is this crosswalk can dessiminate 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:
DisseminationCrosswalk
-
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:
DisseminationCrosswalk
-
createDIM
public static org.jdom.Element createDIM(DSpaceObject dso, List<MetadataValueDTO> dcvs)
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
public static org.jdom.Element createDIM(DSpaceObject dso)
Generate an intermediate representation of a DSpace object.- Parameters:
dso- The dspace object to build a representation of.- Returns:
- element
-
item2Metadata
protected static List<MetadataValueDTO> item2Metadata(Item item)
-
-