Intro
This is a page which briefly describes changes made to the XMLUI in order to support embargoes. This page is to support efforts of others who want similar functionality in the JSPUI. By describing what has been done in the XMLUI, developers more familiar with JSPUI can map the concepts outlined in this document with the JSPUI analog, and provide implementations.
There are really two crucial changes to the XMLUI:
- The
was updated to disallow download of embargoed itemsCode Block BitstreamReader
- The submission interface was updated by adding an embargo step.
There are some "nice to have" features as well:
- Configuration of embargoes by collection
- Displaying embargo metadata in the item view
- Editing the embargo on an item via the Item Editor
In order to make any of the API calls documented below, the developer will need to have a handle on the DspaceEmbargoService. It can be obtained by querying the
Code Block |
---|
PluginManager |
:
Panel |
---|
DspaceEmbargoService embargoSvc = (DspaceEmbargoService) PluginManager.getSinglePlugin( DspaceEmbargoService.class ); |
Download
In the XMLUI, a class named
Code Block |
---|
BitstreamReader |
mediates the download of bitstreams from DSpace. This class had to be updated to disallow downloads of embargoed items. The JSPUI analog of
Code Block |
---|
BitstreamReader |
needs to be updated to disallow the downloading of embargoed items.
The Embargo API call to use is EmbargoService.isEmbargoed( String itemHandle ). Note that the developer will need to walk the DSpace object graph Bitstream->Bundle->Item to get the item handle. The embargo implementation doesn't operate at the bitstream level, only at the item level.
In cases where a user is logged in, a more sophisticated implementation could check to see if the logged in user has permission to bypass an embargo placed on an item. A simple check to see if the user is an administrator is one possibility. The embargo policy subsystem also allows for finer checks via implementations of the PolicyHandler interface. For example, if the logged in user is the same user that submitted the item, the ItemSubmitterPolicyHandler would allow the download. A default implementation of the policy handler can be obtained via the
Code Block |
---|
PluginManager |
:
Panel |
---|
PolicyHandler policyHandler = (PolicyHandler) PluginManager.getSinglePlugin( PolicyHandler.class ); |
Submission Form
Missing File: Embargo_submission_step.png
The embargo submission form used by Johns Hopkins is shown above. The form renders a list of allowed embargo durations for the collection. The form values for the radio buttons are the duration in milliseconds. Ultimately the selected value is set on the
Code Block |
---|
SubmissionInfo |
object by the
Code Block |
---|
org.dspace.submit.step.EmbargoProcessor |
. The form is rendered by
Code Block |
---|
org.dspace.app.xmlui.aspect.submission.submit.EmbargoStep |
.
The Embargo API call used to obtain the list of allowed embargo durations is:
DspaceEmbargoService.getEmbargoProfile( String collectionHandle ). The developer should iterate over the durations in the returned DspaceEmbargoSelectProfile. Note that the API returns the duration lengths in months.
Because embargoes use configurable submission, a JSPUI binding needs to be created which is the analog of the XMLUI binding found in
Code Block |
---|
EmbargoStep |
. The responsibility of the JSPUI binding is to render the values of allowed durations in milliseconds for the collection. The name of the radio button should be
Code Block |
---|
duration |
.
Collection Creation/Edit
Missing File: Embargo_editcollection.png
EditCollectionEmbargoForm
Item Editor
Missing File: Embargo_edititem.png
EditItemStatusForm
Metadata and Download
DSpaceMETSGenerator
BitstreamReader