com.plumtree.portaluiinfrastructure.editor.commonpages.objectproperties
Class ObjPropModel

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.portaluiinfrastructure.editor.commonpages.objectproperties.ObjPropModel
All Implemented Interfaces:
IObjPropModelRO, IExpListPropModelRO, IManagedObject, IModel, IModelRO, IMVCObject, IExpListModelRO, IPaginationModel, IPaginationModelRO
Direct Known Subclasses:
UserProfileObjEditModel

public class ObjPropModel
extends ExpListPropModel
implements IObjPropModelRO

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

Author:
josephc

Field Summary
static int EXPLIST_COL_DATATABLE
          Expandable list column for query result containing EOD data
static int EXPLIST_COL_DATATABLE_INDEX
          Expandable list column for index into query result containing EOD data
static int EXPLIST_COL_MAX
          Number total of columns
static int EXPLIST_COL_REFVALUE_NAME
          Expandable list column for reference value name
static int EXPLIST_COL_SORT_INDEX
          Sort index for value
protected  boolean m_bDisplayPageIsMandatory
          Flag determines if display page containing object properties is mandatory.
protected  boolean m_bSupportsEOD
          Does object support EOD?
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  XPHashtable m_propValueSortingOrder
          A table of the sort order for property values
protected  IPTObject m_ptObject
          IPTObject
protected  IPTObjectProperties m_ptObjProp
          IPTObjectProperties
protected  IPTSession m_ptSession
          IPTSession
protected  java.lang.String m_strTreeQueryFilter
          Query filter for non read-only, multi-select properties
static int PROP_OBJECTID_DESCRIPTION
          Object ID for description property
static int PROP_OBJECTID_NAME
          Object ID for name property
static int ROW_STATUS_DELETED
          Status of deleted row
static java.lang.String STR_MVC_CLASS_NAME
          Class name for the ObjPropModel
static java.lang.String SUBSPACE_KEY_PICKTREE
          Subspace key for pick tree
static java.lang.String SUBSPACE_KEY_REFTREE
          Subspace key for reference 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
ObjPropModel()
          Creates a new ObjPropModel object.
 
Method Summary
 void AddRowsOnRepost(XPHashtable _htFormData)
          Adds a new row to the list of object property values
 boolean CheckDisplayPageIsMandatory()
          Returns true if the display page is mandatory because it contains mandatory properties.
 boolean CheckObjectSupportsEOD()
          Checks to see if the object supports EOD
 boolean CheckPickValuesAreValid(int _nRowIndex)
          If a property has a pick tree or pick list, check that the pick values can be successfully retrieved.
 boolean CheckRowIsHREF(int _nRowIndex)
          Checks to see if the property is an HREF
 boolean CheckRowIsMandatory(int _nRowIndex)
          Checks to see if the property 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
 boolean CheckRowIsVisible(int _nRowIndex)
          Checks to see if the property is visible
 java.lang.Object Create()
          This method is used by the ASManager to return new instances of managed objects.
 void DeleteRowsOnRepost(XPHashtable _htFormData)
          Deletes am existing row from the list of object property values.
 void DoTaskOnComeBackFromSubEditor()
          This method will be called when you come back to the main Editor from a sub Editor.
 void Finish()
          Stores object properties
protected  java.lang.String GetDataKey(int _nRowIndex, XPHashtable _htFormData)
          Override method to save pick list data
 java.lang.String GetName()
          Returns the Class name.
protected  java.lang.String GetNameFromObjectID(int nClassID, int nObjectID)
          Returns the name for an object
protected  IASQueryResult GetObjectPropData(IPTObjectProperties _ptObjProp)
          Return object property non-reference data
protected  IASQueryResult GetObjectPropRefData(IPTObjectProperties _ptObjProp)
          Return object property reference data
 java.lang.Object[][] GetPickListValues(int _nPropertyID)
          Return pick list values for the property
 java.lang.Object GetRowPropertyInfo(int _nRowIndex, int nPropID)
          Returns the value of the requested PROPID from the EOD query result.
 java.lang.String GetRowRefValueName(int _nRowIndex)
          Returns the reference value name
 java.lang.String GetSelectedReference(int _nRowIndex)
          Returns a String of Class IDs and Object IDs of the Objects to select in the tree.
 java.lang.String GetStringFromObjectValue(java.lang.Object oValue, int nPropertyType)
          Returns string representation of property value
 boolean HasAccessToGlobalObjectPropMapEditor()
          Returns true if current user has access to global object property map.
 void InitializeObjectProperties(IPTSession _ptSession, IPTObject _ptObject, java.lang.String _sSectionTitle, int _nListKey)
          Initialize Object Properties
 void InitializeSortedArray(PTGrowableSortedArrayWrapper _saData)
          Initalizes the list (PTGrowableSortedArrayWrapper) with a column mapping and an array of sort.
protected  void LoadProperties()
          Loads object properties for object
 void ModifyRow(XPHashtable _htFormData)
          Action for modifying a row.
protected  int SaveRow(PTGrowableSortedArrayWrapper _saData, int _nRowIndex, XPHashtable _htFormData)
          Saves the data on the row only if the row is visible and is not read-only.
 int SaveSection(XPHashtable _htFormData)
          Saves the data when a repost occurs.
 void UpdateMandatoryPageStatus()
          Determines if the page containing object properties must be a mandatory page.
static void ValidateTree(IPTTreeIterator ptTreeIterator, int nLevel)
          Recursively iterates through a pick tree and validates that all the nodes are valid.
 
Methods inherited from class com.plumtree.portaluiinfrastructure.expandablelist.properties.ExpListPropModel
GetDateTimeFromDatePicker, GetDateTimePickerControlManager, GetPasswordKey, GetPropValueFromString, GetRowErrorMessage, GetRowName, GetRowPropertyID, GetRowStatus, GetRowType, 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, 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, MoveDown, MoveFirst, MoveLast, MoveRow, MoveUp, 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, GetRowPropertyID, GetRowStatus, GetRowType, GetRowValue, GetUniqueDateTimePickerKey
 
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
 

Field Detail

STR_MVC_CLASS_NAME

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

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_DATATABLE

public static final int EXPLIST_COL_DATATABLE
Expandable list column for query result containing EOD data

See Also:
Constant Field Values

EXPLIST_COL_DATATABLE_INDEX

public static final int EXPLIST_COL_DATATABLE_INDEX
Expandable list column for index into query result containing EOD data

See Also:
Constant Field Values

EXPLIST_COL_REFVALUE_NAME

public static final int EXPLIST_COL_REFVALUE_NAME
Expandable list column for reference value name

See Also:
Constant Field Values

EXPLIST_COL_SORT_INDEX

public static final int EXPLIST_COL_SORT_INDEX
Sort index for value

See Also:
Constant Field Values

ROW_STATUS_DELETED

public static final int ROW_STATUS_DELETED
Status of deleted row

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

SUBSPACE_KEY_REFTREE

public static final java.lang.String SUBSPACE_KEY_REFTREE
Subspace key for reference tree

See Also:
Constant Field Values

PROP_OBJECTID_NAME

public static final int PROP_OBJECTID_NAME
Object ID for name property

See Also:
Constant Field Values

PROP_OBJECTID_DESCRIPTION

public static final int PROP_OBJECTID_DESCRIPTION
Object ID for description property

See Also:
Constant Field Values

m_ptObject

protected IPTObject m_ptObject
IPTObject


m_ptObjProp

protected IPTObjectProperties m_ptObjProp
IPTObjectProperties


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_strTreeQueryFilter

protected java.lang.String m_strTreeQueryFilter
Query filter for non read-only, multi-select properties


m_bSupportsEOD

protected boolean m_bSupportsEOD
Does object support EOD?


m_bDisplayPageIsMandatory

protected boolean m_bDisplayPageIsMandatory
Flag determines if display page containing object properties is mandatory.


m_propValueSortingOrder

protected XPHashtable m_propValueSortingOrder
A table of the sort order for property values

Constructor Detail

ObjPropModel

public ObjPropModel()
Creates a new ObjPropModel object.

Method Detail

AddRowsOnRepost

public void AddRowsOnRepost(XPHashtable _htFormData)
Adds a new row to the list of object property values

Specified by:
AddRowsOnRepost in class ExpListModel
Parameters:
_htFormData - Hash table of form data
See Also:
ExpListModel.AddRowsOnRepost(XPHashtable)

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.

CheckObjectSupportsEOD

public boolean CheckObjectSupportsEOD()
Checks to see if the object supports EOD

Specified by:
CheckObjectSupportsEOD in interface IObjPropModelRO
Returns:
Returns true if object supports EOD. Otherwise returns false.
See Also:
IObjPropModelRO.CheckObjectSupportsEOD()

CheckRowIsHREF

public boolean CheckRowIsHREF(int _nRowIndex)
Checks to see if the property is an HREF

Specified by:
CheckRowIsHREF in interface IObjPropModelRO
Parameters:
_nRowIndex - Current row index
Returns:
Returns true if HREF. Otherwise returns false.
See Also:
IObjPropModelRO.CheckRowIsHREF(int)

CheckRowIsMandatory

public boolean CheckRowIsMandatory(int _nRowIndex)
Checks to see if the property is mandatory

Specified by:
CheckRowIsMandatory in interface IObjPropModelRO
Specified by:
CheckRowIsMandatory in class ExpListPropModel
Parameters:
_nRowIndex - Current row index
Returns:
Returns true if mandatory. Otherwise returns false.
See Also:
IObjPropModelRO.CheckRowIsMandatory(int)

CheckRowIsMultiValued

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

Specified by:
CheckRowIsMultiValued in interface IObjPropModelRO
Parameters:
_nRowIndex - Current row index
Returns:
Returns true if multivalued. Otherwise returns false.
See Also:
IObjPropModelRO.CheckRowIsMultiValued(int)

CheckRowIsReadOnly

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

Specified by:
CheckRowIsReadOnly in interface IObjPropModelRO
Parameters:
_nRowIndex - Current row index
Returns:
Returns true if read-only. Otherwise returns false.
See Also:
IObjPropModelRO.CheckRowIsReadOnly(int)

CheckRowIsVisible

public boolean CheckRowIsVisible(int _nRowIndex)
Checks to see if the property is visible

Specified by:
CheckRowIsVisible in interface IObjPropModelRO
Parameters:
_nRowIndex - Current row index
Returns:
Returns true if visible. Otherwise returns false.
See Also:
IObjPropModelRO.CheckRowIsVisible(int)

CheckDisplayPageIsMandatory

public boolean CheckDisplayPageIsMandatory()
Returns true if the display page is mandatory because it contains mandatory properties.

Specified by:
CheckDisplayPageIsMandatory in interface IObjPropModelRO
Returns:
True if page contains mandatory properties that user must enter values for.

UpdateMandatoryPageStatus

public void UpdateMandatoryPageStatus()
Determines if the page containing object properties must be a mandatory page. Iterate through expandable list looking for visible, not read-only, mandatory rows that are also not deleted.


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)
Deletes am existing row from the list of object property values.

Overrides:
DeleteRowsOnRepost in class ExpListModel
Parameters:
_htFormData - Hash table of form data
See Also:
ExpListModel.DeleteRowsOnRepost(XPHashtable)

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

ValidateTree

public static void ValidateTree(IPTTreeIterator ptTreeIterator,
                                int nLevel)
Recursively iterates through a pick tree and validates that all the nodes are valid.

Parameters:
ptTreeIterator - Tree to validate
nLevel - The current level to validate, which should initially be 0.

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 IObjPropModelRO
Parameters:
_nRowIndex - Row index
Returns:
True if pick values can be successfully retrieved.

GetPickListValues

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

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

GetRowPropertyInfo

public java.lang.Object GetRowPropertyInfo(int _nRowIndex,
                                           int nPropID)
Returns the value of the requested PROPID from the EOD query result.

Specified by:
GetRowPropertyInfo in interface IObjPropModelRO
Parameters:
_nRowIndex - Row index
nPropID - PT_PROPID
Returns:
Value of requested PROPID
See Also:
IObjPropModelRO.GetRowPropertyInfo(int, int)

GetRowRefValueName

public java.lang.String GetRowRefValueName(int _nRowIndex)
Returns the reference value name

Specified by:
GetRowRefValueName in interface IObjPropModelRO
Parameters:
_nRowIndex - Row index
Returns:
Reference value name
See Also:
IObjPropModelRO.GetRowRefValueName(int)

GetStringFromObjectValue

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

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

GetSelectedReference

public java.lang.String GetSelectedReference(int _nRowIndex)
Returns a String of Class IDs and Object IDs of the Objects to select in the tree. E.g.: "refClassID,ObjID1".

Specified by:
GetSelectedReference in interface IObjPropModelRO
Parameters:
_nRowIndex - Row index
Returns:
String

HasAccessToGlobalObjectPropMapEditor

public boolean HasAccessToGlobalObjectPropMapEditor()
Returns true if current user has access to global object property map. In order to access this editor, the user must be a member of the administrators group and must have the right to access the Plumtree utilities.

Specified by:
HasAccessToGlobalObjectPropMapEditor in interface IObjPropModelRO
Returns:
True if user has access. False otherwise.

InitializeObjectProperties

public void InitializeObjectProperties(IPTSession _ptSession,
                                       IPTObject _ptObject,
                                       java.lang.String _sSectionTitle,
                                       int _nListKey)
Initialize Object Properties

Parameters:
_ptSession - IPTSession
_ptObject - IPTObject
_sSectionTitle - Title
_nListKey - List key

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 propID, ascending

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

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)

Finish

public void Finish()
Stores object properties

Specified by:
Finish in class ExpListPropModel

SaveSection

public int SaveSection(XPHashtable _htFormData)
Saves the data when a repost occurs. Editors using this framework need to call that method from the SavePage method of the main Model. If the object doesn't support object properties, then don't save the rows.

Overrides:
SaveSection in class ExpListModel
Parameters:
_htFormData -
Returns:
int Status for server side validation
See Also:
com.plumtree.uiinfrastructure.editor.EditorHelperModel#SaveSection(com.plumtree.openfoundation.util.XPHashtable)

GetNameFromObjectID

protected java.lang.String GetNameFromObjectID(int nClassID,
                                               int nObjectID)
Returns the name for an object

Parameters:
nClassID - Class ID of object
nObjectID - Object ID of object
Returns:
Name of object.

GetObjectPropData

protected IASQueryResult GetObjectPropData(IPTObjectProperties _ptObjProp)
Return object property non-reference data

Parameters:
_ptObjProp - IPTObjectProperties
Returns:
Data in query result
Throws:
XPException

GetObjectPropRefData

protected IASQueryResult GetObjectPropRefData(IPTObjectProperties _ptObjProp)
Return object property reference data

Parameters:
_ptObjProp - IPTObjectProperties
Returns:
Data in query result
Throws:
XPException

LoadProperties

protected void LoadProperties()
Loads object properties for object

Specified by:
LoadProperties in class ExpListPropModel

DoTaskOnComeBackFromSubEditor

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


SaveRow

protected int SaveRow(PTGrowableSortedArrayWrapper _saData,
                      int _nRowIndex,
                      XPHashtable _htFormData)
Saves the data on the row only if the row is visible and is not read-only.

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.



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