info.magnolia.ui.admincentral.tree.container
Class HierarchicalJcrContainer

java.lang.Object
  extended by info.magnolia.ui.vaadin.integration.jcr.container.AbstractContainer
      extended by info.magnolia.ui.vaadin.integration.jcr.container.AbstractJcrContainer
          extended by info.magnolia.ui.admincentral.tree.container.HierarchicalJcrContainer
All Implemented Interfaces:
com.vaadin.data.Container, com.vaadin.data.Container.Hierarchical, com.vaadin.data.Container.Indexed, com.vaadin.data.Container.ItemSetChangeNotifier, com.vaadin.data.Container.Ordered, com.vaadin.data.Container.PropertySetChangeNotifier, com.vaadin.data.Container.Sortable, Serializable

public class HierarchicalJcrContainer
extends info.magnolia.ui.vaadin.integration.jcr.container.AbstractJcrContainer
implements com.vaadin.data.Container.Hierarchical

Hierarchical implementation of AbstractJcrContainer.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class info.magnolia.ui.vaadin.integration.jcr.container.AbstractContainer
info.magnolia.ui.vaadin.integration.jcr.container.AbstractContainer.ItemSetChangeEvent, info.magnolia.ui.vaadin.integration.jcr.container.AbstractContainer.PropertySetChangeEvent
 
Nested classes/interfaces inherited from interface com.vaadin.data.Container
com.vaadin.data.Container.Editor, com.vaadin.data.Container.Filter, com.vaadin.data.Container.Filterable, com.vaadin.data.Container.Hierarchical, com.vaadin.data.Container.Indexed, com.vaadin.data.Container.ItemSetChangeEvent, com.vaadin.data.Container.ItemSetChangeListener, com.vaadin.data.Container.ItemSetChangeNotifier, com.vaadin.data.Container.Ordered, com.vaadin.data.Container.PropertySetChangeEvent, com.vaadin.data.Container.PropertySetChangeListener, com.vaadin.data.Container.PropertySetChangeNotifier, com.vaadin.data.Container.SimpleFilterable, com.vaadin.data.Container.Sortable, com.vaadin.data.Container.Viewer
 
Field Summary
 
Fields inherited from class info.magnolia.ui.vaadin.integration.jcr.container.AbstractJcrContainer
ASCENDING_KEYWORD, DEFAULT_CACHE_RATIO, DEFAULT_MAIN_ITEM_TYPE, DEFAULT_PAGE_LENGTH, DESCENDING_KEYWORD, JCR_NAME_FUNCTION, ORDER_BY, SELECT_TEMPLATE, SELECTOR_NAME, WHERE_TEMPLATE_FOR_PATH
 
Constructor Summary
HierarchicalJcrContainer(info.magnolia.ui.model.workbench.definition.WorkbenchDefinition workbenchDefinition)
           
 
Method Summary
 boolean areChildrenAllowed(Object itemId)
           
protected  Collection<String> createContainerIds(Collection<javax.jcr.Item> children)
           
 Collection<javax.jcr.Item> getChildren(javax.jcr.Item item)
           
 Collection<String> getChildren(Object itemId)
           
 javax.jcr.Item getItemByPath(String path)
           
 String getParent(Object itemId)
           
 Collection<javax.jcr.Item> getRootItemIds()
           
 List<String> getSortableContainerPropertyIds()
           
 boolean hasChildren(Object itemId)
           
 boolean isRoot(javax.jcr.Item item)
          Checks if an item is a root.
 boolean isRoot(Object itemId)
           
 boolean moveItem(javax.jcr.Item source, javax.jcr.Item target)
           
 boolean moveItemAfter(javax.jcr.Item source, javax.jcr.Item target)
           
 boolean moveItemBefore(javax.jcr.Item source, javax.jcr.Item target)
           
 Collection<String> rootItemIds()
           
 boolean setChildrenAllowed(Object itemId, boolean areChildrenAllowed)
           
 boolean setParent(Object itemId, Object newParentId)
           
 
Methods inherited from class info.magnolia.ui.vaadin.integration.jcr.container.AbstractJcrContainer
addItem, addItem, addItemAfter, addItemAfter, addItemAt, addItemAt, addItemSetChangeListener, addListener, addListener, addPropertySetChangeListener, constructJCRQuery, containsId, executeQuery, fireItemSetChange, firePropertySetChange, firstItemId, getCacheRatio, getContainerProperty, getCurrentOffset, getIdByIndex, getItem, getItemIds, getItemIds, getItemIndexes, getMainItemTypeAsString, getPageLength, getQuerySelectStatement, getQueryWhereClause, getQueryWhereClauseWorkspacePath, getWorkbenchDefinition, getWorkspace, indexOfId, isFirstId, isLastId, lastItemId, nextItemId, prevItemId, refresh, removeAllItems, removeItem, removeItemSetChangeListener, removeListener, removeListener, removePropertySetChangeListener, resetOffset, setCacheRatio, setPageLength, setSize, size, sort, updateSize
 
Methods inherited from class info.magnolia.ui.vaadin.integration.jcr.container.AbstractContainer
addContainerProperty, getContainerPropertyIds, getType, removeContainerProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.vaadin.data.Container.Hierarchical
removeItem
 
Methods inherited from interface com.vaadin.data.Container
addContainerProperty, addItem, addItem, containsId, getContainerProperty, getContainerPropertyIds, getItem, getItemIds, getType, removeAllItems, removeContainerProperty, size
 

Constructor Detail

HierarchicalJcrContainer

public HierarchicalJcrContainer(info.magnolia.ui.model.workbench.definition.WorkbenchDefinition workbenchDefinition)
Method Detail

getChildren

public Collection<String> getChildren(Object itemId)
Specified by:
getChildren in interface com.vaadin.data.Container.Hierarchical

getParent

public String getParent(Object itemId)
Specified by:
getParent in interface com.vaadin.data.Container.Hierarchical

rootItemIds

public Collection<String> rootItemIds()
Specified by:
rootItemIds in interface com.vaadin.data.Container.Hierarchical

setParent

public boolean setParent(Object itemId,
                         Object newParentId)
                  throws UnsupportedOperationException
Specified by:
setParent in interface com.vaadin.data.Container.Hierarchical
Throws:
UnsupportedOperationException

areChildrenAllowed

public boolean areChildrenAllowed(Object itemId)
Specified by:
areChildrenAllowed in interface com.vaadin.data.Container.Hierarchical

setChildrenAllowed

public boolean setChildrenAllowed(Object itemId,
                                  boolean areChildrenAllowed)
                           throws UnsupportedOperationException
Specified by:
setChildrenAllowed in interface com.vaadin.data.Container.Hierarchical
Throws:
UnsupportedOperationException

isRoot

public boolean isRoot(Object itemId)
Specified by:
isRoot in interface com.vaadin.data.Container.Hierarchical

hasChildren

public boolean hasChildren(Object itemId)
Specified by:
hasChildren in interface com.vaadin.data.Container.Hierarchical

createContainerIds

protected Collection<String> createContainerIds(Collection<javax.jcr.Item> children)
                                         throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getSortableContainerPropertyIds

public List<String> getSortableContainerPropertyIds()
Specified by:
getSortableContainerPropertyIds in interface com.vaadin.data.Container.Sortable
Overrides:
getSortableContainerPropertyIds in class info.magnolia.ui.vaadin.integration.jcr.container.AbstractJcrContainer

getChildren

public Collection<javax.jcr.Item> getChildren(javax.jcr.Item item)
                                       throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getRootItemIds

public Collection<javax.jcr.Item> getRootItemIds()
                                          throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

isRoot

public boolean isRoot(javax.jcr.Item item)
               throws javax.jcr.RepositoryException
Checks if an item is a root. Since root node is never shown, we consider its child nodes and properties as roots to remove unnecessary offset in trees.

Throws:
javax.jcr.RepositoryException

getItemByPath

public javax.jcr.Item getItemByPath(String path)
                             throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

moveItem

public boolean moveItem(javax.jcr.Item source,
                        javax.jcr.Item target)
                 throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

moveItemBefore

public boolean moveItemBefore(javax.jcr.Item source,
                              javax.jcr.Item target)
                       throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

moveItemAfter

public boolean moveItemAfter(javax.jcr.Item source,
                             javax.jcr.Item target)
                      throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException


Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.