Class Packager


  • public class Packager
    extends Object
    Command-line interface to the Packager plugin.

    This class ONLY exists to provide a CLI for the packager plugins. It does not "manage" the plugins and it is not called from within DSpace, but the name follows a DSpace convention.

    It can invoke one of the Submission (SIP) packagers to create a new DSpace Item out of a package, or a Dissemination (DIP) packager to write an Item out as a package.

    Usage is as follows:
    (Add the -h option to get the command to show its own help)

      1. To submit a SIP  (submissions tend to create a *new* object, with a new handle.  If you want to restore an
      object, see -r option below)
       dspace packager
           -e {ePerson}
           -t {PackagerType}
           -p {parent-handle} [ -p {parent2} ...]
           [-o {name}={value} [ -o {name}={value} ..]]
           [-a] --- also recursively ingest all child packages of the initial package
                    (child pkgs must be referenced from parent pkg)
           [-w]   --- skip Workflow
           {package-filename}
    
       {PackagerType} must match one of the aliases of the chosen Packager
       plugin.
    
       The "-w" option circumvents Workflow, and is optional.  The "-o"
       option, which may be repeated, passes options to the packager
       (e.g. "metadataOnly" to a DIP packager).
    
      2. To restore an AIP  (similar to submit mode, but attempts to restore with the handles/parents specified in AIP):
       dspace packager
           -r     --- restores a object from a package info, including the specified handle (will throw an error if
           handle is already in use)
           -e {ePerson}
           -t {PackagerType}
           [-o {name}={value} [ -o {name}={value} ..]]
           [-a] --- also recursively restore all child packages of the initial package
                    (child pkgs must be referenced from parent pkg)
           [-k]   --- Skip over errors where objects already exist and Keep Existing objects by default.
                      Use with -r to only restore objects which do not already exist.  By default, -r will throw an error
                      and rollback all changes when an object is found that already exists.
           [-f]   --- Force a restore (even if object already exists).
                      Use with -r to replace an existing object with one from a package (essentially a delete and
                      restore).
                      By default, -r will throw an error and rollback all changes when an object is found that already
                      exists.
           [-i {identifier-handle-of-object}] -- Optional when -f is specified.  When replacing an object, you can
           specify the
                      object to replace if it cannot be easily determined from the package itself.
           {package-filename}
    
       Restoring is very similar to submitting, except that you are recreating pre-existing objects.  So, in a restore,
       the object(s) are
       being recreated based on the details in the AIP.  This means that the object is recreated with the same handle
       and same parent/children
       objects.  Not all {PackagerTypes} may support a "restore".
    
      3. To write out a DIP:
       dspace packager
           -d
           -e {ePerson}
           -t {PackagerType}
           -i {identifier-handle-of-object}
           [-a] --- also recursively disseminate all child objects of this object
           [-o {name}={value} [ -o {name}={value} ..]]
           {package-filename}
    
       The "-d" switch chooses a Dissemination packager, and is required.
       The "-o" option, which may be repeated, passes options to the packager
       (e.g. "metadataOnly" to a DIP packager).
     
    Note that {package-filename} may be "-" for standard input or standard output, respectively.
    Version:
    $Revision$
    Author:
    Larry Stone, Tim Donohue