Notice View Templates

The view templates of the SDK describe how to display a notice, whatever the format of the display, such as PDF or HTML. They give every application the same standard display of each notice.

Each notice subtype can have one or more view templates. You find these templates in the folder view-templates of the eForms SDK. The template files are written in EFX.

View templates

The view templates are in the folder view-templates of the SDK, and have the extension .efx.

The file view-templates.json gives information on each view template.

Structure of view-templates.json
{
  "ublVersion" : "2.3", (1)
  "sdkVersion" : "1.0.0", (2)
  "metadataDatabase" : { (3)
    "version" : "1.0.0",
    "createdOn" : "2022-08-05T10:24:40"
  },
  "viewTemplates" : [
    {
      "id" : "1", (4)
      "filename" : "1.efx", (5)
      "description" : "Default", (6)
      "_noticeSubtypeIds" : [ "1" ], (7)
      "_label" : "view|name|1" (8)
	  },
	  ...
  ]
}
1 Version of the UBL standard used.
2 Version of the eForms SDK to which the file belongs.
3 Version number and date of the data from which this file was created.
4 Identifier of the view template.
5 Name of the file containing the view template.
6 Description of the view template.
7 List of the notice subtypes that can be displayed with this view template.
8 Identifier of the label for the name of the view template. You find the label in the folder translations.
The properties ublVersion, sdkVersion and metadataDatabase are deprecated. When the file does not change, for example in a patch version, the values of these properties are not always updated, so they can differ from the exact version of the SDK. Use the version of the SDK package instead, or the content of the file VERSION in the top folder of the SDK.

In this version of the eForms SDK, there is only one template for each notice subtype. There is also a summary template, which you can use for any notice subtype, and which gives a short view of the notice.

Template language syntax

As the file extension .efx shows, the templates are written in EFX.

EFX, the eForms Expression Language, is a language made for the domain of eForms. The SDK writes in it both the business rules of eForms and the view templates, so that both have a precise meaning. A template describes the structure of the displayed notice, and uses EFX expressions to give its content.

For the syntax of template files, see Template file.

How to reuse the templates

If your application displays notices with the view templates, you do not need to change its display code each time that a new version of eForms is released. You can also use the same templates to display notices adapted to your Member State.

To do so, translate the view templates of the SDK into the template language of your choice, and display notices with the translated templates.

For guidance on translating the view templates into the template language of your choice, see EFX grammar and EFX Toolkit.


See also: