How to get full path of file in a CLIENT side plugin?
![]()
I Know the question about how to get full path of file had been asked many times, and there are samples showing how to do this, but i can't still get it done in a CLIENT side plugin.
In a SERVER side plugin example, you can get ServiceConfigurationProvider with the following code fragment,
continue;
But in a CLIENT side plugin which you can right click on a change set in Change Explorer view and then click on a customized menu item to export the change log details, how do you get a ServiceConfigurationProvider?
|
One answer
![]()
Thanks for the comment, but all i got for now is change sets user selected in the Change Explorer view, i don't know how to get an IWorkspaceConnection with them.
Comments 1
I see. So, I guess you can use SCMPlatform to get the IWorkspaceConnection. SCMPlatform.getWorkspaceManager().createWorkspace() or
So i still need that the login user should provide a workspace selection so that i can create a IWorkspaceConnection?
The changes shown in Change Explorer view already have the full path presented, there must be something i can reuse, right?
1
If you do not have the workspace context, I think this can help -
1
I thought you may also want to check this question - https://jazz.net/forum/questions/49910/how-to-get-an-iconfiguration-from-ichangeset
Thanks for your reply, i know that we must have a workspace/stream to calculate the full path of a file item, and there is no problem to show a dialog to let user to select it.
I am just wondering, if the Change Explorer view can already show the full path, there must be some IConfiguration instance used inside, then maybe we can reuse it instead of letting user to choose it again.
2
I don't think Change Explorer stores the path in a way to make it available to someone writing an extension like you yourself.
An existed instance of IConfiguration would be good enough, we could then calculate the full path by ourselves.
Anyway, if that is not possible, i should now try to study the information you provided :-)
showing 5 of 7
show 2 more comments
|
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.
Comments
Not sure exactly where would you want to get the full path, but could you try something like this -
- Get IConfiguration. You can get this from IWorkspaceConnection
- Call locateAncestors(). This will give you INameItemPair.
- You would be able to get the information you need from it.
Please let me know if this works for you.