API for Overriding the page | Community
Skip to main content
New Participant
October 19, 2015
Solved

API for Overriding the page

  • October 19, 2015
  • 1 reply
  • 1032 views

Hi All,

I have a doubt in overriding the page during copying page from source to destination.

Suppose TShirt page exists in source and destination area. 

My TShirt  page structure in crxde as follows

TShirt

TShirt —> jcr:content 

TShirt —> jcr:content  —> header

TShirt —> jcr:content  —>  par

TShirt —> jcr:content  —>  par —> image

TShirt —> jcr:content  —>  par —> link

I have modified some content(added some component. Hence contents under par node are changed) in the page at source area…

While copying the page from source to destination, the revision should be created and page content should be updated in destination.

Is there any API available for overriding the page(content should be modified) or we need to change each node manually ?

Please note that version history should be maintained after overriding the page. Thanks in advance !!!!!!!

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 Kunal_Gaba_

You can call PageManager copy method which allows you to do a recursive copy. You need to pass shallow parameter as 'false' to do a recursive copy. 

https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/wcm/api/PageManager.html#copy(com.day.cq.wcm.api.Page, java.lang.String, java.lang.String, boolean, boolean, boolean)

1 reply

Kunal_Gaba_
Kunal_Gaba_Accepted solution
New Participant
October 19, 2015

You can call PageManager copy method which allows you to do a recursive copy. You need to pass shallow parameter as 'false' to do a recursive copy. 

https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/wcm/api/PageManager.html#copy(com.day.cq.wcm.api.Page, java.lang.String, java.lang.String, boolean, boolean, boolean)