com.plumtree.portalpages.admin.serversettings.objectpropertymap.plugin
Class ObjPropMapPluginModel

java.lang.Object
  extended by com.plumtree.uiinfrastructure.editor.EditorHelperModel
      extended by com.plumtree.uiinfrastructure.expandablelist.ExpListModel
          extended by com.plumtree.portalpages.admin.serversettings.objectpropertymap.plugin.ObjPropMapPluginModel
All Implemented Interfaces:
IObjPropMapPluginModelRO, IManagedObject, IModel, IModelRO, IMVCObject, IExpListModelRO, IPaginationModel, IPaginationModelRO

public class ObjPropMapPluginModel
extends ExpListModel
implements IObjPropMapPluginModelRO

This is the implementation of the Expandable List for object properties map.

Author:
josephc

Field Summary
static int EXPLIST_COL_CLASS_NAME
          Column for class name
static int EXPLIST_COL_CLASSID
          Column for class ID
static int EXPLIST_COL_MAPPED_PROPERTIES
          Column for mapped properties
static int EXPLIST_COL_MAX
          Number total of columns
protected  XPHashtable m_htClassMappings
          Table of class mappings
protected  XPHashtable m_htPropertyInfo
          Table of property names and descrptions
protected  java.lang.Object m_oDefaultValue
          This is used on add to populate the input text of the newly added row.
protected  IPTObjectPropertyMap m_ptOPM
          Object property map
protected  IPTObjectManager m_ptPropertyManager
          Property object manager
protected  IPTSession m_ptSession
          IPTSession
static int PROPERTY_INFO_DESC
          Property info column for description
static int PROPERTY_INFO_NAME
          Property info column for name
static java.lang.String STR_MVC_CLASS_NAME
          Class name for the activity space
static java.lang.String SUBSPACE_KEY_PROPERTYTREE
          Subspace key for property 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
ObjPropMapPluginModel()
           
 
Method Summary
protected  void AddPropertiesToRow(int _nRowIndex, XPArrayList _alistSelectedProperties)
          Adds new properties to the row.
 void AddRowsOnRepost(XPHashtable _htFormData)
          Will be called each time the add action is performed.
 java.lang.Object Create()
          This method is used by the ASManager to return new instances of managed objects.
 HTMLImg GetClassIcon(int _nRowIndex)
          Returns the class icon
 java.lang.String GetName()
          Returns the Class name.
 java.lang.String[][] GetPropertyInfo(int _nRowIndex)
          Returns array of property names and descriptions.
 java.lang.String GetSelectedItems(int _nRowIndex)
          Returns a String of Class IDs and Object IDs of the Objects to select in the tree.
 boolean InitializeObjectPropertiesMap(IPTSession _ptSession, java.lang.String _sSectionTitle, int _nListKey)
          Initialize object properties map.
 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.
 void SetDefaultValue(java.lang.Object _oDefaultValue)
          Sets a new default value.
 void StorePropertyMappings()
          Stores the property mapping changes to the property object.
 
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, SetEnableMoveRowActions, 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

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
Column for class ID

See Also:
Constant Field Values

EXPLIST_COL_CLASS_NAME

public static final int EXPLIST_COL_CLASS_NAME
Column for class name

See Also:
Constant Field Values

EXPLIST_COL_MAPPED_PROPERTIES

public static final int EXPLIST_COL_MAPPED_PROPERTIES
Column for mapped properties

See Also:
Constant Field Values

SUBSPACE_KEY_PROPERTYTREE

public static final java.lang.String SUBSPACE_KEY_PROPERTYTREE
Subspace key for property tree

See Also:
Constant Field Values

PROPERTY_INFO_NAME

public static final int PROPERTY_INFO_NAME
Property info column for name

See Also:
Constant Field Values

PROPERTY_INFO_DESC

public static final int PROPERTY_INFO_DESC
Property info column for description

See Also:
Constant Field Values

m_ptPropertyManager

protected IPTObjectManager m_ptPropertyManager
Property object manager


m_ptOPM

protected IPTObjectPropertyMap m_ptOPM
Object property map


m_ptSession

protected IPTSession m_ptSession
IPTSession


m_oDefaultValue

protected java.lang.Object m_oDefaultValue
This is used on add to populate the input text of the newly added row.


m_htClassMappings

protected XPHashtable m_htClassMappings
Table of class mappings


m_htPropertyInfo

protected XPHashtable m_htPropertyInfo
Table of property names and descrptions

Constructor Detail

ObjPropMapPluginModel

public ObjPropMapPluginModel()
Method Detail

AddRowsOnRepost

public void AddRowsOnRepost(XPHashtable _htFormData)
Description copied from class: ExpListModel
Will be called each time the add action is performed. Should take care of adding the row(s) to the list. Use the GetItems() method to get the list.

Specified by:
AddRowsOnRepost in class ExpListModel
Parameters:
_htFormData - Form data
See Also:
ExpListModel.AddRowsOnRepost(XPHashtable)

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

GetClassIcon

public HTMLImg GetClassIcon(int _nRowIndex)
Returns the class icon

Specified by:
GetClassIcon in interface IObjPropMapPluginModelRO
Parameters:
_nRowIndex - Row index
Returns:
Icon for class
See Also:
com.plumtree.portalpages.admin.editors.objectpropertymap.plugin.IObjPropMapPluginModelRO#GetClassIcon(int)

GetName

public java.lang.String GetName()
Description copied from class: EditorHelperModel
Returns the Class name.

Specified by:
GetName in interface IMVCObject
Specified by:
GetName in class EditorHelperModel
Returns:
String
See Also:
IMVCObject.GetName()

GetPropertyInfo

public java.lang.String[][] GetPropertyInfo(int _nRowIndex)
Returns array of property names and descriptions.

Specified by:
GetPropertyInfo in interface IObjPropMapPluginModelRO
Parameters:
_nRowIndex - Row index
Returns:
Array of property names and descriptions
See Also:
com.plumtree.portalpages.admin.editors.objectpropertymap.plugin.IObjPropMapPluginModelRO#GetPropertyNames(int)

GetSelectedItems

public java.lang.String GetSelectedItems(int _nRowIndex)
Returns a String of Class IDs and Object IDs of the Objects to select in the tree. E.g.: "propertyClassID,ObjID1,propertyClassID,objID2". In our case, propertyClassID is the classID for properties.

Specified by:
GetSelectedItems in interface IObjPropMapPluginModelRO
Parameters:
_nRowIndex - Row index
Returns:
String
See Also:
com.plumtree.portalpages.admin.editors.objectpropertymap.plugin.IObjPropMapPluginModelRO#GetSelectedItems(int)

InitializeObjectPropertiesMap

public boolean InitializeObjectPropertiesMap(IPTSession _ptSession,
                                             java.lang.String _sSectionTitle,
                                             int _nListKey)
Initialize object properties map. Initialize expandable list and set the row icon.

Parameters:
_ptSession - IPTSession
_sSectionTitle - Category title
_nListKey - List key
Returns:
True if initialized successfully. False otherwise.

InitializeSortedArray

public void InitializeSortedArray(PTGrowableSortedArrayWrapper _saData)
Initalizes the list (PTGrowableSortedArrayWrapper) with a column mapping and an array of sort. The growable array will be sorted by the 2 columns, first the name and second classID, ascending

Specified by:
InitializeSortedArray in class ExpListModel
Parameters:
_saData -
See Also:
ExpListModel.InitializeSortedArray(PTGrowableSortedArrayWrapper)

SetDefaultValue

public void SetDefaultValue(java.lang.Object _oDefaultValue)
Sets a new default value.

Parameters:
_oDefaultValue - New value

StorePropertyMappings

public void StorePropertyMappings()
Stores the property mapping changes to the property object.


AddPropertiesToRow

protected void AddPropertiesToRow(int _nRowIndex,
                                  XPArrayList _alistSelectedProperties)
Adds new properties to the row.

Parameters:
_nRowIndex - Row index
_alistSelectedProperties - List of selected properties

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.



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