![No UI](https://img.shields.io/static/v1?label=UI&message=none&color=inactive) This plugin sends notification E-Mails about expiring assets. More specifically, it searches for assets which fulfill a certain date-based condition and then determines a list of notification recipients for each asset found. The primary use case is to send warnings about expiring usage rights to users who downloaded the expiring asset in the past. [MINITOC] ## Properties To be configured in {home}/appserver/conf/custom.properties You can define several expiration notifiers by incrementing the counter after _expirationNotifier_: * `expirationNotifier.1.someProperty=...` * `expirationNotifier.2.someProperty=...` In the following documentation, _1_ will be used as an example. > > > > > > To apply a property to all notifiers, simply use *default* instead of the number, e.g. `expirationNotifier.default.someProperty=...`. > > > > > > Numbered properties will still override the _default_ value if defined. ##### expirationNotifier.license > type: String, **required: yes**, default: - license key (delivered by brix Solutions AG) ##### expirationNotifier.1.warnAheadPeriodInDays > type: int, required: yes How many days before reaching the expiration date should the notification be sent? ##### expirationNotifier.1.negativeTimeOffsetInDays > type: int, required: no Shifts the date range **m** days into the past Instead of all assets which will in expire in the next **n** days from now, all assets which will have been expired for **m** days in the next **n** days are selected (where **n** is *warnAheadPeriodInDays* and **m** is *negativeTimeOffsetInDays*). This can be used to send notifications for assets which have been expired for a certain amount of days or even delete them in combination with the [deleteExpiringAssets](#expiration-notifier-1-delete...) flag. ##### expirationNotifier.1.assetFinders > type: list of bean names, **required: yes** A comma-separated list of bean names of type `ExpiringAssetsFinder`. By default, the following asset finder beans are available: * **availabilityExpiringAssetsFinder** - Finds assets based on the *Valid to* date of the general *Asset Availability*. * **dateInfofieldExpiringAssetsFinder** - Finds assets based on a configured information field of type *Date*. See [dateInfofieldExpiringAssetsFinder.informationFieldId](#expirationnotifier-1-dateinfofieldexpiringassetsfinder-informati). You can also define your own custom asset finder by implementing the `ExpiringAssetsFinder` interface. ```java public interface ExpiringAssetsFinder { Iterable getExpiringAssets(Date fromDate, Date toDate); } ``` ##### expirationNotifier.1.dateInfofieldExpiringAssetsFinder.informationFieldId > type: long, required: yes (if dateInfofieldExpiringAssetsFinder is used) The ID of the Date information field to use for *dateInfofieldExpiringAssetsFinder*. ##### expirationNotifier.1.recipientFinders > type: list of bean names, **required: yes**, default: - A comma-separated list of bean names of type `NotificationRecipientFinder`. Each `NotificationRecipientFinder` returns a set of notification recipients for each asset. By default, the following recipient finder beans are available: * **statisticsNotificationRecipientFinder** - Returns the E-Mail addresses of all users who have downloaded the expiring asset by querying the statistics database table. * **staticNotificationRecipientFinder** - Uses a static list of E-mail addresses, regardless of their involvement. This is useful if you always want someone to know, regardless if they've downloaded the asset or not. See [staticNotificationRecipientFinder.staticEmails](#expiration-notifier-1-static...). * **globalStorageNotificationRecipientFinder** - Tries to fetch a set of E-mail addresses from the *Global Data Storage* using the configured storage key and the expiring asset as reference. See [globalStorageNotificationRecipientFinder.globalStorageKey](#expiration-notifier-1-global...). * **staticUsersNotificationRecipientFinder** - Uses static lists of CELUM users and / or user groups to notify. See [staticUsersNotificationRecipientFinder.userIds](#expiration-notifier-1-static...-1) and [staticUsersNotificationRecipientFinder.userGroupIds](#expiration-notifier-1-static...-2). * **infoFieldNotificationRecipientFinder** - Retrieves a set of E-mail addresses from one or multiple information fields on the asset. See [infoFieldNotificationRecipientFinder.informationFieldIds](#expiration-notifier-1-info...). * **nameMatchNotificationRecipientFinder** - Retrieves a set of names from one or multiple information fields on the asset. Each name is then matched against the registered users to find the corresponding E-Mail address. See [nameMatchNotificationRecipientFinder.informationFieldIds](#expiration-notifier-1-name...). * **uploaderNotificationRecipientFinder** - Returns the E-mail addresses of the uploader of the active version and / or of the original creator of the asset. See [uploaderNotificationRecipientFinder.notifyActiveVersionUploader](#expiration-notifier-1-uploader...) and [uploaderNotificationRecipientFinder.notifyOriginalAssetCreator](#expiration-notifier-1-uploader...-1). * **nodeRefFieldNotificationRecipientFinder** - Retrieves a list of recipients from a node-referencing field on the asset. The E-Mail address of the recipient is fetched from the configured text information field on the referenced node. The name of the recipient is the name of the referenced node in the default locale. See [expirationNotifier.1.nodeRefFieldNotificationRecipientFinder.nodeRefFieldId](#expiration-notifier-1-node-ref...) and [expirationNotifier.1.nodeRefFieldNotificationRecipientFinder.emailInfoFieldId](#expiration-notifier-1-node-ref...-1) You can also define your own custom recipient finder by implementing the `NotificationRecipientFinder` interface. ```java public interface NotificationRecipientFinder { Set findRecipientsForExpiredAsset(AssetId assetId); } ``` ##### expirationNotifier.1.globalStorageNotificationRecipientFinder.globalStorageKey > type: string, required: if globalStorageNotificationRecipientFinder is used The *Global Storage Key* to use in *globalStorageNotificationRecipientFinder*. Known values: - DownloadMail ##### expirationNotifier.1.staticNotificationRecipientFinder.staticEmails > type: list of strings (comma-separated), required: if staticNotificationRecipientFinder is used Static list of e-mail addresses to notify, regardless of their involvement, e.g. application owner or the marketing department. The E-Mail format with display name (Max Muster ) is supported. ##### expirationNotifier.1.staticUsersNotificationRecipientFinder.userIds > type: list of IDs (comma-separated), required: no A list of IDs of CELUM users to notify. ##### expirationNotifier.1.staticUsersNotificationRecipientFinder.userGroupIds > type: list of IDs (comma-separated), required: no A list of IDs of CELUM user groups to notify. Users will be determined recursively. ##### expirationNotifier.1.infoFieldNotificationRecipientFinder.informationFieldIds > type: list of IDs (comma-separated), required: yes A list of IDs of asset information fields containing E-mail addresses. The E-Mail format with display name (Max Muster ) is supported. ##### expirationNotifier.1.nameMatchNotificationRecipientFinder.informationFieldIds > type: list of IDs (comma-separated), required: yes A list of IDs of asset information fields containing names. Each name is matched against the registered users to find the corresponding E-Mail address. ##### expirationNotifier.1.uploaderNotificationRecipientFinder.notifyActiveVersionUploader > type: boolean, default: true Whether to notify the uploader of the currently active version of the asset. ##### expirationNotifier.1.uploaderNotificationRecipientFinder.notifyOriginalAssetCreator > type: boolean, default: false Whether to notify the original creator of the asset. ##### expirationNotifier.1.nodeRefFieldNotificationRecipientFinder.nodeRefFieldId > type: number, required: yes The ID of the node-referencing information field containing references to recipient / user nodes. ##### expirationNotifier.1.nodeRefFieldNotificationRecipientFinder.emailInfoFieldId > type: number, required: yes The ID of the text information field on the referenced nodes containing the recipient's email address. ##### expirationNotifier.1.subjectMessageKey > type: string, required: no, default: expirationNotifier.mail.subject The Spring message key to use to generate the mail subject. It is possible to use placeholders in the form `$[propertyName]` in your localized message. These will automatically be replaced with the corresponding configuration value, e.g. `$[warnAheadPeriodInDays]` will be replaced with the number value configured for the current notifier. ##### expirationNotifier.1.mailTemplatePath > type: string, required: no, default: ch.brix.expirationNotifier.default The path to the velocity mail template, so you can customize them via `home/appserver/velocity`. The default `ch.brix.expirationNotifier.default_en.vm` looks like this: ```html #* @vtlvariable name="warnAheadPeriodInDays" type="int" *# #* @vtlvariable name="recipient" type="ch.brix.expirationNotifier.model.Recipient" *# #* @vtlvariable name="expiringAssets" type="java.util.List" *# #* @vtlvariable name="dateTimeFormatter" type="java.time.format.DateTimeFormatter" *# #* @vtlvariable name="locale" type="java.util.Locale" *# #* @vtlvariable name="applicationBaseUrl" type="java.lang.String" *# #* @vtlvariable name="applicationName" type="java.lang.String" *#

The following assets will expire in the next $!warnAheadPeriodInDays days:

    #foreach($expiringAsset in $expiringAssets)
  • Asset "$!expiringAsset.assetName" (ID: $!expiringAsset.assetId) - Expires $dateTimeFormatter.format($expiringAsset.expirationDate.toInstant())
    Show in ${applicationName}
  • #end

${applicationName}
${applicationBaseUrl}

Note: This notification email has been generated automatically, please do not reply.

``` ##### expirationNotifier.1.deleteExpiringAssets > type: boolean, required: no, default: false Whether to delete all assets matched by the configured assetFinders. Use with caution! ##### expirationNotifier.1.useRFC822Addresses > type: boolean, required: no, default: true If enabled recipient addresses are submitted in RFC 822 format: "Jane Doe" ##### expirationNotifier.1.scopeFilter > type: string, required: no, since: 1.11.0 An optional asset filter expression for this notifier configuration. See [Search Util 2](/celum_extensions/search_util_2) for syntax. ## Example Basic example: ``` expirationNotifier.1.warnAheadPeriodInDays=30 expirationNotifier.1.assetFinders=availabilityExpiringAssetsFinder expirationNotifier.1.recipientFinders=statisticsNotificationRecipientFinder ``` Advanced example with multiple finders: ``` expirationNotifier.1.warnAheadPeriodInDays=60 expirationNotifier.1.assetFinders=availabilityExpiringAssetsFinder,dateInfofieldExpiringAssetsFinder expirationNotifier.1.dateInfofieldExpiringAssetsFinder.informationFieldId=130 expirationNotifier.1.recipientFinders=statisticsNotificationRecipientFinder,staticNotificationRecipientFinder expirationNotifier.1.staticNotificationRecipientFinder.staticEmails=dam-owner@company.com ``` ## Compatibility Matrix | expirationNotifier | CELUM (min. version) | |----------------------------|----------------------| | 1.0-5.12.4 to 1.5.0-5.12.4 | 5.12.4 | | 1.6.1-5.13.3 | 5.13.3 | | 1.6.2-5.13.4 | 5.13.4 | | 1.9.0-6.8 | 6.8.0 | | 1.13.1-6.20 | 6.20.0 | ## Release Notes #### 1.0 > Released 2017-10-26 + Initial Version #### 1.4.1 > Released 2018-04-12 + License check added #### 1.4.2 > Released 2018-04-12 + Code optimizations #### 1.5.0 > Released 2019-01-07 + Added "Delete expiring assets" feature + Optimized license handling #### 1.6.0 > Released 2019-06-24 + Added possibility to notify users by user or user group ID via staticUsersNotificationRecipientFinder #### 1.7.0 > Released 2021-05-12 + Improved tracking which notifications have already been sent #### 1.8.0 > Released 2021-10-20 + Added possibility to retrieve recipient E-mail addresses from asset information fields via infoFieldNotificationRecipientFinder #### 1.9.0 > Released 2022-04-13 + Implemented NameMatchNotificationRecipientFinder #### 1.10.0 > Released 2022-06-02 + Implemented UploaderNotificationRecipientFinder #### 1.11.0 > Released 2022-06-02 + Implemented optional asset filter expression per notifier configuration #### 1.13.0 > Released 2025-02-17 + Established compatibility with CELUM 6.20 #### 1.14.0 > Released 2025-06-23 + Implemented NodeRefFieldNotificationRecipientFinder