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)
Deletes given node and all it' child nodes.
|
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() |
CMSNavigationNodeModel |
getNavigationNodeById(java.lang.String id)
Returns a Navigation Node identified via its id
|
CMSNavigationNodeModel |
getNavigationNodeForId(java.lang.String id)
Returns a Navigation Node identified via its id
|
java.util.List<CMSNavigationNodeModel> |
getNavigationNodesByContentPage(ContentPageModel page)
Returns a list of all Navigation Nodes which contain the given page
|
java.util.List<CMSNavigationNodeModel> |
getNavigationNodesByContentPageId(java.lang.String pageId)
Returns a list of all Navigation Nodes which contain the given 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.
|
java.util.List<CMSNavigationNodeModel> |
getRootNavigationNodesByContentPage(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> |
getRootNavigationNodesByContentPageId(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
|
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.
|
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)
Removes a given entry from a given navigation node.
|
void |
setCatalogVersionService(CatalogVersionService catalogVersionService) |
void |
setCmsAdminSiteService(CMSAdminSiteService cmsAdminSiteService) |
void |
setCmsNavigationDao(CMSNavigationDao cmsNavigationDao) |
void |
setCmsPageService(CMSPageService cmsPageService) |
void |
setProcessCodeGenerator(KeyGenerator keyGenerator) |
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, setTenantScope, writeReplacepublic CMSNavigationNodeModel getNavigationNodeById(java.lang.String id) throws CMSItemNotFoundException
getNavigationNodeById in interface CMSNavigationServiceid - id of the Navgiation NodeCMSItemNotFoundException - if no Navigation Node with the given id could be foundpublic CMSNavigationNodeModel getNavigationNodeForId(java.lang.String id) throws CMSItemNotFoundException
getNavigationNodeForId in interface CMSNavigationServiceid - id of the Navgiation NodeCMSItemNotFoundException - if no Navigation Node with the given id could be foundpublic java.util.List<CMSNavigationNodeModel> getNavigationNodesByContentPage(ContentPageModel page)
getNavigationNodesByContentPage in interface CMSNavigationServicepage - Page to lookuppublic java.util.List<CMSNavigationNodeModel> getNavigationNodesByContentPageId(java.lang.String pageId) throws CMSItemNotFoundException
getNavigationNodesByContentPageId in interface CMSNavigationServicepageId - id of the pageCMSItemNotFoundException - if the page with the given id could not be foundpublic 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 CMSNavigationServicepublic java.util.List<CMSNavigationNodeModel> getRootNavigationNodesByContentPage(ContentPageModel page)
getRootNavigationNodesByContentPage in interface CMSNavigationServicepage - page to lookuppublic java.util.List<CMSNavigationNodeModel> getRootNavigationNodesByContentPageId(java.lang.String pageId) throws CMSItemNotFoundException
getRootNavigationNodesByContentPageId in interface CMSNavigationServicepageId - id of the pageCMSItemNotFoundException - if the page with the given id could not be foundpublic 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 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 nodepublic 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 cmsNavigationNodepublic 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)
CMSNavigationNodeModel is not saved!createNavigationNode in interface CMSNavigationServiceparentNode - parent for created navigation nodenavigationNodeName - given navigation node namevisible - flag determines navigation node visibilityrelatedItems - given related itemspublic CMSNavigationNodeModel createSuperRootNavigationNode(CatalogVersionModel catalogVersion)
createSuperRootNavigationNode in interface CMSNavigationServicecatalogVersion - catalog version for which the super root node will be createdpublic 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)
public 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)
protected KeyGenerator getProcessCodeGenerator()
public void setProcessCodeGenerator(KeyGenerator keyGenerator)
protected CMSAdminSiteService getCmsAdminSiteService()
public void setCmsAdminSiteService(CMSAdminSiteService cmsAdminSiteService)
Copyright © 2018 SAP SE. All Rights Reserved.