Class NaviTreeNode

java.lang.Object
org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Treeitem
com.saperion.ngc.navigation.NaviTreeItem
com.saperion.ngc.navigation.NaviTreeNode
All Implemented Interfaces:
EventChild, Identifiable, NaviNodeAccessor, Serializable, Cloneable, Comparable<NaviTreeNode>, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.ext.Disable, org.zkoss.zk.ui.ext.Scope, org.zkoss.zk.ui.sys.ComponentCtrl
Direct Known Subclasses:
AbstractFileNaviTreeNode, CollectionNaviTreeNode, CollectionRootNaviTreeNode, FavoriteNaviTreeNode, FilterNaviTreeNode, FormChildNaviTreeNode, FormNaviTreeNode, LinkNaviTreeNode, MiniFormNode, OutlinerChildNaviTreeNode, RootFavoriteNaviTreeNode, RootFormNaviTreeNode, RootNaviTreeNode, RootPrivateNaviTreeNode, WebpartNaviTreeNode, WorkflowFormNaviTreeNode, WorkflowNaviTreeNode, WorkflowRootNaviTreeNode

public class NaviTreeNode extends NaviTreeItem implements EventChild, NaviNodeAccessor, Comparable<NaviTreeNode>, Identifiable
This class holds the ZK navigation tree node representation.
Author:
mak
See Also:
  • Field Details

    • NODE_ATTR_FILEUPLOAD_TARGET

      public static final String NODE_ATTR_FILEUPLOAD_TARGET
      Attribute used to set the target component for fileupload-events.
      See Also:
    • modelNaviNode

      protected NavigationNode modelNaviNode
      Model node of this view node.
    • countLabel

      protected org.zkoss.zul.Label countLabel
      Label holder for document counts.
    • onClickListener

      protected transient org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> onClickListener
      The onclick event listener of this node.
  • Constructor Details

    • NaviTreeNode

      protected NaviTreeNode(NavigationViewImpl naviView, NavigationTree tree, org.zkoss.zul.Treechildren parent)
      Constructor for root level folders.
      Parameters:
      naviView - navigation view
      tree - model navigation tree
      parent - parent tree element
  • Method Details

    • addTreeRow

      protected final void addTreeRow(boolean selectionMode)
      Add tree row and register event listeners.
      Parameters:
      selectionMode - selection mode enabled or disabled
    • getTreeCell

      protected org.zkoss.zul.Treecell getTreeCell()
      Returns:
      Treecell
    • setTreecells

      protected void setTreecells(List<org.zkoss.zul.Treecell> newCells)
      Parameters:
      newCells - New cells
    • clearChildren

      protected void clearChildren()
      Clear children.
    • createTreerow

      protected void createTreerow()
      Creates a new treerow.
    • createCells

      protected List<org.zkoss.zul.Treecell> createCells()
      Creates the ZK Treecells to display this tree node.
      Returns:
      a list of the created Treecells.
    • getCountValue

      protected String getCountValue()
      Builds and returns the value of this nodes count label.
      Returns:
      the value of this nodes count label.
    • updateCounter

      public void updateCounter(com.saperion.folder.FolderUpdateInfo folderUpdateInfo)
      Updates the count label of this node.
      Parameters:
      folderUpdateInfo - The FolderUpdateInfo describing the update values.
    • updateCounter

      public void updateCounter(com.saperion.wf.BoxCount count)
      Updates the count label of this node.
      Parameters:
      count - count for a workflow inbox
    • getDroppableIdentifiers

      protected String getDroppableIdentifiers()
      Returns a comma separated string with the identifiers of items that can be dropped on this item or 'false'/'true' if no/all items can be dropped on this item.
      Returns:
      identifiers of droppable items
    • getDragableIdentifiers

      protected String getDragableIdentifiers()
      Returns:
      Dragable identifier
    • addOnDoubleClickEventListener

      protected void addOnDoubleClickEventListener()
      Add double click event listener.
    • getNextLevelFolders

      protected boolean getNextLevelFolders() throws AuthenticationException, NgcUiException
      Initiates lazy loading of next level folders.
      Returns:
      false if limit of node count is exceeded
      Throws:
      AuthenticationException - authentication exception
      NgcUiException - exception to be handled by view
    • addOnOpenEventListener

      protected void addOnOpenEventListener()
      Add on open event listener, should load children on demand.
    • openNode

      protected void openNode()
      Expands the node.
    • addContextMenu

      protected void addContextMenu()
      Add context menu.
    • addMainContextMenu

      protected void addMainContextMenu()
      Add main context menu.
    • shouldCreateWebpartFolderMenuItem

      protected boolean shouldCreateWebpartFolderMenuItem()
      Determines if WebpartFolderMenuItem should be created.
      Returns:
      true if WebpartFolderMenuItem should be created, false otherwise.
    • addCreateCollectionMenuItem

      protected void addCreateCollectionMenuItem()
    • addMenuItem

      protected void addMenuItem(org.zkoss.zul.Menuitem item, boolean withSeparator)
      Adds a new item to the context menu.
      Parameters:
      item - the new item
      withSeparator - adds a separator before the item if necessary
    • addSeparator

      protected void addSeparator()
      Add separator.
    • addRefreshMenuItem

      protected void addRefreshMenuItem()
      Adds refresh menu item.
    • addEmptyMenuItem

      protected void addEmptyMenuItem()
      Empty menu item.
    • addFastAccessMenuItem

      protected boolean addFastAccessMenuItem()
      Fast access context menu.
      Returns:
      true if menu item was added
    • getNavigationPresenter

      protected NavigationPresenter getNavigationPresenter()
      Returns:
      Navigation presenter
    • addCreateFolderMenuItem

      protected boolean addCreateFolderMenuItem()
      Add menu item for creating folder.
      Returns:
      true if item was created
    • addRenameFolderMenuItem

      protected boolean addRenameFolderMenuItem()
      Add menu item for delete folder.
      Returns:
      true if item was created
    • addEditFolderPropertiesMenuItem

      protected void addEditFolderPropertiesMenuItem()
      Adds the menu item to edit the folder's properties.
    • addSearchFolderMenuItem

      protected void addSearchFolderMenuItem()
      Adds the menu item to search for folders with a mask.
    • addOnClickEventListener

      protected void addOnClickEventListener()
      Adds the event listener for onClick event. Override this method to listen to click events.
    • raiseTabClear

      protected void raiseTabClear()
      Raise tab clear.
    • addDeleteFolderMenuItem

      protected boolean addDeleteFolderMenuItem()
      Add delete folder menu item.
      Returns:
      true if item was created
    • addFolderSecurityMenuItem

      protected boolean addFolderSecurityMenuItem()
      Add folder security menu item.
      Returns:
      true if item was created
    • addUploadMenuItem

      protected boolean addUploadMenuItem()
      Add folder security menu item.
      Returns:
      true if item was created
    • render

      public void render()
      Renders the children of this node based on the given model node.
      Specified by:
      render in interface NaviNodeAccessor
    • getMenuPopup

      protected org.zkoss.zul.Menupopup getMenuPopup()
      Returns:
      Menu popup
    • renderChildNodes

      protected void renderChildNodes(List<NavigationNode> nodes) throws NgcUiException, AuthenticationException
      Parameters:
      nodes - Nodes
      Throws:
      AuthenticationException - authentication exception
      NgcUiException - exception to be handled by view
    • getNavigationView

      protected NavigationViewImpl getNavigationView()
      Returns:
      navigation view - root panel element.
    • getModelNaviNode

      public NavigationNode getModelNaviNode()
      Specified by:
      getModelNaviNode in interface NaviNodeAccessor
      Returns:
      Model node
    • addChildNodes

      public void addChildNodes(NavigationNode node)
      Adds the already existing model children of the given navigation model node to the associated view tree node.
      Specified by:
      addChildNodes in interface NaviNodeAccessor
      Parameters:
      node - navigation model node
      See Also:
    • remove

      public void remove(NavigationNode node)
      Removes the associated child node.
      Specified by:
      remove in interface NaviNodeAccessor
      Parameters:
      node - navigation model node
      See Also:
    • compareTo

      public int compareTo(NaviTreeNode o)
      Specified by:
      compareTo in interface Comparable<NaviTreeNode>
      See Also:
    • addChild

      public void addChild(NavigationNode child)
      Adds a new child node to the tree.
      Specified by:
      addChild in interface NaviNodeAccessor
      Parameters:
      child - child node
      See Also:
    • getEventtarget

      public Set<org.zkoss.zk.ui.Component> getEventtarget(String eventName)
      Reads the event target for the given event name, if set or the root element.
      Specified by:
      getEventtarget in interface EventChild
      Parameters:
      eventName - Event name or null for main target
      Returns:
      Set of event targets
      See Also:
    • setEventtarget

      public void setEventtarget(org.zkoss.zk.ui.Component comp, String eventName)
      Set the event target.
      Specified by:
      setEventtarget in interface EventChild
      Parameters:
      comp - Event target
      eventName - Event name or null for main target
      See Also:
    • postErrorLogEvent

      public void postErrorLogEvent(LogMessage message)
      Posts an error log event.
      Parameters:
      message - error message
      See Also:
    • postInfoLogEvent

      public void postInfoLogEvent(LogMessage message)
      Posts an info log event.
      Parameters:
      message - info message
      See Also:
    • postLogonEvent

      public void postLogonEvent(LogonEvent.LogonResult result, String username)
      Posts a logon event.
      Parameters:
      result - logon result
      username - username
      See Also:
    • getEventProvider

      protected EventChildHandler getEventProvider()
      Returns the event provider.
      Returns:
      event provider
    • moveFolder

      protected void moveFolder(NaviTreeNode sourceNode) throws NgcUiException
      Moves a folder to another.
      Parameters:
      sourceNode - the node which has to be included before this node.
      Throws:
      NgcUiException - exception to be handled by view
    • copyFolder

      protected void copyFolder(NaviTreeNode folderToCopy, NaviTreeNode target) throws AuthenticationException, NgcUiException
      Copies a folder.
      Parameters:
      folderToCopy - folder to copy
      target - target folder
      Throws:
      AuthenticationException - authentication exception
      NgcUiException - exception to be handled by view
    • getParentNaviNode

      public NaviNodeAccessor getParentNaviNode()
      Returns the parent node (in case of root node null) of this node.
      Specified by:
      getParentNaviNode in interface NaviNodeAccessor
      Returns:
      parent node
    • isPrivate

      public boolean isPrivate()
      Specified by:
      isPrivate in interface NaviNodeAccessor
      Returns:
      Is private folder
      See Also:
    • isWorkflow

      public boolean isWorkflow()
      Specified by:
      isWorkflow in interface NaviNodeAccessor
      Returns:
      Is workflow folder
      See Also:
    • refreshParent

      protected void refreshParent() throws AuthenticationException, NgcUiException
      Refreshes the parent view of the current node.
      Throws:
      NgcUiException - exception to be handled by view
      AuthenticationException - re-logon required
    • refreshCurrentNode

      protected void refreshCurrentNode(boolean includeChildren) throws AuthenticationException, NgcUiException
      Refreshes the current node. Optional boolean parameter to update children laying under the current node.
      Parameters:
      includeChildren - Shall the children of the current node be updated, too?
      Throws:
      AuthenticationException - AuthentificationException
      NgcUiException - NgcUiException
    • refreshCurrentNode

      protected void refreshCurrentNode() throws AuthenticationException, NgcUiException
      Refreshes the current node only.
      Throws:
      AuthenticationException - AuthentificationException
      NgcUiException - NgcUiException
    • getMaskDDC

      public String getMaskDDC()
      Reads the mask ddc name. (Traverses the tree upwards to search).
      Returns:
      Mask ddc name or null, if not found.
    • unregisterChildrensColumns

      protected void unregisterChildrensColumns()
      Unregisters the columns used by the child nodes at the column manager.
    • registerChildrensColumns

      protected void registerChildrensColumns()
      Registers the columns used by the child nodes at the column manager.
    • getFolderClass

      public FolderClass getFolderClass()
      Reads the folder class.
      Specified by:
      getFolderClass in interface NaviNodeAccessor
      Returns:
      Folder class object
    • getContextCreator

      protected NodeContextMenuCreator getContextCreator()
      Returns:
      the context menu item creator
    • generateUUID

      public String generateUUID()
      Specified by:
      generateUUID in interface Identifiable
      Returns:
      the generated uuid for the DOM tree
    • hideChildren

      public boolean hideChildren()
      Checks if this node will hide it's children or not. Other node-types can override this method to decide whether to hide children or not.
      Returns:
      hide children or not
    • onPageDetached

      public void onPageDetached(org.zkoss.zk.ui.Page page)
      Specified by:
      onPageDetached in interface org.zkoss.zk.ui.sys.ComponentCtrl
      Overrides:
      onPageDetached in class org.zkoss.zk.ui.AbstractComponent
    • getDefaultMenuRights

      public NaviMenuRights getDefaultMenuRights()
      This method returns the default NaviMenuRights for the context menu containing all rights. This method is supposed to be overridden in extending classes to handle node type specific rights.
      Returns:
      default menu rights