blob: 1eeb20b4490a5f27bfd6c421de1c6092c1fa9f15 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://schemas.niku.com/2002/httpBinding" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:bd="http://schemas.niku.com/2002/httpBinding" elementFormDefault="qualified">
<xsd:element name="requestBinding" type="bd:requestBindingType">
<xsd:annotation>
<xsd:documentation xml:lang="en">requestBinding is a collection of binding elements that describe a binding from HTTP name/value pairs to a XML document</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="requestBindingType">
<xsd:annotation>
<xsd:documentation xml:lang="en">A complex type that specifies bindings for HTTP name-value pairs into XML</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="binding" type="bd:bindingType" minOccurs="0" maxOccurs="unbounded"/>
<!-- We only update one grid at time right now -->
<xsd:element name="gridBinding" type="bd:gridBindingType" minOccurs="0" maxOccurs="1"/>
<xsd:element name="selector" type="bd:selectorType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="bindAllParams" type="xsd:boolean" default="false">
<xsd:annotation>
<xsd:documentation xml:lang="en">When true, all HTTP parameters will be marshalled regardless if a binding exists for them. If no binding is found, the "canonical" marshalling algorithm will be used to append the parameter node to the end of the document</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="gridBindingType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
Grid bindings create a special format of the document in order marshal all the updated
fields of an editable grid. Since grids may contain more than one object type with multiple fields
of the object being updated the gridBinding instructs the HttpMarshaller to create elements in the document
of the form:
<objects>
<object code="object_code">
<parameter_name value="parameter_value" original_value="original_parameter_value"/>
...
</object>
<object code="object_code">
<parameter_name value="parameter_value"/>
</object>
</objects>
Ex.)
An updatable grid based on the investment data provider that updates the Budgeted Cost field
on three rows, two of which are project objects and one which is the application object would
create a document fragment that looks like:
<objects>
<object code="project">
<budget_cost_total value="5000000" original_value="4000000"/>
<odf_pk value="5000001"/>
</object>
<object code="project">
<budget_cost_total value="6000000" original_value="5000000"/>
<odf_pk value="5000002"/>
</object>
<object code="application">
<budget_cost_total value="3000000" original_value="3200000"/>
<odf_pk value="5000003"/>
</object>
</objects>
</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="bindingType">
<!--
Bindings are stored in a binding cache (ActionBindingCache). The bindings are
placed in a HashMap called a BindingMap and then the BindingMap is stored in the ActionBindingCache.
The keys to the BindingMap are built from the binding 'from' element using the from 'id' and the from 'source' attributes.
Since gridBindings don't have a 'from' element we need another way to key the grid binding in the
BindingMap. The 'id' attribute on the gridBinding element is the mechanism to key the grid binding
into the BindingMap.
-->
<xsd:attribute name="id" type="xsd:string" use="required"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="bindingType">
<xsd:annotation>
<xsd:documentation xml:lang="en">A binding consists of one from entity containing the name of the HTTP parameter and at least one to entity containg the destination location in the XML. Multiple to elements can be used to bind the parameter to more than one destination in the XML.</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="from" type="bd:fromType"/>
<xsd:element name="to" type="bd:toType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="selectorType">
<xsd:annotation>
<xsd:documentation xml:lang="en">A selector defines a group of bindings that are logically related by a selector widget. Selector widgets are typically used in a list table and allow the user to select one or more rows from the table for processing.</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="binding" type="bd:bindingType" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required">
<xsd:annotation>
<xsd:documentation xml:lang="en">The id/name of the selector widget as it will appear in the HTTP request. It must be unique for the entire requestBinding.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="fromType">
<xsd:annotation>
<xsd:documentation xml:lang="en">The from element specifies the name/id of the HTTP parameter. The default atribute can define an optional default value for group of radio buttons or single check boxes.</xsd:documentation>
</xsd:annotation>
<xsd:attribute name="id" type="xsd:string" use="required"/>
<xsd:attribute name="source" use="optional" default="request">
<xsd:annotation>
<xsd:documentation xml:lang="en">Specifies the source from which the parameter value is retreived.</xsd:documentation>
</xsd:annotation>
<xsd:simpleType name="sourceTypes">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="request"/>
<xsd:enumeration value="session"/>
<xsd:enumeration value="cookie"/>
<xsd:enumeration value="header"/>
<xsd:enumeration value="config"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="parameterType" use="optional" default="httpParameterValue">
<xsd:annotation>
<xsd:documentation xml:lang="en">Specifies the type of parameter. Most parameters are http parameters and are retreived from the incoming set of HTTP parameters. Some parameters however, need to come from other sources like the server name, server protocol, and server port, which come from the HttpServletRequest.</xsd:documentation>
</xsd:annotation>
<xsd:simpleType name="parameterTypes">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="httpParameterValue"/>
<xsd:enumeration value="servletRequestValue"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="toType">
<xsd:annotation>
<xsd:documentation xml:lang="en">The to element specifies the destination of the parameter value in the XML</xsd:documentation>
</xsd:annotation>
<xsd:attribute name="destination" use="optional" default="request">
<xsd:annotation>
<xsd:documentation xml:lang="en">Specifies the destination source into which the parameter value is placed.</xsd:documentation>
</xsd:annotation>
<xsd:simpleType name="destinationTypes">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="request"/>
<xsd:enumeration value="session"/>
<xsd:enumeration value="cookie"/>
<xsd:enumeration value="header"/>
<xsd:enumeration value="config"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="location" type="xsd:string" use="required">
<xsd:annotation>
<xsd:documentation xml:lang="en">The location attribute is destination of the parameter value in the XML in the form of an absolute XPath location path expression</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="repeatingLocation" type="xsd:string">
<xsd:annotation>
<xsd:documentation xml:lang="en">The repeatingLocation attribute is used for repeating a binding of one name into multiple destinations in the XML.
It is also in the form of an absolute XPath location expression that must be equivalent to or an ancestor of the location attribute. The last name step of this expression
will be repeated in the resulting XML document for each matching name in the HTTP request. It will never be an attribute, always an element. This is typcially found in "list" HTML tables where each
column of the table has the same name but repeated over numerous rows of data.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="defaultValue" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">The default value of the binding. Will be used when the parameter is not present in the HTTP request.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="selector" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">The id/name of the selector widget as it will appear in the HTTP request. It must be unique for the entire requestBinding.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
</xsd:schema>