Package org.dspace.app.itemupdate
Class ItemUpdate
- java.lang.Object
-
- org.dspace.app.itemupdate.ItemUpdate
-
public class ItemUpdate extends Object
Provides some batch editing capabilities for items in DSpace: Metadata fields - Add, Delete Bitstreams - Add, Delete The design has been for compatibility with ItemImporter in the use of the DSpace archive format which is used to specify changes on a per item basis. The directory names to correspond to each item are arbitrary and will only be used for logging purposes. The reference to the item is from a required dc.identifier with the item handle to be included in the dublin_core.xml (or similar metadata) file. Any combination of these actions is permitted in a single run of this class The order of actions is important when used in combination. It is the responsibility of the calling class (here, ItemUpdate) to register UpdateAction classes in the order to which they are to be performed. It is unfortunate that so much code needs to be borrowed from ItemImport as it is not reusable in private methods, etc. Some of this has been placed into the MetadataUtilities class for possible reuse elsewhere.- Author:
- W. Hays based on a conceptual design by R. Rodgers
-
-
Field Summary
Fields Modifier and Type Field Description protected ActionManageractionMgrstatic StringCONTENTS_FILEstatic StringDELETE_CONTENTS_FILEprotected Stringepersonprotected static EPersonServiceepersonServicestatic Map<String,String>filterAliasesstatic StringHANDLE_PREFIXprotected static HandleServicehandleServiceprotected static ItemServiceitemServicestatic StringSUPPRESS_UNDO_FILENAMEprotected List<String>undoActionListstatic booleanverbose
-
Constructor Summary
Constructors Constructor Description ItemUpdate()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FileinitUndoArchive(File sourceDir)to avoid overwriting the undo source tree on repeated processing sequence numbers are added and checkedstatic voidmain(String[] argv)protected voidprocessArchive(Context context, String sourceDirPath, String itemField, String metadataIndexName, boolean alterProvenance, boolean isTest)process an archiveprotected voidsetEPerson(Context context, String eperson)Set EPerson doing import
-
-
-
Field Detail
-
SUPPRESS_UNDO_FILENAME
public static final String SUPPRESS_UNDO_FILENAME
- See Also:
- Constant Field Values
-
CONTENTS_FILE
public static final String CONTENTS_FILE
- See Also:
- Constant Field Values
-
DELETE_CONTENTS_FILE
public static final String DELETE_CONTENTS_FILE
- See Also:
- Constant Field Values
-
HANDLE_PREFIX
public static String HANDLE_PREFIX
-
verbose
public static boolean verbose
-
epersonService
protected static final EPersonService epersonService
-
itemService
protected static final ItemService itemService
-
handleService
protected static final HandleService handleService
-
actionMgr
protected ActionManager actionMgr
-
eperson
protected String eperson
-
-
Method Detail
-
main
public static void main(String[] argv)
- Parameters:
argv- the command line arguments given
-
processArchive
protected void processArchive(Context context, String sourceDirPath, String itemField, String metadataIndexName, boolean alterProvenance, boolean isTest) throws Exception
process an archive- Parameters:
context- DSpace ContextsourceDirPath- source pathitemField- item fieldmetadataIndexName- index namealterProvenance- whether to alter provenanceisTest- test flag- Throws:
Exception- if error
-
initUndoArchive
protected File initUndoArchive(File sourceDir) throws FileNotFoundException, IOException
to avoid overwriting the undo source tree on repeated processing sequence numbers are added and checked- Parameters:
sourceDir- - the original source directory- Returns:
- the directory of the undo archive
- Throws:
FileNotFoundException- if file doesn't existIOException- if IO error
-
-