Netcentric / accesscontroltool

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

Is it possible to use initialContent to write a multi / array property #654

Closed LucaNerlich closed 2 months ago

LucaNerlich commented 1 year ago

Hi, is it possible, to set multi value properties inside initialContent?

Ive got this variable map:

      - DEF useCaseTemplateMap=:
          crm:
            - /conf/myapp/settings/wcm/templates/c4c-fragment
          feedback:
            - /conf/myapp/settings/wcm/templates/c4c-fragment
            - /conf/myapp/settings/wcm/templates/c4c-feedback-xf

and im trying to set both values from feedback inside initialContent

                    - path: ${xfRootPath}/${brand}/${region}/feedback
                      initialContent: |
                        <jcr:root jcr:primaryType="sling:OrderedFolder" jcr:title="feedback" cq:allowedTemplates="[${useCaseTemplateMap['feedback']}]">
                        </jcr:root>

Using 'feedback' here (its a variable in my code), Id expect it to write both values from the map[feedback]. However, no values get written. A single value works fine, when removing the square brackets though.

kwin commented 2 months ago

That should work fine, but you must concatenate the arrays in the list useCaseTemplateMap['feedback'] with the join EL function leveraging the separator , (compare with https://jackrabbit.apache.org/filevault/docview.html#Property_Values).