Class CmsResourceTreeContainer

  • All Implemented Interfaces:
    com.vaadin.v7.data.Container, com.vaadin.v7.data.Container.Filterable, com.vaadin.v7.data.Container.Hierarchical, com.vaadin.v7.data.Container.Indexed, com.vaadin.v7.data.Container.ItemSetChangeNotifier, com.vaadin.v7.data.Container.Ordered, com.vaadin.v7.data.Container.PropertySetChangeNotifier, com.vaadin.v7.data.Container.SimpleFilterable, com.vaadin.v7.data.Container.Sortable, com.vaadin.v7.data.Property.ValueChangeNotifier, java.io.Serializable, java.lang.Cloneable

    public class CmsResourceTreeContainer
    extends com.vaadin.v7.data.util.HierarchicalContainer
    The data container for the sitmeap folder selection tree.

    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.vaadin.v7.data.util.IndexedContainer

        com.vaadin.v7.data.util.IndexedContainer.ItemSetChangeEvent
      • Nested classes/interfaces inherited from class com.vaadin.v7.data.util.AbstractInMemoryContainer

        com.vaadin.v7.data.util.AbstractInMemoryContainer.BaseItemAddEvent, com.vaadin.v7.data.util.AbstractInMemoryContainer.BaseItemRemoveEvent
      • Nested classes/interfaces inherited from class com.vaadin.v7.data.util.AbstractContainer

        com.vaadin.v7.data.util.AbstractContainer.BaseItemSetChangeEvent, com.vaadin.v7.data.util.AbstractContainer.BasePropertySetChangeEvent
      • Nested classes/interfaces inherited from interface com.vaadin.v7.data.Container

        com.vaadin.v7.data.Container.Editor, com.vaadin.v7.data.Container.Filter, com.vaadin.v7.data.Container.Filterable, com.vaadin.v7.data.Container.Hierarchical, com.vaadin.v7.data.Container.Indexed, com.vaadin.v7.data.Container.ItemSetChangeEvent, com.vaadin.v7.data.Container.ItemSetChangeListener, com.vaadin.v7.data.Container.ItemSetChangeNotifier, com.vaadin.v7.data.Container.Ordered, com.vaadin.v7.data.Container.PropertySetChangeEvent, com.vaadin.v7.data.Container.PropertySetChangeListener, com.vaadin.v7.data.Container.PropertySetChangeNotifier, com.vaadin.v7.data.Container.SimpleFilterable, com.vaadin.v7.data.Container.Sortable, com.vaadin.v7.data.Container.Viewer
      • Nested classes/interfaces inherited from interface com.vaadin.v7.data.Container.Indexed

        com.vaadin.v7.data.Container.Indexed.ItemAddEvent, com.vaadin.v7.data.Container.Indexed.ItemRemoveEvent
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String PROPERTY_RESOURCE
      Property which is used to store the CmsResource.
      static java.lang.String PROPERTY_SITEMAP_CAPTION
      Property which is used to store the sitemap view caption HTML.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addTreeItem​(CmsObject cms, CmsResource resource, CmsUUID parentId)
      Adds an item to the folder tree.
      protected void defineProperties()
      Defines the container properties.
      protected void fillProperties​(CmsObject cms, com.vaadin.v7.data.Item resourceItem, CmsResource resource, CmsUUID parentId)
      Fills the properties of a tree item.
      protected java.lang.String getName​(CmsObject cms, CmsResource resource, CmsUUID parentId)
      Gets the name to display for the given resource.
      java.util.Collection<?> getSortableContainerPropertyIds()  
      void initRoot​(CmsObject cms, CmsResource root)
      Initializes the root level of the tree.
      void readTreeLevel​(CmsObject cms, CmsUUID parentId)
      Reads the given tree level.
      void removeChildren​(CmsUUID parentId)
      Clears the given tree level.
      void update​(CmsObject cms, CmsUUID id, CmsResourceFilter filter)
      Updates the item for the given structure id.
      void updateSort()
      Updates the item order according to the latest sort setting.
      • Methods inherited from class com.vaadin.v7.data.util.HierarchicalContainer

        addItem, addItem, areChildrenAllowed, doFilterContainer, doSort, fireItemSetChange, getChildren, getParent, hasChildren, isIncludeParentsWhenFiltering, isRoot, moveAfterSibling, passesFilters, removeAllItems, removeItem, removeItemRecursively, removeItemRecursively, rootItemIds, setChildrenAllowed, setIncludeParentsWhenFiltering, setParent
      • Methods inherited from class com.vaadin.v7.data.util.IndexedContainer

        addContainerFilter, addContainerFilter, addContainerProperty, addItemAfter, addItemAfter, addItemAt, addItemAt, addListener, addListener, addPropertySetChangeListener, addValueChangeListener, clone, fireItemAdded, fireItemSetChange, getContainerFilters, getContainerProperty, getContainerPropertyIds, getItemSorter, getListeners, getType, getUnfilteredItem, hasContainerFilters, registerNewItem, removeAllContainerFilters, removeContainerFilter, removeContainerFilters, removeContainerProperty, removeListener, removeListener, removePropertySetChangeListener, removeValueChangeListener, setItemSorter, sort
      • Methods inherited from class com.vaadin.v7.data.util.AbstractInMemoryContainer

        addFilter, addItemSetChangeListener, addListener, containsId, filterAll, fireItemRemoved, fireItemsAdded, fireItemsRemoved, firstItemId, getAllItemIds, getFilteredItemIds, getFilters, getFirstVisibleItem, getIdByIndex, getItem, getItemIds, getItemIds, getSortablePropertyIds, getVisibleItemIds, indexOfId, internalAddItemAfter, internalAddItemAt, internalAddItemAtEnd, internalRemoveAllItems, internalRemoveItem, isFiltered, isFirstId, isLastId, isPropertyFiltered, lastItemId, nextItemId, prevItemId, removeAllFilters, removeFilter, removeFilters, removeItemSetChangeListener, removeListener, setAllItemIds, setFilteredItemIds, setFilters, size, sortContainer
      • Methods inherited from class com.vaadin.v7.data.util.AbstractContainer

        fireContainerPropertySetChange, fireContainerPropertySetChange, getItemSetChangeListeners, getPropertySetChangeListeners, setItemSetChangeListeners, setPropertySetChangeListeners
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.vaadin.v7.data.Container

        addContainerProperty, containsId, getContainerProperty, getContainerPropertyIds, getItem, getItemIds, getType, removeContainerProperty, size
      • Methods inherited from interface com.vaadin.v7.data.Container.Ordered

        firstItemId, isFirstId, isLastId, lastItemId, nextItemId, prevItemId
    • Method Detail

      • addTreeItem

        public void addTreeItem​(CmsObject cms,
                                CmsResource resource,
                                CmsUUID parentId)
        Adds an item to the folder tree.

        Parameters:
        cms - the CMS context
        resource - the folder resource
        parentId - the parent folder id
      • getSortableContainerPropertyIds

        public java.util.Collection<?> getSortableContainerPropertyIds()
        Specified by:
        getSortableContainerPropertyIds in interface com.vaadin.v7.data.Container.Sortable
        Overrides:
        getSortableContainerPropertyIds in class com.vaadin.v7.data.util.IndexedContainer
        See Also:
        IndexedContainer.getSortableContainerPropertyIds()
      • initRoot

        public void initRoot​(CmsObject cms,
                             CmsResource root)
        Initializes the root level of the tree.

        Parameters:
        cms - the CMS context
        root - the root folder
      • readTreeLevel

        public void readTreeLevel​(CmsObject cms,
                                  CmsUUID parentId)
        Reads the given tree level.

        Parameters:
        cms - the CMS context
        parentId - the parent id
      • removeChildren

        public void removeChildren​(CmsUUID parentId)
        Clears the given tree level.

        Parameters:
        parentId - the parent id
      • update

        public void update​(CmsObject cms,
                           CmsUUID id,
                           CmsResourceFilter filter)
                    throws CmsException
        Updates the item for the given structure id.

        Parameters:
        cms - the CMS context
        id - the structure id
        filter - the resource filter used for reading the resource
        Throws:
        CmsException - if something goes wrong
      • updateSort

        public void updateSort()
        Updates the item order according to the latest sort setting.

      • defineProperties

        protected void defineProperties()
        Defines the container properties.

      • fillProperties

        protected void fillProperties​(CmsObject cms,
                                      com.vaadin.v7.data.Item resourceItem,
                                      CmsResource resource,
                                      CmsUUID parentId)
        Fills the properties of a tree item.

        Parameters:
        cms - the CMS context
        resourceItem - the empty item
        resource - the resource for which the tree item is being created
        parentId - the parent id
      • getName

        protected java.lang.String getName​(CmsObject cms,
                                           CmsResource resource,
                                           CmsUUID parentId)
        Gets the name to display for the given resource.

        Parameters:
        cms - the CMS context
        resource - a resource
        parentId - the id of the parent of the resource
        Returns:
        the name for the given resoure