Package org.dspace.administer
Class MetadataExporter
java.lang.Object
org.dspace.administer.MetadataExporter
- Author:
- Graham Triggs
This class creates an XML document as passed in the arguments and
from the metadata schemas for the repository.
The form of the XML is as follows
<metadata-schemas> <schema> <name>dc</name> <namespace>http://dublincore.org/documents/dcmi-terms/</namespace> </schema> </metadata-schemas>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static MetadataFieldServiceprotected static MetadataSchemaService -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidsaveRegistry(String file, String schema) Save a registry to a file pathstatic voidsaveSchema(Context context, Document document, String schema) Compose the schema registry.static voidusage()Print the usage message to standard output
-
Field Details
-
metadataSchemaService
-
metadataFieldService
-
-
Method Details
-
main
public static void main(String[] args) throws org.apache.commons.cli.ParseException, SQLException, IOException, RegistryExportException, ClassNotFoundException, InstantiationException, IllegalAccessException - Parameters:
args- command line arguments- Throws:
org.apache.commons.cli.ParseException- if parser errorIOException- if IO errorSQLException- if database errorRegistryExportException- if export errorClassNotFoundException- if no suitable DOM implementationInstantiationException- if no suitable DOM implementationIllegalAccessException- if no suitable DOM implementation
-
saveRegistry
public static void saveRegistry(String file, String schema) throws SQLException, IOException, RegistryExportException, ClassNotFoundException, InstantiationException, IllegalAccessException Save a registry to a file path- Parameters:
file- file pathschema- schema definition to save- Throws:
SQLException- if database errorIOException- if IO errorRegistryExportException- if export errorClassNotFoundException- if no suitable DOM implementationInstantiationException- if no suitable DOM implementationIllegalAccessException- if no suitable DOM implementation
-
saveSchema
public static void saveSchema(Context context, Document document, String schema) throws SQLException, RegistryExportException Compose the schema registry. If the parameter 'schema' is null or empty, save all schemas.- Parameters:
context- DSpace Contextdocument- the document being builtschema- schema (may be null to save all)- Throws:
SQLException- if database errorRegistryExportException- if export error
-
usage
public static void usage()Print the usage message to standard output
-