0

I want to fetch all the streams of a project area and display their names on console using server side API.

IWorkspaceManager workspaceManager =          SCMPlatform.getWorkspaceManager(teamRepository);
IWorkspaceSearchCriteria wsSearchCriteria = WorkspaceSearchCriteria.FACTORY.newInstance();
wsSearchCriteria.setKind(IWorkspaceSearchCriteria.STREAMS);
wsSearchCriteria.setPartialOwnerNameIgnoreCase(projectAreaName);
List <iworkspacehandle> workspaceHandles =   workspaceManager.findWorkspaces(wsSearchCriteria, Integer.MAX_VALUE, monitor);
IWorkspaceConnection workspaceConnection =   workspaceManager.getWorkspaceConnection(workspaceHandles.get(0),monitor); 
String obj="";
obj=workspaceConnection.getName();
System.out.println(obj);

this code does the task on client side. How this can be done using server side API?

John
  • 2,820
  • 3
  • 30
  • 50
  • Why would that same code be running any differently on the server? – VonC Aug 03 '15 at 11:06
  • Hi VonC, Actually I want to create plug-in which will display all the stream names on the work item editor after work item is saved. Above code fetches streams and store its name in the string type of object. But these are client side API. I cant use them when I want develop a plugin which will be deployed on server. IWorkspaceManager workspaceManager = SCMPlatform.getWorkspaceManager(teamRepository); and IWorkspaceConnection workspaceConnection = workspaceManager.getWorkspaceConnection(workspaceHandles.get(0),monitor); String obj=""; – vikrant kamble Aug 03 '15 at 11:26
  • I understand, but couldn't that plugin use the exact same API? – VonC Aug 03 '15 at 11:27
  • Actually server side plugins cannot use classes, interfaces and methods from client API. I have been searching for server API which will do the similar task for me but i could not find them. – vikrant kamble Aug 03 '15 at 11:33

1 Answers1

0

SDK (used server side or like plugin on client) and plain API are really different. Plain API are plain java classes, but with SDK you have to create osgi plugins to the platform to be deployed on server. You can follow this POT: https://jazz.net/library/article/1000 that is for 4.0.x version but still valid.

Mikyjpeg
  • 1,179
  • 1
  • 13
  • 39