It's all about the answers!

Ask a question

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

Boopathy Nagaraj (136) | asked Jul 26 '16, 5:36 a.m.
edited Jul 26 '16, 12:10 p.m. by David Lafreniere (4.3k7)
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?

Accepted answer

permanent link
David Lafreniere (4.3k7) | answered Jul 26 '16, 12:16 p.m.
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

Boopathy Nagaraj commented Aug 03 '16, 4:41 a.m. | edited Aug 03 '16, 6:41 a.m.

Hello Mr.David

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

David Lafreniere commented Aug 05 '16, 3:22 p.m. | edited Aug 05 '16, 3:22 p.m.

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 to post your answer.