How to get IWorkspaceConnection from FileItemWrapper/FolderItemWrapper using RTC SDK?
Hi,
I´m developing an Eclipse plugin using the RTC SDK. I need to get the Workspace or Stream given a FileItemWrapper or a FolderItemWrapper. How can I do that?
Most of the examples that I found require the name of the workspace/stream (IWorkspaceSearchCriteria) to get it. I don't have the name of the workspace (or I don't know how to get it from the plugin); but I have the workspace id: FolderItemWrapper.getWorkspace().
How can I get the IWorkspaceConnection using the workspace id instead of the workspace' name?
I´ll appreciate your help.
Thank you,
Accepted answer
The wrapper has a namespace, which would be a workspace namespace for a FolderItemWrapper/FileItemWrapper. With the namespace, you can call #getWorkspaceConnection (cast to WorkspaceNamespace first) or #getConnection (then cast to IWorkspaceConnection).
One other answer
Thanks for your answers Ralph and Tim. I was able to get the Stream with this code:
IWorkspaceHandle wpHandle = (IWorkspaceHandle) IWorkspace.ITEM_TYPE.createItemHandle(UUID.valueOf(folderSelection.getWorkspace().getContextHandle().getItemId().getUuidValue()), null);Now I need to get the Component the FileItemWrapper/FolderItemWrapper is in. Do you know how to get it?
IWorkspaceConnection wsConn = mgr.getWorkspaceConnection(wpHandle,null);
Thanks,
Comments
Donald Nong
May 08 '14, 3:43 a.m.Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER May 08 '14, 3:54 a.m.Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER May 08 '14, 4:26 a.m.1 vote