com.plumtree.portaluiinfrastructure.expandablelist.properties
Class ExpListPropModel

java.lang.Object
  extended by com.plumtree.uiinfrastructure.editor.EditorHelperModel
      extended by com.plumtree.uiinfrastructure.expandablelist.ExpListModel
          extended by com.plumtree.portaluiinfrastructure.expandablelist.properties.ExpListPropModel
All Implemented Interfaces:
IExpListPropModelRO, IManagedObject, IModel, IModelRO, IMVCObject, IExpListModelRO, IPaginationModel, IPaginationModelRO
Direct Known Subclasses:
EditCardPropModel, ObjPropModel

public abstract class ExpListPropModel
extends ExpListModel
implements IExpListPropModelRO

Expandable list model for properties

Author:
josephc

Field Summary
static int EXPLIST_COL_NAME
          Expandable list column for property name
static int EXPLIST_COL_PROPID
          Expandable list column for property ID
static int EXPLIST_COL_STATUS
          Expandable list column for row status (no change, added, deleted, edited)
static int EXPLIST_COL_TYPE
          Expandable list column for property type
static int EXPLIST_COL_VALUE
          Expandable list column for property value
protected  JSDateTimePickerMgr m_ptJSDateTimePickerMgr
          DateTime picker control
protected  PageMgr m_ptPageMgr
          Page manager
static int ROW_STATUS_ADDED
          Status of newly added row
static int ROW_STATUS_MODIFIED
          Status of modified row
static int ROW_STATUS_NO_CHANGE
          Status of unchanged row
static java.lang.String STR_ROW_PROPERTY_DATE_PICKER_UNIQUE_ID_PREFIX
          Prefix for unique ID of row containing datetime picker
 
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
ExpListPropModel()
           
 
Method Summary
abstract  boolean CheckRowIsMandatory(int _nRowIndex)
          Check whether row is mandatory
abstract  void Finish()
          Implemented by the child class in order to save the properties.
protected  java.lang.String GetDataKey(int _nRowIndex, XPHashtable _htFormData)
          Returns data key for a row.
protected  XPDateTime GetDateTimeFromDatePicker(java.lang.String _strUniqueInstanceID)
          Helper method to return XPDateTime from datetime picker, using the unique instance ID.
 JSDateTimePickerMgr GetDateTimePickerControlManager()
          Returns the datetime-picker control manager.
protected  java.lang.String GetPasswordKey(int _nRowIndex, XPHashtable _htFormData)
          Returns data key for a row.
static java.lang.Object GetPropValueFromString(java.lang.String strValue, int nPropertyType)
          Converts a property value from its string representation to the appropriate type.
protected  java.lang.String GetRowErrorMessage(int _nRowIndex, java.lang.String strMessage)
          Return an error message for row
 java.lang.String GetRowName(int _nRowIndex)
          Returns the name of the property in the indicated row
 int GetRowPropertyID(int _nRowIndex)
          Returns the property ID of the property in the indicated row
 int GetRowStatus(int _nRowIndex)
          Returns the status of the row (added, deleted, edited, modified)
 int GetRowType(int _nRowIndex)
          Returns the value type of the property
 java.lang.Object GetRowValue(int _nRowIndex)
          Returns the value of the property
 java.lang.String GetUniqueDateTimePickerKey(int _nRowIndex)
          Returns the unique date/time picker string ID for the row.
 void Init(AActivitySpace parent)
          Inits the Model with the Activity Space.
protected abstract  void LoadProperties()
          Implemented by the child class in order to load the properties.
 void ReverseCurrentSort()
          Must update date/time picker rows when sorting by column.
protected  int SaveDataValue(int _nRowIndex, XPHashtable _htFormData)
          Saves the data value for the row
protected  int SaveDateTimeRow(int _nRowIndex, XPHashtable _htFormData)
          Saves the date/time value
protected  int SavePasswordValue(int _nRowIndex, XPHashtable _htFormData)
          Saves the data value for the row
protected  int SaveRow(PTGrowableSortedArrayWrapper _saData, int _nRowIndex, XPHashtable _htFormData)
          Saves the data on the row _nRowIndex.
protected  void SetRowStatus(int _nRowIndex, int _nStatus)
          Set the row status
protected  void SetRowValue(int _nRowIndex, java.lang.Object _oValue)
          Set the row value
 void SortByColumn(XPHashtable _htFormData)
          Must update date/time picker rows when sorting by column.
protected  void UpdateDateTimeUniqueKeys()
          Remove all existing datetime components from the datetime picker manager, and re-register all datetime pickers.
protected  void UpdateRowInList(int _nRowIndex, java.lang.Object _oValue)
          Updates a row in the list with new values
protected  int ValidateMandatoryDataValue(int _nRowIndex, java.lang.String strValue)
          Check that a mandatory row does not have a null string value or empty string.
 
Methods inherited from class com.plumtree.uiinfrastructure.expandablelist.ExpListModel
AddRowsOnRepost, 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, InitializeSortedArray, IsAddButtonDisabled, IsCheckBoxesDisabled, IsPaginationEnabled, ModifyRow, MoveDown, MoveFirst, MoveLast, MoveRow, MoveUp, SaveSection, SetAddIcon, SetAddIconAlt, SetDeleteIcon, SetDeleteIconAlt, SetDelRowConfirmMsg, SetEmptyListMessages, SetEnableEmptyListClientValidation, SetEnableMoveRowActions, SetIsListReadOnly, SetListKey, SetPagination, SetSectionTitle, SetTableInstructions, SetWrapColumnHeaders
 
Methods inherited from class com.plumtree.uiinfrastructure.editor.EditorHelperModel
CleanupAllData, CleanupTempData, Create, GetName
 
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.IMVCObject
GetName
 
Methods inherited from interface com.plumtree.uiinfrastructure.activityspace.IModel
CleanupAllData, CleanupTempData
 
Methods inherited from interface com.plumtree.uiinfrastructure.activityspace.IManagedObject
Create
 

Field Detail

STR_ROW_PROPERTY_DATE_PICKER_UNIQUE_ID_PREFIX

public static final java.lang.String STR_ROW_PROPERTY_DATE_PICKER_UNIQUE_ID_PREFIX
Prefix for unique ID of row containing datetime picker

See Also:
Constant Field Values

EXPLIST_COL_PROPID

public static final int EXPLIST_COL_PROPID
Expandable list column for property ID

See Also:
Constant Field Values

EXPLIST_COL_VALUE

public static final int EXPLIST_COL_VALUE
Expandable list column for property value

See Also:
Constant Field Values

EXPLIST_COL_NAME

public static final int EXPLIST_COL_NAME
Expandable list column for property name

See Also:
Constant Field Values

EXPLIST_COL_TYPE

public static final int EXPLIST_COL_TYPE
Expandable list column for property type

See Also:
Constant Field Values

EXPLIST_COL_STATUS

public static final int EXPLIST_COL_STATUS
Expandable list column for row status (no change, added, deleted, edited)

See Also:
Constant Field Values

ROW_STATUS_NO_CHANGE

public static final int ROW_STATUS_NO_CHANGE
Status of unchanged row

See Also:
Constant Field Values

ROW_STATUS_ADDED

public static final int ROW_STATUS_ADDED
Status of newly added row

See Also:
Constant Field Values

ROW_STATUS_MODIFIED

public static final int ROW_STATUS_MODIFIED
Status of modified row

See Also:
Constant Field Values

m_ptJSDateTimePickerMgr

protected JSDateTimePickerMgr m_ptJSDateTimePickerMgr
DateTime picker control


m_ptPageMgr

protected PageMgr m_ptPageMgr
Page manager

Constructor Detail

ExpListPropModel

public ExpListPropModel()
Method Detail

Init

public void Init(AActivitySpace parent)
Inits the Model with the Activity Space. Initializes date/time picker and page manager for date/time picker.

Specified by:
Init in interface IModel
Overrides:
Init in class EditorHelperModel
Parameters:
parent -

GetDateTimePickerControlManager

public JSDateTimePickerMgr GetDateTimePickerControlManager()
Returns the datetime-picker control manager.

Specified by:
GetDateTimePickerControlManager in interface IExpListPropModelRO
Returns:
The datetime-picker control manager.

GetDateTimeFromDatePicker

protected XPDateTime GetDateTimeFromDatePicker(java.lang.String _strUniqueInstanceID)
Helper method to return XPDateTime from datetime picker, using the unique instance ID.

Parameters:
_strUniqueInstanceID - The unique instance ID is the special prefix plus the row number.
Returns:

GetPropValueFromString

public static java.lang.Object GetPropValueFromString(java.lang.String strValue,
                                                      int nPropertyType)
Converts a property value from its string representation to the appropriate type.

Parameters:
strValue - String value
nPropertyType - Property type
Returns:
Property value as an Object
Throws:
java.lang.Exception

GetRowName

public java.lang.String GetRowName(int _nRowIndex)
Returns the name of the property in the indicated row

Specified by:
GetRowName in interface IExpListPropModelRO
Parameters:
_nRowIndex - Row index
Returns:
Name of property

GetRowPropertyID

public int GetRowPropertyID(int _nRowIndex)
Returns the property ID of the property in the indicated row

Specified by:
GetRowPropertyID in interface IExpListPropModelRO
Parameters:
_nRowIndex - Row index
Returns:
Property ID

GetRowStatus

public int GetRowStatus(int _nRowIndex)
Returns the status of the row (added, deleted, edited, modified)

Specified by:
GetRowStatus in interface IExpListPropModelRO
Parameters:
_nRowIndex - Row index
Returns:
Row status

GetRowType

public int GetRowType(int _nRowIndex)
Returns the value type of the property

Specified by:
GetRowType in interface IExpListPropModelRO
Parameters:
_nRowIndex - Row index
Returns:
Value type of property

GetRowValue

public java.lang.Object GetRowValue(int _nRowIndex)
Returns the value of the property

Specified by:
GetRowValue in interface IExpListPropModelRO
Parameters:
_nRowIndex - Row index
Returns:
Value of property

GetUniqueDateTimePickerKey

public java.lang.String GetUniqueDateTimePickerKey(int _nRowIndex)
Returns the unique date/time picker string ID for the row.

Specified by:
GetUniqueDateTimePickerKey in interface IExpListPropModelRO
Parameters:
_nRowIndex -
Returns:

SetRowStatus

protected void SetRowStatus(int _nRowIndex,
                            int _nStatus)
Set the row status

Parameters:
_nRowIndex - Row index
_nStatus - Status of row

SetRowValue

protected void SetRowValue(int _nRowIndex,
                           java.lang.Object _oValue)
Set the row value

Parameters:
_nRowIndex - Row index
_oValue - Value of property in row

UpdateRowInList

protected void UpdateRowInList(int _nRowIndex,
                               java.lang.Object _oValue)
Updates a row in the list with new values

Parameters:
_nRowIndex - Row index
_oValue - Value of property in row

SaveDateTimeRow

protected int SaveDateTimeRow(int _nRowIndex,
                              XPHashtable _htFormData)
Saves the date/time value

Parameters:
_nRowIndex - Row index
_htFormData - Form data
Returns:
Valid if row is saved successfully. Invalid if mandatory and value is null.

GetDataKey

protected java.lang.String GetDataKey(int _nRowIndex,
                                      XPHashtable _htFormData)
Returns data key for a row.

Parameters:
_nRowIndex - Row index
_htFormData - Form data
Returns:
Data key for row

GetPasswordKey

protected java.lang.String GetPasswordKey(int _nRowIndex,
                                          XPHashtable _htFormData)
Returns data key for a row.

Parameters:
_nRowIndex - Row index
_htFormData - Form data
Returns:
Data key for row

ValidateMandatoryDataValue

protected int ValidateMandatoryDataValue(int _nRowIndex,
                                         java.lang.String strValue)
Check that a mandatory row does not have a null string value or empty string. Raise error if string value is null or empty string.

Parameters:
_nRowIndex - Row index
strValue - String value
Returns:
Valid if row is not mandatory or if it is mandatory and has non-empty value.

SaveDataValue

protected int SaveDataValue(int _nRowIndex,
                            XPHashtable _htFormData)
Saves the data value for the row

Parameters:
_nRowIndex - Row index
_htFormData - Form data
Returns:
Valid if row was saved successfully.

SavePasswordValue

protected int SavePasswordValue(int _nRowIndex,
                                XPHashtable _htFormData)
Saves the data value for the row

Parameters:
_nRowIndex - Row index
_htFormData - Form data
Returns:
Valid if row was saved successfully.

GetRowErrorMessage

protected java.lang.String GetRowErrorMessage(int _nRowIndex,
                                              java.lang.String strMessage)
Return an error message for row

Parameters:
_nRowIndex - Row index
strMessage - Message
Returns:
Error message for row

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.

UpdateDateTimeUniqueKeys

protected void UpdateDateTimeUniqueKeys()
Remove all existing datetime components from the datetime picker manager, and re-register all datetime pickers. This method must be called whenever the expandable list is modified (whenever rows are added or deleted) because the row numbers, which are used to construct the unique key, are changed.


LoadProperties

protected abstract void LoadProperties()
Implemented by the child class in order to load the properties.


Finish

public abstract void Finish()
Implemented by the child class in order to save the properties.


CheckRowIsMandatory

public abstract boolean CheckRowIsMandatory(int _nRowIndex)
Check whether row is mandatory

Parameters:
_nRowIndex - Row index
Returns:
True if row is mandatory

SortByColumn

public void SortByColumn(XPHashtable _htFormData)
Must update date/time picker rows when sorting by column.

Overrides:
SortByColumn in class ExpListModel
Parameters:
_htFormData - Form data

ReverseCurrentSort

public void ReverseCurrentSort()
Must update date/time picker rows when sorting by column.

Overrides:
ReverseCurrentSort in class ExpListModel



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