Package org.dspace.content.crosswalk
Class XSLTIngestionCrosswalk
- java.lang.Object
-
- org.dspace.core.SelfNamedPlugin
-
- org.dspace.content.crosswalk.XSLTCrosswalk
-
- org.dspace.content.crosswalk.XSLTIngestionCrosswalk
-
- All Implemented Interfaces:
IngestionCrosswalk,NameAwarePlugin
public class XSLTIngestionCrosswalk extends XSLTCrosswalk implements IngestionCrosswalk
Configurable XSLT-driven ingestion CrosswalkSee the XSLTCrosswalk superclass for details on configuration.
- Author:
- Larry Stone
- See Also:
XSLTCrosswalk
-
-
Field Summary
-
Fields inherited from class org.dspace.content.crosswalk.XSLTCrosswalk
CONFIG_PREFIX, DIM_NS
-
-
Constructor Summary
Constructors Constructor Description XSLTIngestionCrosswalk()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String[]getPluginNames()voidingest(Context context, DSpaceObject dso, List<org.jdom2.Element> metadata, boolean createMissingMetadataFields)Translate metadata with XSL stylesheet and ingest it.voidingest(Context context, DSpaceObject dso, org.jdom2.Element root, boolean createMissingMetadataFields)Ingest a whole document.static voidingestDIM(Context context, DSpaceObject dso, List<org.jdom2.Element> fields, boolean createMissingMetadataFields)static voidingestDIM(Context context, DSpaceObject dso, org.jdom2.Element dim, boolean createMissingMetadataFields)Ingest a DIM metadata expression directly, without translating some other format into DIM.static voidmain(String[] argv)Simple command-line rig for testing the DIM output of a stylesheet.-
Methods inherited from class org.dspace.content.crosswalk.XSLTCrosswalk
getTransformer, makeAliases
-
Methods inherited from class org.dspace.core.SelfNamedPlugin
getPluginInstanceName, setPluginInstanceName
-
-
-
-
Method Detail
-
getPluginNames
public static String[] getPluginNames()
-
ingest
public void ingest(Context context, DSpaceObject dso, List<org.jdom2.Element> metadata, boolean createMissingMetadataFields) throws CrosswalkException, IOException, SQLException, AuthorizeException
Translate metadata with XSL stylesheet and ingest it. Translation produces a list of DIM "field" elements; these correspond directly to Item.addMetadata() calls so they are simply executed.- Specified by:
ingestin interfaceIngestionCrosswalk- Parameters:
createMissingMetadataFields- whether to create missing fieldscontext- DSpace context.dso- DSpace Object (Item, Bitstream, etc) to which new metadata gets attached.metadata- List of XML Elements of metadata- Throws:
CrosswalkException- crosswalk errorIOException- if IO errorSQLException- if database errorAuthorizeException- if authorization error
-
ingest
public void ingest(Context context, DSpaceObject dso, org.jdom2.Element root, boolean createMissingMetadataFields) throws CrosswalkException, IOException, SQLException, AuthorizeException
Ingest a whole document. Build Document object around root element, and feed that to the transformation, since it may get handled differently than a List of metadata elements.- Specified by:
ingestin interfaceIngestionCrosswalk- Parameters:
createMissingMetadataFields- whether to create missing fieldscontext- DSpace context.dso- DSpace Object (usually an Item) to which new metadata gets attached.root- root Element of metadata document.- Throws:
CrosswalkException- crosswalk errorIOException- if IO errorSQLException- if database errorAuthorizeException- if authorization error
-
ingestDIM
public static void ingestDIM(Context context, DSpaceObject dso, org.jdom2.Element dim, boolean createMissingMetadataFields) throws CrosswalkException, IOException, SQLException, AuthorizeException
Ingest a DIM metadata expression directly, without translating some other format into DIM. Thedimelement is expected to be be the root of a DIM document.Note that this is ONLY implemented for Item, Collection, and Community objects. Also only works for the "dc" metadata schema.
- Parameters:
context- the contextdso- object into which to ingest metadatadim- root of a DIM expressioncreateMissingMetadataFields- whether to create missing fields- Throws:
CrosswalkException- crosswalk errorIOException- if IO errorSQLException- if database errorAuthorizeException- if authorization error
-
ingestDIM
public static void ingestDIM(Context context, DSpaceObject dso, List<org.jdom2.Element> fields, boolean createMissingMetadataFields) throws CrosswalkException, IOException, SQLException, AuthorizeException
-
-