Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    6.1p: <templateFile> seems not to support Velocity, even though it should

    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:
    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>
    ARC request to http://127.0.0.1:8888/builtinds/sc/RESTHandler:
    Code:
    <request>
        <dataSource>animals</dataSource>
        <operationType>fetch</operationType>
    </request>
    Result:
    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>
    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
    Last edited by Blama; 5 Apr 2018, 01:40. Reason: Added used version v11.1p_2018-03-17

    #2
    We've made a change to address this issue. Please try the next nightly build, dated April 11.

    Regards
    Isomorphic Software

    Comment


      #3
      Hi Isomorphic,

      this is working now for me, thanks.

      Best regards
      Blama

      Comment

      Working...
      X