1). When you start a Launch Configuration if you don't have any
repositories listed in your preferences under Install/Update -> Available
Software Sites then the list returned by the API will be empty.

2). In older versions of Eclipse you can get the service through the bundle
context and not go through the agent. Like you said, the agent was a
concept introduced in 3.6.



                                                                       
  From:       Andrey Razumovsky <[email protected]>          
                                                                       
  To:         P2 developer discussions <[email protected]>            
                                                                       
  Date:       03/25/2011 11:10 AM                                      
                                                                       
  Subject:    Re: [p2-dev] List of update sites                        
                                                                       
  Sent by:    [email protected]                               
                                                                       





Thanks for the point,

I've got two questions:
1. When I launch my plugin in PDE mode, array returned
by IRepositoryManager.getKnownRepositories
(IRepositoryManager.REPOSITORIES_ALL) is empty. Is that expected? (maybe
because installing features are not avaliable in PDE launch? Can I turn
them on?)
2. IProvisioningAgent seems to be Eclipse 3.6-only class. Is there
something that is 3.5-compatible (or maybe even 3.4)?

2011/3/25 DJ Houghton <[email protected]>
  It is a service so you can acquire it like any other OSGi service.
  The code should look roughly like:

  ServiceReference reference = context.getServiceReference
  (IProvisioningAgent.SERVICE_NAME);
  if (reference == null)
  return null;
  try {
  return context.getService(reference);
  } finally {
  context.ungetService(reference);
  }

  Where "context" is your BundleContext object available from your bundle
  activator.


  Inactive hide details for Andrey Razumovsky ---03/25/2011 10:34:42
  AM---OK, great, now I need to get reference to IProvisioningAndrey
  Razumovsky ---03/25/2011 10:34:42 AM---OK, great, now I need to get
  reference to IProvisioningAgent :) How can I do that?



                                                                       
                                                                       
 From:            Andrey Razumovsky <[email protected]>      
                                                                       
                                                                       
 To:              P2 developer discussions <[email protected]>        
                                                                       
                                                                       
 Date:            03/25/2011 10:34 AM                                  
                                                                       
                                                                       
 Subject:         Re: [p2-dev] List of update sites                    
                                                                       
                                                                       
 Sent by:         [email protected]                           
                                                                       





  OK, great, now I need to get reference to IProvisioningAgent :) How can I
  do that?

  2011/3/25 DJ Houghton <[email protected]>
        Jacek is correct. You can do a service look-up via the agent.

        IProvisioningAgent#getService
        (IMetadataRepositoryManager.class.getName());


        Inactive hide details for Jacek Pospychała ---03/25/2011 10:16:55
        AM---sorry, I didn't noticed you want to "get", and not set Jacek
        Pospychała ---03/25/2011 10:16:55 AM---sorry, I didn't noticed you
        want to "get", and not set repository... :-) Anyway, a bit of
        goolging p
                                                                       
                                                                       
 From:           Jacek Pospychała <[email protected]>       
                                                                       
                                                                       
 To:             P2 developer discussions <[email protected]>         
                                                                       
                                                                       
 Date:           03/25/2011 10:16 AM                                   
                                                                       
                                                                       
 Subject:        Re: [p2-dev] List of update sites                     
                                                                       
                                                                       
 Sent by:        [email protected]                            
                                                                       






        sorry, I didn't noticed you want to "get", and not set
        repository... :-)
        Anyway, a bit of goolging pointed to IRepositoryManager interface,
        that should do what you want. Although I'm not quite sure how to
        obtain reference to it.


        2011/3/25 Jacek Pospychała <[email protected]>
                    one option is via use of p2.inf files, e.g.:


                    instructions.configure=\


                      addRepository(type:0,enabled:false,location:http$
                    {#58}//download.eclipse.org/releases/helios);\


                      addRepository(type:1,enabled:false,location:http$
                    {#58}//download.eclipse.org/releases/helios);


                    you can put p2.inf file in a feature, or a plugin
                    (META-INF folder).


                    There's some limitations though - e.g. you can't set
                    update site name.


                    And there's some bugs, which may make your update site
                    not added, e.g. in Windows 7



                    On Fri, Mar 25, 2011 at 2:42 PM, Andrey Razumovsky <
                    [email protected]> wrote:
                    Hi,

                    Is there a way to get list of configured update sites
                    (those seen in
                    "Avaliable Software" dropdown in "Install" dialog)
                    programmatically?

                    Thanks,
                    Andrey
                    _______________________________________________
                    p2-dev mailing list
                    [email protected]
                    https://dev.eclipse.org/mailman/listinfo/p2-dev


        _______________________________________________
        p2-dev mailing list
        [email protected]
        https://dev.eclipse.org/mailman/listinfo/p2-dev



        _______________________________________________
        p2-dev mailing list
        [email protected]
        https://dev.eclipse.org/mailman/listinfo/p2-dev



  --
  Andrey_______________________________________________

  p2-dev mailing list
  [email protected]
  https://dev.eclipse.org/mailman/listinfo/p2-dev



  _______________________________________________
  p2-dev mailing list
  [email protected]
  https://dev.eclipse.org/mailman/listinfo/p2-dev


_______________________________________________
p2-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/p2-dev

<<inline: graycol.gif>>

<<inline: ecblank.gif>>

_______________________________________________
p2-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/p2-dev

Reply via email to