Class DefaultCMSNavigationService

  • All Implemented Interfaces:
    CMSNavigationService, java.io.Serializable, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean

    public class DefaultCMSNavigationService
    extends AbstractCMSService
    implements CMSNavigationService
    Default implementation of CMSNavigationService interface.
    See Also:
    Serialized Form
    • Constructor Detail

      • DefaultCMSNavigationService

        public DefaultCMSNavigationService()
    • Method Detail

      • getRootNavigationNodesForContentPage

        public 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
        Specified by:
        getRootNavigationNodesForContentPage in interface CMSNavigationService
        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

        public 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
        Specified by:
        getRootNavigationNodesForContentPageId in interface CMSNavigationService
        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
      • createCmsNavigationEntry

        public CMSNavigationEntryModel createCmsNavigationEntry​(CMSNavigationNodeModel node,
                                                                java.lang.String entryName,
                                                                ItemModel entryContent)
        Adds a item to given cmsNavigationNode navigation node.

        Note:
        This method save all modified models i.e. cmsNavigationNode is saved!

        Specified by:
        createCmsNavigationEntry in interface CMSNavigationService
        Parameters:
        node - given navigation node
        entryName - the navigation entry name
        entryContent - item that will be added
        Returns:
        the navigation entry model created for the item and navigationNodeModel
      • deleteRecursively

        protected void deleteRecursively​(CMSNavigationNodeModel cmsNavigationNode)
        Deletes all children all way down to leafs.
        Parameters:
        cmsNavigationNode - navigation node
      • extractCmsNavigationEntries

        protected java.util.List<ItemModel> extractCmsNavigationEntries​(CMSNavigationNodeModel navigatioNode)
        Extracts items from given navigation node.
        Parameters:
        navigatioNode - given navigation node
      • move

        public 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. nodeModel and targetModel are saved!

        Specified by:
        move in interface CMSNavigationService
        Parameters:
        sourceNode - node that will be moved
        targetModel - a new target node
      • move

        public void move​(CMSNavigationNodeModel cmsNavigationNode,
                         ItemModel sourceEntry,
                         ItemModel targetnEntry)
        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. naviNode is saved with new items order!

        Specified by:
        move in interface CMSNavigationService
        Parameters:
        cmsNavigationNode - current navigation node
        sourceEntry - a source node
        targetnEntry - a new target node
      • move

        public 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. sourceNode and targetNode is saved with new item order!

        Specified by:
        move in interface CMSNavigationService
        Parameters:
        item - item that will be moved
        sourceNode - a source node
        targetNode - a new target node
      • delete

        @Deprecated
        public 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.

        Specified by:
        delete in interface CMSNavigationService
        Parameters:
        cmsNavigationNode - navigation node to remove
      • remove

        public 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. cmsNavigationNode is saved!

        Specified by:
        remove in interface CMSNavigationService
        Parameters:
        cmsNavigationNode - given navigation node
        item - given item to remove from cmsNavigationNode
      • removeNavigationEntryByUid

        @Deprecated
        public 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. cmsNavigationNode is saved.

        Specified by:
        removeNavigationEntryByUid in interface CMSNavigationService
        Parameters:
        cmsNavigationNode - given navigation node
        navigationEntryUid - given navigation entry uid.
        Returns:
        true if the entry was removed or false otherwise.
      • createNavigationNode

        public CMSNavigationNodeModel createNavigationNode​(ItemModel parentNode,
                                                           java.lang.String navigationNodeName,
                                                           boolean visible,
                                                           java.util.Collection<ItemModel> relatedItems)
        Description copied from interface: CMSNavigationService
        Creates a navigation node accordingly to specified attributes.

        Note:
        Returned CMSNavigationNodeModel is not saved!

        Specified by:
        createNavigationNode in interface CMSNavigationService
        Parameters:
        parentNode - parent for created navigation node
        navigationNodeName - given navigation node name
        visible - flag determines navigation node visibility
        relatedItems - given related items
        Returns:
        a new navigation node
      • move

        public void move​(CMSNavigationNodeModel sourceNode,
                         CMSNavigationNodeModel targetModel,
                         boolean asChild,
                         boolean append)
        Description copied from interface: CMSNavigationService
        Moves source nod to targert node.
        Specified by:
        move in interface CMSNavigationService
        Parameters:
        sourceNode - node to be moved
        targetModel - node to be dropped at
        asChild - if true source node will be come target node's child otherwise source will become target's sibling
        append - if true source will be added as last (child node)/next(sibling) else as first/previous
      • setCatalogVersionService

        public void setCatalogVersionService​(CatalogVersionService catalogVersionService)
      • setCmsNavigationDao

        public void setCmsNavigationDao​(CMSNavigationDao cmsNavigationDao)
      • setCmsPageService

        public void setCmsPageService​(CMSPageService cmsPageService)
      • getProcessCodeGenerator

        protected KeyGenerator getProcessCodeGenerator()
      • setProcessCodeGenerator

        public void setProcessCodeGenerator​(KeyGenerator keyGenerator)
      • setCmsAdminSiteService

        public void setCmsAdminSiteService​(CMSAdminSiteService cmsAdminSiteService)