Ciphix Token Replacer
Overview
The Ciphix Token Replacer is all you need to get app data into texts. Examples are e-mails (mail merge) and letters. The Ciphix Token Replacer makes it easier to set it up as a developer and to maintain or edit the tokens as an administrator. Although some knowledge of the domain model is good to have, the administrator pages have certain usability features built-in, in which tokens are easier to configure correctly.
Documentation
Description
The Ciphix Token Replacer is all you need to get app data into texts. Examples are e-mails (mail merge) and letters. The Ciphix Token Replacer makes it easier to set it up as a developer and to maintain or edit the tokens as an administrator.
Although some knowledge of the domain model is good to have, the administrator pages have certain usability features builtin, in which tokens are easier to configure correctly.
Typical usage scenario
This module is perfect for applying advanced tokens in texts, which makes it easy to use free formatted templates for both e-mails and letters. Also, this can be applied to contextual texts in the application itself, where account (related) specific data needs to be presented to the user.
Features and limitations
- Used the new Atlas UI.
- Works from one top value object (any Mendix object).
- Is language-dependent, but can by any language. Useful for enumerations, dates, and decimals → e.g. localizations).
- Can reach the entire domain model as long if there are associations.
- Can make use of specializations.
- Works with lists that are sortable. Comes in handy when parsing multiple child objects, like order lines or invoice lines. Sorting can be applied to strings, dates, decimals and integers or longs.
- (Supported from 1.5 and up: nested lists and associated object tokens)
- Use the following tokens to activate the list functionality:
- {%LIST_START%} … some text with tokens to be duplicated per instance … {%LIST_END%}
- Specific formatting for specific data types.
- Decimals: Grouping, number of decimals;
- Strings: Escape HTML;
- Dates: Specific format;
- Content parser to apply specific logic based on the key-value stored in the attribute to use in the token replacement. Useful i.e. for correspondence headings, like 'Dear [MALE -> Mr.] or [FEMALE -> Mrs.]' and this is also language-dependent.
- Specific logging is applied in INFO, DEBUG, AND TRACE which makes it easier to understand as a developer what's happening.
- Works completely with both persistent entities and non-persistent entities.
- The ability to export en import any token replacer definition.
- Abilty to apply system tokens like object id, configuration key like application url or constants. This provides for example deeplinks builds out-of-the-box.
- Added more after startup helpers that can be used for specific data type and system tokens.
Dependencies
- 7.13.1 and up
- MxModelReflection
- Included libraries as of 2.2.1:
- commons-text-1.10.0
- commons-lang3-3.12.0
Installation
Use the _USE_ME-folder for integration in the application.
- Place TokenReplacer_Start in navigation.
- Use the Java-action ReplaceTokens to apply the logic or the microflow activity ‘Replace tokens’
- Use the after startup helpers to generate tokens on startup or import a definition with json.
- Use the exposed microflow actions for more convenient implementation.
Configuration
At least make sure the MxModelReflection is synchronized for all modules to be used for tokens.
Known bugs
-
Future enhancements
- Let me know!
Frequently Asked Questions [optional]
- Q: Can I use this for multiple lists?
- A: Yes, the Ciphix Token Replacer works with multiple lists and also with multiple nested lists.