how to get all the IResource by current login user
![]()
hi,
I know how to get the author of a certain IResource by adapting to it: SCMPlatform.getWorkspaceManager(repo).versionableManager ().fetchCompleteState(shareable.getRemote(), monitor).getModifiedBy(); But I am not sure how to get the other way around (all IResource last modified by current login user). Thanks for any info, Owen |
6 answers
![]()
On Sun, 03 Aug 2008 21:27:55 +0000, jingweno wrote:
Question 1: I would like to get all the IResource last modified by You would have to get a list of all shareable.getRemote() currently loaded per repo, and then fetchCompleteStates() on them. Question 2: are there any listeners that I can use to keep track of the On checkin the IWorkspaceConnection sends ICommitEvent.COMMIT. As for apply patch, I am not sure, there might be events the ComponentSyncModel sends. - Dmitry |
![]() On Sun, 03 Aug 2008 21:27:55 +0000, jingweno wrote: Question 1: I would like to get all the IResource last modified by You would have to get a list of all shareable.getRemote() currently loaded per repo, and then fetchCompleteStates() on them. could you be more specific by giving me a code snippet ? I am looking for a list of IResource last modified by current login user. I expect the procedure would be: getting current login user -> asking the server for results by criteria -> adapting the results back to IResource. I am not familiar with the APIs and not sure whether its possible the results can be adapted back to IResource. And I don't how to get a list of all shareable.getRemote() either. Thanks for any hints, Owen |
![]()
On Tue, 05 Aug 2008 01:57:52 +0000, jingweno wrote:
I expect No, rather you would gather a list of all IResources, then figure out who was the last user that modified them and then keep only those that were modified by the user returned in repo.loggedInContributor(). - Dmitry |
![]()
On Tue, 05 Aug 2008 17:57:57 +0000, jingweno wrote:
Do you know how to get all the IResource that are shared in the Jazz final List<IResource> sharedResources = new ArrayList<IResource>(); ResourcesPlugin.getWorkspace().getRoot().accept(new IResourceVisitor() { public boolean visit(IResource resource) throws CoreException { IShareable s = (IShareable)resource.getAdapter(IShareable.class); if (s != null && s.getRemote() != null) { sharedResources.add(resource); } return true; } }); - Dmitry |
![]()
Do you know how to get all the IResources that are shared in the Jazz repository? I mean how to get a list of IResources that have Jazz properties. Are there any APIs I can use? |
![]() You would have to get a list of all shareable.getRemote() currently fetchCompleteStates() only returns a list of states (IVersionable) which I cannot get any local information from them, e.g. the local IPath of a IVersionalble. To put it simple, the procedure is: 1. a list of IShareable -> 2. fetchCompleteStates() -> 3. a list of IVersionalble -> 4. a list of IResource by current login user. Right now I can filter a list of IVersionable by current login user (step 3). But I can't get any local info such as IPath from it. Does anyone know get the IPath out of a IVersionable. I also tried to adapt IVersionable back to IShareable/IResource but failed. |
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.