com.plumtree.portaluiinfrastructure.tree
Class DirectoryTreeModel

java.lang.Object
  extended by com.plumtree.uiinfrastructure.tree.ATreeModel
      extended by com.plumtree.portaluiinfrastructure.tree.AObjectTreeModel
          extended by com.plumtree.portaluiinfrastructure.tree.DirectoryTreeModel
All Implemented Interfaces:
IObjectTreeModel, IObjectTreeModelRO, IManagedObject, IModel, IModelRO, IMVCObject, IRepostModel, ITreeModel, ITreeModelRO

public class DirectoryTreeModel
extends AObjectTreeModel

Author:
Don Hayler This model browses the directory catalog folders and cards. Originally written by OlegS. Usage example in SmartSortEditorMainForm. -- olegs This model handles generating a tree for document folders.

Field Summary
static int BROWSE_MODE
          Browse Mode
static int EDIT_MODE
          Edit Mode
protected  int[] m_nDisplayedClassIDs
           
protected  IPTSession m_ptSession
           
static java.lang.String STR_MVC_CLASS_NAME
          Browsing Tree object name
 
Fields inherited from class com.plumtree.portaluiinfrastructure.tree.AObjectTreeModel
ALLCOMMUNITIES, m_bDisplayingSearchResults, m_bSearchInitialized, m_nAccessLevel, m_ptClassTypeDescManager, m_ptFolderSelectqf, m_ptqf, NOCOMMUNITIES, THISCOMMUNITY
 
Fields inherited from class com.plumtree.uiinfrastructure.tree.ATreeModel
m_asOwner, m_bAllChecked, m_bAllowEmptyTreeSubmission, m_bEmptyList, m_bFlatList, m_bHelpEnabled, m_bMultiSelect, m_bShowRoot, m_nLastExpandedNodeID, m_nSelectMode, m_nSelectOptions, m_nSubmitMode, m_Root, m_strActionSubTitle, m_strOnClickFunction, m_strParentFormItems, m_strParentFormName, m_strParentFormSpaceID, m_strParentFormSubmit, m_strTitle, m_xpmSelectedItems
 
Constructor Summary
DirectoryTreeModel()
           
 
Method Summary
protected  java.lang.Object[][] CalculateFolderSelectQueryFilter(int nAccessLevel)
          This method calculates the read only query filter.
 java.lang.Object Create()
          This method is used by the ASManager to return new instances of managed objects.
 void ExpandNode(boolean bExpand, int nNodeID)
          Expand or collapse a node in the tree
protected  void ExpandToSelectedItem()
          This method expands the tree to display the pre-selected item.
 int[] GetDisplayedClassIDs()
          This method returns the class IDs to be displayed in this tree.
 int GetFolderClassID()
          This method returns the class ID of the folders in the tree.
 boolean GetItemDisplayed(int nClassID, int nObjectID)
          This method returns whether or not the given item should be displayed.
 java.lang.String GetName()
          Return the name of the MVC object.
 boolean HiddenCard(int nID)
           
 void Init(AActivitySpace parent)
          This method initializes the model.
 void ResetTree()
          This method initializes tree variables.
 void SelectNode(int nID, boolean bSelect)
          This method de/selects the specified tree node
 void SetClassIDsToDisplay(int[] nIDs)
          This method will set the class IDs to be displayed.
 void SetCommunityMode(int nMode, int nFolderID)
          This method sets the community mode for this tree.
 void SetDirectoryMode(int _nDirMode)
           
 void SetObjectIDsToDisplay(int[] nIDs)
          This method will display only the given objects.
 void SetObjectIDsToHide(int[] nIDs)
          This method will hide the given objects.
 void SetObjectIDsToSelect(int[] nIDs)
          This method will select the given objects.
 void SetQueryFilter(int nClassID, int nPropID, int[] nValues)
          This method sets a filter on a specific class.
 void SetQueryFilter(int nClassID, int nPropID, java.lang.String[] sValues)
          This method sets a filter on a specific class.
 void SetRootFolderID(int nID)
          This method sets the root id for object type trees
 
Methods inherited from class com.plumtree.portaluiinfrastructure.tree.AObjectTreeModel
GetAccessLevel, GetDisplayingSearchResults, GetFilterClassID, GetFilterCLSID, GetFilterCLSIDPropID, GetItemSelected, GetLeafIfAlreadySelected, GetPortletAlignment, GetPortletType, GetPortletWebServiceID, GetSearchEnabled, GetSearchStarted, GetUserTypeFilter, ResetToBrowsingMode, SavePage, SetAccessLevel, SetCompositeImage, SetCompositeImage, SetLeafImage
 
Methods inherited from class com.plumtree.uiinfrastructure.tree.ATreeModel
CleanupAllData, CleanupTempData, ClearSelectedItems, Finish, GetActionSubTitle, GetAllChecked, GetAllowEmptySubmission, GetCompositeIfAlreadySelected, GetDisplayingFlatList, GetHelpEnabled, GetKeyFromNode, GetLastExpandedNodeID, GetMultipleSelect, GetNextUniqueID, GetOnClickFunction, GetParentFormName, GetParentFormSpaceID, GetParentFormSubmitFunction, GetRedirectAfterFinish, GetRootTreeIterator, GetSelectedItems, GetSelectMode, GetSelectOptions, GetShowRoot, GetSubmitMode, GetTitle, GetTreeIsEmpty, RefreshTree, RemoveFromSelection, ResetUniqueIDs, SetActionSubTitle, SetAllowEmptySubmission, SetHelpTopic, SetMultipleSelect, SetOnClickFunction, SetParentFormName, SetParentFormSpaceID, SetParentFormSubmitFunction, SetSelectMode, SetSelectOptions, SetShowRoot, SetSubmitMode, SetTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.plumtree.uiinfrastructure.tree.ITreeModelRO
GetActionSubTitle, GetAllChecked, GetAllowEmptySubmission, GetDisplayingFlatList, GetHelpEnabled, GetLastExpandedNodeID, GetMultipleSelect, GetOnClickFunction, GetParentFormName, GetParentFormSpaceID, GetParentFormSubmitFunction, GetRootTreeIterator, GetSelectedItems, GetSelectMode, GetSelectOptions, GetShowRoot, GetSubmitMode, GetTitle, GetTreeIsEmpty
 

Field Detail

STR_MVC_CLASS_NAME

public static final java.lang.String STR_MVC_CLASS_NAME
Browsing Tree object name

See Also:
Constant Field Values

BROWSE_MODE

public static final int BROWSE_MODE
Browse Mode

See Also:
Constant Field Values

EDIT_MODE

public static final int EDIT_MODE
Edit Mode

See Also:
Constant Field Values

m_ptSession

protected IPTSession m_ptSession

m_nDisplayedClassIDs

protected int[] m_nDisplayedClassIDs
Constructor Detail

DirectoryTreeModel

public DirectoryTreeModel()
Method Detail

Create

public java.lang.Object Create()
Description copied from class: ATreeModel
This method is used by the ASManager to return new instances of managed objects.

Specified by:
Create in interface IManagedObject
Specified by:
Create in class ATreeModel
Returns:
A new instance of the managed class (i.e. return new Foo();)
See Also:
IManagedObject.Create()

ExpandNode

public void ExpandNode(boolean bExpand,
                       int nNodeID)
Expand or collapse a node in the tree

Specified by:
ExpandNode in interface ITreeModel
Overrides:
ExpandNode in class ATreeModel
Parameters:
bExpand -
nNodeID -

SelectNode

public void SelectNode(int nID,
                       boolean bSelect)
Description copied from interface: IObjectTreeModel
This method de/selects the specified tree node

Specified by:
SelectNode in interface IObjectTreeModel
Overrides:
SelectNode in class AObjectTreeModel
Parameters:
nID - The ID of the node to de/select
bSelect - true implies select, false deselect
See Also:
IObjectTreeModel.SelectNode(int, boolean)

GetDisplayedClassIDs

public int[] GetDisplayedClassIDs()
Description copied from interface: IObjectTreeModelRO
This method returns the class IDs to be displayed in this tree.

Specified by:
GetDisplayedClassIDs in interface IObjectTreeModelRO
Specified by:
GetDisplayedClassIDs in class AObjectTreeModel
Returns:
int[] the class IDs to display
See Also:
IObjectTreeModelRO.GetDisplayedClassIDs()

GetFolderClassID

public int GetFolderClassID()
Description copied from interface: IObjectTreeModelRO
This method returns the class ID of the folders in the tree. I.E. admin folders or card catalogs.

Specified by:
GetFolderClassID in interface IObjectTreeModelRO
Specified by:
GetFolderClassID in class AObjectTreeModel
Returns:
int class ID of folders in the tree.
See Also:
IObjectTreeModelRO.GetFolderClassID()

GetItemDisplayed

public boolean GetItemDisplayed(int nClassID,
                                int nObjectID)
Description copied from interface: IObjectTreeModelRO
This method returns whether or not the given item should be displayed.

Specified by:
GetItemDisplayed in interface IObjectTreeModelRO
Specified by:
GetItemDisplayed in class AObjectTreeModel
Returns:
boolean true implies display the item
See Also:
IObjectTreeModelRO.GetItemDisplayed(int, int)

GetName

public java.lang.String GetName()
Description copied from interface: IMVCObject
Return the name of the MVC object.

Specified by:
GetName in interface IMVCObject
Specified by:
GetName in class AObjectTreeModel
Returns:
the name of the object.
See Also:
IMVCObject.GetName()

HiddenCard

public boolean HiddenCard(int nID)

Init

public void Init(AActivitySpace parent)
Description copied from interface: IModel
This method initializes the model. This is called automatically when AActivitySpace.RegisterModel() is called.

Specified by:
Init in interface IModel
Overrides:
Init in class AObjectTreeModel
Parameters:
parent - the parent Activity Space
See Also:
IModel.Init(AActivitySpace)

ResetTree

public void ResetTree()
Description copied from interface: ITreeModel
This method initializes tree variables. sub-classes can extend this method.

Specified by:
ResetTree in interface ITreeModel
Overrides:
ResetTree in class AObjectTreeModel

SetClassIDsToDisplay

public void SetClassIDsToDisplay(int[] nIDs)
Description copied from interface: ITreeModel
This method will set the class IDs to be displayed. This must be run before SetObjectIDsToHide() and SetObjectIDsToSelect().

Specified by:
SetClassIDsToDisplay in interface ITreeModel
Specified by:
SetClassIDsToDisplay in class AObjectTreeModel
Parameters:
nIDs -
See Also:
ITreeModel.SetClassIDsToDisplay(int[])

SetDirectoryMode

public void SetDirectoryMode(int _nDirMode)

SetObjectIDsToDisplay

public void SetObjectIDsToDisplay(int[] nIDs)
Description copied from interface: ITreeModel
This method will display only the given objects. Only this method or SetObjectIDsToHide() can be called, not both.

Specified by:
SetObjectIDsToDisplay in interface ITreeModel
Specified by:
SetObjectIDsToDisplay in class ATreeModel
See Also:
ITreeModel.SetObjectIDsToDisplay(int[])

SetObjectIDsToHide

public void SetObjectIDsToHide(int[] nIDs)
Description copied from interface: ITreeModel
This method will hide the given objects. Only this method or SetObjectIDsToDisplay() can be called, not both.

Specified by:
SetObjectIDsToHide in interface ITreeModel
Specified by:
SetObjectIDsToHide in class AObjectTreeModel
See Also:
ITreeModel.SetObjectIDsToHide(int[])

SetObjectIDsToSelect

public void SetObjectIDsToSelect(int[] nIDs)
Description copied from interface: ITreeModel
This method will select the given objects.

Specified by:
SetObjectIDsToSelect in interface ITreeModel
Specified by:
SetObjectIDsToSelect in class AObjectTreeModel
Parameters:
nIDs -
See Also:
ITreeModel.SetObjectIDsToSelect(int[])

SetQueryFilter

public void SetQueryFilter(int nClassID,
                           int nPropID,
                           int[] nValues)
Description copied from interface: IObjectTreeModel
This method sets a filter on a specific class. This is used for things like distinguishing gadgets from gadget templates (which share the same classID). Hiding objects should be done with the ClassIDsToHide QS argument. This can only be called for filtering on gadget alignments or widths. This will create a Query Filter as follows: [0][0] will be equal to nPropID [1][0] will be equal to PT_FILTEROPS.PT_FILTEROP_IN [2][0] will be equal to nValues Filters will only be applied to objects of type nClassID. This must be called after SetAccessLevel() and SetClassIDsToDisplay().

Specified by:
SetQueryFilter in interface IObjectTreeModel
Specified by:
SetQueryFilter in class AObjectTreeModel
See Also:
This must be called after SetAccessLevel() and SetClassIDsToDisplay().

SetQueryFilter

public void SetQueryFilter(int nClassID,
                           int nPropID,
                           java.lang.String[] sValues)
Description copied from interface: IObjectTreeModel
This method sets a filter on a specific class. This is used for things like distinguishing gadgets from gadget templates (which share the same classID). Hiding objects should be done with the ClassIDsToHide QS argument. This can only be called for filtering on data source or web service provider clsids. This will create a Query Filter as follows: [0][0] will be equal to nPropID [1][0] will be equal to PT_FILTEROPS.PT_FILTEROP_IN [2][0] will be equal to nValues Filters will only be applied to objects of type nClassID. This must be called after SetAccessLevel() and SetClassIDsToDisplay().

Specified by:
SetQueryFilter in interface IObjectTreeModel
Specified by:
SetQueryFilter in class AObjectTreeModel
See Also:
This must be called after SetAccessLevel() and SetClassIDsToDisplay().

SetCommunityMode

public void SetCommunityMode(int nMode,
                             int nFolderID)
Description copied from interface: IObjectTreeModel
This method sets the community mode for this tree.

Specified by:
SetCommunityMode in interface IObjectTreeModel
Specified by:
SetCommunityMode in class AObjectTreeModel
Parameters:
nMode -
nFolderID -
See Also:
IObjectTreeModel.SetCommunityMode(int, int)

SetRootFolderID

public void SetRootFolderID(int nID)
Description copied from interface: IObjectTreeModel
This method sets the root id for object type trees

Specified by:
SetRootFolderID in interface IObjectTreeModel
Specified by:
SetRootFolderID in class AObjectTreeModel
Parameters:
nID -
See Also:
IObjectTreeModel.SetRootFolderID(int)

ExpandToSelectedItem

protected void ExpandToSelectedItem()
This method expands the tree to display the pre-selected item. NOTE: expanding too many items could cause performance issues.


CalculateFolderSelectQueryFilter

protected java.lang.Object[][] CalculateFolderSelectQueryFilter(int nAccessLevel)
This method calculates the read only query filter.

Specified by:
CalculateFolderSelectQueryFilter in class AObjectTreeModel
Parameters:
int - the access level required by the tree
Returns:
the qf.



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.