Sample Action Rule Templates and User Interface Files

Action Template (atp) files

Note:

The CustomPolicies folder is located at:

TIBCO_HOME/pd/1.2/samples/CustomPolicies

Refer to any of the sample action template files located at:

CustomPolicies/TemplateCustomActionProject/templates/CustomAction.atp

CustomPolicies/samples/requestCounter/templates/RequestCounter.atp

CustomPolicies/samples/hackAlert/templates/HackAlert.atp

Rule Template (rtp) files

Refer to any of the sample rule template files located at:

CustomPolicies/TemplateCustomActionProject/templates/CustomAction.rtp

CustomPolicies/samples/requestCounter/templates/RequestCounter.rtp

CustomPolicies/samples/hackAlert/templates/HackAlert.rtp

Controller Javascript files

Refer to any of the sample controller javascript files located at:

CustomPolicies/TemplateCustomActionProject/ui/controller.js

CustomPolicies/samples/requestCounter/ui/requestCounter/controller.js

CustomPolicies/samples/hackAlert/ui/hackalert/controller.js

Action Javascript files

Refer to any of the sample javascript files that push the value of each user input and set it to the parameters of the corresponding rule template:

CustomPolicies/TemplateCustomActionProject/ui/customaction.js

CustomPolicies/samples/requestCounter/ui/requestCounter/requestcounter.js

CustomPolicies/samples/hackAlert/ui/hackalert/hackalert.js

Descriptor XML files

The sample descriptor xml files are located at:

CustomPolicies/TemplateCustomActionProject/ui/descriptor.xml

CustomPolicies/samples/requestCounter/ui/requestCounter/descriptor.xml

CustomPolicies/samples/hackAlert/ui/hackalert/descriptor.xml

Action XML files

The sample action xml files to generate the UI are located at:

CustomPolicies/TemplateCustomActionProject/ui/ui/customaction.xml

CustomPolicies/samples/requestCounter/ui/requestCounter/ui/requestcounter.xml

CustomPolicies/samples/hackAlert/ui/hackalert/ui/hackalert.xml

String externalization

The sample locale files for externalizing strings are located at:

CustomPolicies/TemplateCustomActionProject/ui/jss/locales.xml CustomPolicies/samples/requestCounter/ui/requestCounter/jss/locales.xml CustomPolicies/samples/hackAlert/ui/hackalert/jss/locales.xml

To externalize strings using the locales.xml file, use dynamics element of General Interface in your custom action XML.

Example from requestcounter.xml:

Remove the fieldtitletext="Number of Requests" attribute in the strings element: <strings isrequired="1" hideoptionalstring="0" jsxname="textFieldNoOfRequests" jsxtitledisplay="" validator="@isPositiveInteger" cdfattribute="NoOfRequests" fieldtitletext="Number of Requests"/>

Replace it with the following strings and dynamics elements: <strings isrequired="1" hideoptionalstring="0" jsxname=" textFieldNoOfRequests " jsxtitledisplay="" validator="@isPositiveInteger" cdfattribute="PollingTime"/> <dynamics fieldtitletext=" requestCounter@NoOfRequests" /> The fieldtitletext element points to the following entry of your locales.xml file: <record jsxid="requestCounter@NoOfRequests" jsxtext="Number Of Requests" />