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

Nitin Gupta edited comment on SLING-9171 at 3/23/20, 9:03 AM:
--------------------------------------------------------------

Hi,

This is regarding : should we allow the property to be overwritten in the next 
upgrade?

I think we should provide an option for the same.
{code:java}
set properties on /pathA, /path/B (PropertyOption=merge | update)
 set sling:ResourceType to /x/y/z
 set cq:allowedTemplates to /d/e/f/, m/n/
 set someInteger{Integer} to 42
 set someFlag{Boolean} to true 
end
{code}
The suggested approach is to include an additional option at the paths level 
(applicable for all paths mentioned in the block)
{code:java}
PropertyOption{code}
It can have two values: _merge_ or _update_ (default being _merge_): since 
repoinit is often used for customer related content, so ideally we would want 
to avoid overwriting anything. but there may be cases where it is required to 
update without impacting backward compatibility.

Merge option would mean that if that property is already set to a non-null 
value, then don't do anything.

Update option will overwrite the property with new values.

Please feel free to suggest improvements/provide feedback.

cc [~bdelacretaz], [~cziegeler]

 

 


was (Author: nitigupt):
Hi,

This is regarding : should we allow the property to be overwritten in the next 
upgrade?

I think we should provide an option for the same.
{code:java}
set properties on /pathA, /path/B (PropertyOption=merge | update)
 set sling:ResourceType to /x/y/z
 set cq:allowedTemplates to /d/e/f/, m/n/
 set someInteger{Integer} to 42
 set someFlag{Boolean} to true 
end
{code}
The suggested approach is to include an additional option at the paths level 
(applicable for all paths mentioned in the block)
{code:java}
PropertyOption{code}
It can have two values: _merge_ or _update_ (default being _merge_): since 
repoinit is often used for customer related content, so ideally we would want 
to avoid overwriting anything. but there may be cases where it is required to 
update without impact backward compatibility.

Merge option would mean that if that property is already set to a non-null 
value, then don't do anything.

Update option will overwrite the property with new values.

Please feel free to suggest improvements/provide fesdback.

cc [~bdelacretaz], [~cziegeler]

 

 

> Support for settings properties on paths created via repoinit create path
> -------------------------------------------------------------------------
>
>                 Key: SLING-9171
>                 URL: https://issues.apache.org/jira/browse/SLING-9171
>             Project: Sling
>          Issue Type: Improvement
>          Components: Repoinit
>            Reporter: Nitin Gupta
>            Priority: Major
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Apart from jcr:primaryType and mixin, there is a requirement to add custom 
> properties to the nodes valuemap via repoinit. This is a gap currently.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to