Package org.dspace.app.itemexport
Class ItemExport
- java.lang.Object
-
- org.dspace.scripts.DSpaceRunnable<ItemExportScriptConfiguration>
-
- org.dspace.app.itemexport.ItemExport
-
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
ItemExportCLI
public class ItemExport extends DSpaceRunnable<ItemExportScriptConfiguration>
Item exporter to create simple AIPs for DSpace content. Currently exports individual items, or entire collections. For instructions on use, see printUsage() method.ItemExport creates the simple AIP package that the importer also uses. It consists of:
/exportdir/42/ (one directory per item) / dublin_core.xml - qualified dublin core in RDF schema / contents - text file, listing one file per line / file1 - files contained in the item / file2 / ...
issues -doesn't handle special characters in metadata (needs to turn
&'sinto&, etc.)Modified by David Little, UCSD Libraries 12/21/04 to allow the registration of files (bitstreams) into DSpace.
- Author:
- David Little, Jay Paz
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.dspace.scripts.DSpaceRunnable
DSpaceRunnable.StepResult
-
-
Field Summary
Fields Modifier and Type Field Description protected Collectioncollectionprotected static CollectionServicecollectionServiceprotected StringdestDirNameprotected static EPersonServiceepersonServiceprotected booleanexcludeBitstreamsprotected static HandleServicehandleServiceprotected booleanhelpprotected StringidStringprotected Itemitemprotected static ItemServiceitemServiceprotected booleanmigrateprotected intseqStartstatic StringTEMP_DIRprotected inttypeprotected StringtypeStringprotected booleanzipstatic StringZIP_EXTstatic StringZIP_FILENAMEstatic StringZIP_NAMEprotected StringzipFileName-
Fields inherited from class org.dspace.scripts.DSpaceRunnable
commandLine, handler, helpCommandLine
-
-
Constructor Summary
Constructors Constructor Description ItemExport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ItemExportScriptConfigurationgetScriptConfiguration()This method will return the Configuration that the implementing DSpaceRunnable usesvoidinternalRun()This method has to be included in every script and this will be the main execution block for the script that'll contain all the logic neededprotected voidprocess(Context context, ItemExportService itemExportService)Process the exportprotected voidsetDestDirName(Context context, ItemExportService itemExportService)Set the destination directory optionprotected voidsetNumber()Set the number optionvoidsetup()This method has to be included in every script and handles the setup of the script by parsing the CommandLine and setting the variablesprotected voidsetZip(Context context)Set the zip optionprotected voidvalidate()Validate the options-
Methods inherited from class org.dspace.scripts.DSpaceRunnable
getEpersonIdentifier, getFileNamesFromInputStreamOptions, initialize, printHelp, run, setEpersonIdentifier
-
-
-
-
Field Detail
-
TEMP_DIR
public static final String TEMP_DIR
- See Also:
- Constant Field Values
-
ZIP_NAME
public static final String ZIP_NAME
- See Also:
- Constant Field Values
-
ZIP_FILENAME
public static final String ZIP_FILENAME
- See Also:
- Constant Field Values
-
ZIP_EXT
public static final String ZIP_EXT
- See Also:
- Constant Field Values
-
typeString
protected String typeString
-
destDirName
protected String destDirName
-
idString
protected String idString
-
seqStart
protected int seqStart
-
type
protected int type
-
item
protected Item item
-
collection
protected Collection collection
-
migrate
protected boolean migrate
-
zip
protected boolean zip
-
zipFileName
protected String zipFileName
-
excludeBitstreams
protected boolean excludeBitstreams
-
help
protected boolean help
-
handleService
protected static HandleService handleService
-
itemService
protected static ItemService itemService
-
collectionService
protected static CollectionService collectionService
-
epersonService
protected static final EPersonService epersonService
-
-
Method Detail
-
getScriptConfiguration
public ItemExportScriptConfiguration getScriptConfiguration()
Description copied from class:DSpaceRunnableThis method will return the Configuration that the implementing DSpaceRunnable uses- Specified by:
getScriptConfigurationin classDSpaceRunnable<ItemExportScriptConfiguration>- Returns:
- The
ScriptConfigurationthat this implementing DspaceRunnable uses
-
setup
public void setup() throws org.apache.commons.cli.ParseExceptionDescription copied from class:DSpaceRunnableThis method has to be included in every script and handles the setup of the script by parsing the CommandLine and setting the variables- Specified by:
setupin classDSpaceRunnable<ItemExportScriptConfiguration>- Throws:
org.apache.commons.cli.ParseException- If something goes wrong
-
internalRun
public void internalRun() throws ExceptionDescription copied from class:DSpaceRunnableThis method has to be included in every script and this will be the main execution block for the script that'll contain all the logic needed- Specified by:
internalRunin classDSpaceRunnable<ItemExportScriptConfiguration>- Throws:
Exception- If something goes wrong
-
validate
protected void validate()
Validate the options
-
process
protected void process(Context context, ItemExportService itemExportService) throws Exception
Process the export- Parameters:
context-- Throws:
Exception
-
setDestDirName
protected void setDestDirName(Context context, ItemExportService itemExportService) throws Exception
Set the destination directory option- Throws:
Exception
-
setZip
protected void setZip(Context context)
Set the zip option
-
setNumber
protected void setNumber()
Set the number option
-
-