com.plumtree.portaluiinfrastructure.editor.commonpages.localizednames
Class LocNamesModel

java.lang.Object
  extended by com.plumtree.uiinfrastructure.editor.EditorHelperModel
      extended by com.plumtree.uiinfrastructure.expandablelist.ExpListModel
          extended by com.plumtree.portaluiinfrastructure.editor.commonpages.localizednames.LocNamesModel
All Implemented Interfaces:
ILocNamesModel, ILocNamesModelRO, IManagedObject, IModel, IModelRO, IMVCObject, IExpListModelRO, IPaginationModel, IPaginationModelRO

public class LocNamesModel
extends ExpListModel
implements ILocNamesModel

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:
MichaelS

Field Summary
static int CLIENT_VALIDATION_MAX_DESCRIPTION
           
static int CLIENT_VALIDATION_MAX_NAME
          MES- Constants for client side validation
static int LOCNAMEMODEL_COL_DESCRIPTION
          Third column: description.
static int LOCNAMEMODEL_COL_INDEX
          First column: an index to keep the list sorted.
static int LOCNAMEMODEL_COL_LANG
          Fourth column: language.
static int LOCNAMEMODEL_COL_LANGNAME
          Fifth column: language name.
static int LOCNAMEMODEL_COL_MAX
          Number total of columns
static int LOCNAMEMODEL_COL_NAME
          Second column: name.
 boolean m_bHasMandatoryLang
          MES- Does the portal have a mandatory language? See comments below.
 boolean m_bSupportsLocalization
          MES- Does the object support localization at all?
 boolean m_bUseClientValidationMaxNameOverride
          RWW - Sse the max name override value if this is true, use the default value if this is false.
 int m_iClientValidationMaxNameOverride
          RWW - Allow someone to set a different max length for name.
 PTImageType m_imgRowIcon
          Icon to display on each row, just before the input text.
 int m_iRowToEdit
          MES- This is a sort of "temp" variable used when a popup edits a name and description.
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
LocNamesModel()
           
 
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
 java.lang.Object Create()
          This method is used by the ASManager to return new instances of managed objects.
 void Finish()
          MES- Finish is called by the ObjEditorModel when the object is being stored.
 int GetClassID()
           
 boolean GetIsLocalized()
          MES- GetIsLocalized is used by controls to find out if the object is localized.
 int GetMaxNameOverride()
          RWW - Returns the override value for the max length for the name field (for client validation).
 java.lang.String GetName()
          Returns the Class name.
 java.lang.String GetNameLabel()
           
 int GetObjectID()
           
 java.lang.String GetObjectUUID()
           
 java.lang.String GetPopUpDisplayPageName()
           
 java.lang.String GetPrimaryDesc()
          MES- GetPrimaryDesc is used by controls to find out the primary description for the object we're editing
 java.lang.String GetPrimaryLang()
          MES- GetPrimaryLang is used by controls to find out the primary language for the object we're editing
 java.lang.String GetPrimaryName()
          MES- GetPrimaryName is used by controls to find out the primary name for the object we're editing
 PTImageType GetRowIcon()
          Returns the icon to display on each row before the input text.
 int GetRowToEdit()
           
 boolean HasMandatoryLang()
          Does the portal have a mandatory language?
 void InitializeNameDescEditor(IPTLocalizable objToEdit, int _nListKey)
          Initializes the expandable list.
 void InitializeSortedArray(PTGrowableSortedArrayWrapper _saData)
          Initalizes the list (PTGrowableSortedArrayWrapper) with a column mapping and an array of sort.
 boolean IsNoDescriptions()
           
 boolean IsUsingMaxNameOverride()
          RWW - Returns whether we should use use the override or default value for name field.
protected  int SaveRow(PTGrowableSortedArrayWrapper _saData, int _nRowIndex, XPHashtable _htFormData)
          Saves the data on the row _nRowIndex.
 int SaveSection(XPHashtable _htFormData)
          Saves the data when a repost occurs.
 void SetIsLocalized(boolean bIsLocalized)
          MES- SetIsLocalized is used by controls to set the IsLocalized flag on the object we're editing.
 void SetIsNoDescriptions(boolean bNoDescriptions)
          If this method is not called, then it will default to using descriptions unless the Object does not support it.
 void SetNameLabel(java.lang.String strNameLabel)
          Call this method if the default name label is not appropriate.
 void SetPopUpDisplayPageName(java.lang.String strPopUpDisplayPageName)
          Call this method if you want the popup display page to be something other than LocNamesPopUpDP.STR_MVC_CLASS_NAME
 void SetPrimaryLang(java.lang.String sPrimaryLang)
          MES- SetPrimaryLang is used by controls to set the primary language on the object we're editing.
 void SetRowIcon(PTImageType _imgRowIcon)
          Sets the icon to display on each row before the input text.
 void SetRowToEdit(int nRowToEdit)
           
 boolean SupportsLocalization()
          Does the object support localization at all?
 
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, 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

CLIENT_VALIDATION_MAX_NAME

public static final int CLIENT_VALIDATION_MAX_NAME
MES- Constants for client side validation

See Also:
Constant Field Values

CLIENT_VALIDATION_MAX_DESCRIPTION

public static final int CLIENT_VALIDATION_MAX_DESCRIPTION
See Also:
Constant Field Values

LOCNAMEMODEL_COL_INDEX

public static final int LOCNAMEMODEL_COL_INDEX
First column: an index to keep the list sorted.

See Also:
Constant Field Values

LOCNAMEMODEL_COL_NAME

public static final int LOCNAMEMODEL_COL_NAME
Second column: name.

See Also:
Constant Field Values

LOCNAMEMODEL_COL_DESCRIPTION

public static final int LOCNAMEMODEL_COL_DESCRIPTION
Third column: description.

See Also:
Constant Field Values

LOCNAMEMODEL_COL_LANG

public static final int LOCNAMEMODEL_COL_LANG
Fourth column: language.

See Also:
Constant Field Values

LOCNAMEMODEL_COL_LANGNAME

public static final int LOCNAMEMODEL_COL_LANGNAME
Fifth column: language name.

See Also:
Constant Field Values

LOCNAMEMODEL_COL_MAX

public static final int LOCNAMEMODEL_COL_MAX
Number total of columns

See Also:
Constant Field Values

m_imgRowIcon

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


m_bHasMandatoryLang

public boolean m_bHasMandatoryLang
MES- Does the portal have a mandatory language? See comments below.


m_bSupportsLocalization

public boolean m_bSupportsLocalization
MES- Does the object support localization at all?


m_iClientValidationMaxNameOverride

public int m_iClientValidationMaxNameOverride
RWW - Allow someone to set a different max length for name. For example, AdminFolders need to have a max lenght of 63 instead of the default 255 for community naming purposes.


m_bUseClientValidationMaxNameOverride

public boolean m_bUseClientValidationMaxNameOverride
RWW - Sse the max name override value if this is true, use the default value if this is false.


m_iRowToEdit

public int m_iRowToEdit
MES- This is a sort of "temp" variable used when a popup edits a name and description. It's populated by the RepostControl, and read by LocNamesPopupView and this class

Constructor Detail

LocNamesModel

public LocNamesModel()
Method Detail

IsUsingMaxNameOverride

public boolean IsUsingMaxNameOverride()
RWW - Returns whether we should use use the override or default value for name field.

Specified by:
IsUsingMaxNameOverride in interface ILocNamesModelRO
Returns:

GetMaxNameOverride

public int GetMaxNameOverride()
RWW - Returns the override value for the max length for the name field (for client validation).

Specified by:
GetMaxNameOverride in interface ILocNamesModelRO
Returns:
Max length for name field.

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

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

Finish

public void Finish()
MES- Finish is called by the ObjEditorModel when the object is being stored. We should store the data from the model to the IPTObject here.


GetNameLabel

public java.lang.String GetNameLabel()
Specified by:
GetNameLabel in interface ILocNamesModelRO
Returns:
Name label

SetNameLabel

public void SetNameLabel(java.lang.String strNameLabel)
Call this method if the default name label is not appropriate.

Specified by:
SetNameLabel in interface ILocNamesModel
Parameters:
sNameLabel -

IsNoDescriptions

public boolean IsNoDescriptions()
Specified by:
IsNoDescriptions in interface ILocNamesModelRO
Returns:
boolean - No Descriptions
See Also:
com.plumtree.portaluiinfrastructure.editor.commonpages.localizednames.ILocNamesModelRO#GetNoDescriptions()

SetIsNoDescriptions

public void SetIsNoDescriptions(boolean bNoDescriptions)
If this method is not called, then it will default to using descriptions unless the Object does not support it.

Specified by:
SetIsNoDescriptions in interface ILocNamesModel
Parameters:
bNoDescriptions -

GetPopUpDisplayPageName

public java.lang.String GetPopUpDisplayPageName()
Specified by:
GetPopUpDisplayPageName in interface ILocNamesModelRO
Returns:
Name of Pop Up Display Page
See Also:
ILocNamesModelRO.GetPopUpDisplayPageName()

SetPopUpDisplayPageName

public void SetPopUpDisplayPageName(java.lang.String strPopUpDisplayPageName)
Call this method if you want the popup display page to be something other than LocNamesPopUpDP.STR_MVC_CLASS_NAME

Specified by:
SetPopUpDisplayPageName in interface ILocNamesModel
Parameters:
sPopUpDisplayPageName -

GetIsLocalized

public boolean GetIsLocalized()
MES- GetIsLocalized is used by controls to find out if the object is localized.

Specified by:
GetIsLocalized in interface ILocNamesModelRO
Returns:
a boolean indicating if the object is localized

GetName

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

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

GetPrimaryDesc

public java.lang.String GetPrimaryDesc()
MES- GetPrimaryDesc is used by controls to find out the primary description for the object we're editing

Specified by:
GetPrimaryDesc in interface ILocNamesModelRO
Returns:
the primary name of the object

GetPrimaryLang

public java.lang.String GetPrimaryLang()
MES- GetPrimaryLang is used by controls to find out the primary language for the object we're editing

Specified by:
GetPrimaryLang in interface ILocNamesModelRO
Returns:
the identifier of the primary language

GetPrimaryName

public java.lang.String GetPrimaryName()
MES- GetPrimaryName is used by controls to find out the primary name for the object we're editing

Specified by:
GetPrimaryName in interface ILocNamesModelRO
Returns:
the primary name of the object

HasMandatoryLang

public boolean HasMandatoryLang()
Does the portal have a mandatory language?

Specified by:
HasMandatoryLang in interface ILocNamesModelRO
Returns:

SupportsLocalization

public boolean SupportsLocalization()
Does the object support localization at all?

Specified by:
SupportsLocalization in interface ILocNamesModelRO
Returns:

GetRowToEdit

public int GetRowToEdit()
Specified by:
GetRowToEdit in interface ILocNamesModelRO
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 ILocNamesModelRO
Returns:
PTImageType
See Also:
com.plumtree.uiinfrastructure.expandablelist.GrowableListModel#GetRowIcon()

InitializeNameDescEditor

public void InitializeNameDescEditor(IPTLocalizable objToEdit,
                                     int _nListKey)
Initializes the expandable list.

Parameters:
objToEdit - is the IPTObject to be edited

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 -

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.

Overrides:
SaveSection in class ExpListModel
Parameters:
_htFormData -
Returns:
int Status for server side validation

SetIsLocalized

public void SetIsLocalized(boolean bIsLocalized)
MES- SetIsLocalized is used by controls to set the IsLocalized flag on the object we're editing. See comments in SaveSection

Specified by:
SetIsLocalized in interface ILocNamesModel
Parameters:
bIsLocalized - indicates if the object supports localization

SetPrimaryLang

public void SetPrimaryLang(java.lang.String sPrimaryLang)
MES- SetPrimaryLang is used by controls to set the primary language on the object we're editing. See comments in SaveSection

Specified by:
SetPrimaryLang in interface ILocNamesModel
Parameters:
sPrimaryLang - is the identifier of the new primary language

SetRowToEdit

public void SetRowToEdit(int nRowToEdit)
Specified by:
SetRowToEdit in interface ILocNamesModel
Parameters:
nRowToEdit -

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 -

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.

GetObjectID

public int GetObjectID()
Specified by:
GetObjectID in interface ILocNamesModelRO
Returns:

GetObjectUUID

public java.lang.String GetObjectUUID()
Specified by:
GetObjectUUID in interface ILocNamesModelRO
Returns:

GetClassID

public int GetClassID()
Specified by:
GetClassID in interface ILocNamesModelRO
Returns:
See Also:
ILocNamesModelRO.GetClassID()



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