Sample Action Rule Templates and User Interface Files

Note:

The CustomPolicies folder is located at:

TIBCO_HOME/pd/1.2/samples/CustomPolicies

Action Template (atp) files

Refer to any of the sample action template files located:

CustomPolicies/TemplateCustomActionProject/templates/CustomAction.atpCustomPolicies/samples/requestCounter/templates/RequestCounter.atpCustomPolicies/samples/hackAlert/templates/HackAlert.atp

Rule template (rtp) files

Refer to any of the sample rule template files located:

CustomPolicies/TemplateCustomActionProject/templates/CustomAction.rtpCustomPolicies/samples/requestCounter/templates/RequestCounter.rtpCustomPolicies/samples/hackAlert/templates/HackAlert.rtp 
		  

Controller Javascript files

Refer to any of the sample controller javascripts files located:

CustomPolicies/TemplateCustomActionProject/ui/controller.jsCustomPolicies/samples/requestCounter/ui/requestCounter/controller.jsCustomPolicies/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.jsCustomPolicies/samples/requestCounter/ui/requestCounter/requestcounter.jsCustomPolicies/samples/hackAlert/ui/hackalert/hackalert.js 
		 

Descriptor XML files

The sample descriptor XML files are located:

CustomPolicies/TemplateCustomActionProject/ui/descriptor.xmlCustomPolicies/samples/requestCounter/ui/requestCounter/descriptor.xmlCustomPolicies/samples/hackAlert/ui/hackalert/descriptor.xml 
		  

Action XML files

The sample action XML files to generate the UI are located:

CustomPolicies/TemplateCustomActionProject/ui/ui/customaction.xmlCustomPolicies/samples/requestCounter/ui/requestCounter/ui/requestcounter.xmlCustomPolicies/samples/hackAlert/ui/hackalert/ui/hackalert.xml

String externalization

The sample locale files for externalizing strings are located:

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 the 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" />