It's all about the answers!

Ask a question

client SDK - IWorkspace from IFileItemHandle


Bernd van Oostrum (21523955) | asked Nov 29, 7:59 a.m.
Hi,

Given an opened file, I'd like to retrieve the RTC Repository Workspace it is based on.
Can anyone share how to do this using the client SDK?

Regards,
Bernd.

Accepted answer


permanent link
Shashikant Padur (3.9k27) | answered Dec 02, 11:23 p.m.
JAZZ DEVELOPER

IShareable shareable = FileSystemCore.getSharingManager().findShareable(fullPath, ResourceType.FILE);

IShare share = shareable.getShare();
ISharingDescriptor sharingDescriptor = share.getSharingDescriptor();
IWorkspaceHandle workspaceHandle = (IWorkspaceHandle) sharingDescriptor.getConnectionHandle();

Bernd van Oostrum selected this answer as the correct answer

Comments
Bernd van Oostrum commented Dec 03, 4:14 a.m.
Many thanks Shashikant!

2 other answers



permanent link
Ralph Schoon (55.6k23642) | answered Dec 02, 6:22 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Bernd,

please provide more context.

permanent link
Bernd van Oostrum (21523955) | answered Dec 02, 7:42 a.m.

 
Hi Ralph,

The plugin I'm working on will check for a file in the sandbox (= based on the development-stream), if it matches the version from the production stream. If not, the plugin will notify the developer as it means the version he will start working on has been changed in the current release, by someone else.

As a start, I need to know from which stream the IFileItemHandle is derived (= the file is opened in the sandbox, but to which repository workspace is it connected?)

I could also check all streams for the file and then compare them (which is what I have implemented now as a workaround), but that's the other way around. I want to start from the opened file...

Best regards,
Bernd.

Your answer


Register or to post your answer.