It's all about the answers!

Ask a question

iProject to library mappings in RTC


Michele Pegoraro (1.8k14118103) | asked Sep 29 '11, 5:15 a.m.
retagged Jun 23 '12, 5:47 p.m. by Arne Bister (2.6k12832)
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



permanent link
Michele Pegoraro (1.8k14118103) | answered Jun 25 '12, 12:33 p.m.
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.

permanent link
Kevin Doyle (60425) | answered Oct 03 '11, 3:45 p.m.
JAZZ DEVELOPER
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,
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.

permanent link
Michele Pegoraro (1.8k14118103) | answered Oct 07 '11, 4:31 a.m.
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.

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,
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.

permanent link
Michele Pegoraro (1.8k14118103) | answered Oct 11 '11, 3:53 a.m.
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.

permanent link
Kevin Doyle (60425) | answered Oct 11 '11, 10:26 a.m.
JAZZ DEVELOPER
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.

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.

permanent link
Michele Pegoraro (1.8k14118103) | answered Oct 13 '11, 5:07 p.m.
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.

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.

permanent link
Michele Pegoraro (1.8k14118103) | answered Apr 27 '12, 9:14 a.m.
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:


IScmIClientLibrary scmIclient = &#40;IScmIClientLibrary&#41;repo.getClientLibrary&#40;IScmIClientLibrary.class&#41;;

IWorkspaceIHandle workspaceI = scmIclient.getWorkspaceI&#40;workspaceCopy,null&#41;;
if&#40;workspaceI==null&#41;&#123;
workspaceI = scmIclient.createWorkspaceI&#40;workspaceCopy,null&#41;;
&#125;
scmIclient.setProjectToLibraryMappings&#40;workspaceI, folders, Collections.singletonList&#40;targetLibrary&#41;, null&#41;;


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:


IWorkspaceI wsI = &#40;IWorkspaceI&#41;repo.itemManager&#40;&#41;.fetchCompleteItem&#40;workspaceI, ItemManager.DEFAULT, null&#41;;
IWorkspaceHandle wsH = wsI.getWorkspace&#40;&#41;;

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.

permanent link
Michele Pegoraro (1.8k14118103) | answered May 02 '12, 8:18 a.m.
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.


permanent link
Jia Jia Li (8057152192) | answered May 26 '12, 12:04 p.m.
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(&quot;Scrum_ws&quot;, 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


Register or to post your answer.