Skip to content

Retrieving Objects

Eric Lopatin edited this page Aug 4, 2023 · 8 revisions

User Interface

If you used the Merritt metadata options to provide a title, creator, date or local identifier, you will be able to search within the collection for any of those terms. Terms typed in the search box will be found in any of these fields, as well as in the primary identifier assigned by Merritt.

The Display Object screen shows the complete metadata provided by the curator as well as system-generated metadata such as primary identifier, file size, date added (created) and date last modified.

If there are multiple versions of an object, information about the most recent version will display on the Display Object page.

If there are multiple component files for the object, up to four of them will be listed in the right sidebar. Clicking on an object file will open the file.

If there are multiple versions of the object, a link to each version will be available in the right sidebar. The Display Version page, which will provide links to every component file for the object.

The Download Object button on the Display Object page will download a .zip file including every version of the object.

The Display Version screen provides links to each component file you supplied for the object, along with system-derived metadata.

The Display Version screen also provides access to the files that Merritt generates to facilitate object management.

The Download Version button will provide you with a .zip file of the version you are viewing. The download will include the system files Merritt generated.

User Interface: Object Lookup

The Object Lookup dialog that appears on every collection home page can be used to search for objects according to multiple criteria.

Merritt Object Lookup

One can search by:

  • Identifier (exact match) – Enter the object's Primary Identifier (ARK) or its Local Identifier. Note that objects in Merritt can have multiple, unique Local Identifiers separated by the ';' character. Entering any of the object's Local Identifiers will retrieve the object.
  • File name (exact match) – Enter the name of a file in any version of an object. Doing so will retrieve the object in which the file resides.
  • Title, author or date – Enter the title, author or date of an object. With this type of search query, Merritt will return all objects whose metadata contains the query string.

Global Search

Global search, using all of the criteria noted above to search across collections owned by a specific organization (such as a campus library) is a feature that can be enabled upon request in Merritt. Contact a member of the Merritt team directly or via the UC Curation Center contact form. When enabled, a campus-specific "Library Lookup" dialog appears on the collections list page. This page is accessed on login and by clicking the "My collections" menu header.

Programmatic Retrieval of Merritt Objects

Merritt Object/Version download requests are handled by creating a presigned URL to an assembled container in cloud storage.

The Object/version retrieval buttons in the Merritt User Interface make use of this retrieval mechanism.

Presigned URL's have an expiration time. Once the expiration time has passed, a new presigned URL will need to be generated for access. Assembled objects and versions have a finite existence in Merritt. These objects/versions need to be reassembed for subsequent requests.

Object assembly request

GET https://merritt.cdlib.org/api/assemble-obj/{ObjectArk}
  • {ObjectArk} - Url-encoded representation of the Object Ark containing the file to be retrieved

Optional Parameters

  • format: (zip|tar|targz) default is zip
    • Container file format
  • content: (producer|full) default is full
    • full includes all Merritt system files. producer only contains deposited content files.

Version assembly request

GET https://merritt.cdlib.org/api/assemble-obj/{ObjectArk}/{ObjectVersion}
  • {ObjectArk} - Url-encoded representation of the Object Ark containing the file to be retrieved
  • {ObjectVersion} - Version number containing the file to be retrieved

Optional Parameters

  • format: (zip|tar|targz) default is zip
    • Container file format
  • content: (producer|full) default is full
    • full includes all Merritt system files. producer only contains deposited content files.

Assembly response

The response contains a token that will be utilized to retrieve an object once it has been assembled. The anticipated-availability-time suggests when the user should attempt to retrieve the assembled object (base on object size and server capacity).

Response Status: 200
{
  status: 200,
  token: 'uuid',
  cloud-content-byte: 12345,
  anticipated-availability-time: '2019-11-05T08:15:30-08:00',
  message: 'Request queued, use token to check status'
}

Retrieve Assembled Object/Version Request

GET https://merritt.cdlib.org/api/presign-obj-by-token/{token}
  {token} - returned by the assembly request

Optional Parameters

  • no_redirect
    • if "true", the presigned url will be sent in a json payload rather than in a redirect header
  • filename
    • name to assign to downloaded file

Retrieve Assembled Object/Version Response

The following responses may be returned from this request: 303, 200, 202, 410

Response 303: Assembled Object is Available, location header contains presigned URL redirect

Response 200: Assembled Object is Available (no redirect)

The url field contains a presigned url that can be used to retrieve the assembled object. This presigned url is valid for a limited time.

Response Status: 200
{
  status: 200,
  message: "Payload contains token info",
  token: 'uuid',
  cloud-content-byte: 12345,
  url: _presigned url_
}

Response 200: Assembled Object is Not Ready

Try the Retrieve Assembled Object/Version Request request again in a few seconds. If this response occurs frequently, increase the time between requests.

Response 410: Assembed Object has Expired

The assembed object is no longer available. You will need to repeat the Object/Version assembly request.

Clone this wiki locally