The input and output of APIs is in the form of an XML document. Using XML documents enables the Presentation Framework to provide an XML binding mechanism where a developer can form the input necessary to pass to an API and populate a screen with its output.
The binding logic is based on using the name attribute of input fields to map onto an XML attribute. The actual HTML string that needs to be formed is returned by various HTML tag-specific JSP functions and JSP tags that have been provided for that purpose. The HTML that is rendered contains the name attribute set to the appropriate XML path. When data is posted to the server, the servlet provided by the Service Definition Framework captures the request and forms an XML document out of the data in the input and XML path contained in the name attribute. The XML document is then passed as input to the API that has been configured for the action being performed.
For example, you may bind an input box to the ShortDescription attribute of the getItemList() API in an Item search view.
<tr>
<td class="searchlabel" ><yfc:i18n>Short_Description</yfc:i18n></td>
</tr>
<tr>
<td nowrap="true" class="searchcriteriacell" >
<input type="text" class="unprotectedinput"
<%=getTextOptions("xml:/Item/PrimaryInformation/@ShortDescription")%> />
</td>
</tr>
After the JSP functions and JSP tags are resolved,
the HTML is formed as follows:<tr>
<td class="searchlabel" >Short Description</td>
</tr>
<tr>
<td nowrap="true" class="searchcriteriacell" >
<input type="text" class="unprotectedinput"
name="xml:/Item/PrimaryInformation/@ShortDescription" value=""/>
</td>
</tr>
In another example, the user enters Telephone in the input box. When the data is posted to the server, the Presentation Framework forms the following XML document based on the name and the value of the input box.
<Item>
<PrimaryInformation ShortDescription="Telephone"/>
</Item>
Since the Presentation Framework parses the binding string to form the XML, the binding string must follow the syntax below.