Expand my Community achievements bar.

Repository Initialization: Unable to set properties its already existed property

Avatar

Level 2

I am unable to set properties which already existed property using repository initialization script

property cq:allowedTemplates already existed with type "String" but I am trying to set same property with multiple values with type "String[]" causing stopping server error: 

org.apache.sling.engine.impl.SlingHttpContext handleSecurity: Possible reason is missing Repository service. Check AuthenticationSupport dependencies.

can you delete/remvoe property using repository initialization script

4 Replies

Avatar

Community Advisor

"RepoInit operations are always additive, except for a few cases which allow removal of Users, Service Users, and Groups.

Explicit permissions are not needed to run the RepoInit scripts. They have implicit permissions to perform all actions defined per the scripts."

 

https://www.bounteous.com/insights/2021/11/16/adobe-experience-managers-sling-repoinit-have-you-trie... - Please check this blog

https://sling.apache.org/documentation/bundles/repository-initialization.html - this one for reference

Hi Sravan,

I have referred above blogs but I don't find solution to  delete property on specified path through repository script

Avatar

Community Advisor

It works on append mode only, deletion is only for Users, Service Users, and Groups.

Avatar

Employee Advisor

Why do you want to re-create a property with a different value? If that node belongs to your custom application, then change it there and not via repoinit. And you should not be required to change a property which is part of the product.