com.plumtree.portalpages.admin.editors.group
Class SelectActivityRightsModel

java.lang.Object
  extended by com.plumtree.uiinfrastructure.editor.EditorHelperModel
      extended by com.plumtree.uiinfrastructure.expandablelist.ExpListModel
          extended by com.plumtree.portalpages.admin.editors.group.SelectActivityRightsModel
All Implemented Interfaces:
ISelectActivityRightsModelRO, IManagedObject, IModel, IModelRO, IMVCObject, IExpListModelRO, IPaginationModel, IPaginationModelRO
Direct Known Subclasses:
ActSecurityPluginModel

public class SelectActivityRightsModel
extends ExpListModel
implements ISelectActivityRightsModelRO

This is the implementation of the Expandable List framework for the the Select List. The Select List 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:
RickyW

Field Summary
static int EXPLIST_COL_CLASSID
          This column contains the Object Class IDs.
static int EXPLIST_COL_MAX
          Number total of columns
static int EXPLIST_COL_OBJECTID
          This column contains the Object IDs.
static int EXPLIST_COL_STRING
          This is the String that we doisplay in the list.
static int EXPLIST_DEFAULT_INITIAL_SIZE
          Default initial size for the sorted array.
protected  int[] m_arrObjectClassIDs
          Class ID of the Objects displayed on the list.
protected  boolean m_bIsInherited
          Is this instance for inherited rights? Defaults to no.
protected  PTImageType m_imgRowIcon
          Icon to display on each row, just before the input text.
protected  java.lang.String m_sTreeSpaceID
          Tree Space ID.
static java.lang.String STR_MVC_CLASS_NAME
          Class name for the activity space
static java.lang.String SUBSPACE_NAME_SELECTTREE
          Key name used by the Activity Space to store the tree.
 
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
SelectActivityRightsModel()
           
 
Method Summary
 void AddRowsOnRepost(XPHashtable _htFormData)
          Clear the list and add all the values from the tree.
 java.lang.Object Create()
          This method is used by the ASManager to return new instances of managed objects.
 boolean GetIsInherited()
          Returns whether this list is inherited rights.
 java.lang.String GetName()
          Returns the Class name.
 java.lang.String GetObjectClassIDs()
          Returns the array of Class ID of the Objects displayed on the list as a String.
 PTImageType GetRowIcon()
          Returns the icon to display on each row before the input text.
 java.lang.String GetSelectedItems()
          Returns a String of Activity Right Object IDs.
 java.lang.String GetTreeSpaceID()
          Returns tree AS ID.
 void InitializeSelectList(java.lang.String _sSectionTitle, java.lang.String _sSectionSubTitle, PTImageType _imgAddIcon, java.lang.String _sAddLabel, int[] _arrObjectClassIDs, int _nListKey, boolean _bIsInherited)
          Initializes the expandable list.
 void InitializeSortedArray(PTGrowableSortedArrayWrapper _saData)
          Initalizes the list (PTGrowableSortedArrayWrapper) with a column mapping and an array of sort.
protected  int SaveRow(PTGrowableSortedArrayWrapper _saData, int _nRowIndex, XPHashtable _htFormData)
          Saves the data on the row _nRowIndex.
protected  void SaveTreeID(XPHashtable _htFormData)
          Helper method to save the Tree ID on repost.
 void SetDefaultObjects(java.lang.Object[][] _arrRows)
          Add the array passed in argument to the list.
 void SetEnableMoveRowActions(boolean _bEnableMoveRowActions)
          Because this select list needs to support both move row actions enable and disable, we need to change the colspan of the header row when this happens.
 void SetRowIcon(PTImageType _imgRowIcon)
          Sets the icon to display on each row before the input text.
 
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, GetMainColumnSort, GetMainColumnSortDirection, GetModelStorageName, GetMoveAction, GetNumObjects, GetPaginationSize, GetReadOnlyItems, GetRowIndex, GetSectionTitle, GetTableInstructions, GetUniqueInt, GetUniqueString, GetUnusedProperties, GetWrapColumnHeaders, InitializeExpandableList, InitializeReadOnlyExpandableList, IsAddButtonDisabled, IsCheckBoxesDisabled, IsPaginationEnabled, ModifyRow, MoveDown, MoveFirst, MoveLast, MoveRow, MoveUp, ReverseCurrentSort, SaveSection, SetAddIcon, SetAddIconAlt, SetDeleteIcon, SetDeleteIconAlt, SetDelRowConfirmMsg, SetEmptyListMessages, SetEnableEmptyListClientValidation, SetIsListReadOnly, SetListKey, SetPagination, SetSectionTitle, SetTableInstructions, SetWrapColumnHeaders, SortByColumn
 
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.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

SUBSPACE_NAME_SELECTTREE

public static final java.lang.String SUBSPACE_NAME_SELECTTREE
Key name used by the Activity Space to store the tree.

See Also:
Constant Field Values

EXPLIST_COL_MAX

public static final int EXPLIST_COL_MAX
Number total of columns

See Also:
Constant Field Values

EXPLIST_COL_CLASSID

public static final int EXPLIST_COL_CLASSID
This column contains the Object Class IDs.

See Also:
Constant Field Values

EXPLIST_COL_OBJECTID

public static final int EXPLIST_COL_OBJECTID
This column contains the Object IDs.

See Also:
Constant Field Values

EXPLIST_COL_STRING

public static final int EXPLIST_COL_STRING
This is the String that we doisplay in the list. E.g.: Object name or folder path.

See Also:
Constant Field Values

EXPLIST_DEFAULT_INITIAL_SIZE

public static final int EXPLIST_DEFAULT_INITIAL_SIZE
Default initial size for the sorted array.

See Also:
Constant Field Values

m_bIsInherited

protected boolean m_bIsInherited
Is this instance for inherited rights? Defaults to no.


m_imgRowIcon

protected PTImageType m_imgRowIcon
Icon to display on each row, just before the input text.


m_sTreeSpaceID

protected java.lang.String m_sTreeSpaceID
Tree Space ID. The first time the ID is empty and a new AS is opened, but after that, we save the ID and the same tree AS is reopened each time.


m_arrObjectClassIDs

protected int[] m_arrObjectClassIDs
Class ID of the Objects displayed on the list.

Constructor Detail

SelectActivityRightsModel

public SelectActivityRightsModel()
Method Detail

AddRowsOnRepost

public void AddRowsOnRepost(XPHashtable _htFormData)
Clear the list and add all the values from the tree.

Specified by:
AddRowsOnRepost in class ExpListModel
Parameters:
_htFormData - Form data

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
Specified by:
Create in class EditorHelperModel
Returns:
A new instance of the managed class (i.e. return new Foo();)
See Also:
IManagedObject.Create()

GetName

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

Specified by:
GetName in interface IMVCObject
Specified by:
GetName in class EditorHelperModel
Returns:
String

GetObjectClassIDs

public java.lang.String GetObjectClassIDs()
Returns the array of Class ID of the Objects displayed on the list as a String. E.g.: "2,45,3" This is the format used by the tree.

Specified by:
GetObjectClassIDs in interface ISelectActivityRightsModelRO
Returns:
String
See Also:
com.plumtree.portalpages.common.selectptobject.SelectPTObjectModel#GetObjectClassIDs()

GetRowIcon

public PTImageType GetRowIcon()
Returns the icon to display on each row before the input text. If the value is null, no icon is displayed.

Specified by:
GetRowIcon in interface ISelectActivityRightsModelRO
Returns:
PTImageType
See Also:
com.plumtree.portalpages.common.selectptobject.SelectPTObjectModel#GetRowIcon()

GetSelectedItems

public java.lang.String GetSelectedItems()
Returns a String of Activity Right Object IDs. E. g.: "ObjID1, objID2, objID3, etc" This is the format used by this tree.

Specified by:
GetSelectedItems in interface ISelectActivityRightsModelRO
Returns:
String
See Also:
SelectPTObjectModel.GetSelectedItems()

GetTreeSpaceID

public java.lang.String GetTreeSpaceID()
Returns tree AS ID.

Specified by:
GetTreeSpaceID in interface ISelectActivityRightsModelRO
Returns:
String
See Also:
com.plumtree.portalpages.common.selectptobject.SelectPTObjectModel#GetTreeSpaceID()

GetIsInherited

public boolean GetIsInherited()
Returns whether this list is inherited rights.

Specified by:
GetIsInherited in interface ISelectActivityRightsModelRO
Returns:
boolean

InitializeSelectList

public void InitializeSelectList(java.lang.String _sSectionTitle,
                                 java.lang.String _sSectionSubTitle,
                                 PTImageType _imgAddIcon,
                                 java.lang.String _sAddLabel,
                                 int[] _arrObjectClassIDs,
                                 int _nListKey,
                                 boolean _bIsInherited)
Initializes the expandable list.

Parameters:
_sSectionTitle - Main title.
_sSectionSubTitle - Sub title
_imgAddIcon - Icon for the add action.
_sAddLabel - Text to display next to the add icon.
_arrObjectClassIDs - Class ID of the Objects displayed on the list.
_nListKey - In case you have multiple Expandable Lists on the same DP, they should have a different key (otherwise, just set it to 1).
_bIsInherited - are we dealing with inherited rights.

InitializeSortedArray

public void InitializeSortedArray(PTGrowableSortedArrayWrapper _saData)
Initalizes the list (PTGrowableSortedArrayWrapper) with a column mapping and an array of sort. The growable array will always be sorted by the 1st column ascending.

Specified by:
InitializeSortedArray in class ExpListModel
Parameters:
_saData -

SetDefaultObjects

public void SetDefaultObjects(java.lang.Object[][] _arrRows)
Add the array passed in argument to the list. The array should be created using the EXPLIST_COL constants defined in this class.

Parameters:
_arrRows - Array of rows to add.

SetEnableMoveRowActions

public void SetEnableMoveRowActions(boolean _bEnableMoveRowActions)
Because this select list needs to support both move row actions enable and disable, we need to change the colspan of the header row when this happens.

Overrides:
SetEnableMoveRowActions in class ExpListModel
Parameters:
_bEnableMoveRowActions -

SetRowIcon

public void SetRowIcon(PTImageType _imgRowIcon)
Sets the icon to display on each row before the input text. By default, no icon is displayed.

Parameters:
_imgRowIcon -

SaveRow

protected int SaveRow(PTGrowableSortedArrayWrapper _saData,
                      int _nRowIndex,
                      XPHashtable _htFormData)
Saves the data on the row _nRowIndex.

Specified by:
SaveRow in class ExpListModel
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.

SaveTreeID

protected void SaveTreeID(XPHashtable _htFormData)
Helper method to save the Tree ID on repost.

Parameters:
_htFormData - Form data



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