Repository navigation
TEDEFO-5239 Provide the typed attribute and the code list of each data type - #71
Merged
Merged
Conversation
…ist of its values
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.
The attribute and the code list of each data type
TEDEFO-5239
To display the unit of an amount, a measure or a duration in a format block, the EFX Toolkit needs to know which attribute of a field holds the unit. For a calculated duration, which has no field, it needs the code list of its unit. Until now, it had to hard-code both.
Each
SdkDataTypenow has:getAttributeName(): the attribute that the fields of the type carry, for examplecurrencyIDfor an amount;getAttributeType(): the data type of that attribute, for examplecurrency;getListName(): for the four new data typescurrency,measurement-unit,duration-unitandlanguage, the root code list of their values, for exampletimeperiodforduration-unit.The code list of the unit of a calculated duration is therefore the list name of the type of the attribute of
duration:timeperiod. For a field, the code list of its unit still comes from its attribute field infields.json. The design is in section 6 of eForms Data Types.The data types now follow the pattern of the other SDK entities:
SdkDataTypeV1andSdkDataTypeV2are created bySdkEntityFactory.getSdkDataType(sdkVersion, JsonNode), from an entry in the format offields/fwd/data-types.json.SdkDataTypeRepository(sdkVersion)reads them from adata-types.jsonresource of this library, in that format. SDK 1 has no such file, so this is where its data types come from. Reading the SDK 2 file is left to TEDEFO-5231, once it has the four new data types and the types of the attributes (TEDEFO-5238), and the masking value ofduration(TEDEMD-1117).createDefault()is unchanged, and deprecated.Validation
SdkDataTypeRepositoryTest: 9 tests.mvn verify: all 100 tests pass, and so does the API compatibility check.