This documentation refers to an earlier version of Islandora. https://wiki.duraspace.org/display/ISLANDORA/Start is current.

Overview

The Islandora Solr Views module adds Islandora Solr as an option when creating or editing views with the Drupal Views module. This means you can author Drupal Views that pull metadata from Solr documents, and makes it possible to construct new types of visualizations and access points for collections, and new ways of authoring Views blocks using things like contextual filters. This module is most useful to those with some experience with Drupal Views in 7.x and its features. In short, anything one could do with Drupal Views - e.g. create pages that contain the OCR output of books, or create blocks with short at-a-glance lists of new objects added to a particular collection - can be done with Islandora's Solr index.

Dependencies

  • A functioning, properly-indexed Islandora Solr (Copy) installation
  • Drupal Views (3.x) module
  • The Drupal Views UI module (part of the above Drupal Views module) should be enabled if you would like to create views from inside Drupal itself

Downloads

Release Notes and Downloads

Code Repository

https://github.com/Islandora/islandora_solr_views

Installation

Install as usual, see this for further information.

Usage

Islandora Solr Views is a small bit of extra functionality on Drupal Views.  This Duraspace Islandora wiki doesn't cover Drupal in general, but for this specific module, it's very helpful to have worked through some tutorials about "Views" in Drupal 7, so you know the context and how Views are used to make a user interface.  Views is heavily rooted in Drupal, and Islandora Solr Views brings in a bit more interaction with the Islandora objects on the site.

To enable Solr Views:

  • Click to "Modules" and check that the following modules are enabled: "Drupal Views", "Drupal Views UI", "Islandor Solr Views", and "Islandora Solr Search" modules.  If enabling any of those pops up a message about enabling dependent modules, then click yes to enabling those.
  • Click to "People", then "Permissions", and check that your user account has permission to "Administer Views".

When those are enabled, the Views configuration screen should be available by clicking to "Structure" then "Views" (at http://path.to.your.site/admin/structure/views ). From here, you can click 'Add new view' to start creating a Solr View.

On the next screen, enter a name for your view, and from the 'Show' drop-down menu, select 'Islandora Solr'.   This extra drop down menu option is the meat of what Islandora Solr Views is doing to build on Drupal's built-in Views.

You can now click the 'Continue & Edit' button if you'd like to manipulate the view now, or 'Save & Exit' if you would like to edit it later.

From here, most of the configuration and setup for your view is exactly the same as for any other view, with a few significant differences. Islandora Solr Views adds Solr indices to the FIELDS, FILTER CRITERIA and SORT CRITERIA sections.

Tutorial: Creating a block that contains the latest objects in a collection

This tutorial assumes a fresh installation of Islandora with the default Solr and Gsearch setups, and that the Basic Image Solution Pack has been installed and contains images.

  1. Create a new View

    • Click to "Structure" then "Views".

    • In the "Show" box, select "Islandora Solr".

    • When creating a new view, the option to "Create a Page" will be checked, and the option to "Create a Block" will be unchecked.  Uncheck "Create a Page".  Check the box to "Create a Block".

    • Click "Continue and Edit"
    • By default, a block will be created that contains no more than five items in an unformatted list. For this tutorial, these settings will be fine. Click 'Continue & Edit' to continue.

  2. Configure the Block:

    • Under "Fields", remove the "Islandora Solr: Score" field by clicking on "Islandora Solr: Score" and then in the pop up box clicking "Remove".  

    • In the top right corner, click "Save" to save the change.

  3. Add the 'dc.title' field to FIELDS

    • Titles of objects created with an XML form are given the 'dc.title' field. This is what we are going to want our block to display.

    • In the "Fields" section, click the 'Add' button.  On the overlay that comes up, select "Islandora Solr: dc.title" from the list. Click "Apply (all displays)".

    • For a small block, we probably don't want a label showing up for every object listed, so uncheck 'Create a label'.

    • Check the 'Link field to object' button to make sure each object is being linked to from the block.

    • Click 'Apply (all displays)' again to close the overlay.

    • In the top right corner, click "Save" to save the change.
  4. Add the 'RELS_EXT_isMemberOfCollection_uri_ms' field to FILTER CRITERIA

    • We want our objects to be filtered from a certain collection. RELS-EXT datastreams define this collection with the format 'info:fedora/namespace:collection_pid'. In the case of a standard installation of Islandora, the Basic Image Solution Pack will have the RELS-EXT isMemberOfCollection_uri_ms field 'info:fedora/islandora:sp_basic_image_collection'. At any time, you can check a collection's namespace:collection_pid by clicking the 'Manage' tab on that collection, and then clicking the "Datastreams" button. The collection's namespace:collection_pid will be above the list of datastreams.

    • Next to "FILTER CRITERIA", click the "add" button. Check off "Islandora Solr: RELS_EXT_isMemberOfCOllection_uri_ms" from the list, and click "Apply (all displays)". On the next screen, under the 'RELS_EXT_isMemberOfCOllection_uri_ms' field, add 'info:fedora/islandora:sp_basic_image_collection'.

    • Click "Apply (all displays)" again to close the overlay.

    • In the top right corner, click "Save" to save the change.
  5. Add the 'fgs_createdDate_dt' field to SORT CRITERIA
    • We would like to view only the latest objects created in our list, and if there are more than five objects total in the collection, we will need to have them sorted. The 'Islandora Solr: fgs_createdDate_dt' field will allow us to display only the five latest objects in our list.
    • Beside 'SORT CRITERIA', click the 'add' button. Check off 'Islandora Solr: fgs_createdDate_dt' from the list, and click 'Apply (all displays)'.
    • In order for the latest objects to show up on the top, we will need to sort them 'descending' instead of 'ascending', so on the next page, click the radio button beside 'Sort descending'. Click 'Apply (all displays)' again to close the overlay.
  6. Save the block and add it to part of the structure
    • Click the 'Save' button at the top of the view editing page. This will add it to the list of blocks in your site's 'structure' section. You can add it to part of the structure by going to http://path.to.your.site/admin/structure/block, scrolling down to the 'Disabled' block section at the bottom, and adding it to one of the block regions.
  7. Check the View and see how it looks.
    • Your new view will now show up in that region, listing all new images ingested into the Basic Image collection and providing links to those images. The below example is of a view block given the above setup, with the view name 'Image Feed', and a single image in that collection called 'Sample Image'.
    • If you want this block to appear on a Drupal page of its own, you can create a new Drupal node (basic page), then configure the block so it appears on "Only the listed pages" and add the name of that Drupal node. Finally, place a link to that node in one of the site's Drupal menus.

Configuration

The Islandora Solr Views module has no configuration options of its own, but pulls entries from the Solr index. Check the Islandora Solr (Copy) section for more information on setting up Islandora Solr.

  • No labels