It's all about the answers!

Ask a question

Reload/Synchronize Sandbox with Plain Java API


Carmelo Merino (931313) | asked Jan 29 '15, 2:53 a.m.
edited Jan 29 '15, 2:54 a.m.
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:

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!

One answer



permanent link
Carmelo Merino (931313) | answered Feb 23 '15, 5:27 a.m.
Finally I decided to also change the sandbox code and then run a metadata synchronization. I'm not specially satisfied with this solution, but it works ...

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.