Im trying to apply certain values for a specific osgi configuration org.apache.sling.caconfig.impl.override.OsgiConfigurationOverrideProvider . This configuration is a multivalue property with a rather complex format for each one:
[{contextPath}]{configName}/{propertyName}={propertyJsonValue}
or
[{contextPath}]{configName}={propertyJsonValue}
this presents some issues:
- being multivalue string means each entry need to be between quotes
- there is a equal sign that needs escaping
- the json needs proper escaping
Unfortunately I haven't found a way to properly escape the configurations.
For example, this format as an environment variable:
[\"[a]b={'a':true}\",\"[w]x/y={'z':true}\"]
is displayed like this in the groovy console
["[a]b={'a':true}","[w]x/y={'z':true}"]
and leads to the property in the file being written as
[\"[a]b={'a':true}\",\"[w]x/y={'z':true}\"]
Notice that the quotes that should encompass each value have been escaped, though they are not properly picked as individual properties
I think the issue is in VariablesMerger L89
valueToBeUsed = valueToBeUsed.replaceAll("([\\\\=\\s\"])", "\\\\$1");
Where the quote character is escaped every time, making multivalue properties not possible to set.
Im trying to apply certain values for a specific osgi configuration org.apache.sling.caconfig.impl.override.OsgiConfigurationOverrideProvider . This configuration is a multivalue property with a rather complex format for each one:
[{contextPath}]{configName}/{propertyName}={propertyJsonValue}or
[{contextPath}]{configName}={propertyJsonValue}this presents some issues:
Unfortunately I haven't found a way to properly escape the configurations.
For example, this format as an environment variable:
[\"[a]b={'a':true}\",\"[w]x/y={'z':true}\"]is displayed like this in the groovy console
["[a]b={'a':true}","[w]x/y={'z':true}"]and leads to the property in the file being written as
[\"[a]b={'a':true}\",\"[w]x/y={'z':true}\"]Notice that the quotes that should encompass each value have been escaped, though they are not properly picked as individual properties
I think the issue is in VariablesMerger L89
valueToBeUsed = valueToBeUsed.replaceAll("([\\\\=\\s\"])", "\\\\$1");Where the quote character is escaped every time, making multivalue properties not possible to set.