Using the command line Item Importer with ZIP file
DS-204 doesn't appear to work correctly, crashing on ZIP'ed content, that is valid SimpleArchiveFormat.
I had tried to use the item importer with ZIP with content that I created with SAFBuilder, and also with content that DSpace had created, using Item Export (from the UI), or Export Collection (from the UI). The issue that I'm having with the item importer with zip, is that it is expecting the input to not contain a subdirectory, where as, all of these ZIP's create a middle subdirectory.
See stacktrace, the input was valid SimpleArchiveFormat, zipped up. https://gist.github.com/peterdietz/d8bee7d31fc4262efce7
Might have worked in the old-way: item_export-123.zip, which extracts to:
- item_0/(content, dublin_core.xml, file0.pdf)
- item_1/(content, dublin_core.xml, file1.pdf)
However, most ZIP's appear to unzip looking like:
- item_export-123/item_0/(content, dublin_core.xml, file0.pdf)
- item_export-123/item_1/(content, dublin_core.xml, file1.pdf)
So, to accept this format, you need the item import --zip to bump the sourceDirectory with that sub directory.
I have a fix for this, which I will attach shortly, and would appreciate testing before and after.
P.S. To use the Item Importer with ZIP, you do:
/dspace/bin/dspace import -a -e firstname.lastname@example.org -c 123456789/123 -s /path/to/directory/ -z file.zip -m /path/to/import.map
Where the --source is set to the directory the zip lives in, and --zip is set to the filename of the zip, exclusive of any path info.