Package org.dspace.app.bulkedit
Class MetadataExport
- java.lang.Object
-
- org.dspace.app.bulkedit.MetadataExport
-
public class MetadataExport extends Object
Metadata exporter to allow the batch export of metadata into a file- Author:
- Stuart Lewis
-
-
Field Summary
Fields Modifier and Type Field Description protected Contextcontextprotected booleanexportAllWhether to export all metadata, or just normally edited metadataprotected ItemServiceitemServiceprotected Iterator<Item>toExportThe items to export
-
Constructor Summary
Constructors Modifier Constructor Description protectedMetadataExport()MetadataExport(Context c, Iterator<Item> toExport, boolean exportAll)Set up a new metadata exportMetadataExport(Context c, Community toExport, boolean exportAll)Method to export a community (and sub-communities and collections)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Iterator<Item>buildFromCommunity(Context context, Community community, int indent)Build an array list of item ids that are in a community (include sub-communities and collections)DSpaceCSVexport()Run the exportstatic voidmain(String[] argv)main method to run the metadata exporter
-
-
-
Field Detail
-
itemService
protected ItemService itemService
-
context
protected Context context
-
exportAll
protected boolean exportAll
Whether to export all metadata, or just normally edited metadata
-
-
Constructor Detail
-
MetadataExport
protected MetadataExport()
-
MetadataExport
public MetadataExport(Context c, Iterator<Item> toExport, boolean exportAll)
Set up a new metadata export- Parameters:
c- The ContexttoExport- The ItemIterator of items to exportexportAll- whether to export all metadata or not (include handle, provenance etc)
-
MetadataExport
public MetadataExport(Context c, Community toExport, boolean exportAll)
Method to export a community (and sub-communities and collections)- Parameters:
c- The ContexttoExport- The Community to exportexportAll- whether to export all metadata or not (include handle, provenance etc)
-
-
Method Detail
-
buildFromCommunity
protected Iterator<Item> buildFromCommunity(Context context, Community community, int indent) throws SQLException
Build an array list of item ids that are in a community (include sub-communities and collections)- Parameters:
context- DSpace contextcommunity- The community to build fromindent- How many spaces to use when writing out the names of items added- Returns:
- The list of item ids
- Throws:
SQLException- if database error
-
export
public DSpaceCSV export()
Run the export- Returns:
- the exported CSV lines
-
-