Details
-
Improvement
-
Resolution: Fixed
-
Neutral
-
None
-
None
-
None
Description
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); }
Checklists
Attachments
Issue Links
- relates to
-
BLOSSOM-236 Add @Repeatable on @TemplateParam when going to Java 8
-
- Closed
-