com.plumtree.portaluiinfrastructure.tree
Class AObjectTreeModel

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

public abstract class AObjectTreeModel
extends ATreeModel
implements IObjectTreeModel

Author:
Don Hayler This class implements some of the base code for the admin and browsing trees.

Field Summary
static int ALLCOMMUNITIES
           
protected  boolean m_bDisplayingSearchResults
          internal data
protected  boolean m_bSearchInitialized
           
protected  int m_nAccessLevel
           
protected static ClassTypeDescManager m_ptClassTypeDescManager
          class type descriptor
protected  java.lang.Object[][] m_ptFolderSelectqf
          read only access level query filter.
protected  java.lang.Object[][] m_ptqf
          access level query filter
static int NOCOMMUNITIES
          Community Modes -- NO is default
static int THISCOMMUNITY
          THISCOMMUNITY implies the requested community plus all of it's parent communities
 
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
AObjectTreeModel()
           
 
Method Summary
protected abstract  java.lang.Object[][] CalculateFolderSelectQueryFilter(int nAccessLevel)
          This method calculates the read only query filter.
 int GetAccessLevel()
          This method returns the current access level.
abstract  int[] GetDisplayedClassIDs()
          This method returns the class IDs to be displayed in this tree.
 boolean GetDisplayingSearchResults()
          This method returns whether the tree is displaying search results, or just the normal tree.
 int GetFilterClassID()
          This method returns the class ID to be filtered.
 java.lang.String[] GetFilterCLSID()
          This method returns the CLSID values used in the web service/data source query filter.
 int GetFilterCLSIDPropID()
          This method returns the propid for the CLSID values used in the web service/data source query filter.
abstract  int GetFolderClassID()
          This method returns the class ID of the folders in the tree.
abstract  boolean GetItemDisplayed(int nClassID, int nObjectID)
          This method returns whether or not the given item should be displayed.
 boolean GetItemSelected(int nClassID, int nObjectID)
          This method returns whether or not the given item should be selected.
protected  TreeLeafNode GetLeafIfAlreadySelected(java.lang.String strKey)
          This needs it's own implementation because of users.
abstract  java.lang.String GetName()
          Return the name of the MVC object.
 int[] GetPortletAlignment()
          This method returns the values used in the gadget alignment query filter.
 int[] GetPortletType()
          This method returns the values used in the gadget type query filter.
 int[] GetPortletWebServiceID()
          This method returns the values used in the gadget web service ID query filter.
 boolean GetSearchEnabled()
          This method returns whether or not search is enabled.
 boolean GetSearchStarted()
          This method returns whether or not a search has been started.
 int[] GetUserTypeFilter()
          This method returns the user type values used in the user query filter.
 void Init(AActivitySpace parent)
          This method initializes the model.
 void ResetToBrowsingMode()
          This method resets the tree view to display the browsing tree rather than the search tree.
 void ResetTree()
          This method initializes tree variables.
 int SavePage(java.lang.String _sPageName, XPHashtable _htFormData)
          Calls the right save function according to the page name passed in argument.
 void SelectNode(int nID, boolean bSelect)
          This method de/selects the specified tree node
 void SetAccessLevel(int nLevel)
          This method sets the access level that the user needs to have to view items in the tree (default is SELECT).
abstract  void SetClassIDsToDisplay(int[] nIDs)
          This method will set the class IDs to be displayed.
abstract  void SetCommunityMode(int nMode, int nFolderID)
          This method sets the community mode for this tree.
static void SetCompositeImage(TreeCompositeNode node, AActivitySpace asOwner)
           
static void SetCompositeImage(TreeCompositeNode node, int nFolderType, AActivitySpace asOwner)
           
static void SetLeafImage(TreeLeafNode node, AActivitySpace asOwner)
           
abstract  void SetObjectIDsToHide(int[] nIDs)
          This method will hide the given objects.
abstract  void SetObjectIDsToSelect(int[] nIDs)
          This method will select the given objects.
abstract  void SetQueryFilter(int nClassID, int nPropID, int[] nValues)
          This method sets a filter on a specific class.
abstract  void SetQueryFilter(int nClassID, int nPropID, java.lang.String[] sValues)
          This method sets a filter on a specific class.
abstract  void SetRootFolderID(int nID)
          This method sets the root id for object type trees
 
Methods inherited from class com.plumtree.uiinfrastructure.tree.ATreeModel
CleanupAllData, CleanupTempData, ClearSelectedItems, Create, ExpandNode, 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, SetObjectIDsToDisplay, 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

NOCOMMUNITIES

public static final int NOCOMMUNITIES
Community Modes -- NO is default

See Also:
Constant Field Values

THISCOMMUNITY

public static final int THISCOMMUNITY
THISCOMMUNITY implies the requested community plus all of it's parent communities

See Also:
Constant Field Values

ALLCOMMUNITIES

public static final int ALLCOMMUNITIES
See Also:
Constant Field Values

m_ptClassTypeDescManager

protected static ClassTypeDescManager m_ptClassTypeDescManager
class type descriptor


m_ptqf

protected java.lang.Object[][] m_ptqf
access level query filter


m_ptFolderSelectqf

protected java.lang.Object[][] m_ptFolderSelectqf
read only access level query filter. This is used to query for browsable but not selectable admin folders. Not used if null.


m_bDisplayingSearchResults

protected boolean m_bDisplayingSearchResults
internal data


m_bSearchInitialized

protected boolean m_bSearchInitialized

m_nAccessLevel

protected int m_nAccessLevel
Constructor Detail

AObjectTreeModel

public AObjectTreeModel()
Method Detail

GetAccessLevel

public int GetAccessLevel()
Description copied from interface: IObjectTreeModelRO
This method returns the current access level.

Specified by:
GetAccessLevel in interface IObjectTreeModelRO
Returns:
int access level
See Also:
com.plumtree.portaluiinfrastructure.tree.IObjectTreeModelRO#GetSecurityLevel()

GetDisplayingSearchResults

public boolean GetDisplayingSearchResults()
Description copied from interface: IObjectTreeModelRO
This method returns whether the tree is displaying search results, or just the normal tree.

Specified by:
GetDisplayingSearchResults in interface IObjectTreeModelRO
Returns:
boolean true implies search results, false implies tree
See Also:
com.plumtree.portaluiinfrastructure.tree.IObjectTreeModelRO#GetDisplayTreeOrSearch()

GetPortletAlignment

public int[] GetPortletAlignment()
Description copied from interface: IObjectTreeModelRO
This method returns the values used in the gadget alignment query filter.

Specified by:
GetPortletAlignment in interface IObjectTreeModelRO
See Also:
IObjectTreeModelRO.GetPortletAlignment()

GetPortletWebServiceID

public int[] GetPortletWebServiceID()
Description copied from interface: IObjectTreeModelRO
This method returns the values used in the gadget web service ID query filter.

Specified by:
GetPortletWebServiceID in interface IObjectTreeModelRO
See Also:
IObjectTreeModelRO.GetPortletWebServiceID()

GetPortletType

public int[] GetPortletType()
Description copied from interface: IObjectTreeModelRO
This method returns the values used in the gadget type query filter.

Specified by:
GetPortletType in interface IObjectTreeModelRO
See Also:
IObjectTreeModelRO.GetPortletType()

GetUserTypeFilter

public int[] GetUserTypeFilter()
Description copied from interface: IObjectTreeModelRO
This method returns the user type values used in the user query filter.

Specified by:
GetUserTypeFilter in interface IObjectTreeModelRO
See Also:
IObjectTreeModelRO.GetUserTypeFilter()

GetFilterCLSID

public java.lang.String[] GetFilterCLSID()
Description copied from interface: IObjectTreeModelRO
This method returns the CLSID values used in the web service/data source query filter.

Specified by:
GetFilterCLSID in interface IObjectTreeModelRO
See Also:
IObjectTreeModelRO.GetFilterCLSID()

GetFilterCLSIDPropID

public int GetFilterCLSIDPropID()
Description copied from interface: IObjectTreeModelRO
This method returns the propid for the CLSID values used in the web service/data source query filter.

Specified by:
GetFilterCLSIDPropID in interface IObjectTreeModelRO
See Also:
IObjectTreeModelRO.GetFilterCLSIDPropID()

GetFilterClassID

public int GetFilterClassID()
This method returns the class ID to be filtered.

Specified by:
GetFilterClassID in interface IObjectTreeModel
Specified by:
GetFilterClassID in interface IObjectTreeModelRO
Returns:
the class ID to apply the above filter to

GetItemSelected

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

Specified by:
GetItemSelected in interface IObjectTreeModelRO
Returns:
boolean true implies the item is selected
See Also:
IObjectTreeModelRO.GetItemSelected(int, int)

GetSearchStarted

public boolean GetSearchStarted()
Description copied from interface: IObjectTreeModelRO
This method returns whether or not a search has been started. This is used to tell whether or not there should be a tabbed link to the search view (no if it hasn't been started yet).

Specified by:
GetSearchStarted in interface IObjectTreeModelRO
Returns:
boolean true implies should add link (search started).
See Also:
IObjectTreeModelRO.GetSearchStarted()

GetSearchEnabled

public boolean GetSearchEnabled()
Description copied from interface: IObjectTreeModelRO
This method returns whether or not search is enabled. Search will always be enabled except when displaying a pre-selected list.

Specified by:
GetSearchEnabled in interface IObjectTreeModelRO
Returns:
boolean true implies the search box should be displayed.
See Also:
IObjectTreeModelRO.GetSearchEnabled()

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 ATreeModel
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 ATreeModel

SavePage

public int SavePage(java.lang.String _sPageName,
                    XPHashtable _htFormData)
Description copied from interface: IRepostModel
Calls the right save function according to the page name passed in argument.

Specified by:
SavePage in interface IRepostModel
Overrides:
SavePage in class ATreeModel
Returns:
int Page status for server side validation
See Also:
IRepostModel.SavePage(String, XPHashtable)

SetAccessLevel

public void SetAccessLevel(int nLevel)
Description copied from interface: IObjectTreeModel
This method sets the access level that the user needs to have to view items in the tree (default is SELECT). This must be called before SetQueryFilter().

Specified by:
SetAccessLevel in interface IObjectTreeModel
See Also:
IObjectTreeModel.SetAccessLevel(int)

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
Parameters:
nID - The ID of the node to de/select
bSelect - true implies select, false deselect
See Also:
IObjectTreeModel.SelectNode(int, boolean)

ResetToBrowsingMode

public void ResetToBrowsingMode()
Description copied from interface: IObjectTreeModel
This method resets the tree view to display the browsing tree rather than the search tree.

Specified by:
ResetToBrowsingMode in interface IObjectTreeModel
See Also:
IObjectTreeModel.ResetToBrowsingMode()

SetCompositeImage

public static void SetCompositeImage(TreeCompositeNode node,
                                     AActivitySpace asOwner)
Parameters:
node -

SetCompositeImage

public static void SetCompositeImage(TreeCompositeNode node,
                                     int nFolderType,
                                     AActivitySpace asOwner)
Parameters:
node -
nFolderType -

SetLeafImage

public static void SetLeafImage(TreeLeafNode node,
                                AActivitySpace asOwner)
Parameters:
node -

GetDisplayedClassIDs

public abstract 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
Returns:
int[] the class IDs to display
See Also:
IObjectTreeModelRO.GetDisplayedClassIDs()

GetFolderClassID

public abstract 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
Returns:
int class ID of folders in the tree.
See Also:
IObjectTreeModelRO.GetFolderClassID()

GetItemDisplayed

public abstract 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
Returns:
boolean true implies display the item
See Also:
IObjectTreeModelRO.GetItemDisplayed(int, int)

GetName

public abstract 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 ATreeModel
Returns:
the name of the object.
See Also:
IMVCObject.GetName()

SetClassIDsToDisplay

public abstract 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 ATreeModel
See Also:
ITreeModel.SetClassIDsToDisplay(int[])

SetObjectIDsToHide

public abstract 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 ATreeModel
See Also:
ITreeModel.SetObjectIDsToHide(int[])

SetObjectIDsToSelect

public abstract 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 ATreeModel
See Also:
ITreeModel.SetObjectIDsToSelect(int[])

SetQueryFilter

public abstract 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
See Also:
IObjectTreeModel.SetQueryFilter(int, int, int[])

SetQueryFilter

public abstract 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
See Also:
IObjectTreeModel.SetQueryFilter(int, int, String[])

SetCommunityMode

public abstract 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
See Also:
IObjectTreeModel.SetCommunityMode(int, int)

SetRootFolderID

public abstract 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
Parameters:
nID - The ID of the root folder/catalog/etc...
See Also:
IObjectTreeModel.SetRootFolderID(int)

CalculateFolderSelectQueryFilter

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

Parameters:
int - the access level required by the tree
Returns:
the qf.

GetLeafIfAlreadySelected

protected TreeLeafNode GetLeafIfAlreadySelected(java.lang.String strKey)
This needs it's own implementation because of users.

Overrides:
GetLeafIfAlreadySelected in class ATreeModel
Returns:



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