Expand my Community achievements bar.

SOLVED

API for Overriding the page

Avatar

Level 4

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 !!!!!!!

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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...., java.lang.String, java.lang.String, boolean, boolean, boolean)

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

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...., java.lang.String, java.lang.String, boolean, boolean, boolean)