Visualising a notice
To give your users a read-only view of a notice, you have the following options.
Using the TED Visualisation API
You can call the TED Visualisation API to receive a notice in PDF or HTML. For how to call this API, see its endpoint.
| Advantages |
|
| Disadvantages |
|
| If you are creating a traditional application that does not rely on the eForms SDK, this is the option that the Publications Office recommends. |
Creating your own viewer
If you want more control, and a better integration with your application, you can also create your own component to visualise notices.
To understand the general idea, think first of a basic implementation built entirely by hand:
-
You would use a template engine of your choice for your platform, for example XSLT, FreeMarker, Thymeleaf or Mustache.
-
You would write the template files for your template engine by hand, usually one template for each notice type.
-
You would pass the right template file, with the data of the notice, to your template engine.
-
Your template engine would produce the visualisation that you chose.
This is how you would do it entirely by yourself. The next section shows how the eForms SDK can help.
Using the SDK
Instead of writing and maintaining the template files yourself, you can use the template files that the eForms SDK provides, with any template engine. However, these template files are written in EFX. So you need an EFX translator, which translates the EFX templates into your target template language.
The advantage is that you can reuse the templates of the SDK directly. The cost is that you need to write an EFX translator. To make this task as easy as possible, the Publications Office provides the EFX Toolkit. It also provides a sample application that follows this approach, to help you get started.
Once you have created your EFX translator, you no longer need to maintain the view templates yourself: the updates of the eForms SDK bring their new versions. You still maintain your translator and your viewer.
| Start from the Notice Viewer sample application. |
| Advantages |
|
| Disadvantages |
|