public class RoleDisseminator extends Object implements PackageDisseminator
| Modifier and Type | Class and Description |
|---|---|
protected class |
RoleDisseminator.Serializer
Embody a thread for serializing users and groups.
|
| Modifier and Type | Field and Description |
|---|---|
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 |
protected EPersonService |
ePersonService |
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 |
protected GroupService |
groupService |
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_DIGEST |
static String |
PASSWORD_HASH |
static String |
PASSWORD_SALT |
static String |
REQUIRE_CERTIFICATE |
static String |
SELF_REGISTERED |
static String |
TYPE |
| Constructor and Description |
|---|
RoleDisseminator() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected List<Group> |
findAssociatedGroups(Context context,
DSpaceObject object)
Find all Groups associated with this DSpace Object.
|
protected List<EPerson> |
findAssociatedPeople(Context context,
DSpaceObject object)
Find all EPeople associated with this DSpace Object.
|
protected String |
getGroupType(DSpaceObject dso,
Group group)
Return a Group Type string (see RoleDisseminator.GROUP_TYPE_* constants)
which describes the type of group and its relation to the given object.
|
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. |
protected void |
writeEPerson(EPerson eperson,
XMLStreamWriter writer,
boolean emitPassword)
Emit XML describing a single EPerson.
|
protected void |
writeGroup(Context context,
DSpaceObject relatedObject,
Group group,
XMLStreamWriter writer)
Emit XML describing a single Group.
|
protected void |
writeToStream(Context context,
DSpaceObject object,
OutputStream stream,
boolean emitPasswords)
Serialize users and groups to a stream.
|
public static final org.jdom.Namespace DSROLES_NS
public static final String DSPACE_ROLES
public static final String ID
public static final String GROUPS
public static final String GROUP
public static final String NAME
public static final String TYPE
public static final String MEMBERS
public static final String MEMBER
public static final String MEMBER_GROUPS
public static final String MEMBER_GROUP
public static final String EPERSONS
public static final String EPERSON
public static final String EMAIL
public static final String NETID
public static final String FIRST_NAME
public static final String LAST_NAME
public static final String LANGUAGE
public static final String PASSWORD_HASH
public static final String PASSWORD_DIGEST
public static final String PASSWORD_SALT
public static final String CAN_LOGIN
public static final String REQUIRE_CERTIFICATE
public static final String SELF_REGISTERED
public static final String GROUP_TYPE_ADMIN
public static final String GROUP_TYPE_SUBMIT
public static final String GROUP_TYPE_WORKFLOW_STEP_1
public static final String GROUP_TYPE_WORKFLOW_STEP_2
public static final String GROUP_TYPE_WORKFLOW_STEP_3
protected final EPersonService ePersonService
protected final GroupService groupService
public void disseminate(Context context, DSpaceObject object, PackageParameters params, File pkgFile) throws PackageException, CrosswalkException, AuthorizeException, SQLException, IOException
PackageDisseminator
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.
disseminate in interface PackageDisseminatorcontext - DSpace context.object - DSpace object (item, collection, etc)params - Properties-style list of options specific to this packagerpkgFile - File where export package should be writtenPackageValidationException - if package cannot be created or there is
a fatal error in creating it.CrosswalkException - if crosswalk errorAuthorizeException - if authorization errorSQLException - if database errorIOException - if IO errorPackageExceptionprotected void writeToStream(Context context, DSpaceObject object, OutputStream stream, boolean emitPasswords) throws PackageException
context - current Contextobject - DSpaceObjectstream - receives the output. Is not closed by this method.emitPasswords - true if password hashes should be included.PackageException - if errorpublic List<File> disseminateAll(Context context, DSpaceObject dso, PackageParameters params, File pkgFile) throws PackageException, CrosswalkException, AuthorizeException, SQLException, IOException
PackageDisseminatorPackage 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.
disseminateAll in interface PackageDisseminatorcontext - DSpace context.dso - initial DSpace objectparams - Properties-style list of options specific to this packagerpkgFile - File where initial package should be written. All other
packages will be written to the same directory as this File.PackageValidationException - if package cannot be created or there is
a fatal error in creating it.CrosswalkException - if crosswalk errorAuthorizeException - if authorization errorSQLException - if database errorIOException - if IO errorPackageExceptionpublic String getMIMEType(PackageParameters params)
PackageDisseminator"application/zip".
Required when sending the package via HTTP, to
provide the Content-Type header.getMIMEType in interface PackageDisseminatorparams - Package Parametersprotected void writeGroup(Context context, DSpaceObject relatedObject, Group group, XMLStreamWriter writer) throws XMLStreamException, PackageException
context - the DSpace ContextrelatedObject - the DSpaceObject related to this group (if any)group - the Group to describewriter - the description to this streamXMLStreamException - if XML errorPackageException - if packaging errorprotected String getGroupType(DSpaceObject dso, Group group)
As a basic example, if the Group is a Collection Administration group, the Group Type string returned should be "ADMIN"
If type string cannot be determined, null is returned.
dso - the related DSpaceObjectgroup - the groupprotected void writeEPerson(EPerson eperson, XMLStreamWriter writer, boolean emitPassword) throws XMLStreamException
eperson - the EPerson to describewriter - the description to this streamemitPassword - do not export the password hash unless trueXMLStreamException - if XML errorprotected List<Group> findAssociatedGroups(Context context, DSpaceObject object) throws SQLException
If object is SITE, all groups are returned.
If object is COMMUNITY or COLLECTION, only groups associated with those objects are returned (if any).
For all other objects, null is returned.
context - The DSpace contextobject - the DSpace objectSQLException - if database errorprotected List<EPerson> findAssociatedPeople(Context context, DSpaceObject object) throws SQLException
If object is SITE, all people are returned.
For all other objects, null is returned.
context - The DSpace contextobject - the DSpace objectSQLException - if database errorpublic String getParameterHelp()
-o or
--option flags with the Packager script.getParameterHelp in interface PackageDisseminatorCopyright © 2017 DuraSpace. All rights reserved.