Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RTC: How to get deleted components list form the stream using Java API

A list of old Components (past) which are no more part of stream currently.
How to find the name of those components ?

0 votes



3 answers

Permanent link

 In the Eclipse client, open the stream. On the button top left with the stream name click the triangle. Select Show>Operation History

0 votes

Comments

Thank you for quick response.
But i am looking for java API implementation.
If you could suggest me some sample code then it will be great.

I don't know the SCM API that is needed for this operation. I tried to look into the Eclipse client to find a thread to start, but was not able to. 

In eclipse the Show History events is useful here but it is time consuming.
My requirement is on one click gets list (in faster way)
i only want to display removed components name

Here the options I see: 

  1. Create an enhancement request in the IBM Enhancement Request Community
  2. Install the SDK and use YARI https://marketplace.eclipse.org/content/yet-another-rcp-inspector or another such tool to find out how the view is created. 
I did not easily find it. I will ask a developer if they can throw us a bone here. No promises.


Permanent link

Please look here: https://jazz.net/forum/questions/267038/how-to-get-operationhistory-of-the-stream-programmatically-using-rtc-api

0 votes


Permanent link

There is no official API for retrieving this information.
Nothing should really stop you from trying to do what the Operation History does however (which is not official API).

Note: This is pseudo-code giving you some rough direction:

ParmsGetWorkspaceHistory parms = new ParmsGetWorkspaceHistory();
parms.workspaceId = uuidOfStream;

IScmRichClientRestService scmService = (IScmRichClientRestService) ((IClientLibraryContext) repository).getServiceInterface(IScmRichClientRestService.class);
ScmWorkspaceHistory workspaceHistory = scmService.postGetWorkspaceHistory(parms);

<iterate across workspaceHistory.getHistoryEntries()>

   ScmWorkspaceHistoryEntry workspaceHistoryEntry = (ScmWorkspaceHistoryEntry) workspaceHistory.getHistoryEntries().get(i);
   ScmWorkspaceOperationDescription desc = workspaceHistoryEntry.getDescription();
            @SuppressWarnings("unchecked") // Safe to cast per Javadoc
            List<ScmComponentOperationDescription> componentOperations = desc.getComponentDescriptions();
            for (ScmComponentOperationDescription componentOp : componentOperations) {
               // check if componentOp.getOperation() == OperationKind.REMOVE_COMPONENT
                  ScmComponent component = componentOp .getComponent()
                  String componentName = component.getName();
             }



For iterating across the entire history:
IScmRichClientRestService.postGetWorkspaceHistory() will not return the entire history as that may be too large. To get all the data you will need to make multiple calls, paging through the results. If the return value has ScmWorkspaceHistory.getNextPage() non-null and non-empty, then you pass that along as an argument using ParmsGetWorkspaceHistory.pageToken to get subsequent pages.

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 1,700

Question asked: Oct 06 '20, 12:31 a.m.

Question was seen: 1,361 times

Last updated: Oct 08 '20, 8:12 p.m.

Confirmation Cancel Confirm