Resources

Deploying Collections

2010 Leadership Grant

Documentation

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Note
titleOut of date

Newest schema mapping is here

Status

This schema is...

 

under review

complete

 

...

The fields marked (CL) describe a field that is a controlled list (HTML select element). The returned value is a non-spaced string. Please see Controlled List mapping for a mapping of controlled list strings to displayed values.

...

The following columns are returned from an API query call to the collectionobject service

csid|uri|updatedAt|workflowState|objectNumber|objectName|title|responsibleDepartment|briefDescriptionscaption

briefDescriptions caption is used for the browser search results listing page. The related thumbnail image requires a separate call to the relationship service. (See below for additional details.)

...

Tip

Document types with the suffix Tenant42 represent record types with a custom schema extension.

Chaining multiple record calls

The benefit of the relations service is receiving a single payload that contains the CSIDs of all the related records. From here it is necessary to make one API call for every CSID received since no other identifying information is returned for a related record. This can be unwieldy if there are dozens of CSIDs to fetch from. There is a workaround that can be used until the Relations service API can be changed to allow for more information to be returned.

Nuxeo uses a few special properties to identify documents in NXQL. One such property is ecm:name, which maps to the CSID of a CollectionSpace record. This can be used with OR operators to chain together several CSIDs in a single API call.

For instance, say the following relations API call is made to find all the related media records for a given CollectionObject.

Code Block

http://cspacetest.collectionspace.org:8180/cspace-services/relations?sbj=117dc667-faa9-4818-a848-133ca5ad3e11&objType=MediaTenant42

The xml list returns something like this abbreviated payload

Code Block
xml
xml

    ...
    <csid>8394599a-70b1-43e4-9fdb-44eb4ef12003</csid>
    ...
    <csid>faa2930f-1b27-4165-baf9-a7709f018bab</csid>
    ...
    <csid>dcf824ca-cb0a-4129-8440-c79357244f2b</csid>
    ...
    <csid>c6ae5232-8036-4f22-aafc-96708137ee57</csid>
    ...

Then a single API call to the media service will look like this

Code Block

http://cspacetest.collectionspace.org:8180/cspace-services/media?as=ecm:name='8394599a-70b1-43e4-9fdb-44eb4ef12003' OR ecm:name='faa2930f-1b27-4165-baf9-a7709f018bab' OR ecm:name='dcf824ca-cb0a-4129-8440-c79357244f2b' OR ecm:name='c6ae5232-8036-4f22-aafc-96708137ee57'

The above API call will only return a list type result and not the full record payload for every CSID listed. Using selective list-type columns it will be possible to gather the data needed without making individual calls.

Filtering

Filtering the search results requires the use of the Relationship service in order to access a related record's field value.

...

One* or more related movement records will be returned.

Unfortunately, there is no way to request movement record's currentLocation column value in the Relation service payload, which would aid in quickly filtering by the location authority value. Each movement record returned will need to be examined.
Using the chaining API call listed above, it will be possible to quickly filter by list-type column values.

Additionally, some CollectionObject records may have more than one related movement record. Only the most recent movement record should be used and this is determined by comparing the locationDate value of each.

...