Defining an action definition file
The action definition file is a JSON file that provides detailed information about a custom action that is used for page widgets. You must provide a definition file for each custom action in your custom widget package.
When you develop an action, create a IBM® class that inherits from the com.ibm.ecm.extension.PluginAction class. In your class, override the getAdditionalConfiguration() method to return a JSON object.
The following example shows a JSON object:
{"ICM_ACTION_COMPATIBLE": true,
"context": null,
"name": "Custom Add Case Action",
"description": "An action to add cases from other solution",
"properties": [
{
"id": "label",
"title": "Add a custom Case",
"defaultValue": "Custom Add Case",
"type": "string",
"isLocalized":false
},
{
"id": "solution",
"title": "Solution",
"type": "string",
"isLocalized":false
},
{
"id": "caseType",
"title": "Case Type",
"defaultValue": "",
"type": "string",
"isLocalized":false
}
],
"events":[
{
"id":"icm.OpenAddCasePage",
"title":"Open Add custom Case Page",
"direction":"published",
"type":"broadcast",
"description":"Open Add Custom Case Page"
}
]
};
The following table describes the properties that are supported for an action definition
file:
| Property | Required or Optional | Type | Description |
|---|---|---|---|
| ICM_ACTION_COMPATIBLE | Required | Boolean | Set to true if the action can be used in the IBM Case Manager
action framework. This framework extends the IBM Content Navigator action
framework to provide case-related functions. Always set this property to true for IBM Case Manager. |
| type | Optional | String | Indicates special processing for the action. The following values are valid for the type property:
|
| fieldname | Required | String | If the type property is set to checkbox, set this property to the identifier of a property
that is defined in the properties array. If the type property is not set to checkbox, omit the fieldname property. |
| description | Required | String | A brief description of the action. |
| context | Required | Array | Indicates the contexts in which the action can be used. The array elements can take the
following formats:
|
| name | Required | String | The name that is displayed in the user interface for the action. |
| properties | Required | Array | The properties that a user can configure for an action in a toolbar or menu for a page widget or that are used internally by the action at run time. |
| events | Required | Array | The events that are published by the action. This array can be empty if the action does not publish any events. |