5 Replies Latest reply on Jun 15, 2018 3:39 AM by Arun Patidar

    template policies are not readable

    yogeshVaidya Level 1

      All of my template policies are stored like "policy_1522132149527" even after giving readable policy Title and policy description.

      Whenever I am sharing package(containing editable templates) with anyone, it is difficult to identify policy of template so I have to create package without policies and then he(one with whom I have shared package) has to create policies in template. Is there any way to differentiate policies (right now, policies of all editable templates are stored inside /conf/<project_name>/settings/wcm/policies folder) based on template or any way to rewrite policy names in readable format?

        • 1. Re: template policies are not readable
          Arun Patidar Experience Cloud MVP

          Hi,

          I am not sure if you can change that name, I believe JCR node level API return unique id for the node it contains node name (policy) and id.

           

           

          But if you want something like mapping between Policy node and Policy Title in JCR and title , you can run below query in QueryBuilder

           

          path=/conf/AEM63App/settings/wcm/policies/

          type=nt:unstructured

          property = jcr:title

          property.operation = exists

          p.hits=selective

          p.properties=jcr:path jcr:title

          p.limit=-1

           

          It will give you JSON response like below

          {

              "success": true,

              "results": 4,

              "total": 4,

              "more": false,

              "offset": 0,

              "hits": [{

                  "jcr:path": "/conf/AEM63App/settings/wcm/policies/AEM63App/components/structure/page2/policy_15163091 75733",

                  "jcr:title": "Base Page Policy"

              }, {

                  "jcr:path": "/conf/AEM63App/settings/wcm/policies/wcm/foundation/components/responsivegrid/policy_528 5465717875",

                  "jcr:title": "aem63app-policy1"

           

          ...

          }

           

          Thanks

          Arun

          • 2. Re: template policies are not readable
            smacdonald2008 Adobe Employee

            That is how it works -- (right now, policies of all editable templates are stored inside /conf/<project_name>/settings/wcm/policies folder)

             

            They are simply JCR nodes under this location. WHy do you want to rewrite names?

            • 3. Re: template policies are not readable
              Ratna Kumar Experience Cloud MVP

              Hi Yogesh,

               

              Policies of editable templates are stored under /conf/<project_name>/settings/wcm/policies folder.

               

              The only way to modify editable templates by using UI. I think you cannot rewrite the editable template policies.

               

              Thanks,

              Ratna Kumar.

              • 4. Re: template policies are not readable
                yogeshVaidya Level 1

                I was wishing to rewrite their names so that I'll be able to make package of policies related to certain templates.

                • 5. Re: template policies are not readable
                  Arun Patidar Experience Cloud MVP

                  Hi Yogesh,

                  You can do it though.

                  try to write an EventListener on /conf/<project_name>/settings/wcm/policies path as Node_ADDED

                  and get the title and create a new node as a copy of policy node as named as title and delete auto generated policy node.

                   

                  You need to try and see if it works or not because you may need to change reference also inside template.

                   

                   

                  Thanks

                  Arun

                  1 person found this helpful