You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2013/09/03 11:18:52 UTC

[jira] [Commented] (SLING-2779) Support for default properties values of a resource

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

Carsten Ziegeler commented on SLING-2779:
-----------------------------------------

Thanks for updating the patch. I'Ve applied a modified version in rev 1519608:
- moved the CompositeValueMap class to the wrappers package - as this is more a wrapper
- keySet(), entrySet() and values() now share their implementation
- Removed the ValueMapUtil class - we don't say anything about how the key should be structured, some implementations strip the ./, some dont. For example the ValueMapDecorator does not. And I think adding this check in the JCR implementation was wrong in the first place, the caller should be responsible for providing a correct key. As each implementation might do the check - or not, we preserve the same behaviour as calling the single value maps one after the other.
                
> 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
>            Assignee: Carsten Ziegeler
>             Fix For: API 2.5.0
>
>         Attachments: SLING-2779_20130828.patch, 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