It's all about the answers!

Ask a question

How to load components from a baseline using API?

Vinod Kumar (9612010) | asked Dec 19 '11, 1:25 a.m.
retagged Dec 03 '13, 3:10 p.m. by David Lafreniere (4.6k7)
I'm working on a migration tool in which we are trying to migrate SCM data from third party repository (CMVC) to RTC along with all the history. For that we are retrieving all the baselines from CMVC and building the history using these baselines. Now to ensure that we have imported the history from CMVC correctly, we are trying to do the audit by comparing baseline data from CMVC and RTC (by downloading CMVC baselines and RTC baseline and then comparing).
Now to load the RTC components from baselines were were using the API as:

IComponentHandle componentHandle = baseline.getComponent();
IBaselineConnection blConnection = SCMPlatform.getWorkspaceManager(repository).getBaselineConnection(baseline, monitor);
IComponent component = (IComponent) repository.itemManager().fetchCompleteItem(
componentHandle, IItemManager.DEFAULT, monitor);
ILoadOperation loadOperation = IOperationFactory.instance.getLoadOperation(null);
IPath copyFileAreaRoot = new Path(PathString);
ILocation location = new PathLocation(copyFileAreaRoot);
ISandbox sandBox = FileSystemCore.getSharingManager().getSandbox(location, false);
loadOperation.requestLoadAs(sandBox, null, component.getName(), blConnection, componentHandle, component.getRootFolder());

Now above method loadOperation.requestLoadAs() has been removed from the API, how to accomplish the above task?

2 answers

permanent link
Jérôme RAULINE (2112) | answered Oct 23 '13, 3:17 a.m.
 Do I really need to create a temporary workspace with my baseline to load files ????

permanent link
Jérôme RAULINE (2112) | answered Oct 23 '13, 3:16 a.m.

I'm also interested in an answer !
In a previous version of the API, even if theses classes are not in the javadoc, the method requestLoad can use an IBaselineConnection as a parameter.

File localRoot = ...
IPath rootPath = new Path(localRoot.getCanonicalPath());
LoadDilemmaHandler handler = ...
ILoadOperation loadOp = IOperationFactory.instance.getLoadOperation(handler);
ISandbox sandbox = FileSystemCore.getSharingManager().getSandbox(new PathLocation(rootPath), false);
IBaselineConnection baselineConnection = ...
Collection<IVersionableHandle> files = ....
loadOp.requestLoad(sandbox, null, baselineConnection, files);

Your answer

Register or to post your answer.