Closed modeckimellett closed 6 years ago
I would like to be able to @InheritInject a Sling Model for a named sub-node of my current Resource backed Sling Model. @Inject already works for injecting Sling Models for child resources in this way but it does not provide an option to inherit.
@InheritInject
@Inject
The implementation would be something like
getNodeInherited(propertyName).get().resource.adaptTo(Type)
where propertyName is the sub-node path defined by the injected property's name and Type is the type of that property.
propertyName
Type
This would be especially relevant when used in conjunction with the @DialogFieldSet annotation in https://github.com/OlsonDigital/cq-component-maven-plugin as below:
@DialogFieldSet
@DialogField(fieldLabel= "Sample Field", ranking = 1D) @DialogFieldSet(namePrefix = "./sampleField/") @InheritInject ReusableItem sampleField
Where ReusableItem extends AbstractComponent and has some dialog fields configured on it.
ReusableItem
AbstractComponent
Note that this conflicts with #8
added to develop
I would like to be able to
@InheritInject
a Sling Model for a named sub-node of my current Resource backed Sling Model.@Inject
already works for injecting Sling Models for child resources in this way but it does not provide an option to inherit.The implementation would be something like
where
propertyName
is the sub-node path defined by the injected property's name andType
is the type of that property.This would be especially relevant when used in conjunction with the
@DialogFieldSet
annotation in https://github.com/OlsonDigital/cq-component-maven-plugin as below:Where
ReusableItem
extendsAbstractComponent
and has some dialog fields configured on it.Note that this conflicts with #8