Major
Detail
Bugfix
Major
Detail
Currently, you can parse HTML with embedded TL script expressions as a TL script that generates HTML and evaluates and outputs the expressions embedded in it.
For some cases you would also like to have plain text with embedded script expressions. E.g. if you want to configure a dynamic file name for an export (which optionally depends on the exported model). In this case, one would like to enter the file name as plain text and only mark up the optional dynamic part specifically. If instead one had to configure the filename as a TL-Scrip expression, then in the simplest case of a static filename one would always have to use TL-Script-Quotes.
Application
Definition of a property with embedded expressions:
#!java interface MyConfig extends ConfigurationItem { @Format(TextWithEmbeddedExpressionsFormat.class) Expr getDynamicTextProperty() }
The configured expression Expr is then de-facto a function with one parameter. In the configuration you can write normal text and optionally embed TL script expressions in curly braces in it. In these expressions the implicit variable $model can be used. This receives the value passed to the expr function.
Test
- test.com.top_logic.model.search.expr.config.TestTextWithEmbeddedExpressionsFormat
- test.com.top_logic.model.search.expr.TestSearchExpression.testTextWithEmbeddedExpressions()