Configuring Drop Resolvers in CUE

All you need to do make CUE call a drop resolver is add a few entries to the CUE configuration file, /etc/escenic/cue-web-2.9/config.yml. Open this file for editing. If it does not already contain a dropTriggers entry, then add one:

dropTriggers:

Underneath this entry, you can add sub-entries for all the drop resolvers you want to define. A drop resolver configuration contains the following entries:

  - name: resolver-name
    href: http://host:port/service-url
    resultMimeType: mime-type
    attributes:
      custom-resolver-attribute
      ...
    triggers:
      trigger-specification

where:

name

Is the name of the resolver. The name must be unique since CUE identifies the resolvers by their names. Any resolver definition with a duplicate name will be ignored.

href

Is the URI of the resolver service. The resolver service can run in a different domain from CUE, but will then need to be specified as an authorized endpoint in order to be granted access to CUE's endpoints (see Enrichment Service Authentication).

resultMimeType

Is a CUE MIME type, identifying the type of the content returned from the drop resolver.

attributes

Is an optional property that you can use to send custom parameters to the drop resolver. For example:

    attributes:
      my-resolver-param-1: "value1"
      my-resolver-param-2: "value2"
triggers

A specification of the conditions that will trigger CUE to send a dropped object to the drop resolver. The specification can either consist of an array of MIME types or an array of URI patterns (but not both). For example:

    triggers:
      mimeTypes: [mime-type,...]

or:

    triggers:
      urlPatterns: [url-pattern,...]

If mimeTypes is specified, then the drop resolver will be called whenever an object with a MIME type that matches one of the specified MIME types is dropped into CUE.

If urlPatterns is specified, then the drop resolver will be called whenever an object with a URL that matches one of the specified URL patterns is dropped into CUE.

Here is an example configuration for a Google image import drop resolver:

dropTriggers:
  - name: "GoogleImageImport"
    href: "http://my-server/GoogleImageImport"
    resultMimeType: "x-ece/picture"
    triggers:
      urlPatterns: ['^https?:\/\/www\.google\..*\/imgres\?.*']

This configuration will cause CUE to forward any dropped object with a URL that matches the regular expression ^https?:\/\/www\.google\..*\/imgres\?.* to the drop resolver http://my-server/GoogleImageImport.