psdi.webclient.controls

Class Tree

  • All Implemented Interfaces:
    java.lang.Cloneable, DataBeanListener
    Direct Known Subclasses:
    BIMTree


    public class Tree
    extends DatasrcInstance
    implements DataBeanListener
    Control handler of Tree control. The object implements DataBeanListener to notice the main record changes. Contains methods for creating instances of TreeNode
    • Field Detail

      • CONST_RESTRICT_ACTION_ON_LEAFNODES

        public static final java.lang.String CONST_RESTRICT_ACTION_ON_LEAFNODES
        Constant for leaf type nodes
        See Also:
        Constant Field Values
      • CONST_RESTRICT_ACTION_ON_BRANCHNODES

        public static final java.lang.String CONST_RESTRICT_ACTION_ON_BRANCHNODES
        Constant for branch type nodes
        See Also:
        Constant Field Values
    • Constructor Detail

      • Tree

        public Tree()
    • Method Detail

      • initialize

        public void initialize()
        Overridden to setup the databean to use speecific dobjectName and dataattribute. Gets and stores the source control for this tree, usually when the tree is launched from the dialog. If this tree was launched from a detail menu, then capture the attributes. Also gets the properties to be used by the tree control. After the properties have been set, this method will also initialise the data bean behind the tree.
        Overrides:
        initialize in class ControlInstance
        See Also:
        DataBean.initialize()
      • render

        public int render()
                   throws java.lang.NoSuchMethodException,
                          java.lang.IllegalAccessException,
                          java.lang.reflect.InvocationTargetException
        Overridden from ControlInstance to clone the tree nodes. If a uniqueid is not avaialable, but objectname, sourcedataattribute and sourcedataattributevalue is available, it gets the hierarchy data and fetches the uniqueid for further use. If the tree has been refreshed due to structure change, then the previous nodes are cleaned out and new ones are created based on the latest hierarchy data
        Overrides:
        render in class DatasrcInstance
        Throws:
        java.lang.NoSuchMethodException
        java.lang.IllegalAccessException
        java.lang.reflect.InvocationTargetException
        See Also:
        ControlInstance.render()
      • collectNodeAttributes

        public void collectNodeAttributes()
        Traverses through the tree attributes defined in the tree definition in the presentation. Collects the nodeDataAttributes in order to get MboValueData based on which nodes will be cloned It will make an array of objectname, keyattributename,haschildren,hasparent and one ore more dataattributes from treeattribute
      • supportsMarkedForDelete

        public boolean supportsMarkedForDelete()
        Returns true if tree is to check for markedfordelete
        Returns:
      • selectnode

        public void selectnode()
                        throws MXException,
                               java.rmi.RemoteException
        Called when a node is selected in the tree
        Throws:
        MXException
        java.rmi.RemoteException
      • setcurrentnode

        public void setcurrentnode(java.lang.String newobjectname,
                                   java.lang.String newuniqueIdName,
                                   java.lang.String newuniqueIdValue)
                            throws MXException,
                                   java.rmi.RemoteException
        Sets the key values for the node that was just selected in the tree
        Parameters:
        newobjectname -
        newuniqueIdName -
        newuniqueIdValue -
        Throws:
        MXException
        java.rmi.RemoteException
      • createNodes

        public void createNodes()
        Clones tree nodes based on the definition in the registry and values obtained from the HierarchicalMboSet.
        Parameters:
        nodeDataAttributes - Values to be retrieved from the HeirarchicalMboSet
      • getTop

        public java.lang.Object[][] getTop(java.lang.String[] dataattributes,
                                           int maxchildren)
                                    throws MXException,
                                           java.rmi.RemoteException
        Returns all the top level objects in the hierarchy, i.e. objects that do not have parents.
        Parameters:
        nodeDataAttributes - - list of attributes whose values are requested, the attribute data returned in the attribute list correspond to this list.
        maxchildren - - maximum number of rows to return.
        Returns:
        MboValueData[][] - contains an array of Object name, Object key, hasChildren flag, hasParents flag, list of attributes data from the passed attributes list.
        Throws:
        MXException
        java.rmi.RemoteException
      • getChildren

        public java.lang.Object[][] getChildren(java.lang.String objectname,
                                                java.lang.String uniqueId,
                                                java.lang.String[] dataAttributes,
                                                int maxChildren)
                                         throws MXException,
                                                java.rmi.RemoteException
        Parameters:
        objectName - - name of the object whose children are being requested.
        uniqueid - - unique id of the object whose children are being fetched.
        Returns:
        MboValueData[][] - contains an array of Object name, Object key, hasChildren flag, hasParents flag, list of attributes data from the passed attributes list.
        Throws:
        MXException
        java.rmi.RemoteException
      • getChildren

        public java.lang.Object[][] getChildren(java.lang.String objectname,
                                                java.lang.String uniqueId)
                                         throws MXException,
                                                java.rmi.RemoteException
        Parameters:
        objectName - - name of the object whose children are being requested.
        uniqueid - - unique id of the object whose children are being fetched.
        dataattributes - - list of attributes whose values are requested, the attribute data returned in the attribute list correspond to this list.
        maxchildren - - maximum number of rows to return.
        Returns:
        MboValueData[][] - contains an array of Object name, Object key, hasChildren flag, hasParents flag, list of attributes data from the passed attributes list.
        Throws:
        MXException
        java.rmi.RemoteException
      • getPathToTop

        public java.lang.Object[][] getPathToTop(java.lang.String objectname,
                                                 java.lang.String uniqueid,
                                                 java.lang.String[] dataattributes,
                                                 int maxchildren)
                                          throws MXException,
                                                 java.rmi.RemoteException
        Returns all objects in the path to the top from the current object, i.e. every parent of the object in a sequence.
        Parameters:
        objectname - - name of the object whose children are being requested.
        uniqueid - - unique id of the object whose children are being fetched.
        dataattributes - - list of attributes whose values are requested, the attribute data returned in the attribute list correspond to this list.
        maxchildren - - maximum number of rows to return.
        Returns:
        MboValueData[][] - contains an array of Object name, Object key, hasChildren flag, hasParents flag, list of attributes data from the passed attributes list.
        Throws:
        MXException
        java.rmi.RemoteException
      • getpathtotop

        public void getpathtotop()
                          throws MXException,
                                 java.rmi.RemoteException
        Handled getpathtotop event. Clear all treenodes. Creates PathToTop structure
        Throws:
        MXException
        java.rmi.RemoteException
      • getMboValueData

        public java.lang.Object[] getMboValueData(java.lang.String[] dataAttributes)
                                           throws MXException,
                                                  java.rmi.RemoteException
        Returns the MboValueData collection for current record
        Returns:
        collection of information about the current mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • setHierarchy

        public void setHierarchy(java.lang.String objectname,
                                 java.lang.String uniqueId,
                                 java.lang.String hierarchy)
                          throws MXException,
                                 java.rmi.RemoteException
        Sets the hierarchy of the object. This is mainly used in location.
        Parameters:
        objectname - - name of the object whose children are being requested.
        uniqueid - - unique id of the object whose children are being fetched.
        hierarchy - - name of the hierarch
        Throws:
        MXException
        java.rmi.RemoteException
      • getObjectName

        public java.lang.String getObjectName()
        Returns current object name
        Returns:
        current objectname
      • setObjectName

        public void setObjectName(java.lang.String newobjectname)
        Sets new object name and flags the tree to be refreshed
        Parameters:
        newobjectname - - new object name
      • getUniqueIdName

        public java.lang.String getUniqueIdName()
        Returns current uniqueid name
        Returns:
        unique id name
      • setUniqueIdName

        public void setUniqueIdName(java.lang.String newuniqueIdName)
        Sets new unique id name
        Parameters:
        newuniqueIdName - - new name
      • getUniqueIdValue

        public java.lang.String getUniqueIdValue()
        Returns unique id value
        Returns:
        unique id
      • setUniqueIdValue

        public void setUniqueIdValue(java.lang.String newUniqueIdValue)
        Sets new unique id value
        Parameters:
        newuniqueidvalue - - new value for unique id
      • getRestrictActionOn

        public java.lang.String getRestrictActionOn()
        Returns the value of "restrictactionon" specified on the tree
        Returns:
        restrictActionOn as String
      • setRefreshTree

        public void setRefreshTree(boolean flag)
        Sets the refresh flag for the tree
        Parameters:
        flag - - true if refresh needed
      • getSourceAttributeValue

        public java.lang.String getSourceAttributeValue()
        Returns:
        Returns the sourceAttributeValue.
      • setSourceAttributeValue

        public void setSourceAttributeValue(java.lang.String sourceAttributeValue)
        Parameters:
        sourceAttributeValue - The sourceAttributeValue to set.
      • getSourceDataAttribute

        public java.lang.String getSourceDataAttribute()
        Returns:
        Returns the sourceDataAttribute.
      • setSourceDataAttribute

        public void setSourceDataAttribute(java.lang.String sourceDataAttribute)
        Parameters:
        sourceDataAttribute - The sourceDataAttribute to set.
      • getTreeDataBean

        public TreeControlBean getTreeDataBean()
        Returns:
        Returns the treeDataBean.
      • setTreeDataBean

        public void setTreeDataBean(TreeControlBean treeDataBean)
        Parameters:
        treeDataBean - The treeDataBean to set.
      • openFirstLevel

        public boolean openFirstLevel()
        Returns:
        Returns the openFirstLevel.
      • expandAllNodes

        public boolean expandAllNodes()
        Returns:
        Returns the expandAllNodes flag.
      • selectFirstNode

        public boolean selectFirstNode()
        Returns:
        Returns the selectFirstNode.
      • getNodeDataAttributes

        public java.lang.String[] getNodeDataAttributes()
        Returns:
        Returns the nodeDataAttributes.
      • getNodeDelimiter

        public java.lang.String getNodeDelimiter()
      • getNodeAttributeDefinition

        public java.util.ArrayList getNodeAttributeDefinition()
        Returns:
        Returns the treeAttributeDefinition.
      • getTreeNodeInfo

        public java.util.Hashtable getTreeNodeInfo()
        Returns:
        Returns the treeNodeInfo.
      • setTreeNodeInfo

        public void setTreeNodeInfo(java.util.Hashtable treeNodeInfo)
        Parameters:
        treeNodeInfo - The treeNodeInfo to set.
      • getSelectedNode

        public TreeNode getSelectedNode()
        Returns:
        Returns the selectedNode.
      • getLastSelectedNodeId

        public java.lang.String getLastSelectedNodeId()
        Returns:
        Returns the selectedNode.
      • setSelectedNode

        public void setSelectedNode(TreeNode newSelectedNode)
        Parameters:
        selectedNode - The selectedNode to set.
      • getBreadcrumbs

        public java.util.ArrayList getBreadcrumbs()
        Called by the breadcrums control via reflection. The breadcrums are created/prepared when a node is selected
        As a requriement, it prepares breadcrums as a ArrayList collection
        See Also:
        Apr 5, 2007
      • setBreadcrumbs

        public void setBreadcrumbs(java.util.ArrayList newBreadcrumbs)
        Sets newly created breadcrums. Usually called by the TreeNode
        Parameters:
        newBreadcrumbs - Apr 10, 2007
      • getBreadcrumbPath

        public java.util.ArrayList getBreadcrumbPath()
        Return the breadcrumbPath
        Returns:
        Arraylist
      • setBreadcrumbPath

        public void setBreadcrumbPath(java.util.ArrayList newBreadcrumbPath)
        Sets newly created breadcrums path. Usually called by the TreeNode
        Parameters:
        newBreadcrumbPath - Apr 10, 2007
      • breadcrumbselected

        public int breadcrumbselected()
        Implemented to handle the event when breadcrum is selected. Upon selection the node should be selected.
        Returns:
        WebClientBean.EVENT_HANDLED; Apr 10, 2007
      • boundToBreadcrumbs

        public void boundToBreadcrumbs()
        Set the tree as bound to breadcrumbs
      • isBoundToBreadcrumbs

        public boolean isBoundToBreadcrumbs()
        Returns true if the tree is bound to breadcrumbs
      • setLastSelectedNodeIdNull

        protected void setLastSelectedNodeIdNull()
        Sets the last node as Null
      • clearbreadcrumbs

        public int clearbreadcrumbs()
        Event to clear all breadcrumbs
        Returns:
      • checkForNewNodes

        public boolean checkForNewNodes()
        Checks if nodes have to be checked for new children
        Returns:
      • getTopULId

        public java.lang.String getTopULId()
      • setTopULId

        public void setTopULId(java.lang.String id)