Expand my Community achievements bar.

SOLVED

move method of Page Manager API

Avatar

Level 2

Hi All,

I am working on moving a page from one location to an another via Page Manager API.

move(Page page, String destination, String beforeName, boolean shallow, boolean resolveConflict, String[] adjustRefs,String[] publishRefs)

In above method of page manager, how to get value for adjustRefs & publishRefs ?

Do we have any predefined function to get the pages which are refered to currentPage ?

Thanks,

Naveen

1 Accepted Solution

Avatar

Correct answer by
Administrator
10 Replies

Avatar

Level 10

Looking through the JavaDocs for this API - i do not see any method that returns this data.

Here are some API examples for this API - Examples of com.day.cq.wcm.api.PageManager | massapi.com

Avatar

Community Advisor

HI Naveen

  - Pass a String array which contains array of all the page paths that references this Page .

          For example /content/page1 needs to be moved to /content/test/page1 ; Pages /content/Page2 and /content/Page3 has a reference /content/page1 in them , then you should give an array below paths as the parameter adjustRefs

{"/content/Page2" , "/content/Page3"}

Avatar

Employee
Is there an api method to get all the page paths that reference this page? How did you do it? Did you use jcr query?

Avatar

Community Advisor

I have not tested this , but please let me know if there is any difference

Avatar

Level 2

Hi Veena,

Thanks for your cmts but my question is how do we know that page2 and page3 has referred page1? How do we know the moved pages is refered in some pages and how we get these pages?

Avatar

Correct answer by
Administrator

Avatar

Level 6

For that you can use node/resource iteration starting form /content or yo also go for query if the content size is small.

Avatar

Community Advisor

Awesome Kautuk.. You found that .. This will help naveeng73207107

Avatar

Level 2

Thanks, Kautuk & Veena.. I will use that code and check it will fulfill my requirement.

Avatar

Employee

Does this solution work? ACS AEM Commons page reference provided provides the references of a resource of the current page. It doesn't provide the pages where the current page is referenced. I believe "move" method accepts the pages where the current page is reference.

Please do let me know if the ACS AEM Commons Page Reference provided actually works in this scenario.