To create an instance of the standard object view template, you use the <templateInstance> element in your plug-in module’s
plugin.xml file. Inside the
<templateInstance> element, you define the variables that describe the specific instance of the template.
Example: Instantiating the Standard Template in plugin.xml shows an example of how to instantiate the object view template for a new object called a Rack. The
<templateInstance> shown in the example cam appear anywhere inside the root
<plugin> element in the
plugin.xml file, but a best practice is to include the template definition with any other extension definitions.
In Example: Instantiating the Standard Template in plugin.xml, the
<templateInstance> element contains an
id attribute, which is a unique identifier of your choice.
The <templateId> element contains the identifier of the template you want to create. To use the standard object view template included with the vSphere Web Client SDK, this identifier must be
vsphere.core.inventory.objectViewTemplate. To use the
objectViewTemplate, you must define a
namespace variable and an
objectType variable.
The namespace variable sets the naming convention for the object workspace extension points. When the vSphere Web Client creates the extension points for the object workspace, it prepends the value of the
namespace variable onto the default extension point names for each data view.
In Example: Instantiating the Standard Template in plugin.xml, the
namespace variable has a value of
com.vmware.samples.rack. The vSphere Web Client uses the value to create an extension point for each data view included in the standard object workspace. The extension point for the
Monitor tab for the Rack object workspace is named
com.vmware.samples.rack.monitorViews. The other extension points in the Rack object workspace are named using the same convention.
You use the objectType variable to associate the object workspace with your custom entity type. Your custom entity type name should include a namespace prefix, such as your company name, to avoid clashing with other object type names in the vSphere environment. The vSphere Web Client displays the object workspace when the user selects an object of the specified type. In
Example: Instantiating the Standard Template in plugin.xml, the
objectType variable has the value
samples:Rack. The object workspace created by the template appears in the vSphere Web Client when the user selects a Rack object.
The vSphere Web Client SDK contains a template that you can use to create a standard Summary tab view for your custom object. The standard
Summary tab view contains a Summary header view displayed at the top of the main workspace, and an extension point for any number of Portlet views below the header. The extension point that the template creates for Portlet views is named
namespace.summarySectionViews.
To use the standard Summary tab template, you must create an instance of the template in your plug-in module plugin.xml file, using the
<templateInstance> element. The
<templateInstance> element can appear anywhere in the root
<plugin> element, but after the definition for the standard object workspace template.
Example 4-8, on page 41, shows an example of how to instantiate the Summary tab template for a custom object called a Rack.
In Example: Instantiating the Summary Tab Template in plugin.xml, the
<templateInstance> element contains an
id attribute, which is a unique identifier of your choice.
The <templateId> element contains the identifier of the template to create. To use the standard Summary tab template included with the vSphere Web Client SDK, this identifier must be
vsphere.core.inventory.summaryViewTemplate. To use the
summaryViewTemplate, you must define a
namespace variable and a
summaryHeaderView variable.
The value you supply for the namespace variable must match the
namespace for the
Summary tab’s parent object workspace. The
Summary tab created by the Summary tab template uses the extension point
namespace.summaryViews, as defined by the object workspace template.
The Summary tab template also creates the extension point namespace.summarySectionViews. You can use the
namespace.summarySectionViews extension point to add portlet data views to your custom object
Summary tab.
In Example: Instantiating the Summary Tab Template in plugin.xml, the
namespace variable has a value of
com.vmware.samples.rack, matching the
namespace variable in the Rack object workspace template.
You use the summaryHeaderView variable to specify the data view that appears at the top of the
Summary tab. The value you supply for the
summaryHeaderView variable must be the fully qualified class name for an MXML data view class in your plug-in module. If you omit the
summaryHeaderView variable, no header appears in the
Summary tab, and the main workspace displays the portlet data views you create at the
namespace.summarySectionViews extension point, if any.
After you create a Summary tab for your custom object workspace by using the Summary tab template, you can add portlet data views to the
Summary tab. You create the portlet data views at the
namespace.summarySectionViews extension point that the template creates, in the same way that you do for any other extension point in the Virtual Infrastructure. See
Defining a Data View Extension.