Am Mo., 18. Sept. 2023 um 18:12 Uhr schrieb Alon Ziv
<nola...@google.com.invalid>:

> You can achieve this via template magic already:
>
> ${variableB!r"${variableB}"}
>

Thanks, good to know.
But I am looking for something where the template does not need to be
changed.
Basically this behavior but automatically done.


>
> On Mon, Sep 18, 2023 at 7:03 PM Christoph Rüger <c.rue...@synesty.com>
> wrote:
>
>> Hi,
>> we may have a rather special case and are looking for ideas.
>> We would like to to keep the placeholders as they are in case of null
>> values.
>>
>> Assume the following template:
>>
>> ${metaHeaderDataA}
>> ${variableB}
>>
>> We would like the following behavior:
>>
>> *1st render phase:*
>> data.put("metaHeaderDataA", "foo")
>> environment.process(template);
>>
>> Expected Output:
>> foo
>> ${variableB}
>>
>> The we want to render this output again with:
>>
>> *2nd render phase:*
>> data.put("variableB", "bar")
>> environment.process(template);
>>
>> Expected final Output:
>> foo
>> bar
>>
>> As you see there 2 two rendering phases involved. In phase 1 only some
>> variables are known (metaHeaderDataA).
>> The other variables come later.
>> We would like keep the placeholders in the 1st rendering phase, if there
>> is
>> no value or null value in the data model, so that they can be rendered
>> later.
>>
>> I think this is very special.
>> So I am just  thinking, is this something which could (theoretically) be a
>> configurable option maybe on a per-Template-object level (Java Code)? Or
>> is
>> this something impossible to do?
>>
>> Or any other workaround ideas?
>>
>>
>> Thanks
>> Christoph
>>
>> --
>> Synesty GmbH
>> Berggasse 1
>> 07745 Jena
>> Tel.: +49 3641 5596493Internet:
>> https://synesty.com <https://synesty.com>
>> Informationen zum Datenschutz:
>> https://synesty.com/datenschutz <https://synesty.com/datenschutz>
>>
>> Geschäftsführer: Christoph Rüger
>> Unternehmenssitz: Jena
>> Handelsregister B
>> beim Amtsgericht: Jena
>> Handelsregister-Nummer: HRB 508766
>> Ust-IdNr.:
>> DE287564982
>>
>

-- 
Christoph Rüger, Geschäftsführer
Synesty <https://synesty.com/> - Anbinden und Automatisieren ohne
Programmieren

-- 
Synesty GmbH
Berggasse 1
07745 Jena
Tel.: +49 3641 5596493Internet: 
https://synesty.com <https://synesty.com>
Informationen zum Datenschutz: 
https://synesty.com/datenschutz <https://synesty.com/datenschutz>

Geschäftsführer: Christoph Rüger
Unternehmenssitz: Jena
Handelsregister B 
beim Amtsgericht: Jena
Handelsregister-Nummer: HRB 508766
Ust-IdNr.: 
DE287564982

Reply via email to