bea.com | products | dev2dev | support | askBEA

Download Docs | Site Map | Glossary
Search

Building Queries and Data Views

Creating a Complex Parameter Type

The following sections explain the steps needed to turn a query into a data view data source:

- Creating a CPT schema

Creating a CPT schema

A complex parameter type is defined through a simple XML schema.

Listing 6-1 Sample CPT Schema

>     <?xml version = "1.0" encoding = "UTF-8"?>
>     <!--Generated by Data View Builder 1.1. Conforms to w3c http://www.w3.org/2001/XMLSchema-->
>     <xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema" xmlns:crm="urn:schemas-bea-com:ld-crmp" targetNamespace="urn:schemas-bea-com:ld-crmp" >
>     	<xsd:element name="db">
>     		<xsd:complexType>
>     			<xsd:sequence>
>     				<xsd:element name="PROMOTION" minOccurs="0" maxOccurs="unbounded">
>     					<xsd:complexType>
>     						<xsd:sequence>
>     							<xsd:element name="STATE" type="xsd:string"/>
>     							<xsd:element name="PROMOTION_NAME" type="xsd:string"/>
>     							<xsd:element name="PROMOTION_PLAN" minOccurs="1" \
>     																										maxOccurs="unbounded">
>     								<xsd:complexType>
>     									<xsd:sequence>
>     										<xsd:element name="PROMOTION_NAME" type="xsd:string"/>
>     										<xsd:element name="PLAN_NAME" type="xsd:string"/>
>     										<xsd:element name="FROM_DATE" type="xsd:string"/>
>     										<xsd:element name="TO_DATE" type="xsd:string"/>
>     										<xsd:element name="PRICE" type="xsd:string"/>
>     									</xsd:sequence>
>     								</xsd:complexType>
>     							</xsd:element>
>     						</xsd:sequence>
>     					</xsd:complexType>
>     				</xsd:element>
>     			</xsd:sequence>
>     		</xsd:complexType>
>     	</xsd:element>
>     </xsd:schema>

Elements and Attributes in the Sample XML Schema

The format for XML schemas to be used with complex parameter types is nearly as flexible as XML itself. A combination of a namespace and root uniquely identify the portion of the schema that comprises the CPT.

In the sample CPT schema shown above, the following elements appear:

Table 6-1

Element | Description
--- | ---
<?xml version="1.0" encoding="UTF-8"?> | XML 1.0 definition
<xs:schema targetNamespace="urs:schemas-bea-com:ld-cptSample" | Target namespace
xmlns:crm="urn:schemas-bea-com:ld-cptSample" |
xmlns:xs="http://www.w3.org/2001/XMLSchema" |
elementFormDefault="qualified" |
attributeFormDefault="qualified"> |
<xs:element name="db"> |
<xs:complexType> |