Package org.dspace.administer
Class MetadataImporter
- java.lang.Object
-
- org.dspace.administer.MetadataImporter
-
public class MetadataImporter extends Object
- Author:
- Richard Jones
This class takes an xml document as passed in the arguments and
uses it to create metadata elements in the Metadata Registry if
they do not already exist
The format of the XML file is as follows:
<dspace-dc-types> <dc-type> <schema>icadmin</schema> <element>status</element> <qualifier>dateset</qualifier> <scope_note>the workflow status of an item</scope_note> </dc-type> [....] </dspace-dc-types>
-
-
Field Summary
Fields Modifier and Type Field Description protected static MetadataFieldServicemetadataFieldServiceprotected static MetadataSchemaServicemetadataSchemaService
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidloadRegistry(String file, boolean forceUpdate)Load the data from the specified file path into the databasestatic voidmain(String[] args)main method for reading user input from the command linestatic voidusage()Print the usage message to stdout
-
-
-
Field Detail
-
metadataSchemaService
protected static MetadataSchemaService metadataSchemaService
-
metadataFieldService
protected static MetadataFieldService metadataFieldService
-
-
Method Detail
-
main
public static void main(String[] args) throws org.apache.commons.cli.ParseException, SQLException, IOException, TransformerException, ParserConfigurationException, AuthorizeException, SAXException, NonUniqueMetadataException, RegistryImportException, XPathExpressionException
main method for reading user input from the command line- Parameters:
args- the command line arguments given- Throws:
org.apache.commons.cli.ParseException- if parse errorSQLException- if database errorIOException- if IO errorTransformerException- if transformer errorParserConfigurationException- if configuration errorAuthorizeException- if authorization errorSAXException- if parser errorNonUniqueMetadataException- if duplicate metadataRegistryImportException- if import failsXPathExpressionException
-
loadRegistry
public static void loadRegistry(String file, boolean forceUpdate) throws SQLException, IOException, TransformerException, ParserConfigurationException, AuthorizeException, SAXException, NonUniqueMetadataException, RegistryImportException, XPathExpressionException
Load the data from the specified file path into the database- Parameters:
file- the file path containing the source dataforceUpdate- whether to force update- Throws:
SQLException- if database errorIOException- if IO errorTransformerException- if transformer errorParserConfigurationException- if configuration errorAuthorizeException- if authorization errorSAXException- if parser errorNonUniqueMetadataException- if duplicate metadataRegistryImportException- if import failsXPathExpressionException
-
usage
public static void usage()
Print the usage message to stdout
-
-