Using AbstractMigrationHandler for Component Migration Fails
We currently have component model and the corresponding repository with data in Jazz 1.0.0.1. I am trying to migrate this data to Jazz 2 repository. I have written a specific migration handler which extends AbstractMigrationHandler and just overrides the preSave() method as follows.
----------------------------------------------------------------------------------
@Override
public IItem preSave(IItem item, boolean isCurrent, IUnknownProperties unknownProperties) throws TeamRepositoryException {
// links are public
System.out.println("Setting context id to public");
setPublicContext(item);
return item;
}
----------------------------------------------------------------------------------
Also in the plugin.xml - i have this proper extension point definition.
---------------------------------------------------------------------------------
<extension>
<migrationHandler>
<extensionService>
</extensionService>
</migrationHandler>
</extension>>
-------------------------------------------------------------------------------------
The component Id to which the model is attached is "com.example.model" and i have the MyMigrationHandler to do the migration.
However, when i try run the repotools -import, there are errors in the log as follows:
------------------------------------------------------------------------------------
Required property must not be null: contextId
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.failIfNecessary(RdbRepositoryDataMediator.java:366)
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.validateItem(RdbRepositoryDataMediator.java:348)
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.importItem(RdbRepositoryDataMediator.java:2267)
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.importSimpleItem(RdbRepositoryDataMediator.java:2243)
at com.ibm.team.repository.service.internal.RepositoryImportService.doImportSimpleItem(RepositoryImportService.java:274)
at com.ibm.team.repository.service.internal.RepositoryImportService.access$6(RepositoryImportService.java:266)
------------------------------------------------------------------------------------
Look like the MyMigrationHandler.preSave never gets executed.
Can someone help me here?
----------------------------------------------------------------------------------
@Override
public IItem preSave(IItem item, boolean isCurrent, IUnknownProperties unknownProperties) throws TeamRepositoryException {
// links are public
System.out.println("Setting context id to public");
setPublicContext(item);
return item;
}
----------------------------------------------------------------------------------
Also in the plugin.xml - i have this proper extension point definition.
---------------------------------------------------------------------------------
<extension>
<migrationHandler>
<extensionService>
</extensionService>
</migrationHandler>
</extension>>
-------------------------------------------------------------------------------------
The component Id to which the model is attached is "com.example.model" and i have the MyMigrationHandler to do the migration.
However, when i try run the repotools -import, there are errors in the log as follows:
------------------------------------------------------------------------------------
Required property must not be null: contextId
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.failIfNecessary(RdbRepositoryDataMediator.java:366)
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.validateItem(RdbRepositoryDataMediator.java:348)
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.importItem(RdbRepositoryDataMediator.java:2267)
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.importSimpleItem(RdbRepositoryDataMediator.java:2243)
at com.ibm.team.repository.service.internal.RepositoryImportService.doImportSimpleItem(RepositoryImportService.java:274)
at com.ibm.team.repository.service.internal.RepositoryImportService.access$6(RepositoryImportService.java:266)
------------------------------------------------------------------------------------
Look like the MyMigrationHandler.preSave never gets executed.
Can someone help me here?