[jira] [Commented] (SLING-5739) [Sling Models] Allow for extensible @Via providers
[ https://issues.apache.org/jira/browse/SLING-5739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16170075#comment-16170075 ] Justin Edelson commented on SLING-5739: --- [~kwin] docs have been updated. > [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 >Assignee: Justin Edelson > Fix For: Sling Models API 1.3.4, Sling Models Impl 1.4.0 > > Attachments: SLING-5739.diff > > > 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.4.14#64029)
[jira] [Commented] (SLING-5739) [Sling Models] Allow for extensible @Via providers
[ https://issues.apache.org/jira/browse/SLING-5739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16168089#comment-16168089 ] Konrad Windszus commented on SLING-5739: [~justinedelson] Can you update the documentation at https://sling.apache.org/documentation/bundles/models.html#via for this feature and also document the shipped Via providers? > [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 >Assignee: Justin Edelson > Attachments: SLING-5739.diff > > > 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.4.14#64029)
[jira] [Commented] (SLING-5739) [Sling Models] Allow for extensible @Via providers
[ https://issues.apache.org/jira/browse/SLING-5739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15296235#comment-15296235 ] Justin Edelson commented on SLING-5739: --- To be clear, this isn't really about switching the resource. It is about switching the adaptable. Once you think in those terms, it should become clear that `@ViaResource` is a special case and not a general approach. IMHO, the only options are: * `@Via(value = "jcr:content", type = ChildResource.class)` * `@Via(value = "jcr:content", type = "child-resource")` I'm open to supporting an annotation processor thing for `@Via` similar to what we have for `@Inject` but IMHO this must be optional and we need to try to figure out some way to avoid the pain that the injector-specific annotations have caused. > [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)
[jira] [Commented] (SLING-5739) [Sling Models] Allow for extensible @Via providers
[ 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)
[jira] [Commented] (SLING-5739) [Sling Models] Allow for extensible @Via providers
[ https://issues.apache.org/jira/browse/SLING-5739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15293650#comment-15293650 ] Justin Edelson commented on SLING-5739: --- bq. Generally, I think it will almost always be better to create its own model for those use cases (flattening into one Pojo on java side what is structured in the JCR will not make the code better readable or maintainable). In many cases I agree, but creating a separate model for one or two properties doesn't really make sense. bq. It would fairly easy to extend @ResourcePath to lookup the resource's ValueMap and use the target property name to lookup the value to inject. As with SLING-5726, I think this is the wrong separation of concerns, but we obviously have a difference of opinion there. bq. Certainly, this would be more light-weight than introducing another fairly complicated ViaProvider SPI. I'm not sure the SPI should be characterized as "complicated" :) It's two methods. Could be one, but I wanted to use classes to select the type to help with IDE code completion. > [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)
[jira] [Commented] (SLING-5739) [Sling Models] Allow for extensible @Via providers
[ https://issues.apache.org/jira/browse/SLING-5739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15293618#comment-15293618 ] Justin Edelson commented on SLING-5739: --- nevermind. I figured out my error. I'm not sure this behavior should be relied upon as this is not actually part of the contract of ValueMap; it is only there for the one specific implementation. > [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)
[jira] [Commented] (SLING-5739) [Sling Models] Allow for extensible @Via providers
[ https://issues.apache.org/jira/browse/SLING-5739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15293593#comment-15293593 ] Justin Edelson commented on SLING-5739: --- This doesn't work for me. Take a look at this patch to the IT test suite: https://gist.github.com/justinedelson/ae1366b9ffc04e7cc07b14c6942aad34 Maybe I'm doing something wrong. > [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)
[jira] [Commented] (SLING-5739) [Sling Models] Allow for extensible @Via providers
[ https://issues.apache.org/jira/browse/SLING-5739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15293565#comment-15293565 ] Georg Henzler commented on SLING-5739: -- {quote} this is actually about injecting a property of the child resource, not the child resource itself. {quote} This is already possible with {code} @Inject @Named("path/to/resource/jcr:title") @Source("valuemap") // or @ValueMapValue private String titleFromSubResource; {code} {quote} In terms of other `@Via` providers, one more that could make sense is a path reference provider. {quote} Generally, I think it will almost always be better to create its own model for those use cases (flattening into one Pojo on java side what is structured in the JCR will not make the code better readable or maintainable). However if really needed, this we can already almost achieve today: {code} @Inject @Named("otherPath") @Source("resource-path") // or @ResourePath(name="otherPath") private Resource propertyFromSomeOtherResource; // we can get that resource today, but not yet only the property "otherProperty" {code} But for this I would probably fairly easy to just extend @ResourcePath a bit to make the following work: {code} @Inject @Named("otherPath") @TargetProperty("otherProperty") @Source("resource-path") // or @ResourePath(name="otherPath", targetProperty="otherProperty") private String propertyFromSomeOtherResource; {code} It would fairly easy to extend @ResourcePath to lookup the resource's ValueMap and use the target property name to lookup the value to inject. Certainly, this would be more light-weight than introducing another fairly complicated ViaProvider SPI. > [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)
[jira] [Commented] (SLING-5739) [Sling Models] Allow for extensible @Via providers
[ https://issues.apache.org/jira/browse/SLING-5739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15293512#comment-15293512 ] Konrad Windszus commented on SLING-5739: Please consider my example from above. At least in the {{ValueMapInjector}} you can use the name attribute to refer to properties more deeply nested (it is a core feature of the {{ValueMap}} itself). > [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)
[jira] [Commented] (SLING-5739) [Sling Models] Allow for extensible @Via providers
[ https://issues.apache.org/jira/browse/SLING-5739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15293500#comment-15293500 ] Konrad Windszus commented on SLING-5739: Actually you can already achieve that via {code} @Inject @Named("jcr:content/title") String title; {code} > [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)
[jira] [Commented] (SLING-5739) [Sling Models] Allow for extensible @Via providers
[ https://issues.apache.org/jira/browse/SLING-5739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15293492#comment-15293492 ] Konrad Windszus commented on SLING-5739: This is different than the other Via then. For example when using Via on the ValueMapInjector, the Via is applied before it comes to the injector. Here it is the other way round. > [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)
[jira] [Commented] (SLING-5739) [Sling Models] Allow for extensible @Via providers
[ https://issues.apache.org/jira/browse/SLING-5739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15293462#comment-15293462 ] Justin Edelson commented on SLING-5739: --- [~kwin] This is orthogonal to `@Named`. `@Named` is about getting the value to inject. `@Via` is about getting the "container" of that value (if it isn't the adaptable itself). > [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)
[jira] [Commented] (SLING-5739) [Sling Models] Allow for extensible @Via providers
[ https://issues.apache.org/jira/browse/SLING-5739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15293460#comment-15293460 ] Justin Edelson commented on SLING-5739: --- In terms of other `@Via` providers, one more that could make sense is a path reference provider. {code} - foo (nt:unstructured) + otherPath (String) = "/bar" + myProperty (String) = "mine" - bar (nt:unstructured) + otherProperty (String) = "other" {code} And then... {code} @Model(adaptable = Resource.class) public interface Foo { @Inject @Via(value = "otherPath", type = PathReference.class) String getOtherProperty(); @Inject String getMyProperty(); } {code} {code} Resource r = resourceResolver.getResource("/foo"); Foo foo = r.adaptTo(Foo.class); assertEquals("other", foo.getOtherProperty()); {code} > [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)
[jira] [Commented] (SLING-5739) [Sling Models] Allow for extensible @Via providers
[ https://issues.apache.org/jira/browse/SLING-5739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15293457#comment-15293457 ] Justin Edelson commented on SLING-5739: --- [~henzlerg] this is actually about injecting a property of the child resource, not the child resource itself. For example, given the content structure: {code} - foo (nt:unstructured) - jcr:content (nt:unstructured) + title (String) = "My Title" {code} If you want to adapt the node `foo` and have the `title` property injected. Currently, to do this, you have to inject the `jcr:content` resource's ValueMap and then manually extract the property. > [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)
[jira] [Commented] (SLING-5739) [Sling Models] Allow for extensible @Via providers
[ https://issues.apache.org/jira/browse/SLING-5739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15293408#comment-15293408 ] Konrad Windszus commented on SLING-5739: For me introducing more options for {{Via}} is confusing, then you can for some things use either {{@Named}} or attribute {{name}}. I am strongly in favor of having only one option of achieving one thing. So I must say, I agree with [~henzlerg] here. > [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)
[jira] [Commented] (SLING-5739) [Sling Models] Allow for extensible @Via providers
[ https://issues.apache.org/jira/browse/SLING-5739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15293362#comment-15293362 ] Georg Henzler commented on SLING-5739: -- I think the use case from this ticket already works using the "child-resources" injector (both for injecting plain resources or the corresponding model): {code} @Inject @Source("child-resources") // or @ChildResource @Named("path/to/resource") private Resource plainResource; @Inject @Source("child-resources") // or @ChildResource @Named("path/to/resource") private MyModel resourceAdaptedToMyModel; {code} [~justinedelson] Are there other scenarios for @Via providers that would make sense? Otherwise this is maybe just introducing unnecessary complexity... > [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)
[jira] [Commented] (SLING-5739) [Sling Models] Allow for extensible @Via providers
[ https://issues.apache.org/jira/browse/SLING-5739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15292010#comment-15292010 ] Justin Edelson commented on SLING-5739: --- There's one minor issue in the patch - the ChildResourceViaProvider is not in the correct package. I'll correct this when merging. > [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)
[jira] [Commented] (SLING-5739) [Sling Models] Allow for extensible @Via providers
[ https://issues.apache.org/jira/browse/SLING-5739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15291574#comment-15291574 ] Justin Edelson commented on SLING-5739: --- also includes a new @Via provider, ChildResource as shown above. > [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)
[jira] [Commented] (SLING-5739) [Sling Models] Allow for extensible @Via providers
[ https://issues.apache.org/jira/browse/SLING-5739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15291569#comment-15291569 ] Justin Edelson commented on SLING-5739: --- proposed patch: https://codereview.appspot.com/298180043 > [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)