Develop a Custom Control Handler
PHP or any other programming technology can be used to implement the required custom control handler for Custom Controls.
Custom controls can also be used with JavaScript that has been included for use by Intelligent Advisor interview screens. The JavaScript will be automatically loaded during the Intelligent Advisor interview and will appear as separate <script>
tags at the top of each page. The web service which renders the custom control can then utilize this content. For more information, see Add JavaScript to screens.
Note that for Intelligent Advisor Cloud Service, if the secure HTTPS protocol is used for the custom control URL, the server must support Transport Layer Security (TLS) 1.1 or later. TLS 1.0 is not supported. TLS 1.2 is recommended. Also be sure to understand the security considerations for custom control handlers.
This topic gives more information on the HTTP POST used to invoke the page for custom styling when a control on an Intelligent Advisor interview screen has been defined as a custom control.
When the Intelligent Advisor interview reaches a screen containing a custom control, Intelligent Advisor:
- calls the content at the specified location via an HTTP POST, and
- inserts that content inline in the HTML page of the Intelligent Advisor interview, in place of the control itself.
The HTTP POST will contain the following information:
- the interview language
- whether the control is an input or a label
- the caption of the control being displayed after any substitutions have been applied
- the HTML id for the control on the Intelligent Advisor interview screen HTML page
- whether the control is read-only
- (for input controls) the name of the attribute as defined in the policy model
- (for input controls) the current value of the attribute
- the current values of all attributes in the Intelligent Advisor interview
- any custom properties that are attached to the control
For further information on the HTTP POST parameters used to call the custom content, see Custom Control Parameter Reference.
Note that the HTML content returned will be incorporated into a larger HTML page, so is not a full HTML page in its own right.
Tip: There is an alternate version of Emergency Response using custom controls. This project is installed with custom control files implemented using PHP. To view instructions for configuring these files to work in an Oracle B2C Service interview, see Example: Custom Control Project. These instructions are also available on the first interview screen of the project itself.
The following is a sample HTTP POST:
Header
POST /resource/id.php HTTP/1.1
Content-Type: application/x-www-form-urlencoded
charset: utf-8
Cache-Control: no-cache
Pragma: no-cache
User-Agent: Java/1.7.0_45
Host: webaddress.com
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-Length: 1000
Body
name=global_global_nearest_city&opa-id=global_global_nearest_city&opa-control-type=TextInputControl&text=Select+the+nearest+major+city+to+the+incident%3Cbr%3E%3Cbr%3E&opa-locale=en-GB&value=&custom-properties=%3Cproperties%3E%3Cproperty+key%3D%22myFirstKey%22%3EmyFirstValue%3C%2Fproperty%3E%3Cproperty+key%3D%22mySecondKey%22%3EmySecondValue%3C%2Fproperty%3E%3C%2Fproperties%3E&opa-session=%3C%3Fxml+version%3D%221.0%22+%3F%3E%3Csession-data+xmlns%3D%22http%3A%2F%2Foracle.com%2Fdeterminations%2Fengine%2Fsessiondata%2F10.2%22%3E%3Centity+id%3D%22global%22%3E%3Cinstance+id%3D%22global%22%3E%3Cattribute+id%3D%22nearest_city%22+type%3D%22text%22+inferred%3D%22false%22%3E%3Cunknown-val%2F%3E%3C%2Fattribute%3E%3Cattribute+id%3D%22gps_coords%22+type%3D%22text%22+inferred%3D%22false%22%3E%3Cunknown-val%2F%3E%3C%2Fattribute%3E%3Cattribute+id%3D%22number_vehicles%22+type%3D%22text%22+inferred%3D%22false%22%3E%3Cunknown-val%2F%3E%3C%2Fattribute%3E%3C%2Finstance%3E%3C%2Fentity%3E%3C%2Fsession-data%3E
Body with values replaced by [descriptors]
name=[HTML form name of the control]&opa-id=[HTML ID of the control]&opa-control-type=[Interview Control Type]&text=[The current text of the Interview Control]%3Cbr%3E%3Cbr%3E&opa-locale=[Interview Language]&value=[Current value of the control]&custom-properties=[Custom Properties]&opa-session=[opa-session]