Introduction
The initial concept doesn't comprise of a central trait registry which contains all information regarding a trait (i.e. fields, transformers, formatter, etc.).
Trait Registry
Why?
- "Dynamic" dialogs (similar to configuration on the fly)
- Everything regarding a trait in on place, rather than distributed of mulitple configuration locations
- Add traits on-the-fly (e.g dialogs)
Where?
- In any module under the node
- traits/
How?
- Trait will have a TraitDescriptor + ConfiguredTraitDescriptor
- Use the "default" registry mechanism to regsiter additions/modification
TraitDescriptor
A TraitDescriptor should contain:
- constraintField
- FieldDefinition
- To edit the actual contraint (Voter)
- Transformer
- FieldDefinition
- valueField
- FieldDefinition
- To edit the value of a trait
- FieldDefinition
- formatter
- previewParameter
- converters for preview
- enables preview of trait in Preview App
- traitClass=info.magnolia.trait.Country
- The actual class (POJO) of the trait
Overview
Content Tools