Hi Isomorphic,
as long as this is not working I need a workaround for the customer that needs this feature. My workaround is to still use my default html template and with a velocity-{if} another template if the request is for that customer.
Per the docs, <templateFile> is a VelocityExpression, but this test shows that it is not evaluated at all.
Here I'm using one of your default variables, in my case I'd inject a class here before. Tested using v11.1p_2018-03-17.
BuiltInDS animals.ds.xml:
ARC request to http://127.0.0.1:8888/builtinds/sc/RESTHandler:
Result:
I'd expect the $currentDate to be replaced by some date string.
Of course this testcase is not useful if it were replaced, but it shows that the velocity replacement does not take place.
Best regards
Blama
as long as this is not working I need a workaround for the customer that needs this feature. My workaround is to still use my default html template and with a velocity-{if} another template if the request is for that customer.
Per the docs, <templateFile> is a VelocityExpression, but this test shows that it is not evaluated at all.
Here I'm using one of your default variables, in my case I'd inject a class here before. Tested using v11.1p_2018-03-17.
BuiltInDS animals.ds.xml:
Code:
<DataSource ID="animals" serverType="sql" tableName="animals" testFileName="animals.data.xml"> <fields> <field name="commonName" title="Animal" type="text" /> <field name="scientificName" title="Scientific Name" type="text" primaryKey="true" required="true" /> <field name="lifeSpan" title="Life Span" type="integer" /> <field name="status" title="Endangered Status" type="text"> <valueMap> <value>Threatened</value> <value>Endangered</value> <value>Not Endangered</value> <value>Not currently listed</value> <value>May become threatened</value> <value>Protected</value> </valueMap> </field> <field name="diet" title="Diet" type="text" /> <field name="information" title="Interesting Facts" type="text" length="1000" /> <field name="picture" title="Picture" type="image" detail="true" imageURLPrefix="/isomorphic/system/reference/inlineExamples/tiles/images/" /> </fields> <operationBindings> <operationBinding operationType="fetch"> <mail contentType="text/html"> <from>foobar@test.com</from> <to>foobar@test.com</to> <subject>TESTMAIL</subject> [B]<templateFile>$currentDate</templateFile>[/B] </mail> <criteria fieldName="commonName" operator="equals" value="Anteater" /> </operationBinding> </operationBindings> </DataSource>
Code:
<request> <dataSource>animals</dataSource> <operationType>fetch</operationType> </request>
Code:
<response> <status> -1 </status> <queueStatus> -1 </queueStatus> <data> [B]C:\Users\Myuser\workspace\lib\smartgwtpower-6.1p\samples\built-in-ds\war\$currentDate (Das System kann die angegebene Datei nicht finden)[/B] </data> </response>
Of course this testcase is not useful if it were replaced, but it shows that the velocity replacement does not take place.
Best regards
Blama
Comment