Remove versionnode path pages from aem page reference | Community
Skip to main content
New Participant
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_
New Participant
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 

New Participant
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.

Avinash_Gupta_
Avinash_Gupta_Accepted solution
New Participant
December 5, 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)