DSpace/DSpace — pull request #650 by kutsurak (2014-09-17 08:16:19+00:00)
Title: DS-1933 Enhancement for cli batch import regarding collections

Jira Issue: https://jira.duraspace.org/browse/DS-1933

Documentation (to be included in https://wiki.duraspace.org/display/DSDOC5x/Importing+and+Exporting+Items+via+Simple+Archive+Format)

* Importing (per item) into multiple collections from the command line administration tool

If you omit the -c flag, which normally is mandatory, the
ItemImporter searches for a file named in each item
directory. This file should contain a list of collections, one per
line, specified either by their handle, or by their internal db
id. The ItemImporter then will put the item in each of the specified
collections. The owning collection is the collection specified in
the first line of the collections file.

If both the -c flag is specified and the collections file exists in
the item directory, the ItemImporter will ignore the collections
file and will put the item in the collection specified on the
command line.

Since the collections file can differ between item directories, you
have more fine grained control of the process of batch adding items
to collections.

** BTE Import

The DSpaceOutputGenerator, that writes the metadata in DSpace
Simple Archive Format, has been updated to produce the collections
file, if a metadata field named collections (reserved word) exists
in the original metadata. This is mainly applicable to the CSV
input format which is more flexible, but could also be
implemented with a Modifier that adds the collections field to
each Record in the BTE pipeline.

Important note: an entry with key "collections" should be in the
output map that is used by the DSpaceOutputGenerator.