com.plumtree.portaluiinfrastructure.tree
Class AdminTreeModel

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

public class AdminTreeModel
extends AObjectTreeModel

This model handles generating a tree for admin objects.

Author:
Don Hayler

Nested Class Summary
static class AdminTreeModel.ObjectManagerHolder
          Helper class to wrap object managers
 
Field Summary
protected  boolean m_bDisplayingPortlets
          Whether or not we are displaying portlets
protected  boolean m_bDisplayPreSelectedList
          Whether or not we are only displaying pre-selected objects
protected  boolean m_bShowGlobalObjects
          Whether or not we are showing global objects
protected  AdminTreeModel.ObjectManagerHolder m_GroupObjMgr
           
protected  int m_nCommunityMode
           
protected  int[] m_nDisplayedClassIDs
          Class IDs to display
protected  int m_nFilterClassID
           
protected static int m_nOBJECTS_TO_LIST
          the maximum number of objects to list
protected  int[] m_nPortletAlignment
          data for fake query filters in search
protected  int[] m_nPortletType
           
protected  int[] m_nPortletWebServiceID
           
protected  int m_nProviderPropIDType
           
protected  int[] m_nUserTypeFilter
           
protected  XPArrayList m_nxpCommunityFolderIDs
          internal data for community modes
protected  XPArrayList m_ObjMgrs
           
protected  IPTAdminCatalog m_ptCatalog
          server objects
protected  IPTSession m_ptSession
           
protected  java.lang.String[] m_sProviderCLSID
           
protected  AdminTreeModel.ObjectManagerHolder m_UserObjMgr
           
static java.lang.String STR_MVC_CLASS_NAME
          MVC 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
AdminTreeModel()
           
 
Method Summary
 void AppendFolderToNodeName(TreeLeafNode node)
          This helper method appends the folder name to the name of the tree node and the full path to the description.
protected  java.lang.Object[][] CalculateFolderSelectQueryFilter(int nAccessLevel)
          This method calculates the read only query filter.
 void CheckDisabledCommunity(TreeCompositeNode myFolder)
          This method determines whether or not to disable a folder based upon the community mode and ID.
 void CheckForIdenticalNames(TreeLeafNode firstNode, java.lang.String strFirstNodeName, TreeLeafNode secondNode, java.lang.String strSecondNodeName)
          This helper method determines if two nodes in the flat list have the same names, and then gets appends their folder name if they are identical.
 boolean CheckIsHidden(TreeLeafNode node)
          This helper method determines if a node is hidden.
 java.lang.Object Create()
          This method is used by the ASManager to return new instances of managed objects.
 void ExpandDisplayedItemsOnly()
          This method is used to display multiple groups at the root level instead of a folder heirarchy.
protected  void ExpandGroup(TreeCompositeNode node)
           
 void ExpandNode(boolean bExpand, int nNodeID)
          This method expands a node in the tree (Admin folder)
 void ExpandToFlatList()
          This method expands all items in the obj mgr into a flat list and hides the root folder.
protected  void ExpandToSelectedItem()
          This method expands the tree to display the single selected item.
 int[] GetDisplayedClassIDs()
          This method returns the class IDs to be displayed in this 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.
 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.
 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.
 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 RefreshHiddenObjects()
          This helper method makes sure that the tree and the selected items list conform to the hidden objects list.
 void ResetTree()
          This method initializes tree variables.
 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 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 must be called after SetAccessLevel() and SetClassIDsToDisplay().
 void SetQueryFilter(int nClassID, int nPropID, java.lang.String[] sValues)
          This must be called after SetAccessLevel() and SetClassIDsToDisplay().
 void SetRootFolderID(int nID)
          This must be called last.
 
Methods inherited from class com.plumtree.portaluiinfrastructure.tree.AObjectTreeModel
GetAccessLevel, GetDisplayingSearchResults, GetItemSelected, GetLeafIfAlreadySelected, GetSearchStarted, ResetToBrowsingMode, SavePage, SelectNode, 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
MVC object name

See Also:
Constant Field Values

m_nOBJECTS_TO_LIST

protected static final int m_nOBJECTS_TO_LIST
the maximum number of objects to list

See Also:
Constant Field Values

m_ptCatalog

protected IPTAdminCatalog m_ptCatalog
server objects


m_ptSession

protected IPTSession m_ptSession

m_GroupObjMgr

protected AdminTreeModel.ObjectManagerHolder m_GroupObjMgr

m_UserObjMgr

protected AdminTreeModel.ObjectManagerHolder m_UserObjMgr

m_ObjMgrs

protected XPArrayList m_ObjMgrs

m_nDisplayedClassIDs

protected int[] m_nDisplayedClassIDs
Class IDs to display


m_nPortletAlignment

protected int[] m_nPortletAlignment
data for fake query filters in search


m_nPortletWebServiceID

protected int[] m_nPortletWebServiceID

m_nPortletType

protected int[] m_nPortletType

m_sProviderCLSID

protected java.lang.String[] m_sProviderCLSID

m_nProviderPropIDType

protected int m_nProviderPropIDType

m_nFilterClassID

protected int m_nFilterClassID

m_nUserTypeFilter

protected int[] m_nUserTypeFilter

m_bDisplayingPortlets

protected boolean m_bDisplayingPortlets
Whether or not we are displaying portlets


m_bDisplayPreSelectedList

protected boolean m_bDisplayPreSelectedList
Whether or not we are only displaying pre-selected objects


m_bShowGlobalObjects

protected boolean m_bShowGlobalObjects
Whether or not we are showing global objects


m_nxpCommunityFolderIDs

protected XPArrayList m_nxpCommunityFolderIDs
internal data for community modes


m_nCommunityMode

protected int m_nCommunityMode
Constructor Detail

AdminTreeModel

public AdminTreeModel()
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)
This method expands a node in the tree (Admin folder)

Specified by:
ExpandNode in interface ITreeModel
Overrides:
ExpandNode in class ATreeModel
Parameters:
bExpand - whether to expand or collapse (true implies expand)
nNodeID - the ID of the node to expand

ExpandToFlatList

public void ExpandToFlatList()
This method expands all items in the obj mgr into a flat list and hides the root folder.


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()

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
Overrides:
GetPortletAlignment in class AObjectTreeModel
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
Overrides:
GetPortletWebServiceID in class AObjectTreeModel
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
Overrides:
GetPortletType in class AObjectTreeModel
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
Overrides:
GetUserTypeFilter in class AObjectTreeModel
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
Overrides:
GetFilterCLSID in class AObjectTreeModel
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
Overrides:
GetFilterCLSIDPropID in class AObjectTreeModel
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
Overrides:
GetFilterClassID in class AObjectTreeModel
Returns:
the class ID to apply the above filter to

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)

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
Overrides:
GetSearchEnabled in class AObjectTreeModel
Returns:
boolean true implies the search box should be displayed.
See Also:
IObjectTreeModelRO.GetSearchEnabled()

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()

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

ExpandDisplayedItemsOnly

public void ExpandDisplayedItemsOnly()
This method is used to display multiple groups at the root level instead of a folder heirarchy.

Parameters:
nIDs -

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[])

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)
This must be called after SetAccessLevel() and SetClassIDsToDisplay().

Specified by:
SetQueryFilter in interface IObjectTreeModel
Specified by:
SetQueryFilter in class AObjectTreeModel
See Also:
IObjectTreeModel.SetQueryFilter(int, int, int[])

SetQueryFilter

public void SetQueryFilter(int nClassID,
                           int nPropID,
                           java.lang.String[] sValues)
This must be called after SetAccessLevel() and SetClassIDsToDisplay().

Specified by:
SetQueryFilter in interface IObjectTreeModel
Specified by:
SetQueryFilter in class AObjectTreeModel
See Also:
IObjectTreeModel.SetQueryFilter(int, int, String[])

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)
This must be called last. It completes the setup of the tree.

Specified by:
SetRootFolderID in interface IObjectTreeModel
Specified by:
SetRootFolderID in class AObjectTreeModel
Parameters:
nID - The ID of the root folder/catalog/etc...
See Also:
IObjectTreeModel.SetRootFolderID(int)

ExpandGroup

protected void ExpandGroup(TreeCompositeNode node)
Parameters:
node -

ExpandToSelectedItem

protected void ExpandToSelectedItem()
This method expands the tree to display the single selected item.


RefreshHiddenObjects

public void RefreshHiddenObjects()
This helper method makes sure that the tree and the selected items list conform to the hidden objects list. This method should only be called when the hidden objects lists have changed.


CheckIsHidden

public boolean CheckIsHidden(TreeLeafNode node)
This helper method determines if a node is hidden. If it is hidden, it needs to be removed from the tree.


CheckForIdenticalNames

public void CheckForIdenticalNames(TreeLeafNode firstNode,
                                   java.lang.String strFirstNodeName,
                                   TreeLeafNode secondNode,
                                   java.lang.String strSecondNodeName)
This helper method determines if two nodes in the flat list have the same names, and then gets appends their folder name if they are identical.

Parameters:
TreeLeafNode - the first node (may be null)
String - the original name of the first node (in case it has already had the folder name appended to it. (may be null)
TreeLeafNode - the second node
String - the original name of the second node (in case it would be truncated by the node)

AppendFolderToNodeName

public void AppendFolderToNodeName(TreeLeafNode node)
This helper method appends the folder name to the name of the tree node and the full path to the description.

Parameters:
TreeLeafNode - the node to append to.

CheckDisabledCommunity

public void CheckDisabledCommunity(TreeCompositeNode myFolder)
This method determines whether or not to disable a folder based upon the community mode and ID.

Parameters:
TreeCompositeNode - Folder to check.

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.