Monday, May 17, 2010

ADF input forms generator (from XSD to a web page)

There is one XSD file which has is "Define Conuntry application input data definition".
So it defines all the data you have to fill in to create a Country info. XSD defines which fileds are mandatory and which are optional.
We would like to create an internet service to allow creating/displaying a Country.

<schema xmlns=""
<element name="CountryInfo">
<element name="Country" maxOccurs="unbounded">
<element name="Name" type="string"/>
<element name="Capital" type="string"/>
<element name="Area" type="decimal"/>

1)-In JDev, Select the XSD in the Applications Navigator.
2)- Right Click the xsd file and select "Generate JAXB2.0 contet Model".
3)-It generates the required java files.
4)-Right click the relevant Java file(e.g in this case ,
5)-Select "Create Data Control" and generate the .dcx file.

Now you can use this Data Control to drag and drop to build any ADF component such as a Form Layout or a Table etc etc.

Bottom Line is somehow you need to create a DataControl out of the XSD file to use that declaratively to build an ADF UI.

You can also generate the Webservice out of these XSD through JAXB and expose that to build UI, either using ADF datacontrol or any standard J2EE solution.

No comments: