Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325371 - [director] Add option to list installed roots to DirectorApplication
Summary: [director] Add option to list installed roots to DirectorApplication
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.7 M3   Edit
Assignee: DJ Houghton CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-15 11:47 EDT by Alin Dreghiciu CLA
Modified: 2010-09-16 15:36 EDT (History)
0 users

See Also:


Attachments
Proposed patch (9.27 KB, patch)
2010-09-15 12:05 EDT, Alin Dreghiciu CLA
no flags Details | Diff
patch (8.22 KB, patch)
2010-09-15 13:12 EDT, DJ Houghton CLA
no flags Details | Diff
patch (8.17 KB, patch)
2010-09-15 14:05 EDT, DJ Houghton CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alin Dreghiciu CLA 2010-09-15 11:47:32 EDT
Build Identifier: 

Add a new option like "-listInstalledRoots" that will list the roots from a given profile.
The list print information (as current -list) option in the format <iu id>/<iu version>.

The mandatory parameters for this to work are:
-destination
-profile

Reproducible: Always
Comment 1 Alin Dreghiciu CLA 2010-09-15 12:05:54 EDT
Created attachment 178959 [details]
Proposed patch

The proposed patch adds the option as specified.
Beside that it also adds a public method that is able to make use of all DirectorApplication infrastructure/goodies in order to return all the installed root IUs.
Comment 2 DJ Houghton CLA 2010-09-15 12:40:48 EDT
Thanks for the patch. I'll take a look at it. One minor change though, I believe we want to query on the property PROP_PROFILE_ROOT_IU instead. This will list all the "root" things which appear in the About dialog under the Installation details.
Comment 3 DJ Houghton CLA 2010-09-15 13:12:22 EDT
Created attachment 178966 [details]
patch

Updated patch to query on the profile root property.

Also I've removed the public method since it is inconsistent with the other methods in the class. If a client wishes to find the profile roots, they are able to perform a simple query.
Comment 4 DJ Houghton CLA 2010-09-15 13:35:26 EDT
Please give the attached patch a try to see if it works the way you expect. I want to make sure our definition of "root" is the same before releasing anything. 
Thanks.
Comment 5 DJ Houghton CLA 2010-09-15 14:05:50 EDT
Created attachment 178969 [details]
patch

Actually we have a User-Visible Query already so I just changed the code to use that.
Comment 6 Alin Dreghiciu CLA 2010-09-15 16:58:40 EDT
(In reply to comment #5)

Yep, that is better as is consequent with other parts. I was actually pending between the two properties. But I had an example from Pascal and he may comment on why he used the property with STRICT/OPTIONAL values.
Comment 7 Alin Dreghiciu CLA 2010-09-15 17:09:18 EDT
(In reply to comment #3)

Actually my interest was on the public method not printing them. I agree I can query the profile myself but i'm in the process to create another enhancement request/patch that will use similar option/public method combination for listing available versions for a specified list of IUs. ANd in that case will save me a lot of trouble to reuse existing infrastructure/code in DirectorApplication.

ActuallyI wished that the DirectorApplication would be just a thin utility around a set of action classes that perform divers actions/retrive info as director application does. If I would given the chance I would refactor this into class into a parsing/validating method for arguments and then instantiate and execute divers action classes such as PerformProvision, PerformRollback, ListInstalledRoots, ListAvailableRoots where all of this list ones would first give an list of things that are then printed to System out.
Of course that all of them would share some base class that sets up the needed infra such as services or repositories.
Comment 8 DJ Houghton CLA 2010-09-16 15:36:48 EDT
Ok, I've released the current patch and let's use bug 325403 to discuss the public method issue.