major
minor
major
minor
Currently, HTML with embedded TL-Script expressions can be parsed as TL-Script, which generates HTML, evaluates the embedded expressions, and outputs the results.
In some cases, it would also be helpful to have plain text with embedded script expressions. For example, if you want to configure a dynamic filename for an export (which may optionally depend on the exported model). In this case, you’d like to enter the file name as plain text and mark only the optional dynamic part specifically. If, instead, you had to configure the file name as a TL-Script expression, then in the simplest case of a static file name, you’d 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, in effect, a function with one parameter. In the configuration, you can write normal text and optionally embed TL-Script expressions within curly braces. The implicit variable $model can be used in these expressions. It 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()