Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-1788

Simplify / remove FreemarkerUtil, handling of AlertUtil/message in FreemarkerHelper and other improvements.

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Won't Do
    • Major
    • None
    • 3.5 RC1
    • core

    Description

      AlertUtil's message is currently added to the freemarker context only in FreemarkerUtil (contrary to other default values which are added by FreemarkerHelper. Not sure how to handle this, for two reasons:

      • "message" seems a too generic key name (ie it might "accidentally" be used by the template for another purpose)
      • we're having more and more "default values" added to the freemarker context, and maybe they just all belong to the magnolia context, which is already exposed to the template as "ctx".

      The feature where we passed a template stream/reader to FreeMarker templates inline also needs a review/cleanup. It is used by the mail module and we could probably be using a TemplateLoader to achieve this. In fact, Freemarker provides an abstract URLTemplateLoader, and it would be fairly trivial to implement it so that it fetches a page from a given Magnolia instance pretty much the same way the mail module does it at the moment.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                gjoseph Magnolia International
                gjoseph Magnolia International
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Task DoD