template policies are not readable

yogeshVaidya 13-06-2018

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?

Accepted Solutions (1)

Accepted Solutions (1)

Ratna_Kumar
MVP
13-06-2018

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.

Answers (4)

Answers (4)

Arun_Patidar
MVP
15-06-2018

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

smacdonald2008 13-06-2018

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?

Arun_Patidar
MVP
13-06-2018

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_1516309175733",

        "jcr:title": "Base Page Policy"

    }, {

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

        "jcr:title": "aem63app-policy1"

...

}

Thanks

Arun