Each action data object in a set is a data object of type com.vmware.actionsfw.ActionSpec. You must create an ActionSpec data object for every action to add to the action set.

You create each ActionSpec data object by using a <com.vmware.actionsfw.ActionSpec> XML element. In this element, you set the properties for the action.

Property

Type

Description

<uid>

string

Unique identifier of the action. Using namespace style is a best practice, for example com.mySolution.myPlugin.chassis.chassisPowerAction.

<label>

string

String containing the text label for the action, suitable for a button or context menu in the vSphere Web Client user interface.

<description>

string

Optional. String containing a short description of the action, suitable for a tooltip.

<icon>

resource

Optional. Icon class or dynamic resource for the action.

<acceptsMultipleTargets>

boolean

Optional. If you set this value to true, the action can be made available when the user selects multiple vSphere objects.

<conditionalProperty>

string

Optional. Indicates the name of a Boolean property on the target vSphere or custom object. You can use the value of the property specified to define whether the action is available on the target object. For example, you can specify a Boolean property on a Virtual Machine object, and make your action available only when that property is true.

<privateAction>

boolean

Optional. A flag that indicates that this action must not be used by the Actions Framework except when explicitly identified by its <uid>. For example, you can set the property value to true when you define a context-less action. Examples of such actions are global actions in a list toolbar or drag-and-drop actions that must not be available in the default menu.

<command>

string

Command class for a Flex-based action. The command class contains a method annotated to handle the event that the vSphere Web Client generates when the user invokes your action. The handler method must then perform the actual action operation on the vSphere environment.

The following example shows an extension definition for a Flex-based action set extension. In the example, the extension adds a set of two actions to the vSphere Web Client Actions Framework. The actions are associated with a custom object type called Chassis.

<extension id="mySolution.myPlugin.myActionSet">
    <extendedPoint>vise.actions.sets</extendedPoint>
    <object>
        <actions>
            <!-- first action -->
            <com.vmware.actionsfw.ActionSpec>
                <uid>com.mySolution.myPlugin.chassis.createChassis</uid>
                <label>Create Chassis</label>
                <description>Create a Chassis object.</description>
                <icon>#{myPluginImages:sample1}</icon>
                <acceptsMultipleTargets>false</acceptsMultipleTargets>
                <command className="com.mySolution.myPlugin.ChassisCommand"/>
            </com.vmware.actionsfw.ActionSpec>
            <!-- second action -->
            <com.vmware.actionsfw.ActionSpec>
                <uid>com.mySolution.myPlugin.chassis.editChassis</uid>
                <label>Edit Chassis</label>
                <description>Edit a Chassis object.</description>
                <icon>#{myPluginImages:sample2}</icon>
                <acceptsMultipleTargets>true</acceptsMultipleTargets>
                <conditionalProperty>actions.isEditAvailable</conditionalProperty>
                <command className="com.mySolution.myPlugin.ChassisCommand"/>
            </com.vmware.actionsfw.ActionSpec>
        </actions>
    </object>
    <metadata>
        <!-- filters the actions in the set to be visible only for Chassis -->
        <objectType>samples:Chassis</objectType>
    </metadata>
</extension>