The metadata in the manifest file follows a specific XML schema. The major XML elements of a user interface plug-in module manifest include the <plugin> element, the <resources> element, and one or more <extension> elements. The vSphere Web Client SDK contains several examples of user interface plug-in modules with complete plugin.xml manifest files.

The <plugin> element is the root element of any plug-in module manifest file. All other elements are contained within the <plugin> element. The attributes of the <plugin> element contain information about the entire plug-in module.

Attributes of the <plugin> Element

Attribute Name

Attribute Description

id

The unique identifier that you choose for the plug-in module.

moduleUri

A Uniform Resource Identifier (URI) for the SWF file in the plug-in module. The SWF file contains the Flex or ActionScript classes used by the extensions in the plug-in module. The URI must be specified relative to the root directory of the plug-in module WAR bundle.

securityPolicyUri

A URI for a standard cross-domain security policy file. This optional element is used when the plug-in module is hosted remotely and the domain of the plug-in module URL is different from the domain vSphere Web Client application server. For more information on specifying a cross-domain security policy file, go to http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html .

defaultBundle

The name of the default resource bundle for the plug-in module. The bundle name must be unique to your plug-in module to avoid name clashing issues with other plug-in modules. Resources, such as localization data and icons, can be dynamically loaded at runtime. See Specifying Dynamic Resources

The following XML fragment shows how the <plugin> element might appear in the plug-in module manifest file.

<plugin id="com.acme.sampleplugin" 
                 moduleUri="SampleModule.swf" 
                 defaultBundle="com_acme_sampleplugin">
        ...
          <!-- additional plugin data -->
        ...
</plugin>

The <resources> element is used to specify the location of the plug-in module runtime resources, such as localization data. In general, resources are bundled in separate SWF files from the SWF file that contains the plug-in module Flex classes. The vSphere Web Client supports the same set of locales as vCenter Server. The default locale is the locale set by the user’s Web browser. If the user’s Web browser is not set to a locale that the vSphere Web Client supports, the vSphere Web Client defaults to the English (United States) locale.

A best practice is to set the locale attribute in the <resource> element to the value {locale}, rather than hard-coding a specific locale, in your plugin.xml manifest. Using the {locale} value instructs the vSphere Web Client to use the locale that your Web browser specifies at runtime.

For the vSphere Web Client to import the resource locale properly at runtime, resource bundles for all supported locales must be included in the plug-in module. Currently supported locales include English (United States) (en_US), French (fr_FR), German (de_DE), Japanese (ja_JP), Korean (ko_KR), and Mandarin Chinese (zh_CN) locales. For testing purposes, you can make copies of the default locale for any languages for which you do not have resources available. The sample plug-in modules included with the vSphere Web Client SDK demonstrate this method.

The plug-in module manifest file must define each extension that the plug-in module adds to the vSphere Web Client. Each extension is defined using the <extension> element. The <extension> element contains information about each feature, and its exact composition varies depending on the kind of user interface element your plug-in module is adding. See Defining Extensions.