Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-12099

Support Freemarker square interpolation syntax

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Implemented
    • 22.01.01
    • None
    • base
    • None

    Description

      Support Freemarker square interpolation syntax [=...] when the freemarker template filename ends with '.sqi.ftl'. This avoids sharing the same interpolation syntax as Javascript's template literal.
       
      Discussion started at https://lists.apache.org/thread.html/r485b78638f10f95089e5f1123d73a2d132a3f8c2faea0eb056fa1709%40%3Cdev.ofbiz.apache.org%3E

      Reference:
      https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
      https://freemarker.apache.org/docs/dgui_misc_alternativesyntax.html#dgui_misc_alternativesyntax_interpolation

      To test / migrate:
      1) Change template file extension from .ftl to .sqi.ftl
      2) Use regular expresssion replacement:
      From: \${([^${}]+)}
      To: [=$1]

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jamesyong James Yong
            jamesyong James Yong
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment