com.plumtree.portaluiinfrastructure.editor.saveobject
Class SaveObjectModel

java.lang.Object
  extended by com.plumtree.portaluiinfrastructure.editor.saveobject.SaveObjectModel
All Implemented Interfaces:
ISaveObjectModelRO, IManagedObject, IModel, IModelRO, IMVCObject, IRepostModel

public class SaveObjectModel
extends java.lang.Object
implements IRepostModel, ISaveObjectModelRO

This is the Model class for the Save object pop-up. We use it to store the state of the save object pop-up, except for the security page and the folder tree. The Security page is part of the Object Editor AS which is the parent space of this one. The Folder Tree is a sub space.

Author:
Julie Fournier

Field Summary
protected  SaveObjectAS m_asOwner
          Parent Activity Space.
protected  boolean m_bDisableDescription
          For some objects, you can't set/change the description from the Editor.
protected  int m_nCurrentTab
          Flag to know on which tab we are: folder tree or security.
protected  java.lang.String m_sFolderName
          Folder Name.
static java.lang.String RECENT_FOLDERS_COOKIE_NAME
          Class Name for the Activity Space.
static java.lang.String SAVEOBJECT_FOLDERTREE_SUBSPACEKEY
          Key to store the folder tree as a sub space.
static int SAVEOBJECT_TAB_FOLDERTREE
          Constant to identify the folder tree page in the body frame.
static int SAVEOBJECT_TAB_SECURITY
          Constant to identify the security page in the body frame.
static java.lang.String STR_MVC_CLASS_NAME
          Class Name for the Activity Space.
 
Constructor Summary
SaveObjectModel()
           
 
Method Summary
 void AddAdminFolderIDToCookie(IXPRequest _xpRequest, IWebData _webdata)
          Adds the selected admin folder ID to Cookie.
 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.
 java.lang.Object Create()
          This method is used by the ASManager to return new instances of managed objects.
 void Finish()
          Implement some code to execute when the user clicks on "Finish".
 boolean ForceSaveInFolder()
          Returns the Folder ID in which the Object will be saved.
 int GetAdminFolderID()
          Returns the admin folder ID.
 int GetCurrentTab()
          Returns the ID of the current selected tab.
 java.lang.String GetFolderName()
          Returns the folder name.
 java.lang.String GetName()
          Return the name of the MVC object.
 java.lang.String GetObjectDescription()
          Returns the description of the Object being created.
 java.lang.String GetObjectName()
          Returns the name of the Object being created.
 java.lang.Object[][] GetRecentlyUsedFolders()
          Returns the array of most recently used folder IDs and names.
 Redirect GetRedirectAfterFinish()
          Returns the Redirect object (this is were we need to go at the end of the Editor).
 boolean GetRepostBodyFromBottomFrame()
          Returns true if the body frame should be reposted from the bottom frame.
 boolean GetRepostBodyFromTopFrame()
          Returns true if the body frame should be reposted from the top frame.
 boolean GetRepostTreeAndSave()
          Returns true if the tree frame should be reposted from the recent folders frame.
 boolean GetRepostTreeRecentFoldersFrame()
          Returns true if the tree frame should be reposted from the recent folders frame.
 java.lang.String GetTitle()
          Returns the title for the browser.
 boolean HideSecurityTab()
          Returns true if the current Object doesn't support ACLs and the security tab should not be displayed.
 void Init(AActivitySpace parent)
          This method initializes the model.
 void InitializeSaveObjectPopUp(IXPRequest _xpRequest)
          This methods should be called when the pop-up is displayed for the 1st time.
 void InitRecentlyUsedFolders(IXPRequest _xpRequest)
          Adds the selected admin folder ID to Cookie.
 boolean IsAdminFolderInRecentFolders(int _nFolderID)
          Returns true if the current admin folder is one of the recently used folders.
 boolean IsCurrentObjectCommunity()
          Returns true if the current object is a community.
 boolean IsDescriptionDisabled()
          Returns true if the object description cannot be set/changed from the Editor.
 boolean IsMigrationApproved()
          Returns true if the migration has already been approved for the current object.
 boolean IsSysAdmin()
          Returns true if the current user has system administrator activity rights.
protected  void SaveAdminFolderID(XPHashtable _htFormData)
          Saves the new folder ID and set it in the Object.
protected  void SaveNameDesc(XPHashtable _htFormData)
          Saves name and description..
 int SavePage(java.lang.String _sPageName, XPHashtable _htFormData)
          Calls the right save function according to the page name passed in argument.
protected  void SaveTab(XPHashtable _htFormData)
          Saves the new tab ID.
 void SetRepostBodyFromBottomFrame(boolean _bRepostBodyFromBottomFrame)
          Sets a flag to know if the body frame should be reposted from the bottom frame.
 void SetRepostBodyFromTopFrame(boolean _bRepostBodyFromTopFrame)
          Sets a flag to know if the body frame should be reposted from the top frame.
 void SetRepostTreeAndSave(boolean _bRepostTreeAndSave)
          Sets a flag to know if the tree frame should be reposted from the recent folders frame.
 void SetRepostTreeRecentFoldersFrame(boolean _bRepostTreeRecentFoldersFrame)
          Sets a flag to know if the tree frame should be reposted from the recent folders frame.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

RECENT_FOLDERS_COOKIE_NAME

public static final java.lang.String RECENT_FOLDERS_COOKIE_NAME
Class Name for the Activity Space.

See Also:
Constant Field Values

SAVEOBJECT_FOLDERTREE_SUBSPACEKEY

public static final java.lang.String SAVEOBJECT_FOLDERTREE_SUBSPACEKEY
Key to store the folder tree as a sub space.

See Also:
Constant Field Values

SAVEOBJECT_TAB_FOLDERTREE

public static final int SAVEOBJECT_TAB_FOLDERTREE
Constant to identify the folder tree page in the body frame.

See Also:
Constant Field Values

SAVEOBJECT_TAB_SECURITY

public static final int SAVEOBJECT_TAB_SECURITY
Constant to identify the security page in the body frame.

See Also:
Constant Field Values

m_asOwner

protected SaveObjectAS m_asOwner
Parent Activity Space.


m_sFolderName

protected java.lang.String m_sFolderName
Folder Name.


m_bDisableDescription

protected boolean m_bDisableDescription
For some objects, you can't set/change the description from the Editor.


m_nCurrentTab

protected int m_nCurrentTab
Flag to know on which tab we are: folder tree or security.

Constructor Detail

SaveObjectModel

public SaveObjectModel()
Method Detail

AddAdminFolderIDToCookie

public void AddAdminFolderIDToCookie(IXPRequest _xpRequest,
                                     IWebData _webdata)
Adds the selected admin folder ID to Cookie.

Parameters:
_xpRequest -
_webdata -

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

Create

public java.lang.Object Create()
Description copied from interface: IManagedObject
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();)
See Also:
IManagedObject.Create()

Finish

public void Finish()
Description copied from interface: IRepostModel
Implement some code to execute when the user clicks on "Finish".

Specified by:
Finish in interface IRepostModel
See Also:
IRepostModel.Finish()

IsCurrentObjectCommunity

public boolean IsCurrentObjectCommunity()
Returns true if the current object is a community.

Specified by:
IsCurrentObjectCommunity in interface ISaveObjectModelRO
Returns:
boolean
See Also:
IsCurrentObjectCommunity()

ForceSaveInFolder

public boolean ForceSaveInFolder()
Returns the Folder ID in which the Object will be saved.

Specified by:
ForceSaveInFolder in interface ISaveObjectModelRO
Returns:
boolean
See Also:
ForceSaveInFolder()

GetAdminFolderID

public int GetAdminFolderID()
Returns the admin folder ID.

Specified by:
GetAdminFolderID in interface ISaveObjectModelRO
Returns:
int
See Also:
GetAdminFolderID()

GetCurrentTab

public int GetCurrentTab()
Returns the ID of the current selected tab.

Specified by:
GetCurrentTab in interface ISaveObjectModelRO
Returns:
int
See Also:
GetCurrentTab()

GetFolderName

public java.lang.String GetFolderName()
Returns the folder name.

Specified by:
GetFolderName in interface ISaveObjectModelRO
Returns:
String
See Also:
GetFolderName()

GetName

public java.lang.String GetName()
Description copied from interface: IMVCObject
Return the name of the MVC object.

Specified by:
GetName in interface IMVCObject
Returns:
the name of the object.
See Also:
IMVCObject.GetName()

GetObjectDescription

public java.lang.String GetObjectDescription()
Returns the description of the Object being created.

Specified by:
GetObjectDescription in interface ISaveObjectModelRO
Returns:
String
See Also:
GetObjectDescription()

GetObjectName

public java.lang.String GetObjectName()
Returns the name of the Object being created.

Specified by:
GetObjectName in interface ISaveObjectModelRO
Returns:
String
See Also:
GetObjectName()

GetRecentlyUsedFolders

public java.lang.Object[][] GetRecentlyUsedFolders()
Returns the array of most recently used folder IDs and names.

Specified by:
GetRecentlyUsedFolders in interface ISaveObjectModelRO
Returns:
Object[][]
See Also:
GetRecentlyUsedFolders()

GetRedirectAfterFinish

public Redirect GetRedirectAfterFinish()
Description copied from interface: IRepostModel
Returns the Redirect object (this is were we need to go at the end of the Editor).

Specified by:
GetRedirectAfterFinish in interface IRepostModel
Returns:
Redirect
See Also:
IRepostModel.GetRedirectAfterFinish()

GetRepostBodyFromBottomFrame

public boolean GetRepostBodyFromBottomFrame()
Returns true if the body frame should be reposted from the bottom frame.

Specified by:
GetRepostBodyFromBottomFrame in interface ISaveObjectModelRO
Returns:
boolean
See Also:
GetRepostBodyFromBottomFrame()

GetRepostBodyFromTopFrame

public boolean GetRepostBodyFromTopFrame()
Returns true if the body frame should be reposted from the top frame.

Specified by:
GetRepostBodyFromTopFrame in interface ISaveObjectModelRO
Returns:
boolean
See Also:
GetRepostBodyFromTopFrame()

GetRepostTreeAndSave

public boolean GetRepostTreeAndSave()
Returns true if the tree frame should be reposted from the recent folders frame.

Specified by:
GetRepostTreeAndSave in interface ISaveObjectModelRO
Returns:
boolean
See Also:
GetRepostTreeAndSave()

GetRepostTreeRecentFoldersFrame

public boolean GetRepostTreeRecentFoldersFrame()
Returns true if the tree frame should be reposted from the recent folders frame.

Specified by:
GetRepostTreeRecentFoldersFrame in interface ISaveObjectModelRO
Returns:
boolean
See Also:
GetRepostTreeRecentFoldersFrame()

GetTitle

public java.lang.String GetTitle()
Returns the title for the browser.

Specified by:
GetTitle in interface ISaveObjectModelRO
Returns:
String
See Also:
GetTitle()

HideSecurityTab

public boolean HideSecurityTab()
Returns true if the current Object doesn't support ACLs and the security tab should not be displayed.

Specified by:
HideSecurityTab in interface ISaveObjectModelRO
Returns:
boolean
See Also:
HideSecurityTab()

IsDescriptionDisabled

public boolean IsDescriptionDisabled()
Returns true if the object description cannot be set/changed from the Editor.

Specified by:
IsDescriptionDisabled in interface ISaveObjectModelRO
Returns:
boolean
See Also:
IsDescriptionDisabled()

Init

public void Init(AActivitySpace parent)
Description copied from interface: IModel
This method initializes the model. This is called automatically when AActivitySpace.RegisterModel() is called.

Specified by:
Init in interface IModel
Parameters:
parent - the parent Activity Space
See Also:
IModel.Init(AActivitySpace)

InitRecentlyUsedFolders

public void InitRecentlyUsedFolders(IXPRequest _xpRequest)
Adds the selected admin folder ID to Cookie.

Parameters:
_xpRequest -
_webdata -

InitializeSaveObjectPopUp

public void InitializeSaveObjectPopUp(IXPRequest _xpRequest)
This methods should be called when the pop-up is displayed for the 1st time.


IsAdminFolderInRecentFolders

public boolean IsAdminFolderInRecentFolders(int _nFolderID)
Returns true if the current admin folder is one of the recently used folders.

Specified by:
IsAdminFolderInRecentFolders in interface ISaveObjectModelRO
Returns:
boolean
See Also:
com.plumtree.portaluiinfrastructure.editor.saveobject.SaveObjectModel#IsAdminFolderInRecentFolders()

IsMigrationApproved

public boolean IsMigrationApproved()
Returns true if the migration has already been approved for the current object.

Specified by:
IsMigrationApproved in interface ISaveObjectModelRO
Returns:
boolean
See Also:
IsMigrationApproved()

IsSysAdmin

public boolean IsSysAdmin()
Returns true if the current user has system administrator activity rights.

Specified by:
IsSysAdmin in interface ISaveObjectModelRO
Returns:
boolean
See Also:
IsSysAdmin()

SavePage

public int SavePage(java.lang.String _sPageName,
                    XPHashtable _htFormData)
Description copied from interface: IRepostModel
Calls the right save function according to the page name passed in argument.

Specified by:
SavePage in interface IRepostModel
Returns:
int Page status for server side validation
See Also:
IRepostModel.SavePage(String, XPHashtable)

SetRepostBodyFromBottomFrame

public void SetRepostBodyFromBottomFrame(boolean _bRepostBodyFromBottomFrame)
Sets a flag to know if the body frame should be reposted from the bottom frame.

Parameters:
_bRepostBodyFromBottomFrame -

SetRepostBodyFromTopFrame

public void SetRepostBodyFromTopFrame(boolean _bRepostBodyFromTopFrame)
Sets a flag to know if the body frame should be reposted from the top frame.

Parameters:
_bRepostBodyFromTopFrame -

SetRepostTreeAndSave

public void SetRepostTreeAndSave(boolean _bRepostTreeAndSave)
Sets a flag to know if the tree frame should be reposted from the recent folders frame.

Parameters:
_bRepostTreeAndSave -

SetRepostTreeRecentFoldersFrame

public void SetRepostTreeRecentFoldersFrame(boolean _bRepostTreeRecentFoldersFrame)
Sets a flag to know if the tree frame should be reposted from the recent folders frame.

Parameters:
_bRepostTreeRecentFoldersFrame -

SaveAdminFolderID

protected void SaveAdminFolderID(XPHashtable _htFormData)
Saves the new folder ID and set it in the Object. Also if the folder ID has changed, we re-initialize the security page as the security is based on the folder security.


SaveNameDesc

protected void SaveNameDesc(XPHashtable _htFormData)
Saves name and description..

Parameters:
_htFormData -

SaveTab

protected void SaveTab(XPHashtable _htFormData)
Saves the new tab ID.

Parameters:
_htFormData -



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