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

Emulate "Open Local File" action of ChangeExplorer

I want to emulate the "Open Local File" action provided in the ChangeExplorer view in my application. All I have is the change-set information. From my view, I'm able to programmatically open ChangeExplorer view giving it ChangeSetInput.
Now, I want to give another action in my view that would do the "Open Local File" action.

Looked at SDK's OpenLocalFileAction class, which uses IShareable to open a file. How do I create an IShareable from a changeSet ? If that is possible, then I can use the OpenLocalFileAction directly.

0 votes


Accepted answer

Permanent link
IShareable doesn't map to a change set. A shareable represents a resource that is shared with RTC. This can be a file so you'll have to look into the change set to get the items.

ISharingManager sharingManager = FileSystemCore.getSharingManager();

With the sharing manager, you can use the items from the change set (the versionables) to find the shareable on disk.

sharingManager.findShareables(versionableHandle, progressMonitor);
Atul Kumar selected this answer as the correct answer

1 vote

Comments

Thanks Tim. I could achieve "Open Local File" action through following code:

final List<IShareable> shareables = new ArrayList<IShareable>();
ISharingManager sharingManager = FileSystemCore.getSharingManager();
IVersionableHandle versionHandle = (IVersionableHandle) IFileItem.ITEM_TYPE.createItemHandle(UUID.valueOf(fileUUID), UUID.valueOf(stateUUID));                                shareables.addAll((List<IShareable>)sharingManager.findShareables(versionHandle, new NullProgressMonitor()));
if(shareables.size() > 0) {
            OpenLocalFileAction.openLocalFile(parent.getShell(), getSite().getPage(), shareables.get(0));
}

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,943

Question asked: Jun 05 '14, 8:08 a.m.

Question was seen: 4,223 times

Last updated: Jun 06 '14, 3:21 a.m.

Confirmation Cancel Confirm