Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Using IItemManager to modify items in the repository

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

0 votes



9 answers

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

0 votes


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

0 votes


Permanent link
Which item are you trying to modify?

0 votes


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

0 votes


Permanent link
You need to use the IContentManager interface to save contents.

0 votes


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

0 votes


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

0 votes


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

0 votes


Permanent link
I solved by passing the content uuid value in the params.

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

Question asked: Sep 29 '09, 12:06 p.m.

Question was seen: 8,828 times

Last updated: Sep 29 '09, 12:06 p.m.

Confirmation Cancel Confirm