Package org.dspace.administer
Class MetadataExporter
- java.lang.Object
-
- org.dspace.administer.MetadataExporter
-
public class MetadataExporter extends Object
- 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
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 voidmain(String[] args)static voidsaveRegistry(String file, String schema)Save a registry to a filepathstatic voidsaveSchema(Context context, org.apache.xml.serialize.XMLSerializer xmlSerializer, String schema)Serialize the schema registry.static 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, SAXException, RegistryExportException
- Parameters:
args- commandline arguments- Throws:
org.apache.commons.cli.ParseException- if parser errorSAXException- if XML parse errorIOException- if IO errorSQLException- if database errorRegistryExportException- if export error
-
saveRegistry
public static void saveRegistry(String file, String schema) throws SQLException, IOException, SAXException, RegistryExportException
Save a registry to a filepath- Parameters:
file- filepathschema- schema definition to save- Throws:
SQLException- if database errorIOException- if IO errorSAXException- if XML errorRegistryExportException- if export error
-
saveSchema
public static void saveSchema(Context context, org.apache.xml.serialize.XMLSerializer xmlSerializer, String schema) throws SQLException, SAXException, RegistryExportException
Serialize the schema registry. If the parameter 'schema' is null or empty, save all schemas- Parameters:
context- DSpace ContextxmlSerializer- XML serializerschema- schema (may be null to save all)- Throws:
SQLException- if database errorSAXException- if XML errorRegistryExportException- if export error
-
usage
public static void usage()
Print the usage message to stdout
-
-