Class NavigationLayoutService
java.lang.Object
io.meeds.layout.service.NavigationLayoutService
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final StringBroadcast when a page stops being reachable through any navigation node, while the page itself still exists.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.exoplatform.portal.mop.navigation.NodeDatacreateDraftNode(Long nodeId, String username) org.exoplatform.portal.mop.navigation.NodeDatacreateNode(NavigationCreateModel nodeModel, String username) org.exoplatform.portal.mop.navigation.NodeDatacreateNodeWithPage(NavigationCreateModel nodeModel, PageCreateModel pageModel, String username) Creates a navigation item for a caller outside the navigation drawer, a tool or an API, with the page it points to when one is to be created.voiddeleteNode(long nodeId) voiddeleteNode(long nodeId, long delay, String username) voidRuns the deletions still waiting for their delay, which would be lost with this node: their undo is no longer possible.voiddestroy()Lets a deletion that is running end, up toSTOP_TIMEOUTseconds, then runs the deletions still waiting for their delay.org.exoplatform.portal.mop.navigation.NodeContext<org.exoplatform.portal.mop.navigation.NodeContext<Object>> findNode(org.exoplatform.portal.mop.navigation.NodeContext<org.exoplatform.portal.mop.navigation.NodeContext<Object>> node, String name) getDefaultParentNodeId(org.exoplatform.portal.mop.SiteKey siteKey) The site's top menu lists the items under the first root item it keeps, and nothing while that item has no items the viewer sees under it, so a new item goes under that first item by default.org.exoplatform.portal.mop.navigation.NodeDatagetEditableNode(long nodeId, String username) org.exoplatform.portal.mop.navigation.NodeDatagetNodeLabels(long nodeId, String username) getNodeUri(long nodeId, String username) getNodeUri(org.exoplatform.portal.mop.navigation.NodeData node) Set<org.exoplatform.portal.mop.page.PageKey> getReachablePages(org.exoplatform.portal.mop.SiteKey siteKey) voidinit()voidtoNodeLabel(Map<Locale, org.exoplatform.portal.mop.State> nodeLabels) voidundoDeleteNode(long nodeId, String username) voidupdateNode(long nodeId, NavigationUpdateModel nodeModel, String username) org.exoplatform.portal.mop.navigation.NodeDataupdateNodeAndPagePermissions(long nodeId, NavigationItemUpdate update, String username) Changes on a navigation item what a caller outside the navigation drawer was given and keeps every other stored value, the schedule a drawer re-picks included: the node state is merged over the stored one and the translations over the raw stored descriptions, never over the labelsgetNodeLabels(long, String)synthesizes from the navigation bundle, so a bundle-keyed node keeps its key unless a label is given.
-
Field Details
-
PAGE_UNREACHABLE_EVENT
Broadcast when a page stops being reachable through any navigation node, while the page itself still exists. Deliberately NOTLayoutService.PAGE_REMOVED: that event means the page's own data is gone, and a listener acting on it is entitled to clean up everything attached to the page — which would destroy live data here.- See Also:
-
NODE_NAME_NOT_ACCEPTED
- See Also:
-
SCHEDULE_END_BEFORE_START
- See Also:
-
SCHEDULE_START_PAST
- See Also:
-
SCHEDULE_ON_HIDDEN_NODE
- See Also:
-
SCHEDULE_INCOMPLETE
- See Also:
-
PARENT_NODE_NOT_FOUND_MESSAGE
- See Also:
-
NODE_NOT_FOUND_MESSAGE
- See Also:
-
-
Constructor Details
-
NavigationLayoutService
public NavigationLayoutService()
-
-
Method Details
-
getDefaultParentNodeId
The site's top menu lists the items under the first root item it keeps, and nothing while that item has no items the viewer sees under it, so a new item goes under that first item by default. The menu's skip of an item whose page the viewer cannot read depends on the viewer and is not applied here.- Parameters:
siteKey- the site- Returns:
- the id of the navigation root's first child the top menu keeps: one with items under it, whatever its visibility, or one displayed, or scheduled with a window that holds the present time; the root's when there is none, null when the site has no navigation
-
getEditableNode
public org.exoplatform.portal.mop.navigation.NodeData getEditableNode(long nodeId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException - Parameters:
nodeId- the nodeusername- the user about to change it- Returns:
- the node, whatever the user's view right on its page
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- the node is absentIllegalAccessException- the user cannot edit the site's navigation
-
createDraftNode
public org.exoplatform.portal.mop.navigation.NodeData createDraftNode(Long nodeId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException - Throws:
org.exoplatform.commons.exception.ObjectNotFoundExceptionIllegalAccessException
-
deleteNode
public void deleteNode(long nodeId, long delay, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException - Throws:
org.exoplatform.commons.exception.ObjectNotFoundExceptionIllegalAccessException
-
undoDeleteNode
public void undoDeleteNode(long nodeId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException - Throws:
org.exoplatform.commons.exception.ObjectNotFoundException
-
init
@PostConstruct public void init() -
destroy
@PreDestroy public void destroy()Lets a deletion that is running end, up toSTOP_TIMEOUTseconds, then runs the deletions still waiting for their delay. -
deletePendingNodes
public void deletePendingNodes()Runs the deletions still waiting for their delay, which would be lost with this node: their undo is no longer possible. -
moveNode
public void moveNode(long nodeId, Long destinationParentId, Long previousNodeId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException - Throws:
org.exoplatform.commons.exception.ObjectNotFoundExceptionIllegalAccessException
-
getNode
public org.exoplatform.portal.mop.navigation.NodeData getNode(long nodeId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException - Throws:
org.exoplatform.commons.exception.ObjectNotFoundExceptionIllegalAccessException
-
getNodeLabels
public NodeLabel getNodeLabels(long nodeId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException - Throws:
org.exoplatform.commons.exception.ObjectNotFoundExceptionIllegalAccessException
-
getNodeUri
public String getNodeUri(long nodeId, String username) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException - Throws:
IllegalAccessExceptionorg.exoplatform.commons.exception.ObjectNotFoundException
-
getReachablePages
public Set<org.exoplatform.portal.mop.page.PageKey> getReachablePages(org.exoplatform.portal.mop.SiteKey siteKey) - Parameters:
siteKey- the site whose navigation is walked- Returns:
- the pages that a node of the site's navigation leads to, pages of other sites included, whereas the search index resolves a page's path in its own site's navigation
-
deleteNode
public void deleteNode(long nodeId) -
toNodeLabel