Package org.dspace.administer
Class MetadataImporter
java.lang.Object
org.dspace.administer.MetadataImporter
- 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
FieldsModifier and TypeFieldDescriptionprotected static MetadataFieldServiceprotected static MetadataSchemaService -
Method Summary
Modifier and TypeMethodDescriptionstatic voidloadRegistry(String file, boolean forceUpdate) Load the data from the specified file path into the databasestatic voidmain method for reading user input from the command linestatic voidusage()Print the usage message to stdout
-
Field Details
-
metadataSchemaService
-
metadataFieldService
-
-
Method Details
-
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- passed through
-
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- passed through
-
usage
public static void usage()Print the usage message to stdout
-