System templates

If you tick a template as a system one (either in the form of FE or in XML), for this template it will not be allowed to change the attributes of FE forms: system template indication, parameters, and code. System templates are closely tied with BE; currently it isn't allowed to change any of their attributes.

Templates and FE

We can edit templates (html, text, subject) using a simple WYSIWYG editor.

This WYSIWYG editor allows simplified filling template parameters with putting character $. After we put this character into editor, we are offered a current list of parameters:

We can use any available style from WYSIWYG editor for parameters and their combinations.

Style MUST be applied on all parameters including character $. The style can't be applied for merely one part of parameters. See examples

Well applied style to parameter:

Poorly applied style to parameter:

Deploy of templates from an external source

For setting up an external folder with templates, you can use the property 'idm.sec.core.notification.template.folder' and value classpath*:/eu/bcvsolutions/idm/templates/, file:/home/some_user/templates/.

XML template structure

A template saved in resources as an XML file has the following structure:

<?xml version = "1.0" encoding = "UTF-8" standalone = "yes"?>
<!-- 
Description of the template and its parameters
 -->
 
<template>
	<name>Template name</name>
	//code//Unique template code///code//
	<subject>Notification subject</subject>
	<bodyHtml>Notification body, html can be used (if using html, don't forget the CDATA! block)</bodyHtml>
	<bodyText>Notification body without html.</bodyText>
	<parameter>Notification parameters, separated by a comma</parameter>
	<systemTemplate>Indication whether it is a system template, see system templates for more</systemTemplate>
	<moduleId>Module identifier for which the template is created, informative indication on the FE</moduleId>
</template>

Schema for an XML file can be found in the XSD file: IdmNotificationTemplate.xsd

All template elements are required. It is desirable to place only one template within one file, i.e. one root element template.

Loading of templates is currently done at the start of the application only if there isn't any other system template.

Redeploy and backup

In the notification template agenda, it is possible to restore/redeploy/refresh templates that are in the resources. For templates that cannot be found there, it isn't possible to apply restore/reload/refresh process.

It is possible to back up all templates regardless of their origin.

For backup and redeploy, you must enable this configured property:

 idm.sec.core.backups.default.folder.path=

If configuration property is set and no folder exists, the folder will be created.