[ 
https://issues.apache.org/jira/browse/SLING-5739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15296056#comment-15296056
 ] 

Georg Henzler commented on SLING-5739:
--------------------------------------

Having thought about this a bit more, I think the @Via for "switching" the 
resource to a different place makes actually sense - you are right that 
probably only the JcrResourceProvider supports deep paths like 
"jcr:content/myProperty". 

I think that the {{@Via(value = "jcr:content", type = ChildResource.class)}} is 
not a very nice way of mapping it though, would maybe something like 
{{@ViaResource("jcr:content")}} or {{@Via @Path("jcr:content")}} be nicer? 
Maybe introducing {{@ViaResource}} would be better, this new annotation would 
allow a syntax like {{@ViaResource(pathLookupProperty="fileReference")}}, this 
would make it really clear if the path is taken as such or if a mapping via the 
ValueMap is done (in the current {{@ResourcePath}} annotation, the behaviour 
that given paths are taken as is and the fallback is the property name that is 
looked up via ValueMap is confusing to understand IMHO).

The main driver here should not be how things are implemented but rather how 
they look like in the mapping IMHO. WDYT?

> [Sling Models] Allow for extensible @Via providers
> --------------------------------------------------
>
>                 Key: SLING-5739
>                 URL: https://issues.apache.org/jira/browse/SLING-5739
>             Project: Sling
>          Issue Type: New Feature
>          Components: Extensions
>            Reporter: Justin Edelson
>
> Currently, @Via support in Sling Models is limited to JavaBean properties. It 
> would be useful to be able to extend this and allow for downstream projects 
> to add new @Via providers.
> Proposing to support this by extending the @Via annotation
> {code}
> @Via(value = "jcr:content", type = ChildResource.class)
> {code}
> The default type is BeanProperty (the current behavior).
> New providers can be added by implementing a ViaProvider SPI and provide a 
> marker class for use in the annotation.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to