Skip to content

mjordan/islandora_feeds

Repository files navigation

Islandora Feeds

Introduction

This module allows users to create Islandora objects using the Drupal Feeds contrib module. Additional documentation is available on the wiki.

Note that people interested in this module should consider using the Islandora XML Solution Pack. It is both much simpler than this one (which was probably over-engineered in the first place) and offers many more ways of presenting XML content to end users. That said, if integration with Feeds is something you really need, please open an issue and say so.

Requirements

Feeds

Optional modules

Installation

Install as usual, see this for further information.

Usage

Overview

This module provides a Feeds processor that creates Islandora objects. Currently, the only datastream that is created is a managed XML datastream (with the datastream ID of 'OBJ') that contains elements mirroring the column headings in CSV files (or equivalent in other input formats) you are loading using Feeds, with element values that correspond to the values in the columns. You can also import thumbnails for the Islandora objects created with this module.

This module differs from the Islandora Data Solution Pack in that it creates an Islandora object for each row in a CSV file, whereas that module creates an Islandora object for an Excel, LibreOffice, or CSV file as a whole.

For example, given a CSV file like this as input:

Title, Field 1, Field 2, Field 3
"A sample Islandora object","The first field's value", "The second field's value", "The third field's value"
"Second title","Second item's field 1 value", "Second item's field 2 value", "Second item's field 3 value"
"Third title","Third item's field 1 value", "Third item's field 2 value", "Third item's field 3 value"

the module ingests Islandora objects, one per row of the CSV, each with an OBJ datastream that looks like:

<fielddata>
  <title label="Title">A sample Islandora object</title>
  <field_1 label="First field">The first field's value</field_1>
  <field_2 label="Second field">The second field's value</field_2>
  <field_3 label="Third field">The third field's value</field_3>
</fielddata>

Field labels and values are displayed by default in a vertical table layout, like this:

Sample display

Islandora Feeds uses a version of the Feeds Node processor to create a node for each item you are importing. Each node then serves as the source of the Islandora object that is created. You have the option of keeping these nodes (for quality assurance) or deleting them immediately after the Islandora object is created. You also have the option of importing the data into nodes but creating the corresponding Islandora objects later, using Views Bulk Operations.

The specific elements in the OBJ datastream are defined in a Drupal content type. Prior to using Feeds to import your data, you need to create a Drupal content type that contains all the fields corresponding to the data in your incoming Feed source and then map the incoming data to those fields using the standard tool provided by Feeds. The nodes created during the import are instances of this content type, and each node generates a corresponding Islandora object. All objects created by this module share a single Islandora content model (Islandora Feeds Content Model / islandora:feedsCModel), but the XML datastreams generated by the module (whether via a Feeds import or via add/edit forms created by the XML Forms Builder) can have different fields across collections.

Configuration

This module does not have its own configuration form. All configuration is done in the Feeds Importer configuration tool as described below.

Creating objects

First, create a Drupal content type containing the fields that you want to have in your OBJ XML datastreams. The XML element names will correspond to the content type field names minus the "field_" prefix that Drupal adds (for example, a content type field with the machine name "field_my_first_field" will create a <my_first_field> element in your OBJ datastream). The labels your assign to your fields will be used in the display of the OBJ datastream, as illustrated above. All your fields should be of type 'text' and use the 'textfield' widget.

Note that nodes created during the import do not have any continuing relationship to the objects ingested into Fedora after the objects are created - they are only used as the source of the ingest and are not synchronized with the objects after the import.

The collection you want to import objects into mush have "Islandora Feeds Content Model (islandora:feedsCModel)" enabled in its collection policy.

After you have created your Drupal content type and enabled the Islandora Feeds Content Model in your target collection, configure your Feed importer by going to Structure > Feeds importers > Add importer and create a new importer. Attach your Drupal content type to the importer. Other settings are as follows.

Basic settings

  • Attach to content type: select "Use standalone form"
  • Periodic import: Off
  • Import on submission: Check this if you want to start a batch import by creating a single node of your content type

Fetcher

  • Choose File upload
  • Under Settings, use the defaults

Parser

  • Choose CSV parser
  • Under Settings, choose your preferences

Processor

  • Choose Islandora Feeds node processor
  • Under Settings, choose:
    • the Bundle that corresponds to your Drupal content type
    • the target collection and namespace
    • Ingest objects (check if you want to ingest your Islandora objects during the Feeds import; uncheck if you want to ingest your objects in a separate step, for example, after you upload thumbnail images to the nodes or perform quality control on the node content)
    • Keep nodes (check if you want to keep the nodes for the reasons mentioned under "Ingest objects", for example; uncheck if you want the nodes to be automatically deleted after the Islandora objects are ingested).
    • Choose whether you want the nodes to be published or unpublished.
    • Under Author, the Drupal user that will be assigned to be the owner of the Islandora objects.
    • Choose whether you want the nodes to "expire" (be deleted) automatically at a certain point in the future.
  • Under Mapping, under "Source" enter the column headings in your CSV file, and under "Target" select the field in the Drupal content type where you want the value to be added. Make sure that one of the mappings is defined as unique. You do not need to map any of the node properties but you may do so if you want their values in your OBJ datastreams.

Once you have configured the importer, you're ready to import your source content like you would using any other Feeds importer. For example, if you chose "Use standalone form" in the "Basic settings" section above, you can import your content by clicking on the "Import" menu item in your site's navigation menu and selecting the Feeds importer you just configured.

If you choose to create your Islandora objects at a time after importing the Feeds data (for example, because you want to do some QA on the nodes before creating Islandora objects from them), you can do so by using Views Bulk Operations. Create a view listing objects in your content type, and use the "Create Islandora objects from nodes" action. Any changes you make to your nodes before you create your Islandora objects (including uploading of thumbnails) will be reflected in the new objects.

Generating an XML Forms definition file and XSD Schema for your objects

If you want to create add/edit forms for your objects using the Islandora XML Forms Builder, the Islandora Feeds module provides an auto-generated form definition file. You can get this file by going to Structure > [your Drupal content type] > edit > Islandora Feeds. Simply copy the form schema into a file (ending in .xml) and import it into the Form Builder. You can also dowload an XSD Schema for your content type from this page.

Search

The data in the XML datastreams in the objects created by this module is indexed in Solr with no additional configuration. However, currently no field-specific search is available. Advanced search for these objects would be an awesome addition, if someone wants to take it on.

Deriving other datastreams from the OBJ datastream

Islandora Feeds only generates flat XML datastreams with the DSID 'OBJ'. However, it is possible to derive other XML datastreams from the OJB datastream created by this module using XSL stylesheets. A helper module called Islandora Feeds Derivs is provided in the /modules directory to help you do this.

Generating "other datastreams" means you can import CSV data and turn it into MODS datastreams. For instance, if you have CSV data that describes still images, you can import it using Islandora Feeds, write an XSL stylesheet that transforms the resulting OBJ datastreams into MODS, and configure Islandora Feeds Derivs to create the MODS datastreams. That module has options to delete the OBJ datastream, change the content model (to islandora:sp_basic_image, for example) and share the objects with other collections (such as your collection that contains still images). You will need to upload the images manually, though. This sort of workflow, while containing quite a few steps, may be useful if you want to import CSV data into an existing collection.

Notes

  • Mapping a source field that is a number to the title won’t work. Islandora defaults to sequential numbering as a label when you attempt it.
  • When deleting nodes, the error message suggests you’ve deleted Islandora objects. This is not accurate - only the Drupal content is deleted.

To do

  • Provide tutorial/cookbook entry on building CRUD forms using the XML Forms Builder.
  • Fielded search on OBJ datastream XML content.

Troubleshooting/issues/feedback

Use cases are welcome. The goal of this module is to leverage as much of Feeds' built-in functionality as possible while providing the ability to load a wide range of data into Islandora. If you have any questions or comments, please post them to:

About

Feeds module for importing Islandora objects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published