IIUC, what Ben is asking for is a

void setProperties(Map<String, Object> properties);

which will set the properties on all resources in the collection.

Seems like a good idea to me.

Justin


On Wed, Jul 24, 2013 at 9:43 PM, Amit.. Gupta. <amitg...@adobe.com> wrote:

> ResourceCollection has
>
> /**
>      * Creates a new entry in the collection at the last position and add
> a reference to resource
>      * in the entry.
>      * Changes are transient & have to be saved by calling
> resolver.commit()
>      *
>      * @param resource resource to be added
>      * @param properties The additional properties to be stored with the
> collection entry (can be null).
>      * @return true if addition of resource to collection was successful or
>      *         false if collection already contained the resource or
> resource is null.
>      *
>      * @throws {@link PersistenceException} if the operation fails
>      */
> boolean add(Resource resource, Map<String, Object> properties) throws
> PersistenceException;
>
> And, then to retrieve and update the properties.
> /**
>      * Returns additional properties for a particular resource in
> Collection entry.
>      *
>      * @return properties of the Collection entry as
> <code>ModifiableValueMap</code>, returns null if entry found.
>      */
>     ModifiableValueMap getProperties(Resource resource);
>
> Thanks
> -Amit
> From: Ben Helleman [mailto:bhell...@adobe.com]
> Sent: 25 July 2013 00:10
> To: dev@sling.apache.org
> Subject: [sling/collection] Properties
>
> Is there any way which to apply properties to members of a
> sling/collection?
>
> For example I would like to apply properties to the websites node, not the
> resource which websites references.  Yes, I'm aware that I could get the
> collection and dig through children until I find the node of interest and
> then apply properties.  But there must a better way.
>
> [cid:image002.png@01CE887B.BB7E13C0]
>
> Thanks
> Ben
>

Reply via email to