how to get retrieve a page using PageManager.getPath

Avatar

Avatar

jayv25585659

Avatar

jayv25585659

jayv25585659

04-01-2018

so I have the following code snippet

import com.day.cq.wcm.api.Page;

import com.day.cq.wcm.api.PageManager;

...

...

//more unrelated code here

...

...

Page currentPage = pageManager.getPage("/content/data/fishes/greatwhite");

log.error(currentPage.getTitle());

from what I understand (PageManager ("The Adobe AEM Quickstart and Web Application.") ), getPath requires a String input.

And from the code snippet I have provided above, the path I provided is valid. I checked this via CRX/DE.

I've looked at various examples around the net and I cannot find examples where the string supplied to getPath is a string literal. It's always a variable.

I'm just wondering what sort of path is required.

When I debugged my code using Eclipse, currentPage is neither empty or null. like it's undefined. so perhaps I'm using it wrong.

Thanks

View Entire Topic

Avatar

Avatar

ebin_Aby

Avatar

ebin_Aby

ebin_Aby

19-08-2019

Q : The pageManager work for me in Author but does not work in publisher. Seems like it is unable to get the data. Have anyone faced this issue ?