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 String
POPUP_PARAM
-
Constructor Summary
Constructors Constructor Description NavigationHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
canMoveDown(MenuElement elem)
static boolean
canMoveToChild(MenuElement elem)
static boolean
canMoveToParent(MenuElement elem)
static boolean
canMoveUp(MenuElement elem)
static void
changeStepPriority(List<MenuElement> elems, int newStep)
static void
changeStepPriority(MenuElement[] elems, int newStep)
static void
copyElement(ContentContext ctx, MenuElement src, MenuElement target)
copy all element attribute (without children)static int
countUnvalidChildren(MenuElement elem)
static MenuElement
createChildPageAutoName(MenuElement page, ContentContext ctx)
static MenuElement
firstSelectionElement(ContentContext ctx)
static List<String>
getAllRSSChannels(ContentContext ctx, MenuElement page)
static String
getBreadCrumb(ContentContext ctx, MenuElement page)
static MenuElement
getChildWithContent(ContentContext ctx, MenuElement page)
static String
getLinkedURL(MenuElement elem)
get the linked url of the current page, maybe defined in a parent node.static String
getNewName(MenuElement page)
static String
getNewName(MenuElement page, String suggestedName)
create a new name (numeroted -N) with a page namestatic String
getPageBookmark(ContentContext ctx, MenuElement page)
get the page bookmark for the html header. used for pdf generation.static MenuElement
getPageById(ContentContext ctx, String id)
static MenuElement
getPopupPage(ContentContext ctx)
static List<String>
getRSSChannels(ContentContext ctx, MenuElement page)
static void
importPage(ContentContext ctx, PersistenceService persistenceService, NodeXML pageNode, MenuElement currentPage, String lang, boolean readOnly)
static boolean
isParent(MenuElement page, List<MenuElement> parents)
check if pages are parent of a other page.static boolean
isParent(MenuElement page, MenuElement parent)
check if a page is a parent of a other page.static void
movePage(ContentContext ctx, MenuElement parent, MenuElement previousBrother, MenuElement page)
static void
publishNavigation(ContentContext ctx, MenuElement srcRoot, MenuElement targetRoot)
static void
publishOneComponent(ContentContext ctx, String componentId)
static List<MenuElement>
searchLinkTo(ContentContext ctx, MenuElement elem)
search page with a link to a specific pagestatic MenuElement
searchPage(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)
-
-