com.plumtree.server
Interface IPTMigrationManager

All Superinterfaces:
IPTUnknown

public interface IPTMigrationManager
extends IPTUnknown

This interface manages the Import and Export of migration packages of Plumtree objects into/out of a system. It also provides methods used by the UI to perform various queries related to migration.


Method Summary
 void BulkSetMigrationStatus(int nClassID, int[] iaObjectIDs, int nMigrationStatus, java.lang.String strMigrationComment)
          Sets the migration status of the specified objects to have the passed-in migration status.
 boolean CheckObjectCreationRights()
          Checks whether or not the calling user has sufficient activity rights to create all objects contained in the package.
 IPTMigrationElement CreateEmptyMigrationElement()
          Creates an empty IPTMigrationElement.
 void EndExport()
          Writes and closes the migration package file.
 void EndImport()
          Closes the migration package currently open for import.
 IPTMigrationElement ExportObject(int nClassID, int nObjectID, com.plumtree.openfoundation.util.IXPPropertyBag pMigrationConfigBag)
          Exports a single object into an IPTMigrationElement.
 java.lang.String GenerateNewUUID()
          Generates a new Universally Unique Identifier (UUID).
 int GetObjectCount(int nClassID)
          Returns the count of objects of the specified classID in the currently loaded migration package.
 java.lang.String GetPackageSourcePortalUUID()
          Returns the source portal UUID where the currently loaded migration package was created.
 java.lang.String GetPackageSourcePortalVersion()
          Returns the portal version of the portal on which the currently loaded migration package was created.
 IPTMigratable InflateObjectForImport(IPTMigrationElement pMigrationElement, com.plumtree.openfoundation.util.IXPPropertyBag pMigrationConfigBag)
          Populates an in-memory instance of an object using the passed in IPTMigrationElement.
 void InitializeForExport(java.lang.String strMigrationPackagePath)
          Initializes the migration manager for export and opens an empty migration package at the specified file system path.
 void InitializeForImport(java.lang.String strMigrationPackagePath)
          Initializes the migration manager for import.
 java.lang.String LookupMappingInProfile(java.lang.String strSourcePortalUUID, java.lang.String strSourceUUID)
          Retrieves a migration mapping from the database, if it exists.
 boolean ObjectExistsInPackage(java.lang.String strUUID)
          Checks whether or not the object with the specified UUID exists in the currently loaded migration package.
 boolean ObjectExistsInSystem(IPTMigrationElement ptME)
          Checks whether or not the object serialized in the specified IPTMigrationElement already exists in the portal system.
 void PurgeMigrationProfile(java.lang.String strSourcePortalUUID)
          Clears all migration mappings associated with the specified portal UUID from the database.
 IPTQueryResult QueryMigrationHistory(int nClassID, int nObjectID)
          Queries the migration history for a specified object.
 int QueryMigrationStatus(int nClassID, int nObjectID)
          Queries migration status for a specified object.
 IPTQueryResult QueryObjectsByStatus(int nClassID, int nStatus, int nSkipRows, int nMaxRows, java.lang.Object[][] arQueryFilter)
          This function returns a QueryResult with PT_PROPID_NAME, PT_PROPID_DESCRIPTION, PT_PROPID_ISLOCALIZED, PT_PROPID_CLASSID, PT_PROPID_OBJECTID, PT_PROPID_UUID, PT_PROPID_MIGRATION_DATE, and PT_PROPID_MIGRATION_COMMENT for all objects with the passed in values nClassID and nStatus.
 IPTQueryResult QueryObjectsByStatusCount(int nStatus, java.lang.Object[][] arQueryFilter)
          This function returns a QueryResult with PT_PROPID_NAME, PT_PROPID_DESCRIPTION, PT_PROPID_ISLOCALIZED, PT_PROPID_CLASSID, PT_PROPID_OBJECTID, PT_PROPID_UUID, PT_PROPID_MIGRATION_DATE, and PT_PROPID_MIGRATION_COMMENT for all objects with the passed in value of nStatus.
 IPTQueryResult QueryStatusForMigrationRequestor(int nClassID, int nSkipRows, int nMaxRows)
          Queries migration status of all objects for which the calling user requested migration.
 IPTQueryResult QueryStatusForMigrationRequestorCount()
          Queries the count of all objects for which the calling user requested migration, grouped by classID.
 java.lang.String ReadUserDataItemFromPackage(java.lang.String strName)
          Reads a user-specified metadata item from the currently loaded migration package.
 java.lang.String[] RetrieveAllUserDataNames()
          Retrieves an array of all user-specified metadata names.
 IPTMigrationElement RetrieveObjectFromImportPackage(int nIndex, int nClassID)
          Retrieves a single IPTMigrationElement from the migration package.
 void StoreMappingInProfile(java.lang.String strSourcePortalUUID, java.lang.String strSourceUUID, java.lang.String strMappedUUID)
          Stores a migration mapping in the database.
 void StoreObjectInExportPackage(IPTMigrationElement ptME)
          Stores an IPTMigrationElement into the migration package.
 void UpdateHistory(IPTMigrationElement pMigrationElement)
          Adds a history item to the migration history for the specified object.
 java.lang.Object[] UUIDToObjectID(java.lang.String strUUID)
          Converts a UUID to its (classID, objectID) equivalent on the local system, if it exists.
 void WriteUserDataItemToPackage(java.lang.String strName, java.lang.String strValue)
          Writes a user-specified metadata item to the migration package.
 
Methods inherited from interface com.plumtree.server.IPTUnknown
GetInterfaces
 

Method Detail

QueryObjectsByStatus

public IPTQueryResult QueryObjectsByStatus(int nClassID,
                                           int nStatus,
                                           int nSkipRows,
                                           int nMaxRows,
                                           java.lang.Object[][] arQueryFilter)
This function returns a QueryResult with PT_PROPID_NAME, PT_PROPID_DESCRIPTION, PT_PROPID_ISLOCALIZED, PT_PROPID_CLASSID, PT_PROPID_OBJECTID, PT_PROPID_UUID, PT_PROPID_MIGRATION_DATE, and PT_PROPID_MIGRATION_COMMENT for all objects with the passed in values nClassID and nStatus. Used by the UI, requires admin access.
Parameters:
nClassID - the class of interest, from PT_CLASSIDS
nStatus - the status of interest, from PT_MIGRATION_STATUS_TYPES
nSkipRows - number of rows to skip at the beginning, or 0 for none
nMaxRows - maximum number of rows to return, or -1 for all
arQueryFilter - is a 2D array with 3 columns. The first column holds the property id, from PT_PROPIDS. The second column holds the operator, from PT_FILTEROPS. The third column holds the value to be matched.
Returns:
IPTQueryResult containing the records of interest
See Also:
PT_CLASSIDS, PT_MIGRATION_STATUS_TYPES, PT_PROPIDS, PT_ORDERBY_SETTINGS

GetObjectCount

public int GetObjectCount(int nClassID)
Returns the count of objects of the specified classID in the currently loaded migration package.
Parameters:
nClassID - - The classID of objects to count.
Returns:
The count of objects.

PurgeMigrationProfile

public void PurgeMigrationProfile(java.lang.String strSourcePortalUUID)
Clears all migration mappings associated with the specified portal UUID from the database.
Parameters:
strSourcePortalUUID - - The portal UUID to clear mappings for.

ObjectExistsInSystem

public boolean ObjectExistsInSystem(IPTMigrationElement ptME)
Checks whether or not the object serialized in the specified IPTMigrationElement already exists in the portal system.
Parameters:
ptME - - The IPTMigrationElement being imported.
Returns:
true if the object already exists, false otherwise.

ObjectExistsInPackage

public boolean ObjectExistsInPackage(java.lang.String strUUID)
Checks whether or not the object with the specified UUID exists in the currently loaded migration package.
Parameters:
strUUID - - The UUID to check cor.
Returns:
true if the object exists in the package, false otherwise.

CreateEmptyMigrationElement

public IPTMigrationElement CreateEmptyMigrationElement()
Creates an empty IPTMigrationElement.
Returns:
IPTMigrationElement

UUIDToObjectID

public java.lang.Object[] UUIDToObjectID(java.lang.String strUUID)
Converts a UUID to its (classID, objectID) equivalent on the local system, if it exists.
Parameters:
strUUID - - The UUID to look up.
Returns:
A 1-D array containing the objectID and classID, can be indexed using values from the PT_MIGRATION_OBJECT_COLS enumeration.

QueryObjectsByStatusCount

public IPTQueryResult QueryObjectsByStatusCount(int nStatus,
                                                java.lang.Object[][] arQueryFilter)
This function returns a QueryResult with PT_PROPID_NAME, PT_PROPID_DESCRIPTION, PT_PROPID_ISLOCALIZED, PT_PROPID_CLASSID, PT_PROPID_OBJECTID, PT_PROPID_UUID, PT_PROPID_MIGRATION_DATE, and PT_PROPID_MIGRATION_COMMENT for all objects with the passed in value of nStatus. Used by the UI.
Parameters:
nStatus - the status of interest, from PT_MIGRATION_STATUS_TYPES
arQueryFilter - is a 2D array with 3 columns. The first column holds the property id, from PT_PROPIDS. The second column holds the operator, from PT_FILTEROPS. The third column holds the value to be matched.
Returns:
IPTQueryResult containing the records of interest
See Also:
PT_MIGRATION_STATUS_TYPES, PT_PROPIDS, PT_ORDERBY_SETTINGS

InitializeForExport

public void InitializeForExport(java.lang.String strMigrationPackagePath)
Initializes the migration manager for export and opens an empty migration package at the specified file system path.
Parameters:
strMigrationPackagePath - - The full path to the migration package file.

StoreObjectInExportPackage

public void StoreObjectInExportPackage(IPTMigrationElement ptME)
Stores an IPTMigrationElement into the migration package. For use on export only.
Parameters:
ptME - The IPTMigrationElement to store.

EndExport

public void EndExport()
Writes and closes the migration package file. This method should be called once all objects have been added to the migration package; otherwise the file will not be written. For use on export only.

ExportObject

public IPTMigrationElement ExportObject(int nClassID,
                                        int nObjectID,
                                        com.plumtree.openfoundation.util.IXPPropertyBag pMigrationConfigBag)
Exports a single object into an IPTMigrationElement. For use on export only.
Parameters:
nClassID - - The classID of the object to export.
nObjectID - - The objectID of the object to export.
pMigrationConfigBag - - A configuration propertybag containing parameters that specify whether or not to include ACL information and EOD information, for example, in the serialized IPTMigrationElement.
Returns:
IPTMigrationElement representing the object.

InitializeForImport

public void InitializeForImport(java.lang.String strMigrationPackagePath)
Initializes the migration manager for import. Loads the package at the specified file system path.
Parameters:
strMigrationPackagePath - - The full path to the package to be imported.

StoreMappingInProfile

public void StoreMappingInProfile(java.lang.String strSourcePortalUUID,
                                  java.lang.String strSourceUUID,
                                  java.lang.String strMappedUUID)
Stores a migration mapping in the database.
Parameters:
strSourcePortalUUID - - The UUID of the portal where the source object came from.
strSourceUUID - - The UUID of the object to be mapped.
strMappedUUID - - The UUID of the replacement object on the local system.

LookupMappingInProfile

public java.lang.String LookupMappingInProfile(java.lang.String strSourcePortalUUID,
                                               java.lang.String strSourceUUID)
Retrieves a migration mapping from the database, if it exists.
Parameters:
strSourcePortalUUID - - The UUID of the portal where the source object came from.
strSourceUUID - - The UUID of the object to be mapped.
Returns:
The UUID of the replacement object on the local system.

RetrieveObjectFromImportPackage

public IPTMigrationElement RetrieveObjectFromImportPackage(int nIndex,
                                                           int nClassID)
Retrieves a single IPTMigrationElement from the migration package. For use on import only.
Parameters:
nIndex - - The index of the object in the array. The upper bound for this is obtained using the GetObjectCount(nClassID) call.
nClassID - - The classID of the object.
Returns:
IPTMigrationElement

EndImport

public void EndImport()
Closes the migration package currently open for import. For use on import only.

CheckObjectCreationRights

public boolean CheckObjectCreationRights()
Checks whether or not the calling user has sufficient activity rights to create all objects contained in the package.
Returns:
true if the user has all the needed activity rights, false otherwise.

InflateObjectForImport

public IPTMigratable InflateObjectForImport(IPTMigrationElement pMigrationElement,
                                            com.plumtree.openfoundation.util.IXPPropertyBag pMigrationConfigBag)
Populates an in-memory instance of an object using the passed in IPTMigrationElement. The parameters of this process are controlled by the passed in IXPPropertyBag that containst configuration information.
Parameters:
pMigrationElement - - The IPTMigrationElement to use to populate the object.
pMigrationConfigBag - - The configuration Propertybag.
Returns:
IPTMigratable

GetPackageSourcePortalUUID

public java.lang.String GetPackageSourcePortalUUID()
Returns the source portal UUID where the currently loaded migration package was created. For use on import only.
Returns:
The source portal's UUID.

GetPackageSourcePortalVersion

public java.lang.String GetPackageSourcePortalVersion()
Returns the portal version of the portal on which the currently loaded migration package was created. For use on import only.
Returns:
The version string

BulkSetMigrationStatus

public void BulkSetMigrationStatus(int nClassID,
                                   int[] iaObjectIDs,
                                   int nMigrationStatus,
                                   java.lang.String strMigrationComment)
Sets the migration status of the specified objects to have the passed-in migration status. The permissions on this method are checked as follows: Admins have rights to set any object to any status. Non-admins can set objects to the following access levels given the constraints: PT_MIGRATION_STATUS_NONE - only if the calling user was the last migration requestor, and the current status of the object is *not* PT_MIGRATION_STATUS_APPROVED PT_MIGRATION_STATUS_APPROVAL_REQUESTED - if the calling user has Edit access on the objects being marked for the request PT_MIGRATION_STATUS_APPROVED, PT_MIGRATION_STATUS_DENIED, and PT_MIGRATION_STATUS_MIGRATED can only be set on objects by users with admin access.
Parameters:
nClassID - - ClassID of the objects, from the PT_CLASSIDS enumeration.
iaObjectIDs - - Array of objectIDs of the objects to set migration status for.
nMigrationStatus - - The migration status to set, from the PT_MIGRATION_STATUS_TYPES enumeration.
strMigrationComment - - The migration comment to use for the objects. Ignored when setting status to PT_MIGRATION_STATUS_NONE or PT_MIGRATION_STATUS_MIGRATED.

QueryMigrationStatus

public int QueryMigrationStatus(int nClassID,
                                int nObjectID)
Queries migration status for a specified object.
Parameters:
nClassID - - The classID of the object to query, from PT_CLASSIDS.
nObjectID - - The objectID of the object to query.
Returns:
A value from the PT_MIGRATION_STATUS_TYPES enumeration describing the migration status.

QueryMigrationHistory

public IPTQueryResult QueryMigrationHistory(int nClassID,
                                            int nObjectID)
Queries the migration history for a specified object.
Parameters:
nClassID - - The classID of the object to query, from PT_CLASSIDS.
nObjectID - - The objectID of the object to query.
Returns:
IPTQueryResult containing PT_PROPID_NAME, PT_PROPID_DESCRIPTION, PT_PROPID_ISLOCALIZED, PT_PROPID_OBJECTID, PT_PROPID_CLASSID, PT_PROPID_UUID, PT_PROPID_MIGRATION_STATUS, PT_PROPID_MIGRATION_COMMENT, PT_PROPID_MIGRATION_DATE, PT_PROPID_MIGRATION_SOURCEPORTALUUID.
See Also:
PT_PROPIDS

UpdateHistory

public void UpdateHistory(IPTMigrationElement pMigrationElement)
Adds a history item to the migration history for the specified object.
Parameters:
pMigrationElement - - The migration element containing object metadata and history (migration comment).

QueryStatusForMigrationRequestor

public IPTQueryResult QueryStatusForMigrationRequestor(int nClassID,
                                                       int nSkipRows,
                                                       int nMaxRows)
Queries migration status of all objects for which the calling user requested migration.
Parameters:
nClassID - - The classID of objects to query, from the PT_CLASSIDS enumeration.
nSkipRows - - The number of rows to skip. Pass 0 to start at the beginning.
nMaxRows - - The maximum row index to return, pass in -1 to return all rows.
Returns:
IPTQueryResult with PT_PROPID_NAME, PT_PROPID_DESCRIPTION, PT_PROPID_CLASSID, PT_PROPID_OBJECTID, PT_PROPID_UUID, PT_MIGRATION_STATUS, PT_MIGRATION_DATE, PT_MIGRATION_COMMENT for all objects of the given ClassID for which the calling user is listed as the last Migration Requestor.

QueryStatusForMigrationRequestorCount

public IPTQueryResult QueryStatusForMigrationRequestorCount()
Queries the count of all objects for which the calling user requested migration, grouped by classID.
Returns:
IPTQueryResult with PT_PROPID_CLASSID, PT_PROPID_OBJECTCOUNT.

ReadUserDataItemFromPackage

public java.lang.String ReadUserDataItemFromPackage(java.lang.String strName)
Reads a user-specified metadata item from the currently loaded migration package. For use on import only.
Parameters:
strName - - The name of the metadata item to retrieve.
Returns:
The associated value.

WriteUserDataItemToPackage

public void WriteUserDataItemToPackage(java.lang.String strName,
                                       java.lang.String strValue)
Writes a user-specified metadata item to the migration package. For use on export only.
Parameters:
strName - - The name of the metadata item to store.
strValue - - The value to associate.

RetrieveAllUserDataNames

public java.lang.String[] RetrieveAllUserDataNames()
Retrieves an array of all user-specified metadata names. The associated values can be retrieved by iterating through the array and calling ReadUserDataItemFromPackage on the desired items.
Returns:
1-D Array of strings.

GenerateNewUUID

public java.lang.String GenerateNewUUID()
Generates a new Universally Unique Identifier (UUID).
Returns:
The UUID as a string.


Copyright © 2003 Plumtree Software Inc. All Rights Reserved.