com.plumtree.uiinfrastructure.editor
Class EditorModel

java.lang.Object
  extended by com.plumtree.uiinfrastructure.editor.EditorModel
All Implemented Interfaces:
IManagedObject, IModel, IModelRO, IMVCObject, IEditorModelRO, IRepostModel
Direct Known Subclasses:
AApprovalModel, AdvancedSearchModel, AuditManagerModel, AutomationServerModel, BestBetModel, CredentialVaultManagerModel, CustomActivityModel, DiagnosticPageModel, DirPrefsModel, DirSubmitModel_D, DisplayOptModel, EditMyPagePortletLayoutModel_D, EditMyPortalPageModel, EditPortletPrefsModel, GbObjEditorModel, GlobalACLSyncMapModel, HostServicesModel, IntrinsicPortletPrefsEditorModel, JobFoldersModel, LayoutSelectionModel, LocaleSettingsModel, LocalizedStringsModel, MainActivityRightsModel, MigrationHistoryModel, MigrationLoadPackageModel, MigrationUtilityModel, ObjectLockManagerModel, ObjectSelectionModel, ObjEditorModel, ObjPropMapModel, PasswordModel, SearchServerSettingsEditorModel, SearchServerTuningEditorModel, SearchSettingsModel, SecurityMatrixModel, SetServerSettingsModel, SubportalRulesManagerModel, SubscribeMatrixModel, TagLibModel, UnsubscribeCommunitiesModel, UserInfoPropMapModel, UserLockManagerModel, UserProfileModel

public abstract class EditorModel
extends java.lang.Object
implements IRepostModel, IEditorModelRO

This is the Model class for the Editor Framework. Model classes should extend this class.

Author:
Julie Fournier

Field Summary
 boolean isReadAccessAvailable
          Setting to allow read access to all objects
 AActivitySpace m_asOwner
          Associated Activity Space
protected  boolean m_bCloseOnDone
          JF- If this is true, the framework will close the window on finish and cancel.
protected  boolean m_bDeleteOnCancel
          JF- This is for sub editors.
protected  boolean m_bEnableApplyButton
          JF- The Apply button next to the finish button is optional
protected  boolean m_bEnableCancelButton
          JF- If the user should be able to cancel the editor.
protected  boolean m_bHideLeftNav
          JF- This is to hide the left navigation
protected  boolean m_bIsEditorReadOnly
          JF- If the user only has read access to the Editor.
protected  boolean m_bUserHasAccessToEditor
          JF- Is true if the current user has access to this Editor.
protected  int m_nEditorType
          JF- This is the Editor type.
 
Constructor Summary
EditorModel()
           
 
Method Summary
 void Cancel()
          Implement some code to execute when the user clicks on "Cancel".
abstract  boolean CheckEditorAccessAndStart(XPHashtable _htFormData)
          Implements some actions to perform on start.
 void CleanupAllData()
          This method is called when an ActivitySpace is removed from the cache.
 void CleanupTempData()
          This method is called at the end of every HTTP request by the Interpreter.
abstract  java.lang.Object Create()
          This method is used by the ASManager to return new instances of managed objects.
 void DoTaskAfterStore()
          That method contains the code that should be executed just after the object has been stored in the DB.
 void DoTaskBeforeStore()
          That method contains the code that should be executed just before the object is stored in the DB.
 void DoTaskOnChangePage(java.lang.String _sNewSpaceName, java.lang.String _sNewPageName)
          This method can be implemented by classes extending this one.
 void DoTaskOnComeBackFromSubEditor()
          This method will be called when you come back to the main Editor from a sub Editor.
 void DoTaskOnStartEditor(XPHashtable _htFormData)
          That method contains the code that should be executed just after the object has been initialized when the new editor is started.
abstract  void Finish()
          Implement some code to execute when the user clicks on "Finish".
 boolean GetAccessToEditorPriviledges()
          Gets the Read Access to editors without Edit permissions in the portal
 boolean GetCloseOnDone()
          Returns the CloseOnDone flag.
 int GetCurrentRepostAction()
          Returns the current value of the repost action.
 boolean GetDeleteOnCancel()
          Returns the DeleteOnCancel flag.
 int GetEditorType()
          Returns the Editor Type (see EditorStartControl for constant names).
 boolean GetEnableApplyButton()
          Returns true if the apply button should be displayed.
 boolean GetEnableCancelButton()
          Returns true if the current user is able to cancel the Editor.
 boolean GetHideLeftNav()
          Returns the DeleteOnCancel flag.
 boolean GetIsEditorReadOnly()
          Returns true if the current user only has read access to this Editor.
abstract  java.lang.String GetName()
          Returns the Class name.
 Redirect GetRedirectAfterFinish()
          Returns the Redirect object (this is were we need to go at the end of the Editor).
 boolean GetUserHasAccessToEditor()
          Returns true if the current user has access to this Editor.
 void Init(AActivitySpace parent)
          Inits the Model with the Activity Space.
abstract  int SavePage(java.lang.String _sPageName, XPHashtable _htFormData)
          Calls the right save function according to the page name passed in argument.
 void SetCloseOnDone(boolean _bCloseOnDone)
          To tell the framework to close the window on finish or cancel.
 void SetDeleteOnCancel(boolean _bDeleteOnCancel)
          Sets the DeleteOnCancel flag.
 void SetEditorType(int _nEditorType)
          Sets the Editor Type.
 void SetEnableApplyButton(boolean _bEnableApplyButton)
          Enables or disables the apply button next to the finish button.
 void SetHideLeftNav(boolean _bHideLeftNav)
          Sets the m_bHideLeftNav flag.
 void SetPageStatus(int _nNewPageStatus)
          Sets a new Page status.
 void SetUserHasAccessToEditor(boolean _bUserHasAccessToEditor)
          Sets a new value for the m_bUserHasAccessToEditor flag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_asOwner

public AActivitySpace m_asOwner
Associated Activity Space


m_bDeleteOnCancel

protected boolean m_bDeleteOnCancel
JF- This is for sub editors. The first time we access the Editor, if the user clicks on cancel, we want to delete it from the sub Editor list.


m_bCloseOnDone

protected boolean m_bCloseOnDone
JF- If this is true, the framework will close the window on finish and cancel.


m_bHideLeftNav

protected boolean m_bHideLeftNav
JF- This is to hide the left navigation


m_bIsEditorReadOnly

protected boolean m_bIsEditorReadOnly
JF- If the user only has read access to the Editor.


m_bEnableCancelButton

protected boolean m_bEnableCancelButton
JF- If the user should be able to cancel the editor.


m_bUserHasAccessToEditor

protected boolean m_bUserHasAccessToEditor
JF- Is true if the current user has access to this Editor.


m_bEnableApplyButton

protected boolean m_bEnableApplyButton
JF- The Apply button next to the finish button is optional


m_nEditorType

protected int m_nEditorType
JF- This is the Editor type. Constants for that variable are in EditorStartControl. This is mainly to know if it's create or edit mode.


isReadAccessAvailable

public boolean isReadAccessAvailable
Setting to allow read access to all objects

Constructor Detail

EditorModel

public EditorModel()
Method Detail

Create

public abstract java.lang.Object Create()
This method is used by the ASManager to return new instances of managed objects.

Specified by:
Create in interface IManagedObject
Returns:
A new instance of the managed class (i.e. return new Foo();)

GetName

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

Specified by:
GetName in interface IMVCObject
Returns:
String

Cancel

public void Cancel()
Implement some code to execute when the user clicks on "Cancel".


CheckEditorAccessAndStart

public abstract boolean CheckEditorAccessAndStart(XPHashtable _htFormData)
Implements some actions to perform on start. Use the Editor Type if needed.

Parameters:
_htFormData -
Returns:
boolean Is true if the current user has the rights to access this Editor.

Finish

public abstract void Finish()
Implement some code to execute when the user clicks on "Finish".

Specified by:
Finish in interface IRepostModel

DoTaskAfterStore

public void DoTaskAfterStore()
That method contains the code that should be executed just after the object has been stored in the DB.


DoTaskBeforeStore

public void DoTaskBeforeStore()
That method contains the code that should be executed just before the object is stored in the DB.


GetCurrentRepostAction

public int GetCurrentRepostAction()
Returns the current value of the repost action.

Returns:
int

GetDeleteOnCancel

public boolean GetDeleteOnCancel()
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.

Returns:
boolean

GetCloseOnDone

public boolean GetCloseOnDone()
Returns the CloseOnDone flag.

Returns:
boolean

GetEditorType

public int GetEditorType()
Returns the Editor Type (see EditorStartControl for constant names).

Specified by:
GetEditorType in interface IEditorModelRO
Returns:
int
See Also:
GetEditorType()

GetEnableApplyButton

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

Specified by:
GetEnableApplyButton in interface IEditorModelRO
Returns:
boolean
See Also:
GetEnableApplyButton()

SetEnableApplyButton

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

Parameters:
_bEnableApplyButton -

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
Returns:
boolean
See Also:
GetHideLeftNav()

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
Returns:
boolean
See Also:
GetIsEditorReadOnly()

GetEnableCancelButton

public boolean GetEnableCancelButton()
Returns true if the current user is able to cancel the Editor.

Specified by:
GetEnableCancelButton in interface IEditorModelRO
Returns:
boolean
See Also:
GetEnableCancelButton()

GetRedirectAfterFinish

public Redirect GetRedirectAfterFinish()
Returns the Redirect object (this is were we need to go at the end of the Editor). By default this is going to the previous AS (the one that opened this one). But Editors can override that method if they need to redirect somewhere else.

Specified by:
GetRedirectAfterFinish in interface IRepostModel
Returns:
Redirect

GetUserHasAccessToEditor

public boolean GetUserHasAccessToEditor()
Returns true if the current user has access to this Editor. (If false the user will be redirected.)

Returns:
boolean

Init

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

Specified by:
Init in interface IModel
Parameters:
parent -

SavePage

public abstract int SavePage(java.lang.String _sPageName,
                             XPHashtable _htFormData)
Calls the right save function according to the page name passed in argument.

Specified by:
SavePage in interface IRepostModel
Parameters:
_sPageName -
_htFormData -
Returns:
int Page status for server side validation

CleanupTempData

public void CleanupTempData()
Description copied from interface: IModel
This method is called at the end of every HTTP request by the Interpreter. The Interpreter calls AActivitySpace.CleanupTempData(), which calls this method on all IModels registered using AActivitySpace.RegisterModel(). This method is intended for cleaning up temporary data that is only used for the lifetime of a single request, like DB query results.

Specified by:
CleanupTempData in interface IModel
See Also:
IModel.CleanupTempData()

CleanupAllData

public void CleanupAllData()
Description copied from interface: IModel
This method is called when an ActivitySpace is removed from the cache. The Interpreter calls AActivitySpace.CleanupAllData(), which calls this method on all IModels registered using AActivitySpace.RegisterModel(). This method is intended for releasing data stored in the server when the activity space is no longer needed, such as search objects that need to be maintained as long as the user is clicking through the search, but should be freed when the space can no longer be used. This can be used to prevent Java references to COM memory from hanging around in the long lived Java heap without cleaning up the underlying COM memory. The Java reference will still stay in the long lived heap until it gets garbage collected (which could be a while), but the COM memory should get released here. This method will not be called if an HTTPSession times out. CleanupTempData will be called before CleanupAllData.

Specified by:
CleanupAllData in interface IModel
See Also:
IModel.CleanupAllData()

DoTaskOnChangePage

public void DoTaskOnChangePage(java.lang.String _sNewSpaceName,
                               java.lang.String _sNewPageName)
This method can be implemented by classes extending this one. It will be executed each time the user changes page on the left navigation menu.

Parameters:
_sNewSpaceName -
_sNewPageName -

DoTaskOnComeBackFromSubEditor

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


DoTaskOnStartEditor

public void DoTaskOnStartEditor(XPHashtable _htFormData)
That method contains the code that should be executed just after the object has been initialized when the new editor is started.

Parameters:
_htFormData -

SetDeleteOnCancel

public void SetDeleteOnCancel(boolean _bDeleteOnCancel)
Sets 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.

Parameters:
_bDeleteOnCancel -

SetCloseOnDone

public void SetCloseOnDone(boolean _bCloseOnDone)
To tell the framework to close the window on finish or cancel.

Parameters:
_bCloseOnDone -

SetEditorType

public void SetEditorType(int _nEditorType)
Sets the Editor Type. (see EditorStartControl for constant names)

Parameters:
_nEditorType -

SetHideLeftNav

public void SetHideLeftNav(boolean _bHideLeftNav)
Sets the m_bHideLeftNav flag. If this flag is set to true, the left navigation will not be displayed.

Parameters:
_bHideLeftNav -

SetPageStatus

public void SetPageStatus(int _nNewPageStatus)
Sets a new Page status.

Parameters:
_nNewPageStatus -

SetUserHasAccessToEditor

public void SetUserHasAccessToEditor(boolean _bUserHasAccessToEditor)
Sets a new value for the m_bUserHasAccessToEditor flag.

Parameters:
_bUserHasAccessToEditor -

GetAccessToEditorPriviledges

public boolean GetAccessToEditorPriviledges()
Gets the Read Access to editors without Edit permissions in the portal

Returns:
boolean



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