Implementing eForms without the eForms SDK
This page gives guidance and resources for developers who decide to implement eForms in a traditional application, which does not rely on the eForms SDK.
- An important clarification
-
You use the eForms SDK if and only if you create an application driven by metadata, that is, an application that the metadata of the SDK drives. If not, you are developing a "traditional application".
On many of the topics of this page, the focus is on the difficulties, rather than on specific solutions for developers of traditional applications. The approach that the Publications Office proposes for all these difficulties is an architecture driven by metadata, which passes changes on as updates of metadata. If you have decided against this approach, you have, by definition, chosen to design your own solutions to these difficulties.
|
If you are still considering an approach driven by metadata, but have specific difficulties with the SDK, you can propose improvements of the SDK (through GitHub discussions) that would let you base your implementation on it. |
The least impact
Even if you decide not to base your applications on the SDK, there is one thing closely tied to the SDK that you cannot avoid: the SDK version number.
Your application always needs to know the CustomizationID that it uses, and the exact specification that this
CustomizationID stands for. Only then can it create a notice that passes TED CVS validation.
| This is essential to create a valid notice. |
So you need a way to find out which versions of the XML schema, of the business rules and of the controlled vocabularies belong together. With that combination, you can produce a notice XML that TED CVS accepts for publication.
| The easiest way to do this is to take these parts directly from the eForms SDK. |
Where to start
Start by studying the eForms Specification. You find there the definitions and descriptions of all the concepts used in the eForms schemas and in the implementation of eForms by the Publications Office. The eForms SDK contains a consolidated version of the schema. OASIS Open gives more information on UBL 2.3.
The most basic problems for which you must find solutions include:
-
how to create a form that collects the data of a notice;
-
how to validate a notice, above all while the user enters the data;
-
how to save the notice in a valid UBL/XML file.
Other topics, less common but just as difficult, can also interest you:
-
how to edit a notice created with an older version of the eForms specification;
-
how to visualise a notice.
The following sections give guidelines on how to approach these problems without relying on the eForms SDK.
Business rules
You find all the business rules that validate eForms notices, in plain English, in the eForms Metadata Reference section. It lists thousands of business rules, so the task is difficult. Programming every business rule by hand is not practical, so you will have to accept a mix of compromises and workarounds.
Programming and maintaining thousands of business rules by hand is difficult in itself. However, developers who do not use the eForms SDK, or a similar approach, also have to keep their implementation up to date as the eForms specification changes, which is even more difficult. For more on this, see the section Coping with change in eForms specifications below.
| The business rules are also written formally in EFX, the eForms Expression Language. However, since you do not use the SDK, this formal definition will not help you much. |
Creating a form to fill in a notice
There is no proposed solution to this problem for eSenders that do not use the SDK. You need to decide yourself how to program this function of your application, by studying the eForms Specification and the eForms schemas.
| The Publications Office uses the notice type definitions of the eForms SDK to define the forms that users fill in, in its application eNotices2. However, the notice type definitions depend on other metadata of the SDK, so you cannot reuse them on their own. |
| To find out how the SDK deals with these problems, see Creating notice forms. |
Creating a notice XML file
To create a notice XML file, your main source of information is again the eForms Specification, together with the eForms schema. You find there all the information that you need to create a valid notice XML.
| The Publications Office uses a conceptual model of a notice, which the field metadata of the eForms SDK describes. With this model, its application does not depend on the details of the eForms/UBL XSDs, and keeps creating valid notices even when the schemas or the business rules change. |
| To find out how the eForms SDK deals with these problems, see Saving a notice in XML. |
Validating notices
Validation is important for two main reasons:
-
The first is to make sure that the TED Central Validation Service will not reject a notice that is about to be submitted.
-
The second, even more important, is to help the user fill in the notice.
Guiding the user, by showing which fields they need to fill in and what prevents their notice from being valid, is especially important in eForms, because the notice forms are often large and complex.
Validation in the application of the user, while the user fills in the form, is the most user-friendly solution. However, this validation depends on the application, and takes much effort to develop, especially if you must program again by hand all the validation logic that the SDK provides.
Validation on the server
The best solution for validating notices is to validate them through the TED Validation API.
In this way, you can check the validity of notices as you create them, without programming and maintaining thousands of business rules by hand. This approach has some disadvantages, however:
-
you need to send a request to the TED Validation API each time that you need to validate the notice;
-
your application cannot validate notices without a connection to the internet;
-
you need to send a complete notice to the TED API to validate it;
-
without the SDK, it is not easy to match the validation report of the TED API with the controls of your form. It may be more practical to show the whole validation report to your user, and let them work out the problems themselves.
You can also consider the Schematron validation rules of the eForms SDK. However, apart from saving a request to the TED API, this does not solve the other problems listed above.
| The Publications Office uses this type of validation only when a notice is about to be submitted for publication. To help the user while they fill in the form, it relies on validation in the application. |
Validation in the application, while the user fills in the form
There is no proposed solution for validation in the application for developers who do not use the SDK.
| The field metadata of the SDK contains the business rules as constraints, written formally in EFX, a language that does not depend on any platform. However, without the SDK, in an application that is not driven by metadata, you cannot reuse these constraints. |
|
The Publications Office uses its own EFX translator to translate the business rules from EFX into Java. It then
sends a request to the server of its web application to validate the form while the user fills it in. You could start a similar solution for your target language, such as JavaScript or PHP, with the EFX Toolkit. However, without the SDK, you will need to build your own solution for this, or perhaps give up validation in the application. |
Visualising notices
To visualise notices, you can use the TED Visualisation API, which presents the notice in HTML or in PDF for you.
An obvious disadvantage of this solution is that it does not work without a connection to the internet. However, this does not matter for applications that do not need to work without a connection.
The other compromises of this solution are the delay of each request to the TED API, and the limited choice of formats: only PDF and HTML.
| For a better integration with your application, see Creating your own viewer, which shows how you can reuse the EFX templates of the SDK to create your own notice viewer. |
Translations into other languages
The eForms SDK provides translations of all procurement labels. Applications driven by metadata can use these translations directly, through the label identifiers of the SDK. Other applications can reuse them if their design has concepts that match those of the SDK, such as fields.
You can certainly use the translations of the validation messages, because the validation report of TED CVS contains the label identifiers of these messages.
Authority tables
Authority tables (codelists) play an important role in the validity of an eForms notice, because they control the values that certain XML elements can take.
However, several standards in different business domains share the authority tables, which is why they exist in the first place. So they have a life cycle of their own, and each of them evolves at its own pace. The eForms specification evolves alongside the controlled vocabularies. So developers must use the right version of each codelist for each notice, according to the version of the eForms specification with which the notice was created.
You can manage the controlled vocabularies yourself. You usually find them in EU Vocabularies, where all their versions are available in several file formats. However, with this approach, you also need a way to find out which version of each codelist contains the codes that are valid for a specific version of eForms.
| The eForms SDK solves this problem: it brings together the right version of each codelist with all the other parts that define a specific version of eForms. Developers who use the SDK simply take the codelist from the SDK, without having to check its version and content. |
Coping with change in eForms specifications
The main reason why the Publications Office recommends applications driven by metadata, based on the SDK, is to reduce the risks and the effort that come with change, because change is certain to happen.
Changes can come from:
-
changes in the eForms regulation;
-
the need to correct mistakes;
-
the need to deal with security or privacy concerns;
-
the general evolution of existing information systems;
-
the general evolution of the business domain.
The changes that concern you are all the changes that affect the code of your application. With the eForms SDK, the Publications Office tries to reduce and manage the kinds of change that can affect applications. It cannot control how many changes will happen over a period of time, but it can control which kinds of change can affect applications, and so control the overall impact of these changes.
Without the SDK, you cannot benefit from this approach. However, you will face the same changes as everyone else in the business domain, including the Publications Office itself. This section deals with some kinds of change that you will have to cope with, if you decide not to base your implementation of eForms on the SDK.
What can change
First, these are the main parts that can change:
- The eForms schema
-
New XML elements can be added, or old elements removed. The type of an XML element, or the number of times that it can occur, can change.
- The business rules
-
Old rules can be removed, new rules added, and existing rules changed. Changes in the schema can also lead to changes in the rules.
- The authority tables
-
Codelists can be added or removed, or their content (the codes) can change.
Functions affected
Next, these are the functions of an application that these changes affect:
- Filling in a new notice
-
If the eForms schema gains a new XML element, one or more forms must change to include the new element. The removal of an XML element has a similar impact. In the same way, you need to revise one or more forms if the schema changes the type of an XML element, or the number of times that it can occur.
If your application only creates new notices that comply with the latest eForms specification that it implements, this type of impact can be acceptable for an application that is not driven by metadata. - Editing an existing notice
-
If your application lets the user edit an existing notice, the notice may have been created with an older version of eForms. It may then require fields that later versions deleted. In the same way, a notice that complies with a previous version of the eForms specification should not contain fields that later versions added.
However good and detailed the documentation of the Publications Office is, an application that is not driven by metadata will find it difficult to maintain several versions of each form. You may have to choose between giving up the editing of older notices, and finding a way to convert older notices to the latest specification, as far as this is possible.If you need to edit existing notices, reconsider your approach, and choose an application driven by metadata that uses the eForms SDK. - Validating a notice
-
Changes in the business rules can affect validation, but so can changes in the schema. If you edit an existing notice, you also need to validate it against the rules and the schema that it should comply with.
So an application that is not driven by metadata must also maintain the right "versions" of the business rules and of the schema, to validate the different versions of the eForms specification.
To reduce the impact of this type of change on your traditional application, validate notices with the TED Validation API. - Saving a notice XML
-
The difficulties of the previous two cases also apply to this function of your application. In practice, an application that is not driven by metadata cannot handle several versions of the eForms specification at the same time.
Perhaps the only way for traditional applications to limit all these problems is to give up any function that requires several "versions" of the eForms specification, programmed and maintained side by side.If you need to edit existing notices without converting them to the latest eForms specification, reconsider your approach, and choose an application driven by metadata that uses the eForms SDK. - Visualising a notice
-
Unless you use the TED Visualisation API, you need to maintain different "versions" of your templates for the visualisation of notices, to visualise each notice correctly when needed.
To reduce the impact of this type of change on your traditional application, visualise notices with the TED Visualisation API.