Interface CMSNavigationService
-
- All Known Implementing Classes:
DefaultCMSNavigationService
public interface CMSNavigationServiceThe Interface CMSNavigationService for managing cms navigation nodes. In addition, this service contains methods to fetch and create super root nodes with the provided catalog version. A super root node is the first hidden node of every catalog that contains the visible root children nodes.- Catalog
- Hidden Super Root Node
- Visible Root Node
- Visible Root Node
- Hidden Super Root Node
- Spring Bean ID:
- cmsNavigationService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidappendRelatedItems(CMSNavigationNodeModel cmsNavigationNode, java.util.Collection<ItemModel> items)Adds selected items to specificCMSNavigationNodeModelnavigation node.CMSNavigationEntryModelcreateCmsNavigationEntry(CatalogVersionModel catalogVersion, ItemModel item)Creates an orphan entry for a givenitem.CMSNavigationEntryModelcreateCmsNavigationEntry(CMSNavigationNodeModel cmsNavigationNode, java.lang.String entryName, ItemModel item)Adds aitemto givencmsNavigationNodenavigation node.CMSNavigationNodeModelcreateNavigationNode(ItemModel parentNode, java.lang.String navigationNodeName, boolean visible, java.util.Collection<ItemModel> relatedItems)Deprecated.since 1811, please useCMSItemFacade.createItem(Map)instead.CMSNavigationNodeModelcreateSuperRootNavigationNode(CatalogVersionModel catalogVersion)Creates super root navigation node for given catalog version.voiddelete(CMSNavigationNodeModel cmsNavigationNode)Deprecated.since 1811, no longer needed.java.util.List<CMSNavigationEntryModel>getNavigationEntriesByPage(AbstractPageModel page)Finds allCMSNavigationEntryModelassociated with aAbstractPageModel.java.util.Optional<CMSNavigationEntryModel>getNavigationEntryForId(java.lang.String id, CatalogVersionModel catalogVersion)Returns a Navigation Entry identified via its id and the given catalog versionCMSNavigationNodeModelgetNavigationNodeForId(java.lang.String id)Returns a Navigation Node identified via its idjava.util.List<CMSNavigationNodeModel>getNavigationNodesForContentPage(ContentPageModel page)Returns a list of all Navigation Nodes which contain the given pagejava.util.List<CMSNavigationNodeModel>getNavigationNodesForContentPageId(java.lang.String pageId)Returns a list of all Navigation Nodes which contain the given pagejava.util.List<CMSNavigationNodeModel>getRootNavigationNodes()java.util.List<CMSNavigationNodeModel>getRootNavigationNodes(CatalogVersionModel catalogVersion)Returns all root navigation nodes for given catalog version.java.util.List<CMSNavigationNodeModel>getRootNavigationNodesForContentPage(ContentPageModel page)Returns a list of all root Navigation Nodes which have this page assigned, or which have a children in their navigation tree which has this page assignedjava.util.List<CMSNavigationNodeModel>getRootNavigationNodesForContentPageId(java.lang.String pageId)Returns a list of all root Navigation Nodes which have this page assigned, or which have a children in their navigation tree which has this page assignedCMSNavigationNodeModelgetSuperRootNavigationNode(CatalogVersionModel catalogVersionModel)Returns super root navigation node for given catalog version.booleanisSuperRootNavigationNode(CMSNavigationNodeModel navigationNodeModel)Tests if a navigation node is a super root node.voidmove(CMSNavigationNodeModel sourceNode, CMSNavigationNodeModel targetModel)Moves given nodeModel at last position of the child nodes list of targetModel.voidmove(CMSNavigationNodeModel source, CMSNavigationNodeModel target, boolean asChild, boolean append)Moves source nod to targert node.voidmove(CMSNavigationNodeModel cmsNavigationNode, ItemModel sourceItem, ItemModel targetnItem)Moves given items within given navigation node.voidmove(ItemModel item, CMSNavigationNodeModel sourceNode, CMSNavigationNodeModel targetNode)Moves given item from sourceNode to targetNode.voidremove(CMSNavigationNodeModel cmsNavigationNode, ItemModel item)Removes given item from given navigation node.booleanremoveNavigationEntryByUid(CMSNavigationNodeModel cmsNavigationNode, java.lang.String navigationEntryUid)Deprecated.since 1811, no longer needed.CMSNavigationNodeModelsetSuperRootNodeOnNavigationNode(CMSNavigationNodeModel navigationNodeModel, CatalogVersionModel catalogVersionModel)Sets the super root node onto the passed CMS navigation node model.
-
-
-
Method Detail
-
getNavigationNodeForId
CMSNavigationNodeModel getNavigationNodeForId(java.lang.String id) throws CMSItemNotFoundException
Returns a Navigation Node identified via its id- Parameters:
id- id of the Navigation Node- Returns:
- The Navigation Node model with the given id
- Throws:
CMSItemNotFoundException- if no Navigation Node with the given id could be found
-
getNavigationNodesForContentPage
java.util.List<CMSNavigationNodeModel> getNavigationNodesForContentPage(ContentPageModel page)
Returns a list of all Navigation Nodes which contain the given page- Parameters:
page- Page to lookup- Returns:
- list of all Navigation Nodes which have the page assigned
-
getNavigationNodesForContentPageId
java.util.List<CMSNavigationNodeModel> getNavigationNodesForContentPageId(java.lang.String pageId) throws CMSItemNotFoundException
Returns a list of all Navigation Nodes which contain the given page- Parameters:
pageId- id of the page- Returns:
- list of all Navigation Nodes which have the page assigned
- Throws:
CMSItemNotFoundException- if the page with the given id could not be found
-
getRootNavigationNodes
java.util.List<CMSNavigationNodeModel> getRootNavigationNodes()
- Returns:
- A list of all root navigation nodes in the active catalog version. A root navigation node is defined by not having a parent.
-
getRootNavigationNodesForContentPage
java.util.List<CMSNavigationNodeModel> getRootNavigationNodesForContentPage(ContentPageModel page)
Returns a list of all root Navigation Nodes which have this page assigned, or which have a children in their navigation tree which has this page assigned- Parameters:
page- page to lookup- Returns:
- list of all root Navigation Nodes which have this page assigned, or which have a children in their navigation tree which has this page assigned
-
getRootNavigationNodesForContentPageId
java.util.List<CMSNavigationNodeModel> getRootNavigationNodesForContentPageId(java.lang.String pageId) throws CMSItemNotFoundException
Returns a list of all root Navigation Nodes which have this page assigned, or which have a children in their navigation tree which has this page assigned- Parameters:
pageId- id of the page- Returns:
- list of all root Navigation Nodes which have this page assigned, or which have a children in their navigation tree which has this page assigned
- Throws:
CMSItemNotFoundException- if the page with the given id could not be found
-
getNavigationEntriesByPage
java.util.List<CMSNavigationEntryModel> getNavigationEntriesByPage(AbstractPageModel page)
Finds allCMSNavigationEntryModelassociated with aAbstractPageModel.- Parameters:
page- theAbstractPageModel- Returns:
- a List of
CMSNavigationEntryModel, or an empty List if not found
-
getNavigationEntryForId
java.util.Optional<CMSNavigationEntryModel> getNavigationEntryForId(java.lang.String id, CatalogVersionModel catalogVersion)
Returns a Navigation Entry identified via its id and the given catalog version- Parameters:
id- id of the Navigation EntrycatalogVersion- catalog version- Returns:
- The Navigation Entry model
-
createCmsNavigationEntry
CMSNavigationEntryModel createCmsNavigationEntry(CMSNavigationNodeModel cmsNavigationNode, java.lang.String entryName, ItemModel item)
Adds aitemto givencmsNavigationNodenavigation node. Note:
This method save all modified models i.e.cmsNavigationNodeis saved!- Parameters:
item- item that will be addedentryName- the navigation entry namecmsNavigationNode- given navigation node- Returns:
- the navigation entry model created for the item and navigationNodeModel
-
createCmsNavigationEntry
CMSNavigationEntryModel createCmsNavigationEntry(CatalogVersionModel catalogVersion, ItemModel item)
Creates an orphan entry for a givenitem. Note:
This method does not save the entry created.- Parameters:
catalogVersion- catalog versionitem- item that will be added- Returns:
- the navigation entry model created
-
getRootNavigationNodes
java.util.List<CMSNavigationNodeModel> getRootNavigationNodes(CatalogVersionModel catalogVersion)
Returns all root navigation nodes for given catalog version.- Parameters:
catalogVersion- catalog version- Returns:
- founded root navigation nodes
-
move
void move(CMSNavigationNodeModel sourceNode, CMSNavigationNodeModel targetModel)
Moves given nodeModel at last position of the child nodes list of targetModel. It is removed from current parent node list of children. Note:
This method save all modified models i.e.nodeModelandtargetModelare saved!- Parameters:
sourceNode- node that will be movedtargetModel- a new target node
-
move
void move(CMSNavigationNodeModel cmsNavigationNode, ItemModel sourceItem, ItemModel targetnItem)
Moves given items within given navigation node. Precisely: Moves given source item to place of target item (target item is moved one position further). Note:
This method save all modified models i.e.naviNodeis saved with new items order!- Parameters:
cmsNavigationNode- current navigation nodesourceItem- a source nodetargetnItem- a new target node
-
move
void move(ItemModel item, CMSNavigationNodeModel sourceNode, CMSNavigationNodeModel targetNode)
Moves given item from sourceNode to targetNode. Which means soureNode will have one child less, targetNode on the other hand one more. Note:
This method save all modified models i.e.sourceNodeandis saved with new item order!targetNode- Parameters:
item- item that will be movedsourceNode- a source nodetargetNode- a new target node
-
delete
@Deprecated void delete(CMSNavigationNodeModel cmsNavigationNode)
Deprecated.since 1811, no longer needed.Deletes given node and all it' child nodes. Note:
This method save all modified models!. This method removes only the given navigation node with its child - without other references i.e. pages won't be removed.- Parameters:
cmsNavigationNode- navigation node to remove
-
remove
void remove(CMSNavigationNodeModel cmsNavigationNode, ItemModel item)
Removes given item from given navigation node. The item itself is not deleted. Note:
This method save all modified models! i.e.cmsNavigationNodeis saved!- Parameters:
cmsNavigationNode- given navigation nodeitem- given item to remove from cmsNavigationNode
-
removeNavigationEntryByUid
@Deprecated boolean removeNavigationEntryByUid(CMSNavigationNodeModel cmsNavigationNode, java.lang.String navigationEntryUid)
Deprecated.since 1811, no longer needed.Removes a given entry from a given navigation node. The Navigation Entry is deleted, but not the ItemModel in the entry. Note:
This method save all modified models, i.e.cmsNavigationNodeis saved.- Parameters:
cmsNavigationNode- given navigation nodenavigationEntryUid- given navigation entry uid.- Returns:
- true if the entry was removed or false otherwise.
-
createNavigationNode
@Deprecated CMSNavigationNodeModel createNavigationNode(ItemModel parentNode, java.lang.String navigationNodeName, boolean visible, java.util.Collection<ItemModel> relatedItems)
Deprecated.since 1811, please useCMSItemFacade.createItem(Map)instead.Creates a navigation node accordingly to specified attributes. Note:
ReturnedCMSNavigationNodeModelis not saved!- Parameters:
parentNode- parent for created navigation nodenavigationNodeName- given navigation node namevisible- flag determines navigation node visibilityrelatedItems- given related items- Returns:
- a new navigation node
-
isSuperRootNavigationNode
boolean isSuperRootNavigationNode(CMSNavigationNodeModel navigationNodeModel)
Tests if a navigation node is a super root node.- Parameters:
navigationNodeModel- node model to test if it's a super root node- Returns:
- returns true if it is a super root node
-
setSuperRootNodeOnNavigationNode
CMSNavigationNodeModel setSuperRootNodeOnNavigationNode(CMSNavigationNodeModel navigationNodeModel, CatalogVersionModel catalogVersionModel)
Sets the super root node onto the passed CMS navigation node model.- Parameters:
navigationNodeModel- node model to set the super root node oncatalogVersionModel- the belonging catalog version model of the super root node- Returns:
- navigation node with a parent super root node
-
getSuperRootNavigationNode
CMSNavigationNodeModel getSuperRootNavigationNode(CatalogVersionModel catalogVersionModel)
Returns super root navigation node for given catalog version.- Parameters:
catalogVersionModel- current catalog version- Returns:
- a super root navigation node
-
appendRelatedItems
void appendRelatedItems(CMSNavigationNodeModel cmsNavigationNode, java.util.Collection<ItemModel> items)
Adds selected items to specificCMSNavigationNodeModelnavigation node.- Parameters:
cmsNavigationNode- given navigation nodeitems- that will be added
-
createSuperRootNavigationNode
CMSNavigationNodeModel createSuperRootNavigationNode(CatalogVersionModel catalogVersion)
Creates super root navigation node for given catalog version.- Parameters:
catalogVersion- catalog version for which the super root node will be created- Returns:
- a new super root navigation node
-
move
void move(CMSNavigationNodeModel source, CMSNavigationNodeModel target, boolean asChild, boolean append)
Moves source nod to targert node.- Parameters:
source- node to be movedtarget- node to be dropped atasChild- if true source node will be come target node's child otherwise source will become target's siblingappend- if true source will be added as last (child node)/next(sibling) else as first/previous
-
-