Jazz Register Log in
Jazz Forum Welcome to the Jazz Community Forum

Welcome to the Jazz Community Forum

Connect and collaborate with IBM Engineering experts and users

iProject to library mappings in RTC

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.

0 votes



9 answers

Permanent link
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.

1 vote


Permanent link
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.

0 votes


Permanent link
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.

0 votes


Permanent link
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.

0 votes


Permanent link
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.

0 votes


Permanent link
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.

0 votes


Permanent link
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.

0 votes


Permanent link
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.

0 votes

Comments

The problem was related to a bug that has been addressed and resolved in APAR: SE51998.

Michele.


Permanent link
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);

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
× 10,998
× 123

Question asked: Sep 29 '11, 5:15 a.m.

Question was seen: 9,040 times

Last updated: Jun 25 '12, 12:35 p.m.

Confirmation Cancel Confirm