It's all about the answers!

Ask a question

How to fetch Iversionable/IfileItem of a file by passing itemid and stateid of the file


akshay p (111) | asked Feb 11, 4:36 a.m.
edited Feb 11, 6:40 p.m. by Fariz Saracevic (619413)

Is there any way i can get the IFileItem or Iversionable just by knowing ITEM id and state id ?

One answer



permanent link
David Lafreniere (3.8k7) | answered Feb 12, 2:10 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

UUID itemId = getFileItemId();
UUID stateId = getFileState();
IComponentHandle componentHandle = getComponentHandle();
IWorkspaceConnection workspaceConnection = getWorkspaceConnection();


IFileItemHandle fileItemHandle = (IFileItemHandle) IFileItem.ITEM_TYPE.createItemHandle(itemId, stateId);
IFileItem file = (IFileItem) workspaceConnection.configuration(componentHandle).fetchCompleteItem(fileItemHandle, monitor);


Comments
akshay p commented Feb 13, 3:09 a.m.
Currently i am taking State id and item id of a file from different location and these two parameters are of String type. How i can convert them into UUID type.

and one more thing is that, i have various baselines of same component and snapshots of streams. SO i don't want to pass/specify any specific component or stream as a input parameter.

I want to retrieve the file irrespective of streams, snapshots, baselines and JUST WANT TO USE UUID of ITEM ID AND STATE ID

Ralph Schoon commented Feb 13, 3:32 a.m. | edited Feb 13, 3:32 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

David Lafreniere commented Feb 13, 4:57 p.m. | edited Feb 14, 10:25 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
The server API is: IScmService.fetchState(...)

Or from the client APIT you can call:
IVersionableManager vmgr = SCMPlatform.getWorkspaceManager(repo).versionableManager();
IVersionable versionable = vmgr.fetchCompleteState(versionableHandle, monitor);

Your answer


Register or to post your answer.