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

Alexander Klimetschek commented on SLING-2853:
----------------------------------------------

See in my review above, instead of getEntries() returning Resources, I 
suggested a getEntries() returning an Entry class with the referenced resource 
and the properties just as ValueMap (if you want to batch-get all info at 
once). When adding a reference via ResourceCollection.add() you only allow a 
map for the properties either, so no need to return a Resource when reading it.

For all the members/entries that don't have properties, you don't have to 
return any properties - in getEntries() the Entry would hold an empty or null 
map, in the suggested getProperties(Resource) it would also be empty or null.

BTW, there should probably also be an add(Resource) without the metadata.
                
> Add ResourceCollection to Sling
> -------------------------------
>
>                 Key: SLING-2853
>                 URL: https://issues.apache.org/jira/browse/SLING-2853
>             Project: Sling
>          Issue Type: New Feature
>          Components: API
>    Affects Versions: API 2.0.2
>            Reporter: Amit Gupta
>            Priority: Minor
>         Attachments: collection.zip, resourcecollection.zip
>
>
> Creating a collection of resources has been a use case for a while and there 
> has been no inherent support in SLING for the same.
> This proposal is to add a ResourceCollection interface and implementation 
> that allows creation of collection of resources. 
> Collection is a simple list of members, where each member contains path of 
> resource it refers to. In future, we might need to store additional 
> information with the member, hence following structure is proposed
> N: resourceCollection (nt:unstructured)
>         + P: sling:resourceType
>         + N : members (nt:unstructured)
>             + N: member_res1  > nt:unstructured
>                 + P: path > string, reference to actual resource
>             + N: member_res2  > nt:unstructured
>                 + P: path > string, reference to actual resource

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to