Example 2: Rijksmuseum

Last updated on
9 January 2024

note: based on 2.x-dev module version

Create entity type

  1. go to admin/structure/external-entity-types/add
  2. name: 'Rijksmuseum'
  3. name (plural): 'Rijksmuseum objects'

Define storage client

  1. Storage client: choose 'REST'
  2. endpoint https://www.rijksmuseum.nl/api/en/collection
  3. response format: choose 'json'
  4. pager settings: 'p', page number, 'ps'. number of items per page
  5. list parameters:
    format|json
    key|fpGQTuED
    
  6. single parameters:
    format|json
    key|fpGQTuED
    

Manage fields

Make sure to first save your Edit of the new external entity.

Before we can map fields we need to define new fields so visit Manage fields.

  • Add text field 'creation date'
  • Add text field 'object number'
  • Add text field 'creator'
  • Add link field 'image' (note use link field instead of file or image field as the images are external urls)

Fields mapping

Go back to Edit and visit the Field mappings.

Choose JSONPath as Field mapper and add the following mappings:

id: $.artObject.objectNumber
uuid: $.artObject.objectNumber
title: $.artObject.title
creator: $.artObject.principalMaker
object number: $.artObject.objectNumber
creation date: $.artObject.dating.presentingDate
image: $.artObject.webImage.url

The uuid and id are the same in this case, depending on the source the uuid could be something different than the object id.

Image display

  1. install Imagecache external
  2. disable whitelist or add rijksmuseum.nl to the whitelist on the Imagecache External configuration page
  3. choose 'Imagecache external image' as display format for the link field 'image'

Verify entities

1. Note that the list of external entities on /rijksmuseum doesn't work yet

2. Check an individual external entity, for example /rijksmuseum/SK-C-5

Help improve this page

Page status: No known problems

You can: