Uploaded image for project: 'Blossom'
  1. Blossom
  2. BLOSSOM-232

Annotations for declaring template parameters

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 3.1.3
    • None
    • None
    • None

      Right now template parameters can be set using a post create callback. For completeness it would be nice if these could be declared using annotations along with other template settings. Since parameters are defined on the RenderableDefinition interface this annotation should be usable on @Area too.

      The annotation is a candidate for a repeatable annotation as introduced in Java 8. Magnolia is currently on Java 7 so the annotation should be designed so that it can be used as a repeatable annotation once Magnolia goes to Java 8.
      https://docs.oracle.com/javase/tutorial/java/annotations/repeating.html

      In a class hierarchy the annotations should be evaluated from top to bottom (superclass first) so that a subclass can override parameters in its superclass.

      The post create callback style that's necessary now:

      @PreRegister
      public void preRegister(ConfiguredTemplateDefinition definition) {
          Map<String, Object> params = new HashMap<>();
          params.put("name", "value");
          definition.setParameters(params);
      }
      

        Acceptance criteria

              tmattsson Tobias Mattsson
              tmattsson Tobias Mattsson
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD