Adapters connect the Anura front-end components to an upstream source, usually a DAM. At least one is required.
All adapters have to extend the anura-adapter in order to inherit some utility functions, namely:
pageX
is translated as Page {page}
, expecting {page: 5}
in the args. So translate('pageX', {page: 5})
results in Page 5
setTranslation({en: {myKey: 'new value'}, de: {myKey: 'neuer Wert'}})
window.location.hash
(so you can copy-paste stateful links). Prefix is an arbitrary prefix to your key in order to support multiple instances of the same component on one page.
When implementing your own adapter, be sure to inform super() in attributeChangedCallback and connectedCallback.
required: yes (except on localhost), default: -
The license (delivered by brix) enabling you to use the adapter (yeah... gotta eat..). This is based either on the hostname presenting the content, or the source thereof.
for ease of development,
localhost
is enabled without a license.
<some-adapter license="askus"></some-adapter>
required: no, default: the page's language (en if not declared)
ISO 639-1 code for the language you'd like to use. Defaults to <html lang=...>
if present or en
otherwise. Defaults to en
when the requested string is not present in a given language. Note that translation files are loaded asynchronously and relative to the adapter's location.
Supported languages: bg
, cz
, de
, en
, es
, fr
, hu
, it
, ro
, sk
and sl
. Contributions are welcome :-)
<some-adapter locale="de"></some-adapter>
required: no, live: on-load, default: true
Set this to false
to disable faceted search for all downstream components.
<some-adapter facets="false"></some-adapter>
required: no, live: no, default: true
Set this to false
to disable states in all downstream components.
required: no, live: on-load, default: -
Metadata key on which to forbid a direct download and force the user to use asset-order
instead. Note that this is not particularly secure, as advanced users can simply fiddle with this - so if your backend supports such granular permissions, use those instead. Currently this is only implemented for Sharedien (and is not necessary for CELUM).
When used, you MUST set an order-value
as well, which defines what value should be expected that forbids a download, i.e.
<some-adapter asset-order="https://asset.order/instance" order-key="copyrighted" order-value="true"></some-adapter>
required: only then using
order-key
, live: on-load, default: -
Depending on your DAM, it may not feature an asset ordering process, you you need to define where an external asset order server lives.
<some-adapter asset-order="https://some.order.url"></some-adapter>
A regular load-event, can be used to set translations, e.g.
<some-adapter locale="de" onload="this.setTranslation({en: {loadMore: 'gimme more'}})"></celum-adapter>
{detail: {name: name, oldValue: oldValue, newValue: newValue}}
Fired when any attribute has been changed, indicating that components hooked up to this adapter may want to reload themselves, e.g. because the locale has changed (leading edge).
{detail: {name: name, oldValue: oldValue, newValue: newValue}}
Fired after the adapter has reloaded itself, indicating that components hooked up to this adapter may want to reload themselves, e.g. because the locale has changed (trailing edge).
Connects to any Bynder server using their v4-API.
<bynder-adapter url="https://some-instance.bynder.com" token="xxx"></bynder-adapter>
required: yes, default: -
The URL where the back-end endpoint is located, e.g. https://some-sandbox.bynder.com
required: yes, default: -
API-Token to use, see Advanced Settings > Portal Settings > Permanent Tokens. We'd recommend creating a separate user for it, as this will basically be public information for anyone looking at the source.
required: no, default: -
Whether to display video previews instead of showing a large thumbnail.
Note that public video URLs are not available by default -> ask Bynder about "video CDN" first.
<bynder-adapter video-previews></bynder-adapter>
required: no, default: -
Whether to display PDF previews instead of showing a large thumbnail.
This currently triggers an original file download, because Bynder doesn't deliver PDF preview links.
<bynder-adapter pdf-previews></bynder-adapter>
required: no, default: zippy.brix.ch
Because Bynder's API provides no mechanism for downloading more than one file at once (as of 2023-04), an external service is used to assemble a ZIP file for basket downloads. By default our own zippy service is used - ask as about zippy if you want to host your own.
<bynder-adapter zip-service="https://some.zip.url"></bynder-adapter>
Connects Anura to a CELUM DAM, provided that the instance has the backend-plugin installed.
<celum-adapter url="https://my.celum.server/anura/example" locale="en"></celum-adapter>
required: yes, default: -
The URL where the back-end endpoint is located, e.g. https://my.celum.server/anura/example
required: maybe, default: -
login
to trigger a redirect (required backend >= 2.9.31)required: no, default: true
Whether to display PDF previews instead of showing a large thumbnail (depending on availability/file format).
<celum-adapter document-previews="false"></celum-adapter>
required: no, default: true
Whether to display video previews instead of showing a large thumbnail.
<celum-adapter video-previews="false"></celum-adapter>
required: no, default: false
Whether to fetch more asset attributes in list requests (such as file size, see API)
<celum-adapter extended="true"></celum-adapter>
required: no, default: -
A comma-separated list of information field IDs that should be loaded in every list requests (see API)
<celum-adapter infofields="123,456,789"></celum-adapter>
required: no, default: -
An information field ID to use instead of the asset's name (because that can't be localized). The asset's name will be used as a fallback if the information field is empty.
<celum-adapter alt-name="123"></celum-adapter>
Connects to any Sharedien server using their API (API-first 🥳)
<sharedien-adapter url="https://some-instance.sharedien.com" token="xxx"></sharedien-adapter>
Sharedien does not support arbitrary pagination, you must operate the paginator in auto-mode
required: yes, default: -
The URL where the back-end endpoint is located, e.g. https://some-instance.sharedien.com
required: yes, default: -
Go to "Admin > Security > Access Token" and create a token (that lasts long enough ^^)
required: no, default: -
Set the browser identifier to use, which is basically an additional search filter defined in the backend of Sharedien (see Administration > Browsers).
<sharedien-adapter browser="some-browser"></sharedien-adapter>
required: no, default: -
Which additional metadata properties should be loaded in every list request, useful for additional information or bullets.
<sharedien-adapter load-properties="some-prop,some-other-prop"></sharedien-adapter>