How to read "the meanings" of efx templates (in order to build a custom viewer) #910
Replies: 3 comments
-
Dear Fabio, Thanks for an interesting question! Please see also the sample Java application for visualising eForms notices https://github.com/OP-TED/eforms-notice-viewer, especially the Freemarker / XSLT templates at https://github.com/OP-TED/eforms-notice-viewer/blob/develop/src/main/resources/templates/xsl_markup/output_file.ftl The templates are written in a domain-specific language called "EFX". The grammar for this language is in the SDK github repository: https://github.com/OP-TED/eForms-SDK/blob/main/efx-grammar/Efx.g4 and https://github.com/OP-TED/eForms-SDK/blob/main/efx-grammar/EfxLexer.g4. The EFX templates are interpreted using the tool in https://github.com/OP-TED/efx-toolkit-java and converted into XSLT. This XSLT is applied to the notice XML to get the HTML. This is used for all the viewers. The EFX template lines are stored and edited in a database. The template lines in the database have a single sequence order, which is used in all the .efx files. So the EFX lines, and hence the display of lines in the HTML will always be in the same order. And each line is always displayed in the same way, the only differences coming from the information in the notice XML. The database also holds tables defining which template lines are used for which eForms subtypes. These tables are edited manually, and the rules come from the Regulation Annex Excel table. These tables are combined to create the .efx files included in the eForms SDK. There is no single .efx files that is a "template" for the others, as there is no single eForms subtype that uses every defined Field/BT. That said, file 16.efx is a good one to start with, for Contract Notice forms. I also typically use 29.efx for Contract Award Notices, and 6.efx for Prior Information Notices. You are right, the XSLT generated from these EFX lines iterate through the nodes, in a hierarchical way. The template lines all share the same basic structure:
Please let us know how you get on with your project. Best regards, |
Beta Was this translation helpful? Give feedback.
-
Many thanks for the answer. I am trying to develop a procedural list of functions in order to display a notice using the .efx template as "framework". Taking into account:
For instance, how to set-up a function for this line: I am in trouble understanding: What does it tells us to do? I am stuck in this rules because with my code the "custom viewer" give me 3 organizations and not only one. What topic should I study more to better understand how a template .efx works? Your support is really appreciated! |
Beta Was this translation helpful? Give feedback.
-
Another step, a little step, further. I take into account the 16.efx file (the template). The info that would be useful to get the Absolute Xpath of info is: Ok, in the field list this identifier bring to the following Xpath: and this Xpath applied for example to notice That is correct. Best Regards, |
Beta Was this translation helpful? Give feedback.
-
I am trying to develop a notice viewer using .php.
The road is not simple and I am following several ways to get to the target (without success).
The last idea comes from looking at files in: view-templates/16.efx
Question zero: any suggest in order to understand how they are written? Thanks.
First question: are all published notices following the structure of that templates? In other words, for a viewer application are that templates a consistent "scheletron"? Do they provide a guidance about "what info, which data, etc" a particular subtype of notice would have?
If yes, they could be a draft for starting to develop a "php viewer". Or not?
Parsing all rows of template will provide to user all notice information, right?
Information will come from the notice xml_file, Xpaht and making iterative loops through nodes.
I think it's a road worth trying... Or please stop me now :-)
MAIN QUESTION: how to "read" that templates?
Some ideas:
Anyone interested in discover more about the template files?
Best Regards,
Fabio
Beta Was this translation helpful? Give feedback.
All reactions