com.plumtree.portalpages.admin.ptutilities.migrationutility
Class MigrationUtilityModel

java.lang.Object
  extended by com.plumtree.uiinfrastructure.editor.EditorModel
      extended by com.plumtree.portalpages.admin.ptutilities.migrationutility.MigrationUtilityModel
All Implemented Interfaces:
IMigrationUtilityModelRO, IManagedObject, IModel, IModelRO, IMVCObject, IEditorModelRO, IRepostModel
Direct Known Subclasses:
MigrationUtilityExportModel, MigrationUtilityImportModel

public class MigrationUtilityModel
extends EditorModel
implements IMigrationUtilityModelRO


Field Summary
protected  XPArrayList m_alMWSIDs
          Array of MWS IDs
protected  XPHashtable m_htPropBags
          Hashtable of MWS property bags to send.
protected  PTMigrationTask m_objMigrationTask
          migration thread
protected  IPTMigrationManager m_ptMigrationManager
          IPTMigrationManager.
protected  IPTSession m_ptSession
          IPTSession
protected  XPHashtable m_xphtAllObjects
          MigrationElements of all objects (don't access this directly - use GetAllObjectsInPackage instead).
static java.lang.String MWS_REMOTEDATA_DELIMITER
           
static java.lang.String MWS_REMOTEDATA_SCI_KEY
           
static java.lang.String MWS_REMOTEDATA_TYPE_ASSIGNMENT
           
static java.lang.String STR_MVC_CLASS_NAME
           
 
Fields inherited from class com.plumtree.uiinfrastructure.editor.EditorModel
m_asOwner, m_bCloseOnDone, m_bDeleteOnCancel, m_bEnableApplyButton, m_bHideLeftNav, m_bIsEditorReadOnly, m_bUserHasAccessToEditor, m_nEditorType
 
Constructor Summary
MigrationUtilityModel()
           
 
Method Summary
 void CancelMigration()
          Sets the status on the migration task to Cancel.
 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 DoLoadPackage(XPHashtable _htFormData)
          Perform action for when user loads a package.
 void DoTaskBeforeStore()
          That method contains the code that should be executed just before the object is stored in the DB.
 void Finish()
          Implement some code to execute when the user clicks on "Finish".
 XPArrayList[] GetAllObjectsInPackage()
          Gets an XPArrayList[] with all objects in the package, indexed by classID.
 XPArrayList GetAllObjectsInPackage(int nCLASSID)
          Gets an XPArrayList of all objects in the package.
 IPTMigrationManager GetMigrationManager()
          All classes in the AS should access the migration manager using this method, because the same IPTMigrationManager needs to be used for a given migration.
 int GetMigrationStatus()
          Gets the status of the migration task.
 java.lang.String GetName()
          Returns the Class name.
protected  XPArrayList GetXUIServices()
          Returns XPArrayList of Migration Web Service object IDs.
 boolean HasObjectsForMigration()
           
 void Init(AActivitySpace parent)
          Inits member variables
 void ResetMigrationManager()
          This should be called to clear any migration that has been initialized, such as when packages have been loaded.
 int SavePage(java.lang.String _sPageName, XPHashtable _htFormData)
          Calls the right save function according to the page name passed in argument.
protected  boolean StartXUIServices(java.lang.String _strXUIEditorType)
          Retrieves all Migration XUI Services and initializes them.
protected  void StartXUIServicesSafely(java.lang.String sciEditorType)
           
 
Methods inherited from class com.plumtree.uiinfrastructure.editor.EditorModel
Cancel, CleanupAllData, CleanupTempData, DoTaskAfterStore, DoTaskOnChangePage, DoTaskOnComeBackFromSubEditor, DoTaskOnStartEditor, GetCloseOnDone, GetCurrentRepostAction, GetDeleteOnCancel, GetEditorType, GetEnableApplyButton, 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, GetHideLeftNav, GetIsEditorReadOnly
 

Field Detail

STR_MVC_CLASS_NAME

public static final java.lang.String STR_MVC_CLASS_NAME
See Also:
Constant Field Values

MWS_REMOTEDATA_SCI_KEY

public static final java.lang.String MWS_REMOTEDATA_SCI_KEY
See Also:
Constant Field Values

MWS_REMOTEDATA_DELIMITER

public static final java.lang.String MWS_REMOTEDATA_DELIMITER
See Also:
Constant Field Values

MWS_REMOTEDATA_TYPE_ASSIGNMENT

public static final java.lang.String MWS_REMOTEDATA_TYPE_ASSIGNMENT
See Also:
Constant Field Values

m_ptMigrationManager

protected IPTMigrationManager m_ptMigrationManager
IPTMigrationManager. All helper models in this AS should access this MigrationManager.


m_ptSession

protected IPTSession m_ptSession
IPTSession


m_xphtAllObjects

protected XPHashtable m_xphtAllObjects
MigrationElements of all objects (don't access this directly - use GetAllObjectsInPackage instead). This contains a hashtable of arrays or MigrationElements, keyed off of the CLASSID of the MigrationElements in question.


m_objMigrationTask

protected PTMigrationTask m_objMigrationTask
migration thread


m_alMWSIDs

protected XPArrayList m_alMWSIDs
Array of MWS IDs


m_htPropBags

protected XPHashtable m_htPropBags
Hashtable of MWS property bags to send. Key=MWS ID; Value=IXPPropertyBag

Constructor Detail

MigrationUtilityModel

public MigrationUtilityModel()
Method Detail

Init

public void Init(AActivitySpace parent)
Inits member variables

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

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

GetName

public java.lang.String GetName()
Description copied from class: EditorModel
Returns the Class name.

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

CheckEditorAccessAndStart

public boolean CheckEditorAccessAndStart(XPHashtable _htFormData)
Description copied from class: EditorModel
Implements some actions to perform on start. Use the Editor Type if needed.

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

Finish

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

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

DoTaskBeforeStore

public void DoTaskBeforeStore()
Description copied from class: EditorModel
That method contains the code that should be executed just before the object is stored in the DB.

Overrides:
DoTaskBeforeStore in class EditorModel

HasObjectsForMigration

public boolean HasObjectsForMigration()
Returns:
true if objects are pending migration import/export, false if none.

SavePage

public int SavePage(java.lang.String _sPageName,
                    XPHashtable _htFormData)
Description copied from class: EditorModel
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
Returns:
int Page status for server side validation

ResetMigrationManager

public void ResetMigrationManager()
This should be called to clear any migration that has been initialized, such as when packages have been loaded.


GetMigrationManager

public IPTMigrationManager GetMigrationManager()
All classes in the AS should access the migration manager using this method, because the same IPTMigrationManager needs to be used for a given migration.

Specified by:
GetMigrationManager in interface IMigrationUtilityModelRO
Returns:
IPTMigrationManager

GetAllObjectsInPackage

public XPArrayList[] GetAllObjectsInPackage()
Gets an XPArrayList[] with all objects in the package, indexed by classID. Returns an array of IPTMigrationElements. Returns only supported CLASSIDS

Specified by:
GetAllObjectsInPackage in interface IMigrationUtilityModelRO

GetAllObjectsInPackage

public XPArrayList GetAllObjectsInPackage(int nCLASSID)
Gets an XPArrayList of all objects in the package. (based on CLASSID). Returns an array of IPTMigrationElements. Can return objects from unsupported CLASSIDS (see ObjectDeliveryHelper)


DoLoadPackage

public void DoLoadPackage(XPHashtable _htFormData)
Perform action for when user loads a package.

Parameters:
_htFormData -

CancelMigration

public void CancelMigration()
Sets the status on the migration task to Cancel. Removes the migration task from the session.


GetMigrationStatus

public int GetMigrationStatus()
Gets the status of the migration task.

Specified by:
GetMigrationStatus in interface IMigrationUtilityModelRO
Returns:
int (see PTMigrationTask for status values)

GetXUIServices

protected XPArrayList GetXUIServices()
Returns XPArrayList of Migration Web Service object IDs.


StartXUIServicesSafely

protected void StartXUIServicesSafely(java.lang.String sciEditorType)

StartXUIServices

protected boolean StartXUIServices(java.lang.String _strXUIEditorType)
Retrieves all Migration XUI Services and initializes them.

Parameters:
_strXUIEditorType -
Returns:
boolean. True if successful; false if error.



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