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

Can I obtain and download a file from source control if I have the URL using a state transition or save on a work item?

Hi,

I have a work item type called A and this contains a field which is a URL to a file in source control within RTC.

Is it possible (via a plugin or other mechanism) to extract (copy) this file and publish to a location such as C:\

This would be triggered on SAVE or STATE CHANGE of a work item.

Thanks!

0 votes



2 answers

Permanent link
This should theoretically be possible.

However, where is the location? Do you write a server follow up action? Do you write a client follow up action? Can you access the location from within the context of the application server or client?

0 votes


Permanent link


I am writing a server participant where the output location is C:\output (for example).

Do you know of any examples of downloading a file from a URL via a server side (participant)?

eg URL =

https://localhost:7443/jazz/web/projects/JP2047#action=com.ibm.team.scm.viewChangeSetItem&contextItemId=&contextItemType=com.ibm.team.scm.Workspace&componentItemId=_TxNZICI0EeW-mdsed6wq4A&itemType=com.ibm.team.filesystem.FileItem&itemId=_QegBcC9JEeW6da1zRid3Tw&stateId=_Qen9RC9JEeW6da1zRid3Tw


When clicking on the Download link, the URL becomes:

https://localhost:7443/jazz/service/com.ibm.team.filesystem.service.internal.rest.IFilesystemContentService/-/_TxNZICI0EeW-mdsed6wq4A/README.doc?itemId=_QegBcC9JEeW6da1zRid3Tw&stateId=_Qen9RC9JEeW6da1zRid3Tw&platformLineDelimiter=CRLF

Using the values obtained from the URL.....

String componentItemID_String = "_TxNZICI0EeW-mdsed6wq4A"; 

String itemID_String = "_XK9kUC9HEeW6da1zRid3Tw";

String stateID_String = "_Qen9RC9JEeW6da1zRid3Tw";

// createItemHandle(Item ID, State ID)
IItemHandle itemHandle = IComponent.ITEM_TYPE.createItemHandle(UUID.valueOf(itemID_String), UUID.valueOf(stateID_String));

???

How to get the file content?


Thanks!

0 votes

Comments

All examples are in my blog. There is no server side extension that downloads a file. Download is typically also something that is in the client API. You will have to find out if that is possible on your own.

Please note that for security reasons, the application container also typically limits where a WEB application can write on disk.

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
× 11,050

Question asked: Jun 12 '15, 1:36 a.m.

Question was seen: 3,674 times

Last updated: Jul 21 '15, 2:59 a.m.

Confirmation Cancel Confirm