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

How to get the itemUUID and IVersionableHandle object of the particular (XML)file

Hello Jazz team

How to retrieve the itemUUID of the particular(XML) file? Using that itemUUID how to get IversionableHandle object for that particular(XML) file?

0 votes


Accepted answer

Permanent link
If you have the workspace loaded, and want to find a particular file (by path) you can use ISharingManager#findShareable(). This returns an IShareable, and you can use IShareable#getVersionable() to get the IVersionableHandle (if the file is actually a shared file). Also #getItemId() on the versionable would return the item UUID.
Michael Valenta selected this answer as the correct answer

0 votes

Comments

Hello Mr.David

Can you provide me one simple example to get Ishareable object using ISharingManager#findShareable().


This was not tested, but it should be something like:

IShareable shareable = FileSystemCore.getSharingManager().findShareable(new PathLocation("C:/someDir/someDir2/fileA.xml"), ResourceType.FILE);

IVersionableHandle fileHandle = shareable.getVersionable(progress); // Note: 'progress' here is an IProgressMonitor. This method should be run on a background thread and be passed in a progress monitor.

UUID fileUUID = item.getItemId();

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,935
× 1,202

Question asked: Jul 26 '16, 5:36 a.m.

Question was seen: 2,473 times

Last updated: Aug 05 '16, 3:22 p.m.

Confirmation Cancel Confirm