SDK Samples

This page documents the plugin examples included in the SDK's samples directory.

To build and run the samples:

  1. To install and run the samples as is, copy the content of samples/build/plugin-packages into your <vsphere web client>/plugin-packages folder and restart the server.
  2. To rebuild the samples from the command line use the script build-all.bat (or the Ant script build-all.xml on Mac OS or Linux).
  3. To review them in details, debug or make small changes, it is better to build and run within your IDE (Eclipse or STS). In that case make sure to remove the samples from <vsphere web client>/plugin-packages if you already did it in #1, to avoid installing duplicate versions!

Helloworld

Start here for a very simple UI plugin. Learn also how to localize your Flex plugin and use CSS and image assets.

Extension points used: vise.global.view, vise.home.shortcuts.
Key APIs used: ResourceManager, ResourceBundle, localization.

Global View

This sample shows how to add standalone views in the main area (i.e. not related to objects) and how to make Java service calls. It also provides an implementation of data persistence in a local file.

Extension points used: vise.global.view, vise.home.shortcuts, vise.navigator.nodespecs
Key APIs used: com.vmware.flexutil.proxies.BaseProxy, com.vmware.ui.events.NavigationRequest, osgi:service

Actions

This sample shows how to add action extensions on existing vSphere objects.

Extension points used: vise.actions.sets, vsphere.core.menus.solutionMenus
Key APIs used: com.vmware.flexutil.proxies.BaseProxy, com.vmware.ui.events.NavigationRequest, osgi:service

vSphere Views

This set of samples shows how to extend vSphere object views and how to retrieve data from vCenter or external data sources.

Extension points used: vsphere.core.vm.summarySectionViews, vsphere.core.vm.monitorViews, vsphere.core.host.summarySectionViews, vsphere.core.host.monitorViews
Flex APIs used: PropertyProviderAdapter, ClientSessionEndListener, VimObjectReferenceService, UserSession, PropertyRequestSpec
Java APIs used: PropertyProviderAdapter, ClientSessionEndListener, VimObjectReferenceService, UserSession, PropertyRequestSpec, ResultItem

Chassis App

This sample shows how to add custom objects to the Inventory, display the standard object views, handle relations between objects, plus other UI features. It comes as 2 sets of plugins that must be run independently. The first set, chassis-ui and chassis-service, is the simplest version to get started and is a good introduction to custom objects. The 2nd set, chassisRackVSphere-ui and chassisRackVSphere-service, expands on the first version with more features and a more complete implementation.

Extension points used: vise.navigator.nodespecs, vise.relateditems.specs, vise.inventory.representationspecs, vise.inventory.representationspecs, vise.actions.sets
Extension templates used: vsphere.core.inventory.objectViewTemplate, vsphere.core.inventory.summaryViewTemplate, vsphere.core.inventorylist.objectCollectionTemplate
Key APIs used: DataProviderAdapter, VimObjectReferenceService

Doc references: SDK Tutorial - FAQs - Flex API docs - Java API docs - Programming Guide