Hi,
We are using OOTB ca-config "com.adobe.cq.wcm.core.components.config.HtmlPageItemsConfig" to load a script on our page.
But the script src is different for each environment. So, to override it through OSGI, I have tried using Apache Sling Context-Aware Configuration Override Provider: OSGi configuration.
my Ca-config is stored as follows:
I want override the "value" property of srcAttr and my Override provider config is as follows:
but I am unable to achieve it,
could someone help me what's need to be corrected in this case?
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi,
I think there’s some confusion, or perhaps I misunderstood your use case. If you need to switch a script per environment, you should use run modes and environment variables, as this is a more flexible and scalable approach. Context-Aware configurations are intended for multi-tenant projects within the same environment. Please check these threads:
https://medium.com/@toimrank/aem-run-modes-4c36b9b0068e
Hope this helps
Views
Replies
Total Likes
Hi Esteban,
yes, I am aware of run modes, we are using ca-configs and few ca-configs have "src" values of which are run mode specific so I am trying to override the src of ca-configs through OSGI via Apache caconfig override provider.
Views
Replies
Total Likes
Hi @arunpatidar,
Thanks for your response!
I have tried the way you have mentioned, syntax issue is solved but I am unable to override the property.
In general if you look at any ca-config, the properties are stored under jcr:content node, but for this config it is stored in the child resources present under jcr:node, this is causing some issue in identifying the property. is there a way to point the property for such configurations?
Views
Replies
Total Likes
Hi @RahulGa6
By providing an implementation of org.apache.sling.caconfig.spi.ConfigurationOverrideProvider
you can provide your own overrides - if the built-in override providers do not fit your needs.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies