Celum DAM Connector module

Edition

Incubator (services)

Issues

Git

Git

Latest

1.0.5

Compatible with Magnolia 6.2.x up to 6.2.35.

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>1.0.5</version>
</dependency>

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>5.3.17</version>
</dependency>
To be able to use CELUM remote api (api-remote-3.5.0-jar-with-dependencies.jar), it has to be available in your maven (i.e. company Nexus) repository or you will have to install it manually into your local repository.
mvn install:install-file -Dfile=<path-to-file>/api-remote-3.5.0-jar-with-dependencies.jar -DgroupId=com.celum -DartifactId=api-remote -Dversion=3.5.0-jar-with-dependencies -Dpackaging=jar

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).

celum account

Depending on your needs, you might want to add access to the API user to some asset types, that will be done on CELUM app server in the administration feature.

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 CELUM remote API.

Example

http://host/api

clientId

mandatory

Remote clientId. Can be a path from the passwords app. i.e. /celum-credentials/clientId.

clientSecret

mandatory

Client secret. Can be a path from the passwords app. i.e. /celum-credentials/clientSecret.

serverSecret

mandatory

Server secret. Can be a path from the passwords app. i.e. /celum-credentials/serverSecret.

credentialsPath

optional

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.

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: http://localhost:8765/api
clientId: /celum-credentials/clientId
clientSecret: /celum-credentials/clientSecret
serverSecret: /celum-credentials/serverSecret

propertyMap:
  title: title
  copyright: autor
  description: pages
  subject: subject
  caption: caption
  language: sprache
  comment: comment

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)

Some extra Dam templating functions can be added to access to the searchFilters functionality, the service provides a factory for classes that implement 'SearchFilter'. We provide a sample filter implementation 'AssetsByNodeIdFilte', the filter’s implementations have to be configured in the module descriptor

<!-- AssetsByNodeIdFilter search filter -->
<component>
  <type>info.magnolia.external.dam.celum.filters.AssetsByNodeIdFilter</type>
  <implementation>info.magnolia.external.dam.celum.filters.AssetsByNodeIdFilter</implementation>
</component>

To run this filter you need to call the service 'searchByFilter' method with the filter name and the parameters you want to send.

celumservice.searchByFilter("AssetsByNodeIdFilter", params) or customtemplatingfuntion.searchFilter("AssetsByNodeIdFilter", params)

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

Incubators

×

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