com.plumtree.portalpages.admin.editors.doctypemap
Class GbDocTypeListModel

java.lang.Object
  extended by com.plumtree.uiinfrastructure.editor.EditorHelperModel
      extended by com.plumtree.uiinfrastructure.expandablelist.ExpListModel
          extended by com.plumtree.portalpages.admin.editors.doctypemap.GbDocTypeListModel
All Implemented Interfaces:
IGbDocTypeListModelRO, IManagedObject, IModel, IModelRO, IMVCObject, IExpListModelRO, IPaginationModel, IPaginationModelRO

public class GbDocTypeListModel
extends ExpListModel
implements IGbDocTypeListModelRO

This is the implementation of the Expandable List framework for the Growable Array. The Growable Array is a list of input texts. On add, a new input text populated with the default value will be added at the bottom of the list.

Author:
SudhaS

Field Summary
static java.lang.String CURRENTGBDOCTYPEMODEL_ID
           
static java.lang.String CURRENTSECTION_ID
           
static java.lang.String DOCTYPE_ID
          This is the String that we doisplay in the list.
static java.lang.String DOCTYPE_NAME
           
static int EXPLIST_COL_DOCTYPE
          This column contains the Object Class IDs.
static int EXPLIST_COL_IDENTIFIER
          This column contains the Object IDs.
static int EXPLIST_COL_MAX
          Number total of columns
static int EXPLIST_SORTEDARRAY_PROPID_INPUTTEXT
          Second column: the value of the input text.
protected  PTImageType m_imgRowIcon
          Icon to display on each row, just before the input text.
protected  java.lang.String m_sDefaultValue
          This is used on add to populate the input text of the newly added row.
protected  java.lang.String m_strSecondAddLabel
           
static java.lang.String ROW_INDEX
           
static java.lang.String STR_MVC_CLASS_NAME
          Class name for the activity space
 
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
GbDocTypeListModel()
           
 
Method Summary
 void AddRowsOnRepost(XPHashtable _htFormData)
          Adds one row at the bottom of the list and sets the following values: First column: m_nNextIndex Second column: m_sDefaultValue
 void AddRowsToList(java.lang.String[] _aData)
          Adds an array of new rows to the list.
 java.lang.Object Create()
          This method is used by the ASManager to return new instances of managed objects.
 void DoTaskOnComeBackFromSubEditor(int _nDPID)
          This method will be called when you come back to the main Editor from a sub Editor.
 void Finish()
          This method contains the code to store the Document Type Map.
 ASURL GetASURLToProperty(java.lang.String _sSubSpaceKey, java.lang.String _strDefaultSpace)
          Return the ASURL object going to the Property Editor as a sub Editor.
 XPHashtable GetDocTypeMappings(int _nIndex)
           
 java.lang.String GetDocTypeStringFromID(int _nDocTypeID, int _nIndex)
           
 ASURL GetEditObjectURL(int _nDocTypeID, java.lang.String _strDocTypeIdentifier, int _nRowIndex)
          Returns the URL to edit the object.
 int GetFolderID()
           
 java.lang.String[] GetListValues()
          This method should ge used by the client to get back the array of values at the end of the Editor and store them.
 int GetModelID()
           
 java.lang.String GetName()
          Returns the Class name.
 PTImageType GetRowIcon()
          Returns the icon to display on each row before the input text.
 PTImageType GetSecondAddImageIcon()
           
 java.lang.String GetSecondAddLabel()
           
 int GetSectionID(int _nIndex)
           
 IASQueryResult GetSections()
           
 IASQueryResult GetValidDocumentTypes(int _nSectionID)
          Returns the valid document types for that section.
 void InitializeGbDocTypeList(IPTDocumentTypeMap _ptDocTypeMap, int _nListKey, java.lang.String _strSectionName)
          Initializes the expandable list.
 void InitializeSortedArray(PTGrowableSortedArrayWrapper _saData)
          Initalizes the list (PTGrowableSortedArrayWrapper) with a column mapping and an array of sort.
 void RemoveAllRows(int[] iRowIDs)
           
protected  int SaveRow(PTGrowableSortedArrayWrapper _saData, int _nRowIndex, XPHashtable _htFormData)
          Saves the data on the row _nRowIndex.
 void SetDefaultObjects(java.lang.Object[][] _arrRows)
          Add the array passed in argument to the list.
 void SetDefaultValue(java.lang.String _sDefaultValue)
          Sets a new default value.
 void SetDocTypesIDToNameMap(IASQueryResult _ptasqrValidDocTypes, int _nIndex)
           
 void SetFolderID(int _nFolderID)
           
 void SetModelID(int _nGbDocTypeModelID)
           
 void SetRowIcon(PTImageType _imgRowIcon)
          Sets the icon to display on each row before the input text.
 void SetSecondAddImageIcon(PTImageType _imgAddSecondIcon)
           
 void SetSecondAddLabel(java.lang.String _strSecondAddLabel)
           
 void SetSingleDocTypeIDToNameMapping(java.lang.String _strDocTypeName, int _nDocTypeID, int _nIndex)
           
 
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_DOCTYPE

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

See Also:
Constant Field Values

EXPLIST_COL_IDENTIFIER

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

See Also:
Constant Field Values

CURRENTSECTION_ID

public static final java.lang.String CURRENTSECTION_ID
See Also:
Constant Field Values

CURRENTGBDOCTYPEMODEL_ID

public static final java.lang.String CURRENTGBDOCTYPEMODEL_ID
See Also:
Constant Field Values

DOCTYPE_ID

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

See Also:
Constant Field Values

DOCTYPE_NAME

public static final java.lang.String DOCTYPE_NAME
See Also:
Constant Field Values

ROW_INDEX

public static final java.lang.String ROW_INDEX
See Also:
Constant Field Values

EXPLIST_SORTEDARRAY_PROPID_INPUTTEXT

public static final int EXPLIST_SORTEDARRAY_PROPID_INPUTTEXT
Second column: the value of the input text.

See Also:
Constant Field Values

m_imgRowIcon

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


m_sDefaultValue

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


m_strSecondAddLabel

protected java.lang.String m_strSecondAddLabel
Constructor Detail

GbDocTypeListModel

public GbDocTypeListModel()
Method Detail

AddRowsOnRepost

public void AddRowsOnRepost(XPHashtable _htFormData)
Adds one row at the bottom of the list and sets the following values: First column: m_nNextIndex Second column: m_sDefaultValue

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

AddRowsToList

public void AddRowsToList(java.lang.String[] _aData)
Adds an array of new rows to the list.

Parameters:
_aData -

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

DoTaskOnComeBackFromSubEditor

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


Finish

public void Finish()
This method contains the code to store the Document Type Map.


GetASURLToProperty

public ASURL GetASURLToProperty(java.lang.String _sSubSpaceKey,
                                java.lang.String _strDefaultSpace)
Return the ASURL object going to the Property Editor as a sub Editor.

Specified by:
GetASURLToProperty in interface IGbDocTypeListModelRO
Parameters:
_sSubSpaceKey - Key for the sub Editor. If we are going to a new sub Editor, the key can be null and we will just pass in the default key. If we are going back to an existing sub Editor, it should be the sub Editor key.
Returns:
ASURL
See Also:
com.plumtree.portalpagessample.editor.template4#GetASURLToProperty

GetFolderID

public int GetFolderID()
Specified by:
GetFolderID in interface IGbDocTypeListModelRO

SetFolderID

public void SetFolderID(int _nFolderID)

GetDocTypeMappings

public XPHashtable GetDocTypeMappings(int _nIndex)
Parameters:
_nIndex -
Returns:

GetDocTypeStringFromID

public java.lang.String GetDocTypeStringFromID(int _nDocTypeID,
                                               int _nIndex)
Specified by:
GetDocTypeStringFromID in interface IGbDocTypeListModelRO
Parameters:
_nDocTypeID -
_nIndex -
Returns:

GetEditObjectURL

public ASURL GetEditObjectURL(int _nDocTypeID,
                              java.lang.String _strDocTypeIdentifier,
                              int _nRowIndex)
Returns the URL to edit the object.

Specified by:
GetEditObjectURL in interface IGbDocTypeListModelRO
Parameters:
_nClassID -
_nObjectID -
_sEditorASName -
Returns:
ASURL URL to the Editor

GetListValues

public java.lang.String[] GetListValues()
This method should ge used by the client to get back the array of values at the end of the Editor and store them.

Returns:
String[]

GetModelID

public int GetModelID()
Specified by:
GetModelID in interface IGbDocTypeListModelRO
Returns:

GetName

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

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

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 IGbDocTypeListModelRO
Returns:
PTImageType
See Also:
com.plumtree.uiinfrastructure.expandablelist.GrowableListModel#GetRowIcon()

GetSecondAddLabel

public java.lang.String GetSecondAddLabel()
Specified by:
GetSecondAddLabel in interface IGbDocTypeListModelRO
Returns:

GetSectionID

public int GetSectionID(int _nIndex)
Parameters:
_nIndex -
Returns:
Throws:
java.lang.Exception

GetSections

public IASQueryResult GetSections()
Returns:
Throws:
java.lang.Exception
XPException

GetValidDocumentTypes

public IASQueryResult GetValidDocumentTypes(int _nSectionID)
                                     throws java.lang.Exception
Returns the valid document types for that section.

Parameters:
_nSectionID -
Returns:
ASQueryResult
Throws:
java.lang.Exception

InitializeGbDocTypeList

public void InitializeGbDocTypeList(IPTDocumentTypeMap _ptDocTypeMap,
                                    int _nListKey,
                                    java.lang.String _strSectionName)
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.
_nListKey - In case you have multiple Expandable Lists on the same DP, they should have a different key (otherwise, just set it to 1).

SetSecondAddImageIcon

public void SetSecondAddImageIcon(PTImageType _imgAddSecondIcon)

GetSecondAddImageIcon

public PTImageType GetSecondAddImageIcon()
Specified by:
GetSecondAddImageIcon in interface IGbDocTypeListModelRO

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 -

RemoveAllRows

public void RemoveAllRows(int[] iRowIDs)
Parameters:
iRowIDs -

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.

SetDefaultValue

public void SetDefaultValue(java.lang.String _sDefaultValue)
Sets a new default value. By default this is an empty string. This value is used on add to populate the input text of the newly added row.

Parameters:
_sDefaultValue - New value

SetDocTypesIDToNameMap

public void SetDocTypesIDToNameMap(IASQueryResult _ptasqrValidDocTypes,
                                   int _nIndex)
Parameters:
_ptasqrValidDocTypes -
_nIndex -

SetModelID

public void SetModelID(int _nGbDocTypeModelID)
Parameters:
_nGbDocTypeModelID -

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 -

SetSecondAddLabel

public void SetSecondAddLabel(java.lang.String _strSecondAddLabel)
Parameters:
_strSecondAddLabel -

SetSingleDocTypeIDToNameMapping

public void SetSingleDocTypeIDToNameMapping(java.lang.String _strDocTypeName,
                                            int _nDocTypeID,
                                            int _nIndex)
Parameters:
_strDocTypeName -
_nDocTypeID -
_nIndex -

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.