Class PageTreeUtils
java.lang.Object
fr.paris.lutece.plugins.menus.service.PageTreeUtils
Walks up the parent chain of a page
-
Method Summary
Modifier and TypeMethodDescriptionstatic intgetRootParentTree(int nPageId, int nRootPageId, IntFunction<fr.paris.lutece.portal.business.page.Page> pageLoader) Find the ancestor of a page that heads its tree under the root page.
-
Method Details
-
getRootParentTree
public static int getRootParentTree(int nPageId, int nRootPageId, IntFunction<fr.paris.lutece.portal.business.page.Page> pageLoader) Find the ancestor of a page that heads its tree under the root page. The walk stops when the parent chain is broken (missing page, parent 0) or loops, so that a page whose chain does not reach the root never blocks the request.- Parameters:
nPageId- The page identifiernRootPageId- The root page identifierpageLoader- Loads a page from its identifier (an empty page or null when the page does not exist)- Returns:
- The parent page identifier or root tree, or the last ancestor found when the chain does not reach the root
-