Celum DAM Connector module
Edition |
Incubator (services) |
||
Issues |
|||
Git |
|||
Latest |
1.0.5
|
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 |
Usage
You will need an account to connect to CELUM, that account is created in CELUM Configuration Management Application (CMA).
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.
Configuration
Property | Description |
---|---|
|
mandatory Provides the root node id for the tree view. |
|
mandatory Defines the connection string to CELUM remote API.
|
|
mandatory Remote |
|
mandatory Client secret. Can be a path from the passwords app. i.e. |
|
mandatory Server secret. Can be a path from the passwords app. i.e. |
|
optional Is the Passwords app path where we want to listen for credentials changes.
|
|
optional Locale to be used by default when getting Celum node names, defaults to |
|
optional Is a map of properties that maps the properties in the Magnolia asset object to properties in the |
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.
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"/>
Link fields usage
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.