public class DefaultCMSNavigationService extends AbstractCMSService implements CMSNavigationService
CMSNavigationService interface.AbstractService.SerializableDTOCURRENTCATALOGVERSION, CURRENTSITEmodelService, sessionService, txManagertenant| Constructor and Description |
|---|
DefaultCMSNavigationService() |
| Modifier and Type | Method and Description |
|---|---|
void |
appendRelatedItems(CMSNavigationNodeModel cmsNavigationNode,
java.util.Collection<ItemModel> items)
Adds selected items to specific
CMSNavigationNodeModel navigation node. |
CMSNavigationEntryModel |
createCmsNavigationEntry(CatalogVersionModel catalogVersion,
ItemModel item)
Creates an orphan entry for a given
item. |
CMSNavigationEntryModel |
createCmsNavigationEntry(CMSNavigationNodeModel node,
java.lang.String entryName,
ItemModel entryContent)
Adds a
item to given cmsNavigationNode navigation node. |
protected CMSNavigationEntryModel |
createCmsNavigationEntry(ItemModel entryContent,
CatalogVersionModel catalogVersionModel) |
CMSNavigationNodeModel |
createNavigationNode(ItemModel parentNode,
java.lang.String navigationNodeName,
boolean visible,
java.util.Collection<ItemModel> relatedItems)
Creates a navigation node accordingly to specified attributes.
|
CMSNavigationNodeModel |
createSuperRootNavigationNode(CatalogVersionModel catalogVersion)
Creates super root navigation node for given catalog version.
|
void |
delete(CMSNavigationNodeModel cmsNavigationNode)
Deprecated.
since 1811, no longer needed.
|
protected void |
deleteRecursively(CMSNavigationNodeModel cmsNavigationNode)
Deletes all children all way down to leafs.
|
protected java.util.List<ItemModel> |
extractCmsNavigationEntries(CMSNavigationNodeModel navigatioNode)
Extracts items from given navigation node.
|
protected CatalogVersionService |
getCatalogVersionService() |
protected CMSAdminSiteService |
getCmsAdminSiteService() |
protected CMSNavigationDao |
getCmsNavigationDao() |
protected CMSPageService |
getCmsPageService() |
java.util.List<CMSNavigationEntryModel> |
getNavigationEntriesByPage(AbstractPageModel page)
Finds all
CMSNavigationEntryModel associated with a AbstractPageModel. |
java.util.Optional<CMSNavigationEntryModel> |
getNavigationEntryForId(java.lang.String id,
CatalogVersionModel catalogVersion)
Returns a Navigation Entry identified via its id and the given catalog version
|
CMSNavigationNodeModel |
getNavigationNodeForId(java.lang.String id)
Returns a Navigation Node identified via its id
|
protected java.util.List<CMSNavigationNodeModel> |
getNavigationNodesByContentPage(ContentPageModel page) |
java.util.List<CMSNavigationNodeModel> |
getNavigationNodesForContentPage(ContentPageModel page)
Returns a list of all Navigation Nodes which contain the given page
|
java.util.List<CMSNavigationNodeModel> |
getNavigationNodesForContentPageId(java.lang.String pageId)
Returns a list of all Navigation Nodes which contain the given page
|
protected KeyGenerator |
getProcessCodeGenerator() |
java.util.List<CMSNavigationNodeModel> |
getRootNavigationNodes() |
java.util.List<CMSNavigationNodeModel> |
getRootNavigationNodes(CatalogVersionModel catVer)
Returns all root navigation nodes for given catalog version.
|
protected java.util.List<CMSNavigationNodeModel> |
getRootNavigationNodesByContentPage(ContentPageModel page) |
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
|
java.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 assigned
|
CMSNavigationNodeModel |
getSuperRootNavigationNode(CatalogVersionModel catalogVersionModel)
Returns super root navigation node for given catalog version.
|
boolean |
isSuperRootNavigationNode(CMSNavigationNodeModel navigationNodeModel)
Tests if a navigation node is a super root node.
|
void |
move(CMSNavigationNodeModel sourceNode,
CMSNavigationNodeModel targetModel)
Moves given nodeModel at last position of the child nodes list of targetModel.
|
void |
move(CMSNavigationNodeModel sourceNode,
CMSNavigationNodeModel targetModel,
boolean asChild,
boolean append)
Moves source nod to targert node.
|
void |
move(CMSNavigationNodeModel cmsNavigationNode,
ItemModel sourceEntry,
ItemModel targetnEntry)
Moves given items within given navigation node.
|
void |
move(ItemModel item,
CMSNavigationNodeModel sourceNode,
CMSNavigationNodeModel targetNode)
Moves given item from sourceNode to targetNode.
|
void |
remove(CMSNavigationNodeModel cmsNavigationNode,
ItemModel item)
Removes given item from given navigation node.
|
boolean |
removeNavigationEntryByUid(CMSNavigationNodeModel cmsNavigationNode,
java.lang.String navigationEntryUid)
Deprecated.
since 1811, no longer needed.
|
void |
setCatalogVersionService(CatalogVersionService catalogVersionService) |
void |
setCmsAdminSiteService(CMSAdminSiteService cmsAdminSiteService) |
void |
setCmsNavigationDao(CMSNavigationDao cmsNavigationDao) |
void |
setCmsPageService(CMSPageService cmsPageService) |
void |
setProcessCodeGenerator(KeyGenerator keyGenerator) |
CMSNavigationNodeModel |
setSuperRootNodeOnNavigationNode(CMSNavigationNodeModel navigationNodeModel,
CatalogVersionModel catalogVersionModel)
Sets the super root node onto the passed CMS navigation node model.
|
protected java.util.List<CMSNavigationEntryModel> |
wrapItemModel(java.util.Collection<ItemModel> items,
CatalogVersionModel catalogVersionModel)
Wrap given items to become a
CMSNavigationEntryModel. |
getBaseSiteService, getCurrentCatalogVersion, getCurrentSite, getSearchRestrictionService, getUserService, setBaseSiteService, setSearchRestrictionService, setUserServicegetModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerafterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplacepublic CMSNavigationNodeModel getNavigationNodeForId(java.lang.String id) throws CMSItemNotFoundException
getNavigationNodeForId in interface CMSNavigationServiceid - id of the Navigation NodeCMSItemNotFoundException - if no Navigation Node with the given id could be foundprotected java.util.List<CMSNavigationNodeModel> getNavigationNodesByContentPage(ContentPageModel page)
public java.util.List<CMSNavigationNodeModel> getNavigationNodesForContentPage(ContentPageModel page)
getNavigationNodesForContentPage in interface CMSNavigationServicepage - Page to lookuppublic java.util.List<CMSNavigationNodeModel> getNavigationNodesForContentPageId(java.lang.String pageId) throws CMSItemNotFoundException
getNavigationNodesForContentPageId in interface CMSNavigationServicepageId - id of the pageCMSItemNotFoundException - if the page with the given id could not be foundpublic java.util.List<CMSNavigationNodeModel> getRootNavigationNodes()
getRootNavigationNodes in interface CMSNavigationServiceprotected java.util.List<CMSNavigationNodeModel> getRootNavigationNodesByContentPage(ContentPageModel page)
public java.util.List<CMSNavigationNodeModel> getRootNavigationNodesForContentPage(ContentPageModel page)
getRootNavigationNodesForContentPage in interface CMSNavigationServicepage - page to lookuppublic java.util.List<CMSNavigationNodeModel> getRootNavigationNodesForContentPageId(java.lang.String pageId) throws CMSItemNotFoundException
getRootNavigationNodesForContentPageId in interface CMSNavigationServicepageId - id of the pageCMSItemNotFoundException - if the page with the given id could not be foundpublic java.util.List<CMSNavigationEntryModel> getNavigationEntriesByPage(AbstractPageModel page)
CMSNavigationServiceCMSNavigationEntryModel associated with a AbstractPageModel.getNavigationEntriesByPage in interface CMSNavigationServicepage - the AbstractPageModelCMSNavigationEntryModel, or an empty List if not foundpublic java.util.Optional<CMSNavigationEntryModel> getNavigationEntryForId(java.lang.String id, CatalogVersionModel catalogVersion)
CMSNavigationServicegetNavigationEntryForId in interface CMSNavigationServiceid - id of the Navigation EntrycatalogVersion - catalog versionpublic CMSNavigationEntryModel createCmsNavigationEntry(CMSNavigationNodeModel node, java.lang.String entryName, ItemModel entryContent)
item to given cmsNavigationNode navigation node.
Note:cmsNavigationNode is saved!createCmsNavigationEntry in interface CMSNavigationServicenode - given navigation nodeentryName - the navigation entry nameentryContent - item that will be addedpublic CMSNavigationEntryModel createCmsNavigationEntry(CatalogVersionModel catalogVersion, ItemModel item)
CMSNavigationServiceitem.
Note:createCmsNavigationEntry in interface CMSNavigationServicecatalogVersion - catalog versionitem - item that will be addedprotected void deleteRecursively(CMSNavigationNodeModel cmsNavigationNode)
cmsNavigationNode - navigation nodeprotected java.util.List<ItemModel> extractCmsNavigationEntries(CMSNavigationNodeModel navigatioNode)
navigatioNode - given navigation nodeprotected java.util.List<CMSNavigationEntryModel> wrapItemModel(java.util.Collection<ItemModel> items, CatalogVersionModel catalogVersionModel)
CMSNavigationEntryModel.
public java.util.List<CMSNavigationNodeModel> getRootNavigationNodes(CatalogVersionModel catVer)
getRootNavigationNodes in interface CMSNavigationServicecatVer - catalog versionpublic void move(CMSNavigationNodeModel sourceNode, CMSNavigationNodeModel targetModel)
nodeModel and targetModel are saved!move in interface CMSNavigationServicesourceNode - node that will be movedtargetModel - a new target nodepublic void move(CMSNavigationNodeModel cmsNavigationNode, ItemModel sourceEntry, ItemModel targetnEntry)
naviNode is saved with new items order!move in interface CMSNavigationServicecmsNavigationNode - current navigation nodesourceEntry - a source nodetargetnEntry - a new target nodepublic void move(ItemModel item, CMSNavigationNodeModel sourceNode, CMSNavigationNodeModel targetNode)
sourceNode and targetNode is
saved with new item order!move in interface CMSNavigationServiceitem - item that will be movedsourceNode - a source nodetargetNode - a new target node@Deprecated public void delete(CMSNavigationNodeModel cmsNavigationNode)
delete in interface CMSNavigationServicecmsNavigationNode - navigation node to removepublic void remove(CMSNavigationNodeModel cmsNavigationNode, ItemModel item)
cmsNavigationNode is saved!remove in interface CMSNavigationServicecmsNavigationNode - given navigation nodeitem - given item to remove from cmsNavigationNode@Deprecated public boolean removeNavigationEntryByUid(CMSNavigationNodeModel cmsNavigationNode, java.lang.String navigationEntryUid)
cmsNavigationNode is saved.removeNavigationEntryByUid in interface CMSNavigationServicecmsNavigationNode - given navigation nodenavigationEntryUid - given navigation entry uid.public CMSNavigationNodeModel createNavigationNode(ItemModel parentNode, java.lang.String navigationNodeName, boolean visible, java.util.Collection<ItemModel> relatedItems)
CMSNavigationServiceCMSNavigationNodeModel is not saved!createNavigationNode in interface CMSNavigationServiceparentNode - parent for created navigation nodenavigationNodeName - given navigation node namevisible - flag determines navigation node visibilityrelatedItems - given related itemspublic boolean isSuperRootNavigationNode(CMSNavigationNodeModel navigationNodeModel)
CMSNavigationServiceisSuperRootNavigationNode in interface CMSNavigationServicenavigationNodeModel - node model to test if it's a super root nodepublic CMSNavigationNodeModel setSuperRootNodeOnNavigationNode(CMSNavigationNodeModel navigationNodeModel, CatalogVersionModel catalogVersionModel)
CMSNavigationServicesetSuperRootNodeOnNavigationNode in interface CMSNavigationServicenavigationNodeModel - node model to set the super root node oncatalogVersionModel - the belonging catalog version model of the super root nodepublic CMSNavigationNodeModel createSuperRootNavigationNode(CatalogVersionModel catalogVersion)
createSuperRootNavigationNode in interface CMSNavigationServicecatalogVersion - catalog version for which the super root node will be createdpublic void appendRelatedItems(CMSNavigationNodeModel cmsNavigationNode, java.util.Collection<ItemModel> items)
CMSNavigationServiceCMSNavigationNodeModel navigation node.
appendRelatedItems in interface CMSNavigationServicecmsNavigationNode - given navigation nodeitems - that will be addedpublic void move(CMSNavigationNodeModel sourceNode, CMSNavigationNodeModel targetModel, boolean asChild, boolean append)
CMSNavigationServicemove in interface CMSNavigationServicesourceNode - node to be movedtargetModel - 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/previousprotected CMSNavigationEntryModel createCmsNavigationEntry(ItemModel entryContent, CatalogVersionModel catalogVersionModel)
public CMSNavigationNodeModel getSuperRootNavigationNode(CatalogVersionModel catalogVersionModel)
CMSNavigationServicegetSuperRootNavigationNode in interface CMSNavigationServicecatalogVersionModel - current catalog versionprotected CatalogVersionService getCatalogVersionService()
public void setCatalogVersionService(CatalogVersionService catalogVersionService)
protected CMSNavigationDao getCmsNavigationDao()
public void setCmsNavigationDao(CMSNavigationDao cmsNavigationDao)
protected CMSPageService getCmsPageService()
public void setCmsPageService(CMSPageService cmsPageService)
protected KeyGenerator getProcessCodeGenerator()
public void setProcessCodeGenerator(KeyGenerator keyGenerator)
protected CMSAdminSiteService getCmsAdminSiteService()
public void setCmsAdminSiteService(CMSAdminSiteService cmsAdminSiteService)
Copyright © 2018 SAP SE. All Rights Reserved.