compared with
Current by Jesse Martinez
on Sep 27, 2012 12:56.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (7)

View Page History
{note:title=Out of date}Newest schema mapping is [here|MMI Collection Browser Object Schema for 2.4]{note}

h3. Status

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

{{csid\|uri\|updatedAt\|objectNumber\|objectName\|title\|responsibleDepartment\|briefDescriptions}} {{csid\|uri\|updatedAt\|workflowState\|objectNumber\|objectName\|title\|responsibleDepartment\|caption}}

{{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.)




h3. 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}
http://cspacetest.collectionspace.org:8180/cspace-services/relations?sbj=117dc667-faa9-4818-a848-133ca5ad3e11&objType=MediaTenant42
{code}

The xml list returns something like this abbreviated payload
{code: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>
...
{code}

Then a single API call to the media service will look like this
{code}
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'
{code}

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.


h3. Filtering

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.