info.magnolia.ui.workbench.tree
Class HierarchicalJcrContainer

java.lang.Object
  extended by info.magnolia.ui.workbench.container.AbstractContainer
      extended by info.magnolia.ui.workbench.container.AbstractJcrContainer
          extended by info.magnolia.ui.workbench.tree.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.Sortable, Serializable
Direct Known Subclasses:
UserContainer

public class HierarchicalJcrContainer
extends 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.workbench.container.AbstractContainer
AbstractContainer.ItemSetChangeEvent, 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.workbench.container.AbstractJcrContainer
ASCENDING_KEYWORD, DEFAULT_CACHE_RATIO, DEFAULT_NODE_TYPE, DEFAULT_PAGE_LENGTH, DESCENDING_KEYWORD, JCR_NAME_FUNCTION, ORDER_BY, PROPERTY_NAME_AND_UUID_SEPARATOR, SELECT_TEMPLATE, SELECTOR_NAME, WHERE_TEMPLATE_FOR_PATH
 
Constructor Summary
HierarchicalJcrContainer(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)
           
 String getParent(Object itemId)
           
 Collection<javax.jcr.Item> getRootItemIds()
           
 List<String> getSortableContainerPropertyIds()
           
 boolean hasChildren(Object itemId)
           
protected  boolean isNodeVisible(javax.jcr.Node node)
           
 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)
           
 void refresh()
          Refreshes the container - clears all caches and resets size and offset.
 Collection<String> rootItemIds()
           
 boolean setChildrenAllowed(Object itemId, boolean areChildrenAllowed)
           
 boolean setParent(Object itemId, Object newParentId)
           
 
Methods inherited from class info.magnolia.ui.workbench.container.AbstractJcrContainer
addItem, addItem, addItemAfter, addItemAfter, addItemAt, addItemAt, addItemSetChangeListener, addListener, addSortableProperty, clearItemIndexes, constructJCRQuery, containsId, executeQuery, findSearchableNodeTypes, fireItemSetChange, firstItemId, getCacheRatio, getContainerProperty, getCurrentOffset, getDefaultOrderBy, getIdByIndex, getItem, getItemIds, getItemIds, getItemIndexes, getJcrItem, getJcrNameOrderByFunction, getMainNodeType, getPageLength, getQuerySelectStatement, getQueryWhereClause, getQueryWhereClauseNodeTypes, getQueryWhereClauseWorkspacePath, getSearchableNodeTypes, getWorkbenchDefinition, getWorkspace, handleRepositoryException, indexOfId, isFirstId, isLastId, lastItemId, nextItemId, prevItemId, removeAllItems, removeItem, removeItemSetChangeListener, removeListener, resetOffset, setCacheRatio, setPageLength, setSize, size, sort, updateSize
 
Methods inherited from class info.magnolia.ui.workbench.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(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

refresh

public void refresh()
Description copied from class: AbstractJcrContainer
Refreshes the container - clears all caches and resets size and offset. Does NOT remove sorting or filtering rules!

Overrides:
refresh in class AbstractJcrContainer

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)

getSortableContainerPropertyIds

public List<String> getSortableContainerPropertyIds()
Specified by:
getSortableContainerPropertyIds in interface com.vaadin.data.Container.Sortable
Overrides:
getSortableContainerPropertyIds in class AbstractJcrContainer

getChildren

public Collection<javax.jcr.Item> getChildren(javax.jcr.Item item)

isNodeVisible

protected boolean isNodeVisible(javax.jcr.Node node)
                         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

moveItem

public boolean moveItem(javax.jcr.Item source,
                        javax.jcr.Item target)

moveItemBefore

public boolean moveItemBefore(javax.jcr.Item source,
                              javax.jcr.Item target)

moveItemAfter

public boolean moveItemAfter(javax.jcr.Item source,
                             javax.jcr.Item target)


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