Repository navigation
TEDEFO-5220 Format the values displayed by expression blocks in EFX 2 templates - #182
Merged
Merged
Conversation
rousso
force-pushed
the
feature/TEDEFO-4794-output-formatting
branch
from
October 4, 2026 00:24
a71ea95 to
1a0dd8d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Formatted expression blocks in EFX 2 templates
TEDEFO-5220, TEDEFO-5241 and TEDEFO-5244
Based on #181. It needs OP-TED/eForms-SDK#1436 for the grammar (TEDEFO-5219) and OP-TED/eforms-core-java#71 for the data types (TEDEFO-5239). Until the SDK pull request is merged, the build on GitHub fails.
Formatting
Every value that an EFX 2 template displays is now formatted according to its type, and format options can follow a pipe inside the expression block, as in
${BT-00-Number|2}:no-unitno-unitshort,medium,longno-formattingdisplays the value of a field as entered, and the value of any other expression as it is, without a unit.$valueis formatted like the field it refers to.no-unit.The label key of a unit comes from the metadata: for a field, the root code list of its attribute field, found with the new
SymbolResolver.getAttributeOfField(); for a calculated duration, the list name of the type of the attribute ofduration(timeperiod), through the newSymbolResolver.getDataType().In the view templates of SDK 2, this formats 269 dates displayed with
$valueand 177 numbers. None displays an amount, a measure or a duration without a formatting function, so no unit appears twice.Other changes
EfxExpressionTranslatorV2, also used by the formatted expression blocks and by the label shorthand (#{BT-00-Code},#value).peekParserContext()), instead of receiving it from method to method. No translation and no error message changes.dependencies.jsonnames the code lists of a rulecodelistsinstead ofcodeLists, as "codelist" is one word across the SDK.SymbolResolverhas two new methods,getDataType()andgetAttributeOfField(). Other implementations, such as the MDM's, must add them.Validation
mvn test: all 1523 tests pass, with the grammar of TEDEFO-5219 Add format options to the expression blocks of EFX 2 templates eForms-SDK#1436 and the eForms Core Library of TEDEFO-5239 Provide the typed attribute and the code list of each data type eforms-core-java#71.