This guide provides information for developers that wish to use the Eclipse Marketplace Client (MPC) API. The MPC API enables Eclipse applications to launch the MPC wizard, optionally specifying catalogs. The API also provides a mechanism for registering new catalogs.
Concepts and Terminology
The Eclipse Marketplace Client defines the following concepts:
- Marketplace Client
- A service that provides access to solutions, including name, description, branding and installation metadata. The marketplace reference implementation can be found at . A marketplace must implement a REST API, which is must conform to Marketplace/REST.
- A catalog is a description of a marketplace, including branding and an URL.
In order to use the MPC API your bundle will need to declare a dependency on the following bundles:
MPC bundles may be installed from the Helios update site http://download.eclipse.org/releases/helios
Pre-release MPC bundles can be installed from the Helios staging update site http://download.eclipse.org/releases/staging or can be downloaded directly from the CI build server at https://build.eclipse.org/hudson/job/epp-mpc-nightly/
Please refer to Obtaining Sources for information on obtaining MPC source code.
Registering Marketplace Catalogs
MPC catalogs may be registered via an extension point or at runtime via a Java API.
Catalog Registration via Extension Point
Catalogs may be registered via an extension point by adding the appropriate declaration to the plugin.xml of your plug-in (bundle):
<extension point="org.eclipse.epp.mpc.ui.catalog"> <catalog description="%catalog.description" icon="icons/marketplace32.png" label="%catalog.label" url="http://marketplace.eclipse.org"> </catalog> </extension>
Catalog Registration via Java API
Catalogs may be registered using the Java API as follows:
CatalogDescriptor catalogDescriptor = new CatalogDescriptor(url,label); catalogDescriptor.setIcon(icon); catalogDescriptor.setDescription(description); MarketplaceClient.addCatalogDescriptor(catalogDescriptor);
Please refer to the javadoc for further details.
Launching the Marketplace Client UI
Normally the marketplace client UI is launched by a user either via the Help menu or from the Welcome page. In some cases it may be desirable to launch the marketplace client UI programatically.
Open the MPC UI using the default registered catalogs as follows:
The MPC UI can also be launched using a specified list of catalogs as follows:
List<CatalogDescriptor> catalogDescriptors = ... MarketplaceClient.openMarketplaceWizard(catalogDescriptors);
URL protocol handler
MPC installs an URL protocol handler for the URI scheme "eclipse+mpc://". That way, eclipse plugins can be installed by simply clicking on a link on the marketplace website. The URL should have the following segments:
- the scheme "eclipse+mpc://"
- optionally a catalog descriptor, like e.g. "marketplace.eclipse.org"
- the action to perform
- "install" for instalation of a solution-id
- "favorites" for installation of user favorites
- the identifier of the solution or the user
eg. eclipse-mpc:/install/<solution-name> or eclipse+mpc://favorites/<user-name> or eclipse-mpc://marketplace.eclipse.org/install/<solution-id> or eclipse+mpc://marketplace.eclipse.org/favorites/<user-name>