It's all about the answers!

Ask a question

Using IItemManager to modify items in the repository


Furio Belgiorno (3651) | asked Sep 29 '09, 12:06 p.m.
I am trying to use IItemManager to modify items in the repository, but IItemManager.applyItemUpdates() does not seem to commit any change to the repository. Is this the correct way?
My problem is: I have an item attribute of type Content, and I am wondering how to upload data from the client. The jazzbot example is only server-side, while the documentation on IContentManager only shows how to upload a file directly to the workspace. Moreover, it refers to the non-existing function com.ibm.team.repository.client.ITeamRepository.save(IAuditable).

9 answers



permanent link
Rafik Jaouani (5.0k16) | answered Sep 29 '09, 7:18 p.m.
JAZZ DEVELOPER
There is no generic way from the client to modify items in the repository. You will need to use the API provided by the item type owner component.
IItemManager.applyItemUpdates only updates the item copy that is cached on the client and should only be called by component implementers.

permanent link
Furio Belgiorno (3651) | answered Sep 30 '09, 5:07 a.m.
Thanks for the clarification. But how can I pass the Content to the component? I have tried to pass it as a parameter in a method (IContent type), but the server component receives a null value.

permanent link
Rafik Jaouani (5.0k16) | answered Sep 30 '09, 8:06 a.m.
JAZZ DEVELOPER
Which item are you trying to modify?

permanent link
Furio Belgiorno (3651) | answered Sep 30 '09, 8:52 a.m.
The item contains an attribute of type Content, and the client should be able to put a file in it. I cannot use a method similar to the one in the jazztalk example, postNewMessage(NewMessageParameters params), because IParameterWrapper only supports Strings and primitive types.

permanent link
Rafik Jaouani (5.0k16) | answered Sep 30 '09, 10:35 a.m.
JAZZ DEVELOPER
You need to use the IContentManager interface to save contents.

permanent link
Furio Belgiorno (3651) | answered Sep 30 '09, 11:46 a.m.
I did. But to save the contents... where? I cannot pass an IContent in the params, and I cannot use IItemManager to modify the item in the repository.
The only way I see now is just a workaround, i.e. upload the contents somewhere in the workspace and then ask the server to read the content from that place and to put them into the item.
Or is there any straightforward support to perform this operation?

permanent link
Rafik Jaouani (5.0k16) | answered Sep 30 '09, 7:50 p.m.
JAZZ DEVELOPER
What is the Item type of the Item you are trying to save? Did you define the item type yourself using EMF Ecore? If that is the case, you will need to define an RPC service that runs on the server and exposes a save method.

permanent link
Furio Belgiorno (3651) | answered Oct 01 '09, 5:10 a.m.
Yes, I defined the item type myself using EMF Ecore. I defined a service derived from com.ibm.team.repository.service.AbstractService as I saw in the example https://jazz.net/wiki/bin/view/Main/JazzTalkWalkthrough . The problem is: how can I pass the Content to the save method? IParameterWrapper only supports Strings and primitive types.

permanent link
Furio Belgiorno (3651) | answered Oct 01 '09, 10:51 a.m.
I solved by passing the content uuid value in the params.

Your answer


Register or 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.