Get component baselines in Stream/Workspace/Snapshot via RTC API
Accepted answer
Marko,
I can point you to some of my examples which are client side code. I guess server side code will be similar.
Snapshot recipe:
First you need IBaselineSet snapshot;
You can get this from snapshot URL:
URI snapshotUri = URI.create(snapshotURL.replaceAll(" ", "%20"));
Location snapshotLocation = Location.location(snapshotUri);
snapshotItem = (IBaselineSet) teamRepository.itemManager()
.fetchCompleteItem(snapshotLocation, IItemManager.DEFAULT,monitor);
Then get the baselines and resolve them permission aware:
List<IBaselineHandle> snapBaseList = snapshot.getBaselines();
IFetchResult fetchResult = teamRepository.itemManager().fetchCompleteItemsPermissionAware(snapBaseList, IItemManager.DEFAULT, null);
Stream / Workspace:
They are both of class IFlowNodeConnection. This has a method
IFlowNodeConnection myStream = ... ;
List<IBaselineSetHandle> baselineSetHandles = myStream.getBaselineSets(monitor);
which returns the snapshots. Get latest snapshot and proceed as with Snapshot recipe.
If this answers your question please mark it as accepted.
- Arne
I can point you to some of my examples which are client side code. I guess server side code will be similar.
Snapshot recipe:
First you need IBaselineSet snapshot;
You can get this from snapshot URL:
URI snapshotUri = URI.create(snapshotURL.replaceAll(" ", "%20"));
Location snapshotLocation = Location.location(snapshotUri);
snapshotItem = (IBaselineSet) teamRepository.itemManager()
.fetchCompleteItem(snapshotLocation, IItemManager.DEFAULT,monitor);
Then get the baselines and resolve them permission aware:
List<IBaselineHandle> snapBaseList = snapshot.getBaselines();
IFetchResult fetchResult = teamRepository.itemManager().fetchCompleteItemsPermissionAware(snapBaseList, IItemManager.DEFAULT, null);
Stream / Workspace:
They are both of class IFlowNodeConnection. This has a method
IFlowNodeConnection myStream = ... ;
List<IBaselineSetHandle> baselineSetHandles = myStream.getBaselineSets(monitor);
which returns the snapshots. Get latest snapshot and proceed as with Snapshot recipe.
If this answers your question please mark it as accepted.
- Arne
Comments
Marko Tomljenovic
Jun 30 '15, 3:12 a.m.