Remove versionnode path pages from aem page reference | Community
Skip to main content
November 18, 2022
Solved

Remove versionnode path pages from aem page reference

  • November 18, 2022
  • 1 reply
  • 1450 views

Hi All,

 

We are having a scenario where /content/versionhistory... path are also coming in  references for pages. We tried to limit it by adding exclude path property in cq:lucene but no luck. Can someone please help in this ?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Avinash_Gupta_

Hi @yashaswidotiya 

 

You can handle by Simply creating an JCR Event Listner for versionhsitory node created and delete version history node as soon as node created.

 

observationManager.addEventListener(this, Event.NODE_ADDED "/content/versionhistory"truenull,

  new String[]{"cq:Page"} , true);

 

You can find more detail about above method at ObservationManager (Content Repository for Java Technology API 1.0)

 

 

1 reply

Avinash_Gupta_
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
November 23, 2022

@yashaswidotiya 

 

Whenever author do page compare with any older version, that older version is created as page inside versionhistory node and shows as a page. Please check the below post and it will give you an answer.

 

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-verionhistory-node-under-content/m-p/272572 

December 5, 2022

I am aware that version gets created but we are trying to remove those entries from the references which should not be there. When we check for references from the miscadmin, we should not be seeing versionhistory nodes.

December 7, 2022

Hi @yashaswidotiya 

 

You can handle by Simply creating an JCR Event Listner for versionhsitory node created and delete version history node as soon as node created.

 

observationManager.addEventListener(this, Event.NODE_ADDED "/content/versionhistory"truenull,

  new String[]{"cq:Page"} , true);

 

You can find more detail about above method at ObservationManager (Content Repository for Java Technology API 1.0)

 

 


We don't require a version history node deletion but only remove them from page reference.