RTC Plain Java API: Having IWorkspace and IComponent, need IBaseline of IComponent as it is in IWorkspace
Martin Muellenberg (72●5●9)
| asked Oct 24 '13, 7:00 a.m.
retagged Dec 16 '13, 1:27 p.m. by David Lafreniere (4.8k●7)
Hello all,
I use the RTC Plain Java API 4.0.4. I have an IWorkspace and an IComponent (which is a direct child of the IWorkspace). How to get the IBaseline of the IComponent as it is contained in the IWorkspace? I don't want all IBaselines of the IComponent as I then do not know which of the IBaselines is the one in IWorkspace. Any hint is highly appreaciated. Kind regards and thanks Martin Muellenberg |
Accepted answer
Hi Martin, try importing:
com.ibm.team.scm.client.SCMPlatform
com.ibm.team.scm.client.IWorkspaceConnection
and using:
ITeamRepository repo = ...
IWorkspace workspace = ... // or just IWorkspaceHandle
IComponent component = ... // or just IComponentHandle
IProgressMonitor pm = null; // should really use a proper one
IWorkspaceConnection conn = SCMPlatform.getWorkspaceManager(repo).getWorkspaceConnection(workspace, pm);
int max = 10;
IHistoricBaselineIterator iter = conn.getBaselinesInHistory(component, max, pm)
where IHistoricBaselineIterator is kind of a page iterator, with methods getBaselines() (their handles), hasPrevious(), and getPrevious(...).
Martin Muellenberg selected this answer as the correct answer
Comments If you want to get snapshots (aka baseline sets) instead, use:
conn.getBaselineSets(pm)
Martin Muellenberg
commented Oct 26 '13, 5:43 a.m.
Hello Nick,
|
One other answer
Just to point out that com.ibm.team.scm.client.IFlowNodeConnection.getBaselinesInHistory(IComponentHandle, int, IProgressMonitor) returns baselines that "... are considered to be part of this workspace's history if this workspace's change history is built explicitly on top of previous baselines. In the very least, this result should include the component's initial baseline...".
So if you're searching instead a list of the specific stream or workspace component baselines (like what you get from ui when you right click on the component of a workspace and then you select show > baselines) you've to follow a different path, for example this link just changing for example from
|
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.