Best Practices for Extending the User Interface Layer
When developing extensions for the user interface layer of the vSphere Client, follow these best practices.
- Create pointer node extensions on the Object Navigator home page only for major applications and solutions. This approach provides consistent and meaningful user experience for the customized vSphere Client.
- When you create action set extensions for a particular type of vSphere object, you must use the extensions filtering mechanism. The defined action sets must be visible only when the user selects the relevant vSphere object type.
- Use the REST API for retrieving data from the service layer. Use proxies only for adding, editing, and deleting issued data requests.
- For better performance, avoid making proxy calls that require more than several seconds to return a response. A best practice is to design your extensions to submit a task that returns immediately, and to track the task progress.
- If you use proxies for data requests, verify that you receive the request response before sending another request through the proxy.
- If you use localization data
for your plug-in package, follow these recommendations:
-
Set the
locale
attribute in the<resource>
element of the plugin.xml manifest file to the value{locale}
. Using the{locale}
value instructs the vSphere Client to display the plug-in by using the current vSphere Client locale.The following XML fragment shows how the<resource>
element can be used in the plug-in module manifest file.<plugin id="com.vmware.samples.htmlsample" defaultBundle="com_vmware_samples_htmlsample"> <resources baseUrl="locales/"> <resource>com_vmware_samples_htmlsample</resource> </resources> .... </plugin>
- To avoid collisions with
other localized plug-in packages, set a unique resource bundle name to the
defaultBundle
attribute of the<plugin>
element in the plug-in manifest file. Use your company name and product name as part of the resource bundle name to make it unique. - Make sure that the filenames of your resource files end with _en_US instead of -en_US
-