Netcentric / accesscontroltool

Rights and roles management for AEM made easy
Eclipse Public License 1.0
147 stars 92 forks source link

When using variables in initialContent, allow to properly escape them #690

Closed ghenzler closed 2 months ago

ghenzler commented 4 months ago

https://github.com/Netcentric/accesscontroltool/blob/develop/docs/AdvancedFeatures.md#providing-initial-content provides the ability to create content on the fly

For cases where the whole string is given as literal, it just needs to be valid xml. For cases that EL expressions ${..} are used, there is at the moment no way to encode it correctly without using a long chain of replace() functions. Therefore https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringEscapeUtils.html#escapeXml11-java.lang.String- shall be made available and the documentation be updated to encourage the use of this function for the intitialContent case.

kwin commented 2 months ago

DocView is XML 1.0 (not 1.1). Therefore the XML 1.0 compliant escaping should be done: https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringEscapeUtils.html#escapeXml10-java.lang.String- (not the one for 1.1 which includes control characters!