com.plumtree.portalpages.admin.ptutilities.objectlockmanager
Class ObjectLockManagerModel

java.lang.Object
  extended by com.plumtree.uiinfrastructure.editor.EditorModel
      extended by com.plumtree.portalpages.admin.ptutilities.objectlockmanager.ObjectLockManagerModel
All Implemented Interfaces:
IObjectLockManagerModelRO, IManagedObject, IModel, IModelRO, IMVCObject, IEditorModelRO, IRepostModel

public class ObjectLockManagerModel
extends EditorModel
implements IObjectLockManagerModelRO

This class keeps an up-to-date state of all the settings for the object lock manager. It contains the set and get methods for those settings. It contains the start, save and finish methods.

Author:
John Hogan

Field Summary
static java.lang.String STR_MVC_CLASS_NAME
          The unique identifier for the class
 
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
ObjectLockManagerModel()
           
 
Method Summary
 void ChangeSort()
          Changes the sort of the locked items array.
 boolean CheckEditorAccessAndStart(XPHashtable _htFormData)
          Implements some actions to perform on start.
 java.lang.Object Create()
          This method is used by the ASManager to return new instances of managed objects.
 void DoTaskOnChangePage(java.lang.String _sNewSpaceName, java.lang.String _sNewPageName)
          DoTaskOnChangePage() Changes the classID to the ID of the page to which the user is entering.
 void Finish()
          Implement some code to execute when the user clicks on "Finish".
 java.lang.String GetAgentName(int intObjectID)
          Static method to return system agent names based on their objectids
 int GetClassID()
          Returns the classID.
 int GetLockedCount(int classID)
           
 PTGrowableSortedArrayWrapper GetLockedItems(int intClassID)
          Retrieves the list of locked items from the database, places those items into a PTSortedArrayWrapper member variable, m_arrLockedItems, then returns that member variable.
 PTGrowableSortedArrayWrapper GetLockedItemsFromHashtable(int _intClassID)
          GetLockedItemsFromHashtable() Returns the growable array of locked items for the classID of the particular view.
 java.lang.String GetName()
          Returns the Class name.
 int GetSortColumn()
          Returns the sortColumn.
 int GetSortDirection()
          Returns the sortDirection.
 boolean GetSortOnly()
          Returns whether we are just sorting the list of locked items, or whether we should retrieve new data from the database.
 void Init(AActivitySpace parent)
          Inits the Model with the IPTSession.
 int SavePage(java.lang.String _sPageName, XPHashtable _htFormData)
          Calls the right save function according to the page name passed in argument.
 void SaveValues(XPHashtable _htFormData)
          Stores the object IDs of the objects selected to be unlocked in the m_arrItemsToUnlock member variable.
 void SetClassID(int classID)
          Sets the classID.
 void SetLocks()
          SetLocks() Initializes hashtable of locked items for the current page - called from View to ensure that the correct class of objects is set.
 void SetSortColumn(int sortColumn)
          Sets the sortColumn.
 void SetSortDirection(int sortDirection)
          Sets the sortDirection.
 void SetSortOnly(boolean m_bSortOnly)
          Sets whether we are just sorting the list of locked items, or whether we should retrieve new data from the database.
 void UnlockObjects()
          UnlockObjects() Maintains the state of the hashtables that store lock/unlock object information.
 
Methods inherited from class com.plumtree.uiinfrastructure.editor.EditorModel
Cancel, CleanupAllData, CleanupTempData, DoTaskAfterStore, DoTaskBeforeStore, DoTaskOnComeBackFromSubEditor, DoTaskOnStartEditor, GetAccessToEditorPriviledges, GetCloseOnDone, GetCurrentRepostAction, GetDeleteOnCancel, GetEditorType, GetEnableApplyButton, GetEnableCancelButton, GetHideLeftNav, GetIsEditorReadOnly, GetRedirectAfterFinish, GetUserHasAccessToEditor, SetCloseOnDone, SetDeleteOnCancel, SetEditorType, SetEnableApplyButton, 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
GetEditorType, GetEnableApplyButton, GetEnableCancelButton, GetHideLeftNav, GetIsEditorReadOnly
 

Field Detail

STR_MVC_CLASS_NAME

public static final java.lang.String STR_MVC_CLASS_NAME
The unique identifier for the class

See Also:
Constant Field Values
Constructor Detail

ObjectLockManagerModel

public ObjectLockManagerModel()
Method Detail

SetClassID

public void SetClassID(int classID)
Sets the classID.

Parameters:
classID - The classID to set

GetClassID

public int GetClassID()
Returns the classID.

Specified by:
GetClassID in interface IObjectLockManagerModelRO
Returns:
int

SetSortColumn

public void SetSortColumn(int sortColumn)
Sets the sortColumn.

Parameters:
sortColumn - The sortColumn to set

GetSortColumn

public int GetSortColumn()
Returns the sortColumn.

Specified by:
GetSortColumn in interface IObjectLockManagerModelRO
Returns:
int

SetSortDirection

public void SetSortDirection(int sortDirection)
Sets the sortDirection.

Parameters:
sortDirection - The sortDirection to set

GetSortDirection

public int GetSortDirection()
Returns the sortDirection.

Specified by:
GetSortDirection in interface IObjectLockManagerModelRO
Returns:
int

SetSortOnly

public void SetSortOnly(boolean m_bSortOnly)
Sets whether we are just sorting the list of locked items, or whether we should retrieve new data from the database.

Parameters:
m_bSortOnly - The m_bSortOnly to set

GetSortOnly

public boolean GetSortOnly()
Returns whether we are just sorting the list of locked items, or whether we should retrieve new data from the database.

Specified by:
GetSortOnly in interface IObjectLockManagerModelRO
Returns:
boolean

DoTaskOnChangePage

public void DoTaskOnChangePage(java.lang.String _sNewSpaceName,
                               java.lang.String _sNewPageName)
DoTaskOnChangePage() Changes the classID to the ID of the page to which the user is entering. Next initializes the growable array of locks in the hashtable of locked objects

Overrides:
DoTaskOnChangePage in class EditorModel
Parameters:
sNewSpaceName -
sNewPageName -

ChangeSort

public void ChangeSort()
Changes the sort of the locked items array.

Parameters:
intColumn -
intDirection -

CheckEditorAccessAndStart

public boolean CheckEditorAccessAndStart(XPHashtable _htFormData)
Implements some actions to perform on start.

Specified by:
CheckEditorAccessAndStart in class EditorModel
Parameters:
_htFormData -
Returns:
boolean Is true if the current user has the rights to access this Editor.

SetLocks

public void SetLocks()
SetLocks() Initializes hashtable of locked items for the current page - called from View to ensure that the correct class of objects is set.


Create

public java.lang.Object Create()
Description copied from class: EditorModel
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 EditorModel
Returns:
A new instance of the managed class (i.e. return new Foo();)
See Also:
IManagedObject.Create()

Finish

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

Specified by:
Finish in interface IRepostModel
Specified by:
Finish in class EditorModel

GetLockedItems

public PTGrowableSortedArrayWrapper GetLockedItems(int intClassID)
Retrieves the list of locked items from the database, places those items into a PTSortedArrayWrapper member variable, m_arrLockedItems, then returns that member variable. This function is called by the view class, ObjectLockManagerView each time the page is repainted. The only reason to store the list at all is for sorting purposes. If the user resorts the list of locks, the sort column is changed, but the data is not retrieved again.

Specified by:
GetLockedItems in interface IObjectLockManagerModelRO
Returns:
PTGrowableSortedArrayWrapper

GetLockedCount

public int GetLockedCount(int classID)

GetName

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

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

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 -

SavePage

public 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
Specified by:
SavePage in class EditorModel
Parameters:
_sPageName -
_htFormData -
Returns:
int Page status for server side validation

SaveValues

public void SaveValues(XPHashtable _htFormData)
Stores the object IDs of the objects selected to be unlocked in the m_arrItemsToUnlock member variable.

Parameters:
_htFormData -

UnlockObjects

public void UnlockObjects()
UnlockObjects() Maintains the state of the hashtables that store lock/unlock object information. Does not commit to the database until the Finish(). This method is called through the RepostControl when the user selects the "Unlock" button in the UI


GetLockedItemsFromHashtable

public PTGrowableSortedArrayWrapper GetLockedItemsFromHashtable(int _intClassID)
GetLockedItemsFromHashtable() Returns the growable array of locked items for the classID of the particular view. Used to display the objects in the UI

Specified by:
GetLockedItemsFromHashtable in interface IObjectLockManagerModelRO
Returns:
PTSortedArrayWrapper

GetAgentName

public java.lang.String GetAgentName(int intObjectID)
Static method to return system agent names based on their objectids

Parameters:
intObjectID -
Returns:
strName



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