[
https://issues.apache.org/jira/browse/SLING-2779?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13745959#comment-13745959
]
Gilles Knobloch commented on SLING-2779:
----------------------------------------
[~cziegeler], thanks for the review.
{quote}
I'm not sure about the "deletedProperties" part - does this mean you pass in a
defaults map with a set of deleted properies and if the default map contains a
property which is in the deleted set, this one is ignored? Why not simply
removing the properties from the default map then?
{quote}
Yes that's the idea.
Being able to provide list of deleted properties is more a convenient way,
especially if you provide an unmodifiable Map as defaults (you would have to
create a temporary one and remove there).
Instead of exposing it into a constructor, it could also just be a method like
{{setDeletedProperties}} or {{setIgnoredProperties}} (I don't care about the
name).
{quote}
For the location I think this makes sense to have it in the api bundle.
I'm not sure about the name, DefaultsValueMap - while it sounds fine it's
similar to the CompositeMap
(http://commons.apache.org/proper/commons-collections/javadocs/api-3.2.1/index.html).
{quote}
If I understood correctly, it should be
{{org.apache.sling.api.resource.CompositeValueMap}} (at
{{bundles/api/src/main/java/org/apache/sling/api/resource}}).
> Support for default properties values of a resource
> ---------------------------------------------------
>
> Key: SLING-2779
> URL: https://issues.apache.org/jira/browse/SLING-2779
> Project: Sling
> Issue Type: New Feature
> Components: API
> Affects Versions: API 2.3.0
> Reporter: Gilles Knobloch
> Attachments: SLING-2779.patch
>
>
> I already noticed several times it would be useful to be able to specify a
> default properties for a resource:
> * if the resource itself contains the property, it will override the default
> one.
> * but if it doesn't, the default value is used.
> This could be done either via:
> * specifying a {{sling:defaults}} property on the resource, which contains
> the path to the resource which properties will be used by default.
> * providing a default map of properties
> Attaching a patch for review.
> For testing purpose, I put it under {{org.apache.sling.defaults}}, but I
> imagine it could go to {{org.apache.sling.api.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