how to fetch streams and display its name on console using server side API
Accepted answer
Your extension class also has to most likely extend AbstractScmService rather than AbstractService. See https://rsjazz.wordpress.com/2012/11/01/restrict-delivery-of-changesets-to-workitem-types-advisordelivery-of-changesets-associated-to-wrong-work-item-types-advisor/ for an example that works on an SCM operation.
2 other answers
Comments
Hi Michele,
IWorkspaceConnection is used only on PlainAPI.
Hi Michele
Put everything you get using getService() into the prerequisites and remove entries that the plugin might choke on.
Hi Ralph,
That error is related to prerequisite tag on plugin.xml. Could you paste this extension part of the plugin.xml?
Here is my plugin.xml
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="com.ibm.team.process.service.operationParticipants">
<operationParticipant
class="com.datamato.displaystream.DisplayStream"
id="com.datamato.displaystream.operationParticipant1"
name="Show Stream Name IN WIE"
operationId="com.ibm.team.workitem.operation.workItemSave">
<extensionService
componentId="com.datamato.displaystream.extensionService1"
implementationClass="com.datamato.displaystream.DisplayStream">
<prerequisites>
<requiredservice interface="com.ibm.team.workitem.service.IWorkItemServer"/>
<requiredservice interface="com.ibm.team.workitem.common.IWorkItemCommon"/>
<requiredservice interface="com.ibm.team.scm.common.internal.IScmQueryService"/>
<requiredservice interface="com.ibm.team.scm.common.dto.IWorkspaceSearchCriteria"/>
</prerequisites>
</extensionService>
</operationParticipant>
</extension>
</plugin>
Comments
As Ralph said required service have to include only services, not IWorkspaceSearchCriteria, I also think that having both IWorkItemServer and IWorkItemCommon is a duplication, but it should not give you problem.
Yes,
I removed IWorkspaceSearchCriteria from prerequisites and added IScmServices in the prerequisites. I have no idea why I had to add IScmService in prerequisites because I did not used IScmService interface in my program.
But It solved my problem which I was getting before.
Because the IScmService is the most fundamental service most SCM operations rely upon.
Comments
sam detweiler
Aug 03 '15, 7:43 a.m.what server side console? there isn't one.
if you mean creating a web app that run on the same tomcat/websphere server, then its still a client to RTC.
server side runs IN the RTC server process..
vikrant kamble
Aug 03 '15, 8:17 a.m.Hi Sam,
sam detweiler
Aug 03 '15, 8:30 a.m.Ok, I am confused again.. the work item editor is a client. so why do you need to display this on the server side?
the code is fundamentally the same, just need to understand that you are IN the repository, so you don't need to 'connect to it'. and link the client side, you need to load the services you want to use.. for plugins you have to do the dependencies in the plugin.xml..
I would take the extensions class to show how to do all this, altho not source specific.
I wrote this little routine to connect to the SCM service
import com.ibm.team.scm.common.IScmService;
private volatile IScmService scmService;
public IScmService getScmService()
{
if ( scmService == null ) {
scmService = getService(IScmService.class);
}
return scmService;
}
vikrant kamble
Aug 03 '15, 8:42 a.m.Actually I want to develop a plugin which will be deployed on server. This plugin will display all the stream names on work item editor after work item is saved. In short I want to create an operation participant.
vikrant kamble
Aug 03 '15, 8:47 a.m.Please tell me about server API which will fetch streams of a particular project area.
sam detweiler
Aug 03 '15, 8:52 a.m.connect your dev environment to the SDK, and look at the SCMService class.. ti is the equivalent of the SCMPlatform client side class.
there is no doc on the server side classes.. you have to dig and discover them yourself..
what I did was find a built in plugin (the deliver plugin), configure it, look at the class names, and then search thru the sdk source to find it and figure out how it works.
import com.ibm.team.scm.common.IScmService
common means it works for both client and server..
so you could find the source for that in the SDK
I''m still not sure why you need to do this.. as the display is on client side, just use the client api calls.
you don't need to create another service (I've done that too) as the data is available to you already