ReferencesManager

How to get ReferencesManager

ES2015+:

import ReferencesManager from 'fontoxml-references/referencesManager'

ES5:

define([
	'fontoxml-references/referencesManager'
], function (
	ReferencesManager
) {
});

Type: Class

The reference manager manages communication with the references CMS endpoints.

Methods

Name Description
createPermanentIdForReference

Create a permanent ID for the given reference.

Creating a permanent ID requires specifying the referrer document. This can be specified as a local DocumentId referrerDocumentId.

For operations, use the createPermanentIdForReference transform.


  Arguments
# Name Type Description
1. referrerDocumentId DocumentId

The local document id from which the reference is created.

2. target String
3. [referenceType] String
4. metadata Object
  Default value
{}
  Returns

Type: Promise<String>

retrieve

Returns the details of references given a permanent identifiers to the references, which uses batching to make the actual requests.

This method uses batching based on a time window. After the first call to this method is made, a time window is started. All calls to this method made in the time window are bundled in one request to the connector. After this time window has expired, the actual request to the connector is made. The first call to this method after the time window has expired will create a new batch window.


  Arguments
# Name Type Description
1. permanentIds Array<String>

The permanent identifiers of the references.

  Returns

Type: Promise<Array<Reference>>

Resolves to an Array of references

retrieveSingle

Convenience method to retrieve a single reference. Consider using ReferencesManager#retrieve if you need to retrieve multiple references.

For operations, use the retrieveReferenceFromPermanentId transform.


  Arguments
# Name Type Description
1. permanentId String
  Returns

Type: Promise<Reference>

Resolves to the reference object

updateMetadata

Update the metadata of an existing reference in the reference repository and returns the reference.


  Arguments
# Name Type Description
1. permanentId String

The permanent identifier of the reference.

2. metadata Object

An object which may contain metadata properties to update or create for the specified reference. Existing properties should be kept; To remove a metadata property, set it to null.

  Returns

Type: Promise<Reference>

The reference with the updated metadata