EPP/MPC/Developer Guide

From Eclipsepedia

< EPP‎ | MPC
Jump to: navigation, search

Contents

Overview

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:

MPC 
Marketplace Client
Marketplace 
A service that provides access to solutions, including name, description, branding and installation metadata. The marketplace reference implementation can be found at [1]. A marketplace must implement a REST API, which is must conform to Marketplace/REST.
Catalog 
A catalog is a description of a marketplace, including branding and an URL.

Dependencies

In order to use the MPC API your bundle will need to declare a dependency on the following bundles:

  • org.eclipse.epp.mpc.ui

Binaries

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/

Sources

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:

MarketplaceClient.openMarketplaceWizard(null);

The MPC UI can also be launched using a specified list of catalogs as follows:

List<CatalogDescriptor> catalogDescriptors = ...
MarketplaceClient.openMarketplaceWizard(catalogDescriptors);