Celum DAM Connector module

Issues

Git

Git

Latest

2.0.0

Compatible with Magnolia 6.2.

The Celum DAM Connector module provides a connector to Celum to use assets form this service. It provides an app to browse and add/remove images, and a dialog to use this images and/or videos into your website.

This module is at the INCUBATOR level.

Installing with Maven

Maven is the easiest way to install the module. Add the following to your bundle:

<dependency>
  <groupId>info.magnolia.external.dam</groupId>
  <artifactId>celum-dam-connector</artifactId>
  <version>2.0.0</version>
</dependency>

From Magnolia 6.2.9 to Magnolia 6.2.36, modules using the @Cacheable annotation from addon-commons (info.magnolia.addon.commons.cache.annotation.Cacheable) did not work with Java 17.

Usage

You will need an account to connect to CELUM, that account is created in CELUM Configuration Management Application (CMA).

To retrieve the API key, please follow these revised instructions:

  1. Go to your Celum instance,

  2. Navigate to the Go to Advanced UI option.

    go to advanced ui
  3. In the Advanced UI, click Administration > Configuration Management and log in.

    1. Under the Authentication category header, click on Profiles.

      You can use your existing profile or create a new one.
    2. Click the + ADD symbol at the bottom of the screen to add a new Authentication Profile.

    3. Now, click Rest API. A new dialog should open.

      create new rest account

  4. Get the API key for use.

    celum account

Control permissions by asset type

Depending on your needs, you may want to grant access to only some asset types for an API user.

You can do this inside the Celum app server in the administration section.

celum asset type permissions

Configuration

Property Description

rootNodeId

mandatory

Provides the root node id for the tree view.

connectionString

mandatory

Defines the connection string to the Celum remote API.

Example

https://<your-celum-baseURL>/content-api/v1

apiKey

mandatory

The remote apiKey. This can be a path from the passwords app; e.g., /celum-credentials/apiKey.

credentialsPath

optional

This is the Passwords app path where we want to listen for credentials changes.

Default

/celum-credentials/

defaultLocale

optional

Locale to be used by default when getting Celum node names, defaults to en.

apiParams

optional

Additional parameters to be added into your header request parameters.

propertyMap:

  • title: somepropame

  • description: somepropame

  • copyright: somepropname

  • subject: somepropname

  • caption: smepropname

  • language: somepropname

  • comment: somepropname

optional

Is a map of properties that maps the properties in the Magnolia asset object to properties in the fileProperties of the Celum remote asset. There are some extra properties provided by fileProperties in Celum asset that are automatically available to be used in dialogs, no need to declare them here.

Using the Passwords app

In order to use the Passwords app to store the credentials for the remote connection to Celum, you need to create the folder with the items and set the paths in the config.yaml or the JCR configuration of the Celum connector module.

passwords app celum

config.yaml
rootNodeId: 1111
connectionString: https://yourCelumBaseURL/content-api/v1 (1)
apiKey: "/celum-credentials/apiKey" (2)

propertyMap:
  title: title
  copyright: autor
  description: pages
  subject: subject
  caption: caption
  language: sprache
  comment: comment
1 Defines the connection string to the Celum remote API.
2 The remote apiKey location. This can be a relative path from the passwords app; e.g., /celum-credentials/apiKey.

Deactivate Netty logs

Add the following lines to the log configuration file in your log properties file: log4j2.xml.

<!-- External libraries -->
<!-- Netty -->
<Logger name="io.netty" level="INFO"/>

Once the module has been installed you can add assets to the website and/or apps by using the the default Dam link field,

image:
  class: info.magnolia.ui.field.LinkFieldDefinition
  buttonSelectNewLabel: Select new ...
  buttonSelectOtherLabel: Select another ...
  chooser:
    workbenchChooser:
      appName: dam-chooser

Using the custom celum link field which uses celum datasource and celum chooser by default

celum:
    $type: celumLinkField

Or using the dam link field with the dam chooser or adding your own celum-chooser,

celum:
  $type: damLinkField
  chooser:
    workbenchChooser:
      appName: dam-chooser
  datasource:
    class: info.magnolia.dam.app.data.AssetDatasourceDefinition
    name: celum

RichTextField usage

RichTextField are using by default dam-chooser, which displays assets from all registered asset providers, but without any optimization

text:
  $type: richTextField

Celum connector provides an optimized celum chooser. Using following configuration in your module descriptor, you would be able to let author choosing between standard dam chooser and optimized celum chooser in richTextField:

<components>
  <id>main</id>
  <type-mapping>
    <type>info.magnolia.ui.field.RichTextFieldDefinition</type>
    <implementation>info.magnolia.external.dam.celum.field.CelumRichTextFieldDefinition</implementation>
  </type-mapping>
</components>

The following configuration would limit the standard dam chooser to JCR assets only:

<components>
  <id>datasource-assets</id>
  <type-mapping>
    <type>info.magnolia.ui.contentapp.browser.TreePresenter</type>
    <implementation>info.magnolia.external.dam.celum.app.contentview.browser.JcrAssetTreePresenter</implementation>
  </type-mapping>
  <type-mapping>
    <type>info.magnolia.ui.contentapp.browser.ListPresenter</type>
    <implementation>info.magnolia.external.dam.celum.app.contentview.browser.JcrAssetListPresenter</implementation>
  </type-mapping>
</components>

Celum templating functions

The module provides a templating function:

  • damcelfn: Provide a helper to fetch the public URLs of Celum assets, which are cached in JCR.

Misc

In the templates you can access to the asset link by calling:

asset.getlink() or damfn.getRendition(asset, renditionname)

In order to use SSO credentials, you need to provide your own implementation of interface ImpersonationHandler and set the configuration option "impersonate" to true. The default implementation is empty.

<!-- Impersonation Handler -->
<component>
  <type>info.magnolia.external.dam.celum.ImpersonationHandler</type>
  <implementation>info.magnolia.external.dam.celum.DefaultImpersonationHandler</implementation>
</component>

Public URL cleaner

Celum module embeds a command named cleanPublicUrlCache to clean the public URLs, removing the ones that are not returning 2xx code, and URLs that are cached for more than the number of days specified within the publicUrlValidityDays parameter passed to the command (default being 7 days if no parameter is passed)

A schedule setup is already preconfigured but disabled by default to trigger this command on a regular basis. It can be activated in scheduler config, switching the enabled property of cleanPublicUrlCacheJob to true. Default setup schedules it every hour, but it can be adapted by changing the cron property of the job.

Feedback

DX Core

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the Celum DAM Connector module docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules