Package org.javlo.helper
Class NavigationHelper
- java.lang.Object
-
- org.javlo.helper.NavigationHelper
-
public class NavigationHelper extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringPOPUP_PARAM
-
Constructor Summary
Constructors Constructor Description NavigationHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancanMoveDown(MenuElement elem)static booleancanMoveToChild(MenuElement elem)static booleancanMoveToParent(MenuElement elem)static booleancanMoveUp(MenuElement elem)static voidchangeStepPriority(List<MenuElement> elems, int newStep)static voidchangeStepPriority(MenuElement[] elems, int newStep)static voidcopyElement(ContentContext ctx, MenuElement src, MenuElement target)copy all element attribute (without children)static intcountUnvalidChildren(MenuElement elem)static MenuElementcreateChildPageAutoName(MenuElement page, ContentContext ctx)static MenuElementfirstSelectionElement(ContentContext ctx)static List<String>getAllRSSChannels(ContentContext ctx, MenuElement page)static StringgetBreadCrumb(ContentContext ctx, MenuElement page)static MenuElementgetChildWithContent(ContentContext ctx, MenuElement page)static StringgetLinkedURL(MenuElement elem)get the linked url of the current page, maybe defined in a parent node.static StringgetNewName(MenuElement page)static StringgetNewName(MenuElement page, String suggestedName)create a new name (numeroted -N) with a page namestatic StringgetPageBookmark(ContentContext ctx, MenuElement page)get the page bookmark for the html header. used for pdf generation.static MenuElementgetPageById(ContentContext ctx, String id)static MenuElementgetPopupPage(ContentContext ctx)static List<String>getRSSChannels(ContentContext ctx, MenuElement page)static voidimportPage(ContentContext ctx, PersistenceService persistenceService, NodeXML pageNode, MenuElement currentPage, String lang, boolean readOnly)static booleanisParent(MenuElement page, List<MenuElement> parents)check if pages are parent of a other page.static booleanisParent(MenuElement page, MenuElement parent)check if a page is a parent of a other page.static voidmovePage(ContentContext ctx, MenuElement parent, MenuElement previousBrother, MenuElement page)static voidpublishNavigation(ContentContext ctx, MenuElement srcRoot, MenuElement targetRoot)static voidpublishOneComponent(ContentContext ctx, String componentId)static List<MenuElement>searchLinkTo(ContentContext ctx, MenuElement elem)search page with a link to a specific pagestatic MenuElementsearchPage(ContentContext ctx, String idOrNameOrPath)
-
-
-
Field Detail
-
POPUP_PARAM
public static final String POPUP_PARAM
- See Also:
- Constant Field Values
-
-
Method Detail
-
canMoveDown
public static final boolean canMoveDown(MenuElement elem)
-
canMoveToChild
public static final boolean canMoveToChild(MenuElement elem)
-
canMoveToParent
public static final boolean canMoveToParent(MenuElement elem)
-
canMoveUp
public static final boolean canMoveUp(MenuElement elem)
-
changeStepPriority
public static final void changeStepPriority(List<MenuElement> elems, int newStep)
-
changeStepPriority
public static final void changeStepPriority(MenuElement[] elems, int newStep)
-
copyElement
public static void copyElement(ContentContext ctx, MenuElement src, MenuElement target) throws Exception
copy all element attribute (without children)- Parameters:
src- source MenuElementtarget- target MenuElement- Throws:
Exception
-
countUnvalidChildren
public static int countUnvalidChildren(MenuElement elem)
-
firstSelectionElement
public static MenuElement firstSelectionElement(ContentContext ctx) throws Exception
- Throws:
Exception
-
getAllRSSChannels
public static List<String> getAllRSSChannels(ContentContext ctx, MenuElement page) throws Exception
- Throws:
Exception
-
getLinkedURL
public static String getLinkedURL(MenuElement elem)
get the linked url of the current page, maybe defined in a parent node.- Parameters:
elem-- Returns:
-
getRSSChannels
public static List<String> getRSSChannels(ContentContext ctx, MenuElement page) throws Exception
- Throws:
Exception
-
importPage
public static final void importPage(ContentContext ctx, PersistenceService persistenceService, NodeXML pageNode, MenuElement currentPage, String lang, boolean readOnly) throws Exception
- Throws:
Exception
-
publishNavigation
public static void publishNavigation(ContentContext ctx, MenuElement srcRoot, MenuElement targetRoot) throws Exception
- Throws:
Exception
-
publishOneComponent
public static void publishOneComponent(ContentContext ctx, String componentId) throws Exception
- Throws:
Exception
-
searchLinkTo
public static List<MenuElement> searchLinkTo(ContentContext ctx, MenuElement elem) throws Exception
search page with a link to a specific page- Parameters:
elem- a specific page- Returns:
- a list of page
- Throws:
Exception
-
isParent
public static boolean isParent(MenuElement page, MenuElement parent)
check if a page is a parent of a other page.- Parameters:
page- a page with parentparent- the suposed parent page- Returns:
-
isParent
public static boolean isParent(MenuElement page, List<MenuElement> parents)
check if pages are parent of a other page.- Parameters:
page- a page with parentparent- the suposed parent page- Returns:
-
getPageBookmark
public static String getPageBookmark(ContentContext ctx, MenuElement page) throws Exception
get the page bookmark for the html header. used for pdf generation.- Returns:
- Throws:
Exception
-
movePage
public static void movePage(ContentContext ctx, MenuElement parent, MenuElement previousBrother, MenuElement page)
-
createChildPageAutoName
public static MenuElement createChildPageAutoName(MenuElement page, ContentContext ctx) throws Exception
- Throws:
Exception
-
getPageById
public static MenuElement getPageById(ContentContext ctx, String id) throws Exception
- Throws:
Exception
-
getChildWithContent
public static MenuElement getChildWithContent(ContentContext ctx, MenuElement page) throws Exception
- Throws:
Exception
-
getBreadCrumb
public static String getBreadCrumb(ContentContext ctx, MenuElement page) throws Exception
- Throws:
Exception
-
searchPage
public static MenuElement searchPage(ContentContext ctx, String idOrNameOrPath) throws Exception
- Throws:
Exception
-
getPopupPage
public static MenuElement getPopupPage(ContentContext ctx) throws Exception
- Throws:
Exception
-
getNewName
public static final String getNewName(MenuElement page)
-
getNewName
public static final String getNewName(MenuElement page, String suggestedName)
create a new name (numeroted -N) with a page name- Parameters:
page- the 'source' page.- Returns:
- a new name (this name not exist in the current context)
-
-