Unsupported Release
This documentation relates to DSpace 1.8.x, an old, unsupported version. Looking for another version? See all documentation.
As of January 2015, DSpace 1.8.x is no longer supported. We recommend upgrading to a more recent version of DSpace. See DSpace Software Support Policy.
Updating Items via Simple Archive Format
Item Update Tool
ItemUpdate is a batch-mode command-line tool for altering the metadata and bitstream content of existing items in a DSpace instance. It is a companion tool to ItemImport and uses the DSpace simple archive format to specify changes in metadata and bitstream contents. Those familiar with generating the source trees for ItemImporter will find a similar environment in the use of this batch processing tool.
For metadata, ItemUpdate can perform 'add' and 'delete' actions on specified metadata elements. For bitstreams, 'add' and 'delete' are similarly available. All these actions can be combined in a single batch run.
ItemUpdate supports an undo feature for all actions except bitstream deletion. There is also a test mode, as with ItemImport. However, unlike ItemImport, there is no resume feature for incomplete processing. There is more extensive logging with a summary statement at the end with counts of successful and unsuccessful items processed.
One probable scenario for using this tool is where there is an external primary data source for which the DSpace instance is a secondary or down-stream system. Metadata and/or bitstream content changes in the primary system can be exported to the simple archive format to be used by ItemUpdate to synchronize the changes.
A note on terminology: item refers to a DSpace item. metadata element refers generally to a qualified or unqualified element in a schema in the form [schema].[element].[qualifier]
or [schema].[element]
and occasionally in a more specific way to the second part of that form. metadata field refers to a specific instance pairing a metadata element to a value.
DSpace Simple Archive Format
As with ItemImporter, the idea behind the DSpace's simple archive format is to create an archive directory with a subdirectory per item. There are a few additional features added to this format specifically for ItemUpdate. Note that in the simple archive format, the item directories are merely local references and only used by ItemUpdate in the log output.
The user is referred to the previous section DSpace Simple Archive Format.
Additionally, the use of a delete_contents is now available. This file lists the bitstreams to be deleted, one bitstream ID per line. Currently, no other identifiers for bitstreams are usable for this function. This file is an addition to the Archive format specifically for ItemUpdate.
The optional suppress_undo file is a flag to indicate that the 'undo archive' should not be written to disk. This file is usually written by the application in an undo archive to prevent a recursive undo. This file is an addition to the Archive format specifically for ItemUpdate.
ItemUpdate Commands
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="0238cd45-25f6-422c-8f1b-6185c74aee97"><ac:plain-text-body><![CDATA[ |
Command used: |
|
]]></ac:plain-text-body></ac:structured-macro> |
Java class: |
org.dspace.app.itemupdate.ItemUpdate |
||
Arguments short and (long) forms: |
Description |
||
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="c3a3b9d4-094f-47ba-a09e-c2d101698f17"><ac:plain-text-body><![CDATA[ |
|
Repeatable for multiple elements. The metadata element should be in the form dc.x or dc.x.y. The mandatory argument indicates the metadata fields in the dublin_core.xml file to be added unless already present (multiple fields should be separated by a semicolon ';'). However, duplicate fields will not be added to the item metadata without warning or error. |
]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="16deb7bc-46f5-44f5-8798-5ce83bc4b135"><ac:plain-text-body><![CDATA[ |
|
Repeatable for multiple elements. All metadata fields matching the element will be deleted. |
]]></ac:plain-text-body></ac:structured-macro> |
|
Adds bitstreams listed in the contents file with the bitstream metadata cited there. |
||
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="3ec4c264-890c-45b9-9e0d-6eb0bace9884"><ac:plain-text-body><![CDATA[ |
|
Not repeatable. With no argument, this operation deletes bitstreams listed in the |
]]></ac:plain-text-body></ac:structured-macro> |
|
Displays brief command line help. |
||
|
Email address of the person or the user's database ID (Required) |
||
|
Directory archive to process (Required) |
||
|
Specifies the metadata field that contains the item's identifier; Default value is "dc.identifier.uri" (Optional) |
||
|
Runs the process in test mode with logging. But no changes applied to the DSpace instance. (Optional) |
||
|
Prevents any changes to the provenance field to represent changes in the bitstream content resulting from an Add or Delete. In other words, when this flag is specified, no new provenance information is added to the DSpace Item when adding/deleting a bitstream. No provenance statements are written for thumbnails or text derivative bitstreams, in keeping with the practice of MediaFilterManager. (Optional) |
||
|
The filter properties files to be used by the delete bitstreams action (Optional) |
||
|
Turn on verbose logging. |
CLI Examples
Adding Metadata:
[dspace]/bin/dspace itemupdate -e joe@user.com -s [path/to/archive] -a dc.description
This will add from your archive the dc element description based on the handle from the URI (since the{{-i}} argument wasn't used).