* @param startPageIds
* path construction ends at one of the given pages, otherwise path go back to project's start page
*/
private PageArrayList getPath(String startPageIdsOrNull, String separator, boolean includeBlocks, boolean includeNodes) throws RQLException {
PageArrayList result = new PageArrayList();
// collect going backwards until project start page
Page page = this.getPage();
boolean loop = true;
try {
while (loop) {
int type = getPageType(page);
if (type == PAGE_TYPE_PHYSICAL) {
result.add(page);
} else if (type == PAGE_TYPE_BLOCK) {
if (includeBlocks) {
result.add(page);
}
} else if (type == PAGE_TYPE_NODE) {
if (includeNodes) {
if (isContentNode(page)) {
List pseudoList = page.getList(getParameter("nodePagePseudoListTmpltElemName"));
if (pseudoList != null && pseudoList.hasChildPages()) {
Page firstChild = pseudoList.getFirstChildPage();
if (firstChild != null) {
result.add(firstChild);
}
}
} else {
result.add(page);
}
}
}
// always
page = page.getMainLinkParentPage();
// check optional end condition by given page
if (startPageIdsOrNull != null && StringHelper.contains(startPageIdsOrNull, page.getPageId(), true)) {
// add last page itself
result.add(page);
loop = false;
}
}
} catch (UnlinkedPageException upe) {
// simply end iteration