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

Add Freemarker functionality to the Nuxeo configuration templates

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.6-SNAPSHOT
    • Fix Version/s: 5.6-RC1, 5.6
    • Component/s: Configuration
    • Tags:
    • Backlog priority:
      400
    • Impact type:
      Configuration format change
    • Upgrade notes:
      Hide

      Due to some constraints of the Freemarker data model (see description), a few configuration keys need to be changed:

      • nuxeo.templates.parsing.extensions -> nuxeo.plaintext_parsing_extensions
      • nuxeo.db.user.separator.key -> nuxeo.db.user_separator_key
      • nuxeo.server.tomcat-admin.port -> nuxeo.server.tomcat_admin.port
        and some java properties will not be available in Freemarker:
      • java.vendor.url
      • java.vendor.url.bug
      Show
      Due to some constraints of the Freemarker data model (see description), a few configuration keys need to be changed: nuxeo.templates.parsing.extensions -> nuxeo.plaintext_parsing_extensions nuxeo.db.user.separator.key -> nuxeo.db.user_separator_key nuxeo.server.tomcat-admin.port -> nuxeo.server.tomcat_admin.port and some java properties will not be available in Freemarker: java.vendor.url java.vendor.url.bug

      Description

      To be able to add some logic to the templates and factorize some of them, we need a richer templating language than just "replace keys with values".
      Freemarker seems to fit the bill and is used in other parts of Nuxeo so people are familiar with it -> integrate it.

      There is a constraint of the Freemarker data model that makes it impossible to have a key name that starts with another existing key name (ie "nuxeo.foo" and "nuxeo.foo.bar").
      -> migrate the few keys that are blocking for this, use a map in ConfigurationGenerator or TextTemplate to convert the old ones in memory.

      We don't want to parse everything as Freemarker: use a specific extension to mark the files we want to process. We shouldn't use the default '.ftl' in case we want to include .ftl files to be deployed by a template.
      -> use '.nxftl' and remove the extension on copy (ie 'server.xml.nxftl' will be processed in Freemarker and the resulting file will be name 'server.xml').

      Due to the expected factorization of some templates (possibly the database ones and certainly the https one), we need to be able to tell people to not use a specific template anymore.
      -> add a key for deprecation (<templatename>.deprecated=true),
      -> add an optional message in case of deprecation (<templatename>.deprecation=message).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mguillaume Mathieu Guillaume
                Reporter:
                mguillaume Mathieu Guillaume
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2 days
                  2d
                  Remaining:
                  Remaining Estimate - 2 days
                  2d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified