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

How to upload a file into Jazz repository ?

Hi,

I am extending the Jazz repository and one of the data items I need to store is file attachments. I have modeled the file contents as "Content" in my ecore.

I am using TeamModelledService, to expose the get/post operations on the extended data-store.

From the browser side, I would be using post with enctype = multipart/form-data.

Could someone please guide me as to how I would need to implement this on server side ?

Thanks
- Vibha

0 votes



2 answers

Permanent link
To handle the file upload, you can create a new TeamRawService that handles the form POST data. When you receive the data, you will need to:

1) Find the item that the data will be attached to
2) Create a new IContent object using the IContentService with the uploaded data
3) Create a working copy of your item
4) Attach the content to the working copy
5) Save the new item state

The LicenseUploadService does something similar (though it doesn't create and save content). You can use that service as a starting point for how to handle the form POST request.

0 votes


Permanent link
You could also take a look at AttachmentRestService in the com.ibm.team.workitem.service plug-in which does the same for work item attachments.

Christof
Jazz Work Item team


lavinm wrote:
To handle the file upload, you can create a new TeamRawService that
handles the form POST data. When you receive the data, you will need
to:

1) Find the item that the data will be attached to
2) Create a new IContent object using the IContentService with the
uploaded data
3) Create a working copy of your item
4) Attach the content to the working copy
5) Save the new item state

The LicenseUploadService does something similar (though it doesn't
create and save content). You can use that service as a starting
point for how to handle the form POST request.

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

Question asked: Jul 09 '08, 6:11 a.m.

Question was seen: 7,404 times

Last updated: Jul 09 '08, 6:11 a.m.

Confirmation Cancel Confirm