iProject to library mappings in RTC
Michele Pegoraro (1.8k●14●119●103)
| asked Sep 29 '11, 5:15 a.m.
retagged Jun 23 '12, 5:47 p.m. by Arne Bister (2.6k●1●28●32)
Hi,
I'm looking for this extension: I want to set repository workspace properties in order to mapping iProject to target library. I was searching for some methods on IWorkspace or IWorkspaceConnection but the only things I had found was IWorkspace.getProperties method which returns an empty Map ( though I've previously set some iProject-Library mappings). Does anyone has some hints on how to manage these properties? Thanks, Michele. |
9 answers
Hi, the best way is to use a SearchCriteria:
IWorkspaceSearchCriteria wSC = IWorkspaceSearchCriteria.FACTORY.newInstance(); wSC.setExactName(this.workspaceName); wSC.setKind(IWorkspaceSearchCriteria.WORKSPACES); List<IWorkspaceHandle> wsHandles = wsManager.findWorkspaces(wSC, IWorkspaceManager.MAX_QUERY_SIZE , null); Best regards, Michele.
|
The IBM i properties on workspaces are handled through IWorkspaceIHandle.
You can get an IWorkspaceIHandle by doing something like: clientLibrary = (IScmIClientLibrary)(repository.getClientLibrary(IScmIClientLibrary.class)); clientLibrary.getWorkspaceI(workspace, null); where workspace is an IWorkspaceHandle. Hi, |
Thanks for your answer. I can't find any IWorkspaceIHandle or IScmIClientLibrary both on PlainAPI or SDK... is there any others API do I have to download?
Michele. The IBM i properties on workspaces are handled through IWorkspaceIHandle. Hi, |
I found the classes in com.ibm.teamp.scm.client and com.ibm.teamp.scm.common jars provided with RDP. I've added them to my Plain API and now it works.
How can I add these jars to my server in order to use them on server side? I was thinking particulary on how to get service with getService method. Thanks, Michele. |
Since you are doing server side development you shouldn't be using com.ibm.teamp.scm.client. You should get the IScmIService like you have been doing before for IScmService, which is in the plug-in com.ibm.teamp.scm.service. The plug-ins com.ibm.teamp.scm.service and com.ibm.teamp.scm.common are shipped as part of the server today in: INSTALL_DIRECTORY/server/conf/ccm/sites/enterprise-update-site
I found the classes in com.ibm.teamp.scm.client and com.ibm.teamp.scm.common jars provided with RDP. I've added them to my Plain API and now it works. |
I found them and I've added them to my target platform. Then I've been able to get the service and use the classes.
Thanks for your help! Best regards, Michele Since you are doing server side development you shouldn't be using com.ibm.teamp.scm.client. You should get the IScmIService like you have been doing before for IScmService, which is in the plug-in com.ibm.teamp.scm.service. The plug-ins com.ibm.teamp.scm.service and com.ibm.teamp.scm.common are shipped as part of the server today in: INSTALL_DIRECTORY/server/conf/ccm/sites/enterprise-update-site I found the classes in com.ibm.teamp.scm.client and com.ibm.teamp.scm.common jars provided with RDP. I've added them to my Plain API and now it works. |
Hi,
I've used these methods on server side and they works fine. Now I have to create a script using client side and I've some problem on setting the library map. This is my code:
It seems to work well, but if I open the repository workspace property I can't get the library map I've set. Another strange point is this: after I set the mapping I cannot retrieve back my workspaceHandle:
because wsH is null! It seems to me that I have to save (I don't know how) my IWorkspaceI back into my IWorkspace object in order to save it. It is different from server side, where I only have to set the library mapping in order to have it saved. Can someone help me with this? Thanks, Michele. |
I've another problem with this method. On server side it has suddenly stopped to work (and has started to behave exactly as on client side).
The same extensions, on a different server, works correctly. The main problem is that I don't have any advice of this behavior: setProjectToLibraryMappings seems to works (it does not returns any exception). Do you know how to debug it? Or somebody know in which cases this behaviour could occour? Thanks, Michele. Comments
Michele Pegoraro
commented Jun 25 '12, 12:35 p.m.
The problem was related to a bug that has been addressed and resolved in APAR: SE51998. Michele. |
Hi, I use the flowing code to get the Iworkspage, but always null. Could you tell me how to get it?
Thanks! IWorkspaceManager wm = SCMPlatform.getWorkspaceManager(repo); IItemQueryPage itemQueryPage = wm.findWorkspacesByName("Scrum_ws", true , false , false , 2, monitor); int size = itemQueryPage.getSize(); itemQueryPage.getItemHandles().get(0); IWorkspaceHandle workspaceHandle = (IWorkspaceHandle) itemQueryPage.getItemHandles().get(0); // IWorkspaceConnection workspaceConnection = wm.getWorkspaceConnection((IWorkspaceHandle) workspaceHandle, monitor); IScmIClientLibrary scmIclient = (IScmIClientLibrary)repo.getClientLibrary(IScmIClientLibrary.class); IWorkspaceIHandle workspaceIHandle = scmIclient.getWorkspaceI(workspaceHandle, monitor); |
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.