Uploaded image for project: 'Magnolia Resources Module'
  1. Magnolia Resources Module
  2. MGNLRES-210

Groovy as resources: Allow groovy in light modules as model classes

    XMLWordPrintable

Details

    • Story
    • Resolution: Won't Do
    • Neutral
    • None
    • 2.4.1
    • resourceLoaders
    • Yes
    • Yes
    • 13

    Description

      The new resource loading mechanism provides a lot of templating possibilities for light modules.
      But a templater using a light module also get fast to a limit: Using Java for a model class.

      The need for a model class is not the same Java scope as "real" back-end adaptions.
      Often its not complex code, and mainly its very bound to the component/template itself.

      We have a groovy implementation, but:
      One needs to add a groovy script into the CMS (groovy script workspace) to be able to use it as a Module.
      Which would lead to the need of a real JAr based module.

      Suggestion:
      1. Allow a groovy script to be directly added to a light module into the resources, see print screen "Groovy-LinkModel.png"
      2. Add possibility that it can be defined directly in a Yaml file and can be executed by the system.

      modelClass: travel-demo.templates.components.LinkModel
      

      What we gain:
      A pure light module template could get much further with this additional possibility.
      It would open the door for a mixture that even with a light module you can do some 'back-end' coding.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                cringele Christian Ringele
                Nucleus
                Votes:
                8 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Task DoD

                    Time Tracking

                      Estimated:
                      Original Estimate - Not Specified
                      Not Specified
                      Remaining:
                      Remaining Estimate - 0d
                      0d
                      Logged:
                      Time Spent - 0.5d
                      0.5d