Drupal Module that allows users to create Bags with Islandora Bagger. Can be run in "remote" or "local" mode, as explained below.
drupal/web/modules/contrib
directory.drush en -y islandora_bagger_integration
.The admin settings form for this module requires the following:
10.0.2.2
as your endpoint IP address instead of localhost
.recipient_email
. In addition, if this option is checked, the message displayed to the user will indicate they will receive an email when their Bag is ready for download.After you configure the admin setting, place the "Islandora Bagger Block" as you normally would any other block. You should restrict this block to the content types of your Islandora nodes, and to user roles who you want to be able to create Bags.
This module's interaction with Islandora Bagger can be configured in two ways:
In both cases, end users generate a Bag for the current object by submitting a simple form (with just one button) in a block. If running in remote mode, the user is told that they will get an email indicating where they can download the Bag (the microservice needs to be configured to send this email); if running in local mode, the user is presented with a link where they can download the Bag.
The advantage of local mode is that the user is presented with the download link immediately after the Bag is generated. The disadvantage of the local mode is that creating the Bag is done synchronously, and there is a risk that, for objects that have very large files, the job will time out.
The advantage of the remote mode is that generating a Bag will never time out because clicking on the "Create Bag" button sends a simple REST request to the remote Islandora Bagger microservice, which then adds the request to a queue to be processed later. This is also a disadvantage, since the user doesn't get to download the Bag until later.
This module comes with two Context Reactions that provide control over the Islandora Bagger configuration.
One of those Reactions allows you to use Islandora Bagger configuration files other than the default. To enable this, do the following:
This module provides no mechanism for uploading configuration files via Drupal's web interface, so you will need access to the Drupal server's file system. Also, do not put configuration files in directories that are accessible via the web, since they contain credentials for accessing your Drupal's REST interface.
The other Reaction allows you to add options to the Islandora Bagger configuration file or override existing options. To enable this, do the following:
serialize: tgz
bag-info: Contact-Email: [email protected] | Custom-Tag: Some value.
plugins: AddBasicTags | AddMedia | AddFedoraTurtle
bag-info
,drupal_basic_auth
,drupal_media_tags
, plugins
, and post_bag_scripts
are pipe-separated lists. For bag-info
, each member of the list is a tag:value pair (separated by a colon). The other list options takes a pipe-separated list of values.
If the option's key exists in the configuration file, that option will be updated with the new value. If the option's key doesn't exist in the configuration file, it will be added. The only exception is bag-info
: for this option, its values provided in the Context Reaction will be merged with any existing values from the configuration file. For example, if the Reaction contains a tag "Contact-Email: [email protected]", and the configuration file contains a "Contact-Email" tag, the existing one will be replaced by the one from the Reaction. If the Reaction contains a tag that does not exist in the configuration file, it will be added as a new tag.
Islandora Bagger can be configured to register the creation of Bags with this module. Each Bag gets an entry in a database table. To do this, each Islandora Bagger configuration file needs to contain the following setting:
register_bags_with_islandora: true
This tells Islandora Bagger to send a REST request to this module to register the creation of the Bag. To configure this module to accept these requests, you must enable the REST endpoint:
Then, back at the list of REST resources, for "Islandora Bagger Integration Bag Log" choose "Permissions" and in the "Islandora Bagger Integration" section, enable the "Log Bag creation" permission for the roles that can populate the log. The user identified in the Islandora Bagger configuration file (in the drupal_basic_auth
option) must be a member of the enabled roles.
The data created by this feature is accessible via Views, but (currently) in a very basic way - you can add fields from this data, but not filters or relationships (see issue to add these).
This module defines a hook that allows other modules to modify the Islandora Bagger configuration, in both remote and local modes. See islandora_bagger_integration.api.php
for details.
See issue list.