You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Justin Edelson (JIRA)" <ji...@apache.org> on 2016/05/20 14:44:12 UTC

[jira] [Comment Edited] (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 edited comment on SLING-5739 at 5/20/16 2:43 PM:
----------------------------------------------------------------

[~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 which is, IMHO, not as elegant and intuitive as using the `@Via` annotation to select the resource.



was (Author: justinedelson):
[~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)