com.plumtree.portalpages.browsing.editors.dircommon.editdocumentproperty
Class EditCardPropModel

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
              extended by com.plumtree.portalpages.browsing.editors.dircommon.editdocumentproperty.EditCardPropModel
All Implemented Interfaces:
IEditCardPropModelRO, IExpListPropModelRO, IManagedObject, IModel, IModelRO, IMVCObject, IExpListModelRO, IPaginationModel, IPaginationModelRO

public class EditCardPropModel
extends ExpListPropModel
implements IEditCardPropModelRO

This is the implementation of the Expandable List for editing card properties.

Author:
stephenc

Field Summary
static int EXPLIST_COL_MAX
          Number total of columns
static java.lang.String HTMLINPUT_ITEM
          Input for input text box
protected  boolean m_bAddMultiValuedPropSortLater
          This flag is used to commit MultiValued property and when we add a value
protected  XPHashtable m_htPickListValues
           
protected  XPHashtable m_htPickTypes
           
protected  PTImageType m_imgRowIcon
          Icon to display on each row, just before the input text.
protected  java.lang.Object m_oDefaultValue
          This is used on add to populate the input text of the newly added row.
protected  IPTCardPropertyValues m_ptCardPropertyValues
          IPTCardPropertyValues
protected  IPTObject m_ptObject
          IPTObject
protected  IPTSession m_ptSession
          IPTSession
 XPSortedDictionary m_xpCardProperties
          Card properties
 XPArrayList m_xpDeletedProperties
          XPArrayList: This holds only the original properties that have been deleted.
 XPSortedDictionary m_xpUnusedProperties
          XPSortedDictionary
static int NEW_PROP_DEFAULTVALUE
           
static int NEW_PROP_PROPID_UNSELECTED
           
static int ROW_STATUS_ADDED_NEW
           
static java.lang.String STR_MVC_CLASS_NAME
          Class name for the activity space
static java.lang.String SUBSPACE_KEY_PICKTREE
          Subspace key for pick tree
 
Fields inherited from class com.plumtree.portaluiinfrastructure.expandablelist.properties.ExpListPropModel
EXPLIST_COL_NAME, EXPLIST_COL_PROPID, EXPLIST_COL_STATUS, EXPLIST_COL_TYPE, EXPLIST_COL_VALUE, m_ptJSDateTimePickerMgr, m_ptPageMgr, ROW_STATUS_ADDED, ROW_STATUS_MODIFIED, ROW_STATUS_NO_CHANGE, STR_ROW_PROPERTY_DATE_PICKER_UNIQUE_ID_PREFIX
 
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
EditCardPropModel()
          Creates a new EditCardPropModel object.
 
Method Summary
 void AddRowsOnRepost(XPHashtable _htFormData)
          Will be called each time the add action is performed.
 boolean CheckPickValuesAreValid(int _nRowIndex)
          If a property has a pick tree or pick list, check that the pick values can be successfully retrieved.
 boolean CheckRowIsMandatory(int _nRowIndex)
          Check whether row is mandatory
 boolean CheckRowIsMultiValued(int _nRowIndex)
          Checks to see if the property is multivalued
 boolean CheckRowIsReadOnly(int _nRowIndex)
          Checks to see if the property is read-only
 java.lang.Object Create()
          This method is used by the ASManager to return new instances of managed objects.
 void DeleteRowsOnRepost(XPHashtable _htFormData)
          Gets the array of checked rows and delete them from the list.
 void DoTaskOnComeBackFromSubEditor()
          This method will be called when you come back to the main Editor from a sub Editor.
 void Finish()
          Implemented by the child class in order to save the properties.
 java.lang.Object[][] GetArrExpListColInfo()
          Returns the array of column titles, associated column IDs and column width.
protected  java.lang.String GetDataKey(int _nRowIndex, XPHashtable _htFormData)
          Override method to save pick list data
protected  IASQueryResult GetEditCardProperties(IPTObjectProperties _ptObjProp)
           
 java.lang.String GetName()
          Returns the Class name.
 int GetNewlySelectedPropertyID()
           
 int GetNumProperties()
           
 java.lang.Object[][] GetPickListValues(int _nPropertyID)
          Return cached pick list values for the property.
 int GetPickType(int _nRowIndex)
          Return the pick type for the property.
 PTImageType GetRowIcon()
          Returns the icon to display on each row before the input text.
 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)
protected  java.lang.Object[][] GetRowsToAdd(java.lang.String[] _aDataValue)
           
protected  int[] GetRowsToDelete(java.lang.String[] _aDataValue)
           
 int GetRowType(int _nRowIndex)
          Returns the value type of the property
 java.lang.String GetStringFromObjectValue(java.lang.Object oValue, int nPropertyType)
          Returns string representation of property value
 XPSortedDictionary GetUnusedProperties()
           
 boolean InitializeCardProperties(IPTSession _ptSession, IPTCardPropertyValues ptCardPropValues, XPSortedDictionary xpCardProperties, java.lang.String _sSectionTitle, PTImageType _imgAddIcon, java.lang.String _sAddLabel, int _nListKey)
           
 void InitializeSortedArray(PTGrowableSortedArrayWrapper _saData)
          Initalizes the list (PTGrowableSortedArrayWrapper) with a column mapping and an array of sort.
protected  void LoadProperties()
          Implemented by the child class in order to load the properties.
 void ModifyRow(XPHashtable _htFormData)
          Action for modifying a row.
protected  int SaveRow(PTGrowableSortedArrayWrapper _saData, int _nRowIndex, XPHashtable _htFormData)
          Saves the data on the row _nRowIndex.
 
Methods inherited from class com.plumtree.portaluiinfrastructure.expandablelist.properties.ExpListPropModel
GetDateTimeFromDatePicker, GetDateTimePickerControlManager, GetPasswordKey, GetPropValueFromString, GetRowErrorMessage, GetRowName, GetRowValue, GetUniqueDateTimePickerKey, Init, ReverseCurrentSort, SaveDataValue, SaveDateTimeRow, SavePasswordValue, SetRowStatus, SetRowValue, SortByColumn, UpdateDateTimeUniqueKeys, UpdateRowInList, ValidateMandatoryDataValue
 
Methods inherited from class com.plumtree.uiinfrastructure.expandablelist.ExpListModel
DisableAddButton, DisableCheckBoxes, EnablePagination, GetAddIcon, GetAddIconAlt, GetAddLabel, GetAlertMessageForEmptyList, GetArrayOfObjToDelete, GetCurrentLowerObjectCount, GetCurrentUpperObjectCount, GetDeleteIcon, GetDeleteIconAlt, GetDelRowConfirmMsg, GetEmptyListInstructions, GetEmptyListMainMessage, GetEnableMoveRowActions, GetIsListReadOnly, GetItems, GetListKey, GetMainColumnSort, GetMainColumnSortDirection, GetModelStorageName, GetMoveAction, GetNumObjects, GetPaginationSize, GetReadOnlyItems, GetRowIndex, GetSectionTitle, GetTableInstructions, GetUniqueInt, GetUniqueString, GetWrapColumnHeaders, InitializeExpandableList, InitializeReadOnlyExpandableList, IsAddButtonDisabled, IsCheckBoxesDisabled, IsPaginationEnabled, 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
 
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.expandablelist.properties.IExpListPropModelRO
GetDateTimePickerControlManager, GetRowName, GetRowValue, GetUniqueDateTimePickerKey
 
Methods inherited from interface com.plumtree.uiinfrastructure.expandablelist.IExpListModelRO
GetAddIcon, GetAddIconAlt, GetAddLabel, GetAlertMessageForEmptyList, GetDeleteIcon, GetDeleteIconAlt, GetDelRowConfirmMsg, GetEmptyListInstructions, GetEmptyListMainMessage, GetEnableMoveRowActions, GetIsListReadOnly, GetListKey, GetMainColumnSort, GetMainColumnSortDirection, GetModelStorageName, GetReadOnlyItems, GetSectionTitle, GetTableInstructions, GetUniqueInt, GetUniqueString, 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
 

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

ROW_STATUS_ADDED_NEW

public static final int ROW_STATUS_ADDED_NEW
See Also:
Constant Field Values

HTMLINPUT_ITEM

public static final java.lang.String HTMLINPUT_ITEM
Input for input text box

See Also:
Constant Field Values

NEW_PROP_DEFAULTVALUE

public static final int NEW_PROP_DEFAULTVALUE
See Also:
Constant Field Values

NEW_PROP_PROPID_UNSELECTED

public static final int NEW_PROP_PROPID_UNSELECTED
See Also:
Constant Field Values

SUBSPACE_KEY_PICKTREE

public static final java.lang.String SUBSPACE_KEY_PICKTREE
Subspace key for pick tree

See Also:
Constant Field Values

m_xpDeletedProperties

public XPArrayList m_xpDeletedProperties
XPArrayList: This holds only the original properties that have been deleted. Newly added properties that are deleted are not added to this list


m_xpUnusedProperties

public XPSortedDictionary m_xpUnusedProperties
XPSortedDictionary


m_xpCardProperties

public XPSortedDictionary m_xpCardProperties
Card properties


m_ptCardPropertyValues

protected IPTCardPropertyValues m_ptCardPropertyValues
IPTCardPropertyValues


m_ptObject

protected IPTObject m_ptObject
IPTObject


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_imgRowIcon

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


m_htPickTypes

protected XPHashtable m_htPickTypes

m_htPickListValues

protected XPHashtable m_htPickListValues

m_bAddMultiValuedPropSortLater

protected boolean m_bAddMultiValuedPropSortLater
This flag is used to commit MultiValued property and when we add a value

Constructor Detail

EditCardPropModel

public EditCardPropModel()
Creates a new EditCardPropModel object.

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 -

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

DeleteRowsOnRepost

public void DeleteRowsOnRepost(XPHashtable _htFormData)
Description copied from class: ExpListModel
Gets the array of checked rows and delete them from the list.

Overrides:
DeleteRowsOnRepost in class ExpListModel
Parameters:
_htFormData -

DoTaskOnComeBackFromSubEditor

public void DoTaskOnComeBackFromSubEditor()
This method will be called when you come back to the main Editor from a sub Editor.


ModifyRow

public void ModifyRow(XPHashtable _htFormData)
Action for modifying a row. Override the default behavior of this method so that pick tree or reference tree can modify the row.

Overrides:
ModifyRow in class ExpListModel
Parameters:
_htFormData - Form data
See Also:
ExpListModel.ModifyRow(XPHashtable)

GetName

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

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

GetNewlySelectedPropertyID

public int GetNewlySelectedPropertyID()
Specified by:
GetNewlySelectedPropertyID in interface IEditCardPropModelRO
Returns:

GetNumProperties

public int GetNumProperties()
Specified by:
GetNumProperties in interface IEditCardPropModelRO
Returns:

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 IEditCardPropModelRO
Returns:
PTImageType

CheckPickValuesAreValid

public boolean CheckPickValuesAreValid(int _nRowIndex)
If a property has a pick tree or pick list, check that the pick values can be successfully retrieved.

Specified by:
CheckPickValuesAreValid in interface IEditCardPropModelRO
Parameters:
_nRowIndex - Row index
Returns:
True if pick values can be successfully retrieved.

GetPickListValues

public java.lang.Object[][] GetPickListValues(int _nPropertyID)
Return cached pick list values for the property.

Specified by:
GetPickListValues in interface IEditCardPropModelRO
Parameters:
_nPropertyID - Property ID
Returns:
Pick list values
See Also:
IObjPropModelRO.GetPickListValues(int)

GetPickType

public int GetPickType(int _nRowIndex)
Return the pick type for the property.

Specified by:
GetPickType in interface IEditCardPropModelRO
Parameters:
__nRowIndex - Row index
Returns:
Pick type

GetStringFromObjectValue

public java.lang.String GetStringFromObjectValue(java.lang.Object oValue,
                                                 int nPropertyType)
Returns string representation of property value

Specified by:
GetStringFromObjectValue in interface IEditCardPropModelRO
Parameters:
oValue - Property value as Object
nPropertyType - Property type
Returns:
Property value as string

GetUnusedProperties

public XPSortedDictionary GetUnusedProperties()
Specified by:
GetUnusedProperties in interface IEditCardPropModelRO
Specified by:
GetUnusedProperties in interface IExpListModelRO
Overrides:
GetUnusedProperties in class ExpListModel
Returns:

InitializeCardProperties

public boolean InitializeCardProperties(IPTSession _ptSession,
                                        IPTCardPropertyValues ptCardPropValues,
                                        XPSortedDictionary xpCardProperties,
                                        java.lang.String _sSectionTitle,
                                        PTImageType _imgAddIcon,
                                        java.lang.String _sAddLabel,
                                        int _nListKey)
Parameters:
_ptSession -
_ptObject -
_sSectionTitle -
_imgAddIcon -
_sAddLabel -
_nListKey -
Returns:

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 -

Finish

public void Finish()
Description copied from class: ExpListPropModel
Implemented by the child class in order to save the properties.

Specified by:
Finish in class ExpListPropModel

GetEditCardProperties

protected IASQueryResult GetEditCardProperties(IPTObjectProperties _ptObjProp)
Parameters:
_ptObjProp -
Returns:
Throws:
XPException

GetRowsToAdd

protected java.lang.Object[][] GetRowsToAdd(java.lang.String[] _aDataValue)
Parameters:
_aDataValue -
Returns:

GetRowsToDelete

protected int[] GetRowsToDelete(java.lang.String[] _aDataValue)
Parameters:
_aDataValue -
Returns:

GetDataKey

protected java.lang.String GetDataKey(int _nRowIndex,
                                      XPHashtable _htFormData)
Override method to save pick list data

Overrides:
GetDataKey in class ExpListPropModel
Parameters:
_nRowIndex - Row index
_htFormData - Form data
Returns:
Return key for pick list if row has picklist. Otherwise return regular key.

SaveRow

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

Overrides:
SaveRow in class ExpListPropModel
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.

GetArrExpListColInfo

public java.lang.Object[][] GetArrExpListColInfo()
Returns the array of column titles, associated column IDs and column width. This specific implementation checks to see if there is a multi valued property in the list of properties and adds a new header column to the list of columns to be shown in UI.

Specified by:
GetArrExpListColInfo in interface IExpListModelRO
Overrides:
GetArrExpListColInfo in class ExpListModel
Returns:
Object[][]
See Also:
ExpListModel.GetArrExpListColInfo()

LoadProperties

protected void LoadProperties()
Description copied from class: ExpListPropModel
Implemented by the child class in order to load the properties.

Specified by:
LoadProperties in class ExpListPropModel

GetRowType

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

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

GetRowStatus

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

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

GetRowPropertyID

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

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

CheckRowIsMultiValued

public boolean CheckRowIsMultiValued(int _nRowIndex)
Checks to see if the property is multivalued

Specified by:
CheckRowIsMultiValued in interface IEditCardPropModelRO
Parameters:
_nRowIndex - Current row index
Returns:
Returns true if multivalued. Otherwise returns false.
See Also:
com.plumtree.portaluiinfrastructure.editor.dircommon.editdocumentproperty.IEditCardPropModelRO#CheckRowIsMultiValued(int)

CheckRowIsReadOnly

public boolean CheckRowIsReadOnly(int _nRowIndex)
Checks to see if the property is read-only

Specified by:
CheckRowIsReadOnly in interface IEditCardPropModelRO
Parameters:
_nRowIndex - Current row index
Returns:
Returns true if read-only. Otherwise returns false.
See Also:
om.plumtree.portaluiinfrastructure.editor.dircommon.editdocumentproperty.IEditCardPropModelRO#CheckRowIsReadOnly(int)

CheckRowIsMandatory

public boolean CheckRowIsMandatory(int _nRowIndex)
Description copied from class: ExpListPropModel
Check whether row is mandatory

Specified by:
CheckRowIsMandatory in class ExpListPropModel
Parameters:
_nRowIndex -
Returns:



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