org.dspace.content.packager
Class RoleDisseminator

java.lang.Object
  extended by org.dspace.content.packager.RoleDisseminator
All Implemented Interfaces:
PackageDisseminator

public class RoleDisseminator
extends Object
implements PackageDisseminator

Plugin to export all Group and EPerson objects in XML, perhaps for reloading.

Author:
Mark Wood

Field Summary
static String CAN_LOGIN
           
static String DSPACE_ROLES
           
static org.jdom.Namespace DSROLES_NS
          DSpace Roles XML Namespace in JDOM form.
static String EMAIL
           
static String EPERSON
           
static String EPERSONS
           
static String FIRST_NAME
           
static String GROUP
           
static String GROUP_TYPE_ADMIN
           
static String GROUP_TYPE_SUBMIT
           
static String GROUP_TYPE_WORKFLOW_STEP_1
           
static String GROUP_TYPE_WORKFLOW_STEP_2
           
static String GROUP_TYPE_WORKFLOW_STEP_3
           
static String GROUPS
           
static String ID
           
static String LANGUAGE
           
static String LAST_NAME
           
static String MEMBER
           
static String MEMBER_GROUP
           
static String MEMBER_GROUPS
           
static String MEMBERS
           
static String NAME
           
static String NETID
           
static String PASSWORD_HASH
           
static String REQUIRE_CERTIFICATE
           
static String SELF_REGISTERED
           
static String TYPE
           
 
Constructor Summary
RoleDisseminator()
           
 
Method Summary
 void disseminate(Context context, DSpaceObject object, PackageParameters params, File pkgFile)
          Export the object (Item, Collection, or Community) as a "package" on the indicated OutputStream.
 List<File> disseminateAll(Context context, DSpaceObject dso, PackageParameters params, File pkgFile)
          Recursively export one or more DSpace Objects as a series of packages.
 String getMIMEType(PackageParameters params)
          Identifies the MIME-type of this package, e.g.
 String getParameterHelp()
          Returns a user help string which should describe the additional valid command-line options that this packager implementation will accept when using the -o or --option flags with the Packager script.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DSROLES_NS

public static final org.jdom.Namespace DSROLES_NS
DSpace Roles XML Namespace in JDOM form.


DSPACE_ROLES

public static final String DSPACE_ROLES
See Also:
Constant Field Values

ID

public static final String ID
See Also:
Constant Field Values

GROUPS

public static final String GROUPS
See Also:
Constant Field Values

GROUP

public static final String GROUP
See Also:
Constant Field Values

NAME

public static final String NAME
See Also:
Constant Field Values

TYPE

public static final String TYPE
See Also:
Constant Field Values

MEMBERS

public static final String MEMBERS
See Also:
Constant Field Values

MEMBER

public static final String MEMBER
See Also:
Constant Field Values

MEMBER_GROUPS

public static final String MEMBER_GROUPS
See Also:
Constant Field Values

MEMBER_GROUP

public static final String MEMBER_GROUP
See Also:
Constant Field Values

EPERSONS

public static final String EPERSONS
See Also:
Constant Field Values

EPERSON

public static final String EPERSON
See Also:
Constant Field Values

EMAIL

public static final String EMAIL
See Also:
Constant Field Values

NETID

public static final String NETID
See Also:
Constant Field Values

FIRST_NAME

public static final String FIRST_NAME
See Also:
Constant Field Values

LAST_NAME

public static final String LAST_NAME
See Also:
Constant Field Values

LANGUAGE

public static final String LANGUAGE
See Also:
Constant Field Values

PASSWORD_HASH

public static final String PASSWORD_HASH
See Also:
Constant Field Values

CAN_LOGIN

public static final String CAN_LOGIN
See Also:
Constant Field Values

REQUIRE_CERTIFICATE

public static final String REQUIRE_CERTIFICATE
See Also:
Constant Field Values

SELF_REGISTERED

public static final String SELF_REGISTERED
See Also:
Constant Field Values

GROUP_TYPE_ADMIN

public static final String GROUP_TYPE_ADMIN
See Also:
Constant Field Values

GROUP_TYPE_SUBMIT

public static final String GROUP_TYPE_SUBMIT
See Also:
Constant Field Values

GROUP_TYPE_WORKFLOW_STEP_1

public static final String GROUP_TYPE_WORKFLOW_STEP_1
See Also:
Constant Field Values

GROUP_TYPE_WORKFLOW_STEP_2

public static final String GROUP_TYPE_WORKFLOW_STEP_2
See Also:
Constant Field Values

GROUP_TYPE_WORKFLOW_STEP_3

public static final String GROUP_TYPE_WORKFLOW_STEP_3
See Also:
Constant Field Values
Constructor Detail

RoleDisseminator

public RoleDisseminator()
Method Detail

disseminate

public void disseminate(Context context,
                        DSpaceObject object,
                        PackageParameters params,
                        File pkgFile)
                 throws PackageException,
                        CrosswalkException,
                        AuthorizeException,
                        SQLException,
                        IOException
Description copied from interface: PackageDisseminator
Export the object (Item, Collection, or Community) as a "package" on the indicated OutputStream. Package is any serialized representation of the item, at the discretion of the implementing class. It does not have to include content bitstreams.

Use the params parameter list to adjust the way the package is made, e.g. including a "metadataOnly" parameter might make the package a bare manifest in XML instead of a Zip file including manifest and contents.

Throws an exception of the chosen object is not acceptable or there is a failure creating the package.

Specified by:
disseminate in interface PackageDisseminator
Parameters:
context - DSpace context.
object - DSpace object (item, collection, etc)
params - Properties-style list of options specific to this packager
pkgFile - File where export package should be written
Throws:
PackageValidationException - if package cannot be created or there is a fatal error in creating it.
PackageException
CrosswalkException
AuthorizeException
SQLException
IOException

disseminateAll

public List<File> disseminateAll(Context context,
                                 DSpaceObject dso,
                                 PackageParameters params,
                                 File pkgFile)
                          throws PackageException,
                                 CrosswalkException,
                                 AuthorizeException,
                                 SQLException,
                                 IOException
Description copied from interface: PackageDisseminator
Recursively export one or more DSpace Objects as a series of packages. This method will export the given DSpace Object as well as all referenced DSpaceObjects (e.g. child objects) into a series of packages. The initial object is exported to the location specified by the pkgFile. All other generated packages are recursively exported to the same directory.

Package is any serialized representation of the item, at the discretion of the implementing class. It does not have to include content bitstreams.

Use the params parameter list to adjust the way the package is made, e.g. including a "metadataOnly" parameter might make the package a bare manifest in XML instead of a Zip file including manifest and contents.

Throws an exception of the initial object is not acceptable or there is a failure creating the packages.

A packager may choose not to implement disseminateAll, or simply forward the call to disseminate if it is unable to support recursive dissemination.

Specified by:
disseminateAll in interface PackageDisseminator
Parameters:
context - DSpace context.
dso - initial DSpace object
params - Properties-style list of options specific to this packager
pkgFile - File where initial package should be written. All other packages will be written to the same directory as this File.
Returns:
List of all package Files which were successfully disseminated
Throws:
PackageValidationException - if package cannot be created or there is a fatal error in creating it.
PackageException
CrosswalkException
AuthorizeException
SQLException
IOException

getMIMEType

public String getMIMEType(PackageParameters params)
Description copied from interface: PackageDisseminator
Identifies the MIME-type of this package, e.g. "application/zip". Required when sending the package via HTTP, to provide the Content-Type header.

Specified by:
getMIMEType in interface PackageDisseminator
Returns:
the MIME type (content-type header) of the package to be returned

getParameterHelp

public String getParameterHelp()
Returns a user help string which should describe the additional valid command-line options that this packager implementation will accept when using the -o or --option flags with the Packager script.

Specified by:
getParameterHelp in interface PackageDisseminator
Returns:
a string describing additional command-line options available with this packager


Copyright © 2011 DuraSpace. All Rights Reserved.