com.plumtree.portaluiinfrastructure.securitymatrix
Class MultiObjectsSecurityModel

java.lang.Object
  extended by com.plumtree.uiinfrastructure.editor.EditorHelperModel
      extended by com.plumtree.uiinfrastructure.expandablelist.ExpListModel
          extended by com.plumtree.portaluiinfrastructure.expandablelist.selectptobject.SelectPTObjectModel
              extended by com.plumtree.portaluiinfrastructure.expandablelist.selectptobject.selectptobjectsbytype.SelectPTObjectsByTypeModel
                  extended by com.plumtree.portaluiinfrastructure.editor.commonpages.objectsecurity.ObjectSecurityModel
                      extended by com.plumtree.portaluiinfrastructure.securitymatrix.MultiObjectsSecurityModel
All Implemented Interfaces:
IObjectSecurityModelRO, ISelectPTObjectModelRO, IMultiObjectsSecurityModelRO, IManagedObject, IModel, IModelRO, IMVCObject, IExpListModelRO, IPaginationModel, IPaginationModelRO

public class MultiObjectsSecurityModel
extends ObjectSecurityModel
implements IMultiObjectsSecurityModelRO

This is the implementation of the Expandable List framework for the the Select PTObject list. The Select PTObject is a list of objects. New objects can be added to the list by selecting them from the associated Object tree. The list is by default sorted by name ascending.

Author:
Julie Fournier

Field Summary
protected  int[] m_arrColumns
          Array of column info.
protected  XPArrayList m_arrObjects
          Array of objects we are editing the security for.
protected  XPHashtable m_htObjectColumnKeys
           
static java.lang.String QS_MULTI_OBJ_SECURITY_IDS
          Class name for the activity space
static java.lang.String STR_MVC_CLASS_NAME
          Class name for the activity space
 
Fields inherited from class com.plumtree.portaluiinfrastructure.editor.commonpages.objectsecurity.ObjectSecurityModel
EXPLIST_COL_ACCESSLEVEL_ID, EXPLIST_COL_ACCESSLEVEL_STRING, EXPLIST_COL_GROUPTREEASID, EXPLIST_COL_MANDATORY, EXPLIST_COL_MAX, EXPLIST_COL_ROWACCESS, EXPLIST_DEFAULT_INITIAL_SIZE, m_arrAccessLevels, m_arrLowAccessObjects, m_arrNoContentTree, m_bCardACL, m_bShowHeaderAndLeftNav, m_nSupportMandatoryColumn, m_ptObject, m_ptSession, m_sLeftNavString, MANDATORY_FALSE, MANDATORY_TRUE, MANDCOL_COMMUNITY, MANDCOL_NONE, MANDCOL_REGULAR, PT_ACCESS_LIST_ENTRY_READONLY, PT_ACCESS_LIST_ENTRY_READWRITE, SUBSPACE_KEY_EVERYONETREE, SUBSPACE_KEY_GROUPTREE
 
Fields inherited from class com.plumtree.portaluiinfrastructure.expandablelist.selectptobject.SelectPTObjectModel
CREATE_NEW_COL_ASNAME, CREATE_NEW_COL_CLASSID, CREATE_NEW_COL_ICON, CREATE_NEW_COL_LABEL, CREATE_NEW_COL_MAX, CREATE_NEW_COL_MAXWITHPARAMS, CREATE_NEW_COL_PARAMS, EXPLIST_COL_CLASSID, EXPLIST_COL_OBJECTID, EXPLIST_COL_STRING, HIDE_COL_CLASSID, HIDE_COL_MAX, HIDE_COL_OBJECTID, m_arrCreateNewInfo, m_arrObjectClassIDs, m_arrReadOnlyObjects, m_bNoRowIcons, m_bTreeMultiSelect, m_imgDefaultRowIcon, m_nAccessLevel, m_nCommunityFolderID, m_nCommunityMode, m_sDisplayObjects, m_sTreeSpaceID, m_sTreeSubTitle, m_sTreeTitle, m_strObjectsToHide, m_strTreeQueryFilter, m_treeLeafType, m_xphtRowIcons, PARAM_COL_PARAMNAME, PARAM_COL_PARAMVALUE, READ_ONLY_ROW_CLASSID, READ_ONLY_ROW_OBJECTID, SUBSPACE_KEY_SELECTTREE
 
Fields inherited from class com.plumtree.uiinfrastructure.expandablelist.ExpListModel
EXPLIST_COLUMN_COLSPAN, EXPLIST_COLUMN_ENABLESORT, EXPLIST_COLUMN_ID, EXPLIST_COLUMN_INVALID, EXPLIST_COLUMN_TITLE, EXPLIST_COLUMN_WIDTH, EXPLIST_SORTEDARRAY_PROPID_INDEX, m_arrExpListColInfo, m_bAddButtonDisabled, m_bCheckBoxesDisabled, m_bEnableMoveRowActions, m_bIsReadOnly, m_bWrapColumnHeaders, m_imgAddIcon, m_imgDeleteIcon, m_nListKey, m_nNextIndex, m_saData, m_sAddIconAlt, m_sAddLabel, m_sDeleteIconAlt, m_sDelRowConfirmMsg, m_sEmptyListAlert, m_sInstructions, m_sMainMessage, m_sSectionTitle, m_sTableInstructions, MAX_ROWS, MOVEACTION_DOWN, MOVEACTION_FIRST, MOVEACTION_LAST, MOVEACTION_UP, parent
 
Fields inherited from class com.plumtree.uiinfrastructure.editor.EditorHelperModel
m_asOwner
 
Constructor Summary
MultiObjectsSecurityModel()
           
 
Method Summary
protected  void AddACLToList(int _nClassID, int _nObjectID, java.lang.String _sName)
          Helper method that adds a row to the list.
 java.lang.Object Create()
          This method is used by the ASManager to return new instances of managed objects.
protected  java.lang.Object[][] CreateColumnInfos()
          Creates the array of clolumn info.
 void Finish()
          Saves the security settings into the IPTObject.
 java.lang.String GetAccessLevelString(int _nAccessLevelID)
          Returns the String associated with the Access Level ID in argument.
 int GetACLIndex(int _nClassID, int _nObjectID)
           
protected  int[] GetArrayOfColumns()
          Helper method to get the sort.
 int[] GetColumns()
          Returns the array of column info.
 IPTAccessList GetCurrentFolderACL()
           
 java.lang.String GetName()
          Returns the Class name.
 XPArrayList GetObjectArray()
          Returns the array of Objects.
 int[] GetObjectIDs()
          Returns the array of Object IDs.
 boolean HasSecurityMatrixChanged()
          Returns a flag to know whether any of the security settings on the matrix have changed (compare to what we have in the DB).
protected  void InitAccessLevels()
          Inits the array of supported Access Levels.
 boolean InitializeMultiObjsSecurityPage(XPHashtable _htFormData, IPTSession _ptSession)
          Initializes the expandable list.
protected  void InitListWithACLFromObject(IPTObject _ptObject)
          Initializes the list with the ACL from the PTObject.
 boolean IsAdminModifiedOnFolder(IPTAccessList _ptOldACL)
           
 boolean IsEdtingAdminFolderSecurity()
          Returns true if we are Editing Security on Amdin Folders.
protected  boolean IsMatrixRowInObjectACL(int _nClassID, int _nObjectID, int _nAccessLevel, IPTAccessList _ptACL)
          Tells whether the row identified by the class ID, the object ID and the Access Level ID in argument is in the Object ACL or no.
 void ResetSettings()
          Resets all the changes that were made so far.
protected  int SaveRow(PTGrowableSortedArrayWrapper _saData, int _nRowIndex, XPHashtable _htFormData)
          Saves the access level for the row _nRowIndex.
protected  void StoreSecurityOnObject(IPTObject _ptObject)
          Saves the security settings into the IPTObject.
 
Methods inherited from class com.plumtree.portaluiinfrastructure.editor.commonpages.objectsecurity.ObjectSecurityModel
AddACLFromTree, AddRowsOnRepost, CanPropagateSecurity, DisplayGroupMembersTree, GetAccessLevels, GetColumnInfos, GetIsCardACL, GetLeftNavString, GetSelectedItems, GetShowHeaderAndLeftNav, GetSupportMandatoryColumn, HasAccessRights, HasEditAccessToGroup, HasSecurityChanged, InitializeSecurityPage, InitListWithACLFromObject, InitReadOnlyAccessFlag, IsACLInArray, IsEveryoneGroup, SetCardACL, SetLeftNavString, SetShowHeaderAndLeftNav, SetSupportMandatoryColumn
 
Methods inherited from class com.plumtree.portaluiinfrastructure.expandablelist.selectptobject.selectptobjectsbytype.SelectPTObjectsByTypeModel
GetMainColumnSort, GetMainColumnSortDirection, InitializeSortedArray, ReverseCurrentSort, SortByColumn
 
Methods inherited from class com.plumtree.portaluiinfrastructure.expandablelist.selectptobject.SelectPTObjectModel
AddControlParamsToURL, ClearHiddenObjects, ContainsObject, CreateIndexMapping, DoTaskOnComeBackFromSubEditor, GetAccessLevel, GetCommunityFolderID, GetCommunityMode, GetCreateNewInfo, GetCreateNewURL, GetDefaultRowIcon, GetDisplayObjects, GetEditObjectURL, GetHiddenObjects, GetIndex, GetNoRowIcons, GetObjectClassIDs, GetRowIconByClassID, GetSelectedNamesAsHTML, GetTreeLeafType, GetTreeMultiSelect, GetTreeQueryFilter, GetTreeSpaceID, GetTreeSubTitle, GetTreeTitle, GetUniquePopUpName, InitializeListClassIDs, InitializeReadOnlySelectPTObject, InitializeSelectPTObject, IsEditLinkEnabled, IsObjectReadOnly, ResetTreeID, SaveTreeID, SetAccessLevel, SetCommunityFolderID, SetCommunityMode, SetDefaultObjects, SetDefaultRowIcon, SetDisplayObjects, SetEnableCreateNew, SetEnableMoveRowActions, SetHiddenObjects, SetNoRowIcons, SetReadOnlyObjects, SetRowIconByClassID, SetTreeLeafType, SetTreeMultiSelect, SetTreeQueryFilter, SetTreeSubTitle, SetTreeTitle
 
Methods inherited from class com.plumtree.uiinfrastructure.expandablelist.ExpListModel
DeleteRowsOnRepost, DisableAddButton, DisableCheckBoxes, EnablePagination, GetAddIcon, GetAddIconAlt, GetAddLabel, GetAlertMessageForEmptyList, GetArrayOfObjToDelete, GetArrExpListColInfo, GetCurrentLowerObjectCount, GetCurrentUpperObjectCount, GetDeleteIcon, GetDeleteIconAlt, GetDelRowConfirmMsg, GetEmptyListInstructions, GetEmptyListMainMessage, GetEnableMoveRowActions, GetIsListReadOnly, GetItems, GetListKey, GetModelStorageName, GetMoveAction, GetNumObjects, GetPaginationSize, GetReadOnlyItems, GetRowIndex, GetSectionTitle, GetTableInstructions, GetUniqueInt, GetUniqueString, GetUnusedProperties, GetWrapColumnHeaders, InitializeExpandableList, InitializeReadOnlyExpandableList, IsAddButtonDisabled, IsCheckBoxesDisabled, IsPaginationEnabled, ModifyRow, MoveDown, MoveFirst, MoveLast, MoveRow, MoveUp, SaveSection, SetAddIcon, SetAddIconAlt, SetDeleteIcon, SetDeleteIconAlt, SetDelRowConfirmMsg, SetEmptyListMessages, SetEnableEmptyListClientValidation, SetIsListReadOnly, SetListKey, SetPagination, SetSectionTitle, SetTableInstructions, SetWrapColumnHeaders
 
Methods inherited from class com.plumtree.uiinfrastructure.editor.EditorHelperModel
CleanupAllData, CleanupTempData, Init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.plumtree.portaluiinfrastructure.editor.commonpages.objectsecurity.IObjectSecurityModelRO
DisplayGroupMembersTree, GetAccessLevels, GetIsCardACL, GetLeftNavString, GetShowHeaderAndLeftNav, GetSupportMandatoryColumn, HasEditAccessToGroup, IsEveryoneGroup
 
Methods inherited from interface com.plumtree.portaluiinfrastructure.expandablelist.selectptobject.ISelectPTObjectModelRO
ClearHiddenObjects, GetAccessLevel, GetCommunityFolderID, GetCommunityMode, GetCreateNewInfo, GetCreateNewURL, GetDefaultRowIcon, GetDisplayObjects, GetEditObjectURL, GetHiddenObjects, GetNoRowIcons, GetObjectClassIDs, GetRowIconByClassID, GetSelectedItems, GetSelectedNamesAsHTML, GetTreeLeafType, GetTreeMultiSelect, GetTreeQueryFilter, GetTreeSpaceID, GetTreeSubTitle, GetTreeTitle, GetUniquePopUpName, IsEditLinkEnabled, IsObjectReadOnly
 
Methods inherited from interface com.plumtree.uiinfrastructure.expandablelist.IExpListModelRO
GetAddIcon, GetAddIconAlt, GetAddLabel, GetAlertMessageForEmptyList, GetArrExpListColInfo, GetDeleteIcon, GetDeleteIconAlt, GetDelRowConfirmMsg, GetEmptyListInstructions, GetEmptyListMainMessage, GetEnableMoveRowActions, GetIsListReadOnly, GetListKey, GetMainColumnSort, GetMainColumnSortDirection, GetModelStorageName, GetReadOnlyItems, GetSectionTitle, GetTableInstructions, GetUniqueInt, GetUniqueString, GetUnusedProperties, GetWrapColumnHeaders, IsAddButtonDisabled, IsCheckBoxesDisabled, IsPaginationEnabled
 
Methods inherited from interface com.plumtree.uiinfrastructure.form.pagination.IPaginationModelRO
GetCurrentLowerObjectCount, GetCurrentUpperObjectCount, GetNumObjects, GetPaginationSize
 
Methods inherited from interface com.plumtree.uiinfrastructure.activityspace.IModel
CleanupAllData, CleanupTempData, Init
 

Field Detail

STR_MVC_CLASS_NAME

public static final java.lang.String STR_MVC_CLASS_NAME
Class name for the activity space

See Also:
Constant Field Values

QS_MULTI_OBJ_SECURITY_IDS

public static final java.lang.String QS_MULTI_OBJ_SECURITY_IDS
Class name for the activity space

See Also:
Constant Field Values

m_arrObjects

protected XPArrayList m_arrObjects
Array of objects we are editing the security for.


m_arrColumns

protected int[] m_arrColumns
Array of column info.


m_htObjectColumnKeys

protected XPHashtable m_htObjectColumnKeys
Constructor Detail

MultiObjectsSecurityModel

public MultiObjectsSecurityModel()
Method Detail

AddACLToList

protected void AddACLToList(int _nClassID,
                            int _nObjectID,
                            java.lang.String _sName)
Helper method that adds a row to the list.

Overrides:
AddACLToList in class ObjectSecurityModel
Parameters:
_nClassID -
_nObjectID -
_sName -

Create

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

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

Finish

public void Finish()
Saves the security settings into the IPTObject.

Overrides:
Finish in class ObjectSecurityModel

GetACLIndex

public int GetACLIndex(int _nClassID,
                       int _nObjectID)
Parameters:
_nClassID -
_nObjectID -
Returns:
int

HasSecurityMatrixChanged

public boolean HasSecurityMatrixChanged()
Returns a flag to know whether any of the security settings on the matrix have changed (compare to what we have in the DB).

Returns:
boolean

IsMatrixRowInObjectACL

protected boolean IsMatrixRowInObjectACL(int _nClassID,
                                         int _nObjectID,
                                         int _nAccessLevel,
                                         IPTAccessList _ptACL)
Tells whether the row identified by the class ID, the object ID and the Access Level ID in argument is in the Object ACL or no.

Parameters:
_nClassID -
_nObjectID -
_nAccessLevel -
_ptACL -
Returns:
boolean

IsEdtingAdminFolderSecurity

public boolean IsEdtingAdminFolderSecurity()
Returns true if we are Editing Security on Amdin Folders.

Returns:
boolean

GetCurrentFolderACL

public IPTAccessList GetCurrentFolderACL()
Returns:
the current IPTAccessList of the folder whose security is being edited

IsAdminModifiedOnFolder

public boolean IsAdminModifiedOnFolder(IPTAccessList _ptOldACL)
Parameters:
_ptOldACL - the IPTAccessList from before the ACLs were changed
Returns:
true if an admin acl was added or an acl was changed to admin.

GetObjectIDs

public int[] GetObjectIDs()
Returns the array of Object IDs.

Returns:
int[]

GetAccessLevelString

public java.lang.String GetAccessLevelString(int _nAccessLevelID)
Returns the String associated with the Access Level ID in argument. The ID has to be a PT_ACCESS_LEVELS constant.

Specified by:
GetAccessLevelString in interface IObjectSecurityModelRO
Overrides:
GetAccessLevelString in class ObjectSecurityModel
Parameters:
_nAccessLevelID -
Returns:
String
See Also:
com.plumtree.portaluiinfrastructure.editor.commonpages.objectsecurity.ObjectSecurityModel#GetAccessLevelString()

GetColumns

public int[] GetColumns()
Returns the array of column info.

Specified by:
GetColumns in interface IMultiObjectsSecurityModelRO
Returns:
int[]
See Also:
GetColumns()

GetName

public java.lang.String GetName()
Returns the Class name.

Specified by:
GetName in interface IMVCObject
Overrides:
GetName in class ObjectSecurityModel
Returns:
String

GetObjectArray

public XPArrayList GetObjectArray()
Returns the array of Objects.

Specified by:
GetObjectArray in interface IMultiObjectsSecurityModelRO
Returns:
XPArrayList
See Also:
GetObjectArray()

InitializeMultiObjsSecurityPage

public boolean InitializeMultiObjsSecurityPage(XPHashtable _htFormData,
                                               IPTSession _ptSession)
Initializes the expandable list.

Parameters:
_ptObject - Object being created or edited
_ptSession - User session
Returns:
boolean Flag to know if the initialization was successful or no.

ResetSettings

public void ResetSettings()
Resets all the changes that were made so far.


CreateColumnInfos

protected java.lang.Object[][] CreateColumnInfos()
Creates the array of clolumn info.

Returns:
Object[][]

GetArrayOfColumns

protected int[] GetArrayOfColumns()
Helper method to get the sort.

Overrides:
GetArrayOfColumns in class ObjectSecurityModel
Returns:
int[]

InitAccessLevels

protected void InitAccessLevels()
Inits the array of supported Access Levels.

Overrides:
InitAccessLevels in class ObjectSecurityModel

InitListWithACLFromObject

protected void InitListWithACLFromObject(IPTObject _ptObject)
Initializes the list with the ACL from the PTObject.

Parameters:
_ptObject - Object being created or edited

SaveRow

protected int SaveRow(PTGrowableSortedArrayWrapper _saData,
                      int _nRowIndex,
                      XPHashtable _htFormData)
Saves the access level for the row _nRowIndex.

Overrides:
SaveRow in class ObjectSecurityModel
Parameters:
_saData - List to update the data on row _nRowIndex
_nRowIndex - Index of the row to save.
_htFormData - Data posted by the form.
Returns:
int Status for server side validation.

StoreSecurityOnObject

protected void StoreSecurityOnObject(IPTObject _ptObject)
Saves the security settings into the IPTObject.




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