Reload/Synchronize Sandbox with Plain Java API
Is there a way to programatically synchronize the sandbox?
In order to reduce the administrative work of our developers, we've been working on some plugins that will change the metadata and the code itself when they deliver it. But that means that the sandbox will be actually out of sync. To avoid the lasting clicking of the Load Wizard, we've tried to found a way to directly synchronize the sandbox after the delivering (as a participant plugin). The metadata are no problem, but the reloading of the code isn't working.
My code looks like this:
The CBLoadDilemmaHandler extends the LoadDilemmaHandler and changes the collision method (the out of sync files are listed as collision, and the LoadDilemmaHandler just stops the load process in that case):
Is this the right way to reload/refresh/synchronize the sandbox? Or is there maybe another easier way? Thank you very much!
In order to reduce the administrative work of our developers, we've been working on some plugins that will change the metadata and the code itself when they deliver it. But that means that the sandbox will be actually out of sync. To avoid the lasting clicking of the Load Wizard, we've tried to found a way to directly synchronize the sandbox after the delivering (as a participant plugin). The metadata are no problem, but the reloading of the code isn't working.
My code looks like this:
IRepositoryResolver p = IRepositoryResolver.EXISTING_SHARED; CBLoadDilemmaHandler cbLoadDilemmaHandler = CBLoadDilemmaHandler.getDefault(); ILoadOperation loadOperation = IOperationFactory.instance.getLoadOperation(cbLoadDilemmaHandler);
// ILoadOperation loadOperation = IOperationFactory.instance.getLoadOperation(LoadDilemmaHandler.getDefault());
loadOperation.requestReLoad(shareList, p, new NullProgressMonitor());
loadOperation.evaluateLoadRequests(new NullProgressMonitor());
loadOperation.run(new NullProgressMonitor());
The CBLoadDilemmaHandler extends the LoadDilemmaHandler and changes the collision method (the out of sync files are listed as collision, and the LoadDilemmaHandler just stops the load process in that case):
@Override public int collision(Collection<ICollision> collisions,
Collection<IRemovedShare> removedShares,
Collection<IShareOutOfSync> sharesOutOfSync) {
return CONTINUE;
}
Is this the right way to reload/refresh/synchronize the sandbox? Or is there maybe another easier way? Thank you very much!