Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-27613

Allow Map and List in Nuxeo Platform Rendering templateParam

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 11.1, 2021.0
    • Component/s: Template Rendering

      Description

      Add the possibility to contribute a complexe structure as templateParam. For instance:

      <fields xmlns:dt="http://www.nuxeo.org/DocumentTemplate">
        <dt:field name="account" type="Map">
          <dt:field name="owner" type="Map">
            <dt:field name="firstname" type="String" value="Benjamin"/>
            <dt:field name="lastname" type="String" value="JALON"/>
          </dt:field>
          <dt:field name="type" type="String" value="checking"/>
          <dt:field name="operations" type="list">
            <dt:field name="op1" type="Map">
              <dt:field name="date" type="Date" value="2017-07-14 13:14:15.678"/>
              <dt:field name="value" type="String" value="$ 200.20"/>
              <dt:field name="isPositive" type="Boolean" value="true"/>
            </dt:field>
            <dt:field name="op2" type="Map">
              <dt:field name="date" type="Date" value="2017-07-15 13:10:15.678"/>
              <dt:field name="value" type="String" value="-$ 40.27"/>
              <dt:field name="isPositive" type="Boolean" value="false"/>
            </dt:field>
          </dt:field>
        </dt:field>
      </fields>
      

      And so the following FTL template filled:

      Hello ${account.owner.firstname} ${account.owner.lastname},
      Here are the operations of the account ${account.number} for this month:
                  DATE          |   VALUE  | IS POSITIVE
       <#list account.operations as operation>
       ${operation.date?datetime} | ${operation.value} | ${operation.isPositive?string("yes", "no")}
       </#list>
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 1 hour
                  1d 1h