Once you create a template project for your HTML plug-in, you must be familiar with the folder structure of the project and the purpose of each file inside the project. This knowledge will help you to easily create your custom plug-ins for the vSphere Client.

The following tables contain detailed information about the structure of the UI and Java service components of the HTML plug-in project template.

Details About the UI Project Template Structure

User Interface Project Structure

Description

/myplugin-ui

/src/main

locale

en_US

Contains string resources for the English locale. You can use the build-resources script to compile the resources.

Contains string resources for the French locale. You can use the build-resources script to compile the resources.

fr_FR

webapp

assets

css

Contains assets used in the plug-in such as images, CSS files, and JavaScript libraries. The css folder contains the plugin-icons.css file that you can use to define the external icons. For more information, see Guidelines for Creating Plug-Ins Compatible with the vSphere Client.

images

META-INF

MANIFEST.MF

Contains the manifest file of the WAR bundle. The file contains the following manifest headers:

Bundle-SymbolicName - Specifies a unique identifier for the bundle.

Web-ContextPath - Specifies the Web application context path which must start with vsphere-client/.

Import-Package - Lists the packages on which the UI bundle depends including references to classes from the Java service layer.

resources

js

Contains the HTML and JavaScript resources of the UI bundle.

The js folder includes also the web-platform.js file. This file contains the JavaScript initialization code that is generated for each project. For more information, see vSphere Client JavaScript APIs.

host-monitor.html

mainView.html

WEB-INF

spring

bundle-context.xml

Contains the Spring configuration which you can use to declare the services from the service layer that the UI bundle uses.

web.xml

The deployment descriptor that describes the classes, resources and configuration of the application.

plugin.xml

The manifest file that uses metadata to define the plug-in extensions and resources. See User Interface Plug-In Module Manifest.

build-plugin-package.bat

build-plugin-package.sh

build-plugin-package.xml

build-resources.bat

build-resources.sh

build-resources.xml

build-war.bat

build-war.sh

build-war.xml

plugin-package.xml

Contains the automation scripts for generating the WAR file, compiling the resources for the UI component, for building the plug-in package folder from the UI and Java service components, and the template plugin-package.xml manifest file.

For more information about he structure of the plug-in package and the metadata provided with the plugin-package.xml file, see Plug-In Package Overview and XML Elements of the Plug-In Package Manifest File.

Details About the Java Service Project Template Structure

Java Service Project Structure

Description

myplugin-service

/src/main

java/com/mycompany/myplugin

mvc

Contains the controllers that manage requests to the /actions.html, /data, and /services endpoints. The folder contains also utility classes related to the controllers.

services

Contains the sample Echo service and the sample service that responds to user actions.

resources/META-INF

spring

Contains the Spring configuration files and the bundle manifest file.

MANIFEST.MF

build-java.bat

build-java.sh

build-java.xml

Contains the automation scripts for generating the Java service bundle.