A Media kit page showing four photos of shoes from a ResourceSpace collection, each with a Download link under it.
The Collection gallery formatter settings: Thumbnail, Image style, Show a download link under each image, Download set to Largest JPEG, Images shown and Refresh every 3600 seconds.
The ResourceSpace settings form after Save and test the connection, with the address, the API user, the private API key, the request timeout and the largest download.
The ResourceSpace tab of the Media Library: a search box, a Collection list set to Press kit, and six photos of shoes, two of them checked, above an Add selected button.

This project is not covered by Drupal’s security advisory policy.

ResourceSpace DAM puts a collection from ResourceSpace, the open source digital asset management system, on a Drupal page. Editors choose the images in ResourceSpace, a field holds the collection, and the page shows its images, each with a download link. Visitors never reach the DAM: the thumbnails and the downloads come from the site. Editors can also pick single images from the DAM in the Media Library and use them wherever a media field goes, without uploading them to Drupal.

Features

  • 🖼️ Live collections. A ResourceSpace collection field holds a collection, and the Collection gallery formatter shows its images in the collection's own order. An image added to or taken out of the collection in ResourceSpace shows or goes once the listing is older than the refresh time you set, with nothing to do in Drupal.
  • 🧩 DAM images as media items. The ResourceSpace DAM Media submodule adds a ResourceSpace media source and a ResourceSpace tab in the Media Library, which searches the DAM by words, by collection or both. Each image becomes a media item that holds the resource and takes its name, alternative text and the metadata fields you map from the DAM; the site keeps one preview of it, never the original, and an image chosen twice is the same media item. On cron, a file replaced in ResourceSpace gets a new preview, changed metadata updates the mapped fields, and a resource deleted in ResourceSpace unpublishes its media item.
  • 🔒 Downloads for the visitors who can see the page. Each download link is signed for its page, field, image and size. Before every download the site checks that the visitor can view the page and the field and that the image is still in the collection, so a link from an unpublished page, or to an image taken out of the collection, stops working. A media item's download link is checked the same way against the media item.
  • ⬇️ The largest JPEG by default. The download is the high resolution rendition when ResourceSpace has one, otherwise the original when it is a JPEG, otherwise the largest preview. An original in another format, such as a layered TIFF, is served only when you choose the original, and files over a size limit are refused.
  • ⚡ Cached, and light on the DAM. The collection listing is cached for the refresh time, at most 12 hours. Each thumbnail is copied once per version of the file and served from the site's files; copies no page has used for 30 days are deleted on cron. When ResourceSpace cannot be reached, the page still loads and the gallery tries again a minute later.
  • ⚙️ Configured without code. The field's widget lists the featured and public collections the API user can see. The formatter sets the thumbnail size, an optional image style, the download size, the number of images and the refresh time, and the settings form tests the connection.
  • 🎨 Themeable. The gallery is rendered by resourcespace-collection.html.twig, which gets each image's thumbnail, title and download link, with a small grid stylesheet a theme can replace.

A Media kit page showing four photos of shoes from a ResourceSpace collection, each with a Download link under it.

Quick start

composer require drupal/resourcespace:@alpha
drush en resourcespace
  1. In ResourceSpace, give the site its own user, in a group that can search and download and cannot edit or upload, and copy the user's private API key from its page.
  2. At Configuration > System > Keys, add a key that holds the private API key. Then at Configuration > Media > ResourceSpace, enter the ResourceSpace address, the API user and the key, and click Save and test the connection.
  3. Add a ResourceSpace collection field to a content type, paragraph type or block type, and choose a collection on a page. The page shows the collection's images, each with a Download link under it.
  4. For single images, enable ResourceSpace DAM Media (drush en resourcespace_media), add a media type with ResourceSpace as its source, and allow it on a media field. The field's Media Library gets a ResourceSpace tab.

 a search box, a Collection list set to Press kit, and six photos of shoes, two of them checked, above an Add selected button.

The ResourceSpace tab in the Media Library.

 Thumbnail, Image style, Show a download link under each image, Download set to Largest JPEG, Images shown and Refresh every 3600 seconds.

The formatter settings, under Manage display.

 the message says the API user can see 3 featured or public collections, above the address, the API user, the private API key, the request timeout and the largest download.

The settings form, after testing the connection.

Good to know

  • Whatever the API user can see in ResourceSpace, the site can show and serve, so give it a group that only searches and downloads. The site only shows and serves the featured and public collections that user can see.
  • Thumbnails are copies of a ResourceSpace preview in public://resourcespace, and media items keep theirs in public://resourcespace-media. Originals are never saved on the site: a download is read from ResourceSpace and streamed to the visitor.
  • When an image's metadata changes in ResourceSpace, its media item takes it again, over any edit made on the site to the mapped fields. A media item unpublished because its resource was deleted is not published again if the resource comes back.
  • Each download keeps a PHP process busy until it ends, which is why downloads over the Largest download setting (50 MB by default) are refused.
  • The preview URLs ResourceSpace hands out through its API expire after 24 hours by default, which is why the listing is cached for 12 hours at most.
  • Developed against ResourceSpace 11.0.

Additional requirements

  • Drupal 10.3 or later, or Drupal 11.
  • Key 1.17 or later, which holds the private API key.
  • A ResourceSpace site with its API enabled.
  • For the media submodule, the core Media and Media Library modules.

Community documentation

  • README: installation, configuration, how the collections, thumbnails, downloads and media items work, and caching.

Supporting this module

Developed and maintained by Bloomidea. Bloomidea offers support and custom development for this module.

Supporting organizations: 
Development and maintenance

Project information

Releases