move method of Page Manager API

Avatar

Avatar

naveeng73207107

Avatar

naveeng73207107

naveeng73207107

22-11-2017

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

kautuk_sahni

Community Manager

Total Posts

5.7K

Likes

1.0K

Correct Reply

1.1K

Avatar

kautuk_sahni

Community Manager

Total Posts

5.7K

Likes

1.0K

Correct Reply

1.1K
kautuk_sahni
Community Manager

23-11-2017

Answers (8)

Answers (8)

Avatar

Avatar

Veena_Vikram

MVP

Avatar

Veena_Vikram

MVP

Veena_Vikram
MVP

23-11-2017

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

Avatar

Avatar

mjb54261515

Avatar

mjb54261515

mjb54261515

23-11-2017

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

Avatar

Avatar

Veena_Vikram

MVP

Avatar

Veena_Vikram

MVP

Veena_Vikram
MVP

22-11-2017

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

Avatar

Nikash_Bahadur

Employee

Avatar

Nikash_Bahadur

Employee

Nikash_Bahadur
Employee

05-01-2020

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.

Avatar

Avatar

naveeng73207107

Avatar

naveeng73207107

naveeng73207107

23-11-2017

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

Avatar

Avatar

naveeng73207107

Avatar

naveeng73207107

naveeng73207107

22-11-2017

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

Avatar

Veena_Vikram

MVP

Avatar

Veena_Vikram

MVP

Veena_Vikram
MVP

22-11-2017

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

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

22-11-2017

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