com.plumtree.portaluiinfrastructure.intrinsicportlets.prefs
Class IntrinsicPortletPrefsEditorModel

java.lang.Object
  extended by com.plumtree.uiinfrastructure.editor.EditorModel
      extended by com.plumtree.portaluiinfrastructure.intrinsicportlets.prefs.IntrinsicPortletPrefsEditorModel
All Implemented Interfaces:
IIntrinsicPortletPrefsModelRO, IManagedObject, IModel, IModelRO, IMVCObject, IEditorModelRO, IRepostModel
Direct Known Subclasses:
EODPortletPrefsModel, IntrinsicPrefsEditorForPageletParametersModel, SavedSearchPortletPrefsModel, SiteMapPortletPrefsModel

public abstract class IntrinsicPortletPrefsEditorModel
extends EditorModel
implements IEditorModelRO, IIntrinsicPortletPrefsModelRO

This is the base intrinsic portlet preferences model. All intrinsic portlet models should extend this base class. This model extends the editor model.

Author:
josephc

Field Summary
protected  boolean m_bIsAdminPref
          Admin pref
protected  int m_nCommunityID
          CommunityID
protected  int m_nPageID
          PageID
protected  int m_nPortletID
          PortletID
protected  int m_nPrefType
          Preference type
protected  IPTGadget m_ptPortlet
          IPTGadget
protected  IPTSession m_ptSession
          IPTSession
protected  java.lang.String m_strPreviousURL
           
static int PREF_TYPE_ADMIN
          Preference type for admin preferences
static int PREF_TYPE_COMMUNITY
          Preference type for community preferences
static int PREF_TYPE_PERSONAL
          Preference type for personal preferences
static int SETTINGSTYPE_ADMIN
          Setting type for admin preferences
static int SETTINGSTYPE_COMMUNITY
          Setting type for community preferences
static int SETTINGSTYPE_COMMUNITYPORTLET
          Setting type for community portlet preferences
static int SETTINGSTYPE_PORTLET
          Setting type for user portlet preferences
static int SETTINGSTYPE_USER
          Setting type for user preferences
 
Fields inherited from class com.plumtree.uiinfrastructure.editor.EditorModel
isReadAccessAvailable, m_asOwner, m_bCloseOnDone, m_bDeleteOnCancel, m_bEnableApplyButton, m_bEnableCancelButton, m_bHideLeftNav, m_bIsEditorReadOnly, m_bUserHasAccessToEditor, m_nEditorType
 
Constructor Summary
IntrinsicPortletPrefsEditorModel()
           
 
Method Summary
 boolean CheckEditorAccessAndStart(XPHashtable _htFormData)
          That method is called by the EditorStartControl.
 int GetCommunityId()
          Returns the community Id if the portlet is on a community
 int GetEditorType()
          Returns the Editor Type (see EditorStartControl for constant names).
 boolean GetEnableApplyButton()
          Returns true if the apply button should be displayed.
 boolean GetHideLeftNav()
          Returns the DeleteOnCancel flag.
 boolean GetIsEditorReadOnly()
          Returns true if the current user only has read access to this Editor.
protected  IPTGadget GetPortletFromSpace(AActivitySpace asParent)
          If this model is started as a sub-editor from the Portlet editor's model, then get the portlet object from the editor model using this method.
 java.lang.String GetPortletName()
          Get portlet name
 int GetPrefType()
          Returns the type of preference that is being requested.
 Redirect GetRedirectAfterFinish()
          Returns the Redirect object (this is were we need to go at the end of the Editor).
 java.lang.Object GetSettingValue(int nSettingType, java.lang.String strName)
          Returns a single setting value, based on the setting type specified.
 java.lang.Object[][] GetSettingValues(int nSettingType, java.lang.String[] arFilter)
          Returns all settings, based on the setting type and filter specified.
 void Init(AActivitySpace parent)
          Inits the Model with the IPTSession.
protected  void InitializePortlet(XPHashtable _htFormData)
          Initialize the member variables of the model.
 void RemoveSettingValue(int nSettingType, java.lang.String strName)
          Removes a setting value, depending on the specified setting type.
 void SetEnableApplyButton(boolean _bEnableApplyButton)
          Enables or disables the apply button next to the finish button.
 void SetMemberVariablesFromQS(XPHashtable _htFormData)
          Helper method for the StartEditor method.
 void SetSettingValue(int nSettingType, java.lang.String strName, java.lang.Object oValue)
          Sets the appropriate setting value, based on the setting type.
 
Methods inherited from class com.plumtree.uiinfrastructure.editor.EditorModel
Cancel, CleanupAllData, CleanupTempData, Create, DoTaskAfterStore, DoTaskBeforeStore, DoTaskOnChangePage, DoTaskOnComeBackFromSubEditor, DoTaskOnStartEditor, Finish, GetAccessToEditorPriviledges, GetCloseOnDone, GetCurrentRepostAction, GetDeleteOnCancel, GetEnableCancelButton, GetName, GetUserHasAccessToEditor, SavePage, SetCloseOnDone, SetDeleteOnCancel, SetEditorType, SetHideLeftNav, SetPageStatus, SetUserHasAccessToEditor
 
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.editor.IEditorModelRO
GetEnableCancelButton
 
Methods inherited from interface com.plumtree.uiinfrastructure.activityspace.IMVCObject
GetName
 

Field Detail

SETTINGSTYPE_PORTLET

public static final int SETTINGSTYPE_PORTLET
Setting type for user portlet preferences

See Also:
Constant Field Values

SETTINGSTYPE_ADMIN

public static final int SETTINGSTYPE_ADMIN
Setting type for admin preferences

See Also:
Constant Field Values

SETTINGSTYPE_COMMUNITY

public static final int SETTINGSTYPE_COMMUNITY
Setting type for community preferences

See Also:
Constant Field Values

SETTINGSTYPE_COMMUNITYPORTLET

public static final int SETTINGSTYPE_COMMUNITYPORTLET
Setting type for community portlet preferences

See Also:
Constant Field Values

SETTINGSTYPE_USER

public static final int SETTINGSTYPE_USER
Setting type for user preferences

See Also:
Constant Field Values

PREF_TYPE_ADMIN

public static final int PREF_TYPE_ADMIN
Preference type for admin preferences

See Also:
Constant Field Values

PREF_TYPE_PERSONAL

public static final int PREF_TYPE_PERSONAL
Preference type for personal preferences

See Also:
Constant Field Values

PREF_TYPE_COMMUNITY

public static final int PREF_TYPE_COMMUNITY
Preference type for community preferences

See Also:
Constant Field Values

m_ptPortlet

protected IPTGadget m_ptPortlet
IPTGadget


m_ptSession

protected IPTSession m_ptSession
IPTSession


m_nCommunityID

protected int m_nCommunityID
CommunityID


m_nPageID

protected int m_nPageID
PageID


m_nPortletID

protected int m_nPortletID
PortletID


m_bIsAdminPref

protected boolean m_bIsAdminPref
Admin pref


m_nPrefType

protected int m_nPrefType
Preference type


m_strPreviousURL

protected java.lang.String m_strPreviousURL
Constructor Detail

IntrinsicPortletPrefsEditorModel

public IntrinsicPortletPrefsEditorModel()
Method Detail

CheckEditorAccessAndStart

public boolean CheckEditorAccessAndStart(XPHashtable _htFormData)
That method is called by the EditorStartControl.

Specified by:
CheckEditorAccessAndStart in class EditorModel
Parameters:
_htFormData -
Returns:
boolean Is true if the current user has the rights to access this Editor.
See Also:
com.plumtree.uiinfrastructure.editor.EditorModel#StartEditor(XPHashtable)

GetEditorType

public int GetEditorType()
Description copied from class: EditorModel
Returns the Editor Type (see EditorStartControl for constant names).

Specified by:
GetEditorType in interface IEditorModelRO
Overrides:
GetEditorType in class EditorModel
Returns:
See Also:
EditorModel.GetEditorType()

GetHideLeftNav

public boolean GetHideLeftNav()
Returns the DeleteOnCancel flag. For sub Editors only: this flag will determine if the Editor should be deleted from the list of sub Editors on cancel.

Specified by:
GetHideLeftNav in interface IEditorModelRO
Overrides:
GetHideLeftNav in class EditorModel
Returns:
boolean
See Also:
EditorModel.GetHideLeftNav()

SetEnableApplyButton

public void SetEnableApplyButton(boolean _bEnableApplyButton)
Enables or disables the apply button next to the finish button.

Overrides:
SetEnableApplyButton in class EditorModel
Parameters:
_bEnableApplyButton -

GetEnableApplyButton

public boolean GetEnableApplyButton()
Returns true if the apply button should be displayed.

Specified by:
GetEnableApplyButton in interface IEditorModelRO
Overrides:
GetEnableApplyButton in class EditorModel
Returns:
boolean
See Also:
EditorModel.GetEnableApplyButton()

GetIsEditorReadOnly

public boolean GetIsEditorReadOnly()
Returns true if the current user only has read access to this Editor. (can be true in Edit mode only)

Specified by:
GetIsEditorReadOnly in interface IEditorModelRO
Overrides:
GetIsEditorReadOnly in class EditorModel
Returns:
boolean
See Also:
EditorModel.GetIsEditorReadOnly()

GetPortletName

public java.lang.String GetPortletName()
Get portlet name

Specified by:
GetPortletName in interface IIntrinsicPortletPrefsModelRO
Returns:
Portlet name
See Also:
IIntrinsicPortletPrefsModelRO.GetPortletName()

GetPrefType

public int GetPrefType()
Returns the type of preference that is being requested.

Specified by:
GetPrefType in interface IIntrinsicPortletPrefsModelRO
Returns:
Preference type: PREF_TYPE_ADMIN, PREF_TYPE_USER or PREF_TYPE_COMMUNITY
See Also:
IIntrinsicPortletPrefsModelRO.GetPrefType()

GetRedirectAfterFinish

public Redirect GetRedirectAfterFinish()
Returns the Redirect object (this is were we need to go at the end of the Editor). For prefs pages this just closes the popup window since the prefs page should be in a popup.

Specified by:
GetRedirectAfterFinish in interface IRepostModel
Overrides:
GetRedirectAfterFinish in class EditorModel
Returns:
Redirect

GetSettingValue

public java.lang.Object GetSettingValue(int nSettingType,
                                        java.lang.String strName)
Returns a single setting value, based on the setting type specified.

Parameters:
nSettingType - Setting type
strName - Setting name
Returns:
Setting value
See Also:
com.plumtree.portaluiinfrastructure.intrinsicportlets.prefs.IIntrinsicPortletPrefsModelRO#GetSettingValue(int, String)

GetSettingValues

public java.lang.Object[][] GetSettingValues(int nSettingType,
                                             java.lang.String[] arFilter)
Returns all settings, based on the setting type and filter specified.

Parameters:
nSettingType - Setting type
arFilter - Filter for settings
Returns:
All settings
See Also:
com.plumtree.portaluiinfrastructure.intrinsicportlets.prefs.IIntrinsicPortletPrefsModelRO#GetSettingValues(int, Object[])

Init

public void Init(AActivitySpace parent)
Inits the Model with the IPTSession.

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

RemoveSettingValue

public void RemoveSettingValue(int nSettingType,
                               java.lang.String strName)
Removes a setting value, depending on the specified setting type.

Parameters:
nSettingType - Setting type
strName - Setting name

SetMemberVariablesFromQS

public void SetMemberVariablesFromQS(XPHashtable _htFormData)
Helper method for the StartEditor method. Fill out the member variables with data from QS.

Parameters:
_htFormData -

SetSettingValue

public void SetSettingValue(int nSettingType,
                            java.lang.String strName,
                            java.lang.Object oValue)
Sets the appropriate setting value, based on the setting type.

Parameters:
nSettingType - Setting type
strName - Setting name
oValue - Setting value

GetCommunityId

public int GetCommunityId()
Description copied from interface: IIntrinsicPortletPrefsModelRO
Returns the community Id if the portlet is on a community

Specified by:
GetCommunityId in interface IIntrinsicPortletPrefsModelRO
Returns:
community id

GetPortletFromSpace

protected IPTGadget GetPortletFromSpace(AActivitySpace asParent)
If this model is started as a sub-editor from the Portlet editor's model, then get the portlet object from the editor model using this method. CHANGED TO PROTECTED TO MAKE THIS METHOD MOCKABLE

Parameters:
asParent - Parent space of editor when started as a subeditor
Returns:
Portlet object from the PortletEditor's model

InitializePortlet

protected void InitializePortlet(XPHashtable _htFormData)
Initialize the member variables of the model. If the pageID is 0, then we are editing admin pref, and so get the IPTMyPortal object from the parent space and don't create an AppDataState object.

Parameters:
_htFormData - Table containing form data



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