Class CmsSitemapView

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  CmsSitemapView.TreeOpenHandler
      The sitemap tree open handler.
    • Constructor Summary

      Constructors 
      Constructor Description
      CmsSitemapView()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      CmsSitemapTreeItem create​(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
      Creates a new tree item from the given sitemap entry.
      CmsSitemapTreeItem createSitemapItem​(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
      Creates a sitemap tree item from a client sitemap entry.
      void displayCategoryData​(org.opencms.ade.sitemap.shared.CmsSitemapCategoryData categoryData, boolean openLocalCategories, org.opencms.util.CmsUUID openItemId)
      Displays the category data.
      void displayGalleries​(java.util.Map<org.opencms.ade.sitemap.shared.CmsGalleryType,​java.util.List<org.opencms.ade.sitemap.shared.CmsGalleryFolderEntry>> galleries)
      Displays the gallery view.
      void displayModelPages​(org.opencms.ade.sitemap.shared.CmsModelInfo modelPageData)
      Displays the model page data in a tree.
      void displayNewGallery​(org.opencms.ade.sitemap.shared.CmsGalleryFolderEntry galleryFolder)
      Displays a newly created gallery folder.
      void displayNewModelPage​(org.opencms.ade.sitemap.shared.CmsModelPageEntry modelPageData, boolean isModelGroup)
      Adds a new model page to the model page view.
      protected void ensureEntriesLoaded​(CmsGalleryTreeItem parent)
      Makes sure corresponding sitemap entries are loaded when the gallery tree is opened.
      void ensureVisible​(CmsSitemapTreeItem item)
      Ensures the given item is visible in the viewport.
      CmsSitemapController getController()
      Returns the controller.
      org.opencms.ade.sitemap.shared.CmsSitemapData.EditorMode getEditorMode()
      Returns the editor mode.
      java.lang.String getIconForEntry​(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
      Returns the icon class for the given entry depending on the editor mode.
      static CmsSitemapView getInstance()
      Returns the instance.
      org.opencms.ade.sitemap.shared.CmsModelPageEntry getModelPageEntry​(org.opencms.util.CmsUUID id)
      Gets the model page bean with the given structure id.
      org.opencms.util.CmsPair<java.util.List<org.opencms.ade.sitemap.shared.CmsClientSitemapEntry>,​java.util.List<org.opencms.ade.sitemap.shared.CmsClientSitemapEntry>> getOpenAndClosedDescendants​(java.lang.String path)
      Gets the list of descendants of a path and splits it into two lists, one containing the sitemap entries whose children have already been loaded, and those whose children haven't been loaded.
      protected CmsSitemapTreeItem getRootItem()
      Gets the sitemap tree item widget which represents the root of the current sitemap.
      CmsSitemapToolbar getToolbar()
      Gets the sitemap toolbar.
      CmsLazyTree<CmsSitemapTreeItem> getTree()
      Returns the tree.
      CmsSitemapTreeItem getTreeItem​(java.lang.String path)
      Returns the tree entry with the given path.
      CmsSitemapTreeItem getTreeItem​(org.opencms.util.CmsUUID entryId)
      Returns the tree entry with the given path.
      void highlightPath​(java.lang.String sitePath)
      Highlights the sitemap entry with the given path.
      boolean isDisabledModelPageEntry​(org.opencms.util.CmsUUID id)
      Returns the disabled state of the given model page entry.
      boolean isGalleryMode()
      Returns if the current sitemap editor mode is galleries.
      boolean isModelGroupEntry​(org.opencms.util.CmsUUID entryId)
      Returns if the given entry is a model group page.
      boolean isModelPageEntry​(org.opencms.util.CmsUUID entryId)
      Returns if the given entry is a template model page.
      boolean isModelPageMode()
      Checks if the sitemap editor is in 'model page mode'.
      boolean isNavigationMode()
      Returns if the current sitemap editor mode is navigation.
      boolean isParentModelPageEntry​(org.opencms.util.CmsUUID entryId)
      Returns if the given entry is a template model page inherited from the parent configuration.
      boolean isSpecialMode()
      Returns true if we are not currently displaying the navigation or VFS tree.
      void onBeforeSetEditorMode​(org.opencms.ade.sitemap.shared.CmsSitemapData.EditorMode mode)
      Performs necessary async actions before actually setting the mode.
      void onChange​(CmsSitemapChangeEvent changeEvent)
      Will be triggered when something has changed.
      void onLoad​(CmsSitemapLoadEvent event)
      Will be triggered when an entry loads its children.
      void onModuleLoad()  
      void removeDeleted​(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
      Removes deleted entry widget reference.
      protected void setCategoriesVisible​(boolean visible)
      Shows/hides the category view.
      void setEditorMode​(org.opencms.ade.sitemap.shared.CmsSitemapData.EditorMode editorMode)
      Sets the editor mode.
      protected void setElementVisible​(com.google.gwt.user.client.ui.Widget widget, boolean visible)
      Shows or hides the element for a widget.
      protected void setGalleriesVisible​(boolean visible)
      Shows or hides the tree for the gallery mode.
      void setHeaderVisible​(boolean visible)
      Sets the visibility of the normal siteamp header (the header can be hidden so that the Vaadin code can display its own header).
      protected void setModelPagesVisible​(boolean visible)
      Shows or hides the tree for the model page mode.
      void updateDetailPageView​(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
      Updates the detail page view for a given changed entry.
      void updateEntriesById​(java.util.Collection<org.opencms.util.CmsUUID> ids)
      Updates the entries whose id is in the given list of ids.
      void updateModelPageDisabledState​(org.opencms.util.CmsUUID entryId, boolean disabled)
      Updates the disabled state for the given model page.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • create

        public CmsSitemapTreeItem create​(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
        Creates a new tree item from the given sitemap entry.

        Parameters:
        entry - the sitemap entry
        Returns:
        the new created (still orphan) tree item
      • createSitemapItem

        public CmsSitemapTreeItem createSitemapItem​(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
        Creates a sitemap tree item from a client sitemap entry.

        Parameters:
        entry - the entry from which the sitemap tree item should be created
        Returns:
        the new sitemap tree item
      • displayCategoryData

        public void displayCategoryData​(org.opencms.ade.sitemap.shared.CmsSitemapCategoryData categoryData,
                                        boolean openLocalCategories,
                                        org.opencms.util.CmsUUID openItemId)
        Displays the category data.

        Parameters:
        categoryData - the category data
        openLocalCategories - true if the local category tree should be opened
        openItemId - the id of the item to open
      • displayGalleries

        public void displayGalleries​(java.util.Map<org.opencms.ade.sitemap.shared.CmsGalleryType,​java.util.List<org.opencms.ade.sitemap.shared.CmsGalleryFolderEntry>> galleries)
        Displays the gallery view.

        Parameters:
        galleries - the gallery data
      • displayModelPages

        public void displayModelPages​(org.opencms.ade.sitemap.shared.CmsModelInfo modelPageData)
        Displays the model page data in a tree.

        Parameters:
        modelPageData - the model page data
      • displayNewGallery

        public void displayNewGallery​(org.opencms.ade.sitemap.shared.CmsGalleryFolderEntry galleryFolder)
        Displays a newly created gallery folder.

        Parameters:
        galleryFolder - the gallery folder
      • displayNewModelPage

        public void displayNewModelPage​(org.opencms.ade.sitemap.shared.CmsModelPageEntry modelPageData,
                                        boolean isModelGroup)
        Adds a new model page to the model page view.

        Parameters:
        modelPageData - the data for the new model page
        isModelGroup - in case of a model group page
      • ensureVisible

        public void ensureVisible​(CmsSitemapTreeItem item)
        Ensures the given item is visible in the viewport.

        Parameters:
        item - the item to see
      • getEditorMode

        public org.opencms.ade.sitemap.shared.CmsSitemapData.EditorMode getEditorMode()
        Returns the editor mode.

        Returns:
        the editor mode
      • getIconForEntry

        public java.lang.String getIconForEntry​(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
        Returns the icon class for the given entry depending on the editor mode.

        Parameters:
        entry - the entry to get the icon for
        Returns:
        the icon CSS class
      • getModelPageEntry

        public org.opencms.ade.sitemap.shared.CmsModelPageEntry getModelPageEntry​(org.opencms.util.CmsUUID id)
        Gets the model page bean with the given structure id.

        Parameters:
        id - a structure id
        Returns:
        the model page bean with the given id
      • getOpenAndClosedDescendants

        public org.opencms.util.CmsPair<java.util.List<org.opencms.ade.sitemap.shared.CmsClientSitemapEntry>,​java.util.List<org.opencms.ade.sitemap.shared.CmsClientSitemapEntry>> getOpenAndClosedDescendants​(java.lang.String path)
        Gets the list of descendants of a path and splits it into two lists, one containing the sitemap entries whose children have already been loaded, and those whose children haven't been loaded.

        Parameters:
        path - the path for which the open and closed descendants should be returned
        Returns:
        a pair whose first and second components are lists of open and closed descendant entries of the path, respectively
      • getTreeItem

        public CmsSitemapTreeItem getTreeItem​(org.opencms.util.CmsUUID entryId)
        Returns the tree entry with the given path.

        Parameters:
        entryId - the id of the sitemap entry
        Returns:
        the tree entry with the given path, or null if not found
      • getTreeItem

        public CmsSitemapTreeItem getTreeItem​(java.lang.String path)
        Returns the tree entry with the given path.

        Parameters:
        path - the path to look for
        Returns:
        the tree entry with the given path, or null if not found
      • highlightPath

        public void highlightPath​(java.lang.String sitePath)
        Highlights the sitemap entry with the given path.

        Parameters:
        sitePath - the sitemap path of the entry to highlight
      • isDisabledModelPageEntry

        public boolean isDisabledModelPageEntry​(org.opencms.util.CmsUUID id)
        Returns the disabled state of the given model page entry.

        Parameters:
        id - the entry id
        Returns:
        the disabled state
      • isGalleryMode

        public boolean isGalleryMode()
        Returns if the current sitemap editor mode is galleries.

        Returns:
        true if the current sitemap editor mode is galleries
      • isModelGroupEntry

        public boolean isModelGroupEntry​(org.opencms.util.CmsUUID entryId)
        Returns if the given entry is a model group page.

        Parameters:
        entryId - the entry id
        Returns:
        true if the given entry is a model group page
      • isModelPageEntry

        public boolean isModelPageEntry​(org.opencms.util.CmsUUID entryId)
        Returns if the given entry is a template model page.

        Parameters:
        entryId - the entry id
        Returns:
        true if the given entry is a template model page
      • isModelPageMode

        public boolean isModelPageMode()
        Checks if the sitemap editor is in 'model page mode'.

        Returns:
        true if we are in model page view
      • isNavigationMode

        public boolean isNavigationMode()
        Returns if the current sitemap editor mode is navigation.

        Returns:
        true if the current sitemap editor mode is navigation
      • isParentModelPageEntry

        public boolean isParentModelPageEntry​(org.opencms.util.CmsUUID entryId)
        Returns if the given entry is a template model page inherited from the parent configuration.

        Parameters:
        entryId - the entry id
        Returns:
        true if the given entry is a template model page
      • isSpecialMode

        public boolean isSpecialMode()
        Returns true if we are not currently displaying the navigation or VFS tree.

        Returns:
        true if we are not currently in navigation or VFS mode
      • onBeforeSetEditorMode

        public void onBeforeSetEditorMode​(org.opencms.ade.sitemap.shared.CmsSitemapData.EditorMode mode)
        Performs necessary async actions before actually setting the mode.

        Parameters:
        mode - the mode
      • onModuleLoad

        public void onModuleLoad()
        Specified by:
        onModuleLoad in interface com.google.gwt.core.client.EntryPoint
        Overrides:
        onModuleLoad in class A_CmsEntryPoint
        See Also:
        EntryPoint.onModuleLoad()
      • removeDeleted

        public void removeDeleted​(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
        Removes deleted entry widget reference.

        Parameters:
        entry - the entry being deleted
      • setEditorMode

        public void setEditorMode​(org.opencms.ade.sitemap.shared.CmsSitemapData.EditorMode editorMode)
        Sets the editor mode.

        Parameters:
        editorMode - the editor mode to set
      • setHeaderVisible

        public void setHeaderVisible​(boolean visible)
        Sets the visibility of the normal siteamp header (the header can be hidden so that the Vaadin code can display its own header).

        Parameters:
        visible - true if the normal header should be visible
      • updateDetailPageView

        public void updateDetailPageView​(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
        Updates the detail page view for a given changed entry.

        Parameters:
        entry - the entry which was changed
      • updateEntriesById

        public void updateEntriesById​(java.util.Collection<org.opencms.util.CmsUUID> ids)
        Updates the entries whose id is in the given list of ids.

        Parameters:
        ids - a list of sitemap entry ids
      • updateModelPageDisabledState

        public void updateModelPageDisabledState​(org.opencms.util.CmsUUID entryId,
                                                 boolean disabled)
        Updates the disabled state for the given model page.

        Parameters:
        entryId - the model page id
        disabled - the disabled state
      • ensureEntriesLoaded

        protected void ensureEntriesLoaded​(CmsGalleryTreeItem parent)
        Makes sure corresponding sitemap entries are loaded when the gallery tree is opened.

        Parameters:
        parent - the parent gallery tree item
      • getRootItem

        protected CmsSitemapTreeItem getRootItem()
        Gets the sitemap tree item widget which represents the root of the current sitemap.

        Returns:
        the root sitemap tree item widget
      • setCategoriesVisible

        protected void setCategoriesVisible​(boolean visible)
        Shows/hides the category view.

        Parameters:
        visible - true if the categories should be made visible
      • setElementVisible

        protected void setElementVisible​(com.google.gwt.user.client.ui.Widget widget,
                                         boolean visible)
        Shows or hides the element for a widget.

        Parameters:
        widget - the widget to show or hide
        visible - true if the widget should be shown
      • setGalleriesVisible

        protected void setGalleriesVisible​(boolean visible)
        Shows or hides the tree for the gallery mode.

        Parameters:
        visible - true if the tree should be shown
      • setModelPagesVisible

        protected void setModelPagesVisible​(boolean visible)
        Shows or hides the tree for the model page mode.

        Parameters:
        visible - true if the model pages should be shown