You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by aj...@apache.org on 2005/12/02 08:04:38 UTC
svn commit: r351617 - in /webservices/axis2/trunk/java/xdocs/adb:
adb-codegen-integration.html adb-howto.html adb-tweaking.html
Author: ajith
Date: Thu Dec 1 23:04:29 2005
New Revision: 351617
URL: http://svn.apache.org/viewcvs?rev=351617&view=rev
Log:
Updated the documentation on ADB
Modified:
webservices/axis2/trunk/java/xdocs/adb/adb-codegen-integration.html
webservices/axis2/trunk/java/xdocs/adb/adb-howto.html
webservices/axis2/trunk/java/xdocs/adb/adb-tweaking.html
Modified: webservices/axis2/trunk/java/xdocs/adb/adb-codegen-integration.html
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/xdocs/adb/adb-codegen-integration.html?rev=351617&r1=351616&r2=351617&view=diff
==============================================================================
--- webservices/axis2/trunk/java/xdocs/adb/adb-codegen-integration.html (original)
+++ webservices/axis2/trunk/java/xdocs/adb/adb-codegen-integration.html Thu Dec 1 23:04:29 2005
@@ -1,6 +1,30 @@
<html>
+<head>
+ <meta http-equiv="content-type" content="">
+ <title></title>
+</head>
+
<body>
-<h1> This is the ADB Integration guide. Sadly It's not complete yet! </h1>
+<h1>ADB Integration With Axis2</h1>
+
+<h2>Introduction</h2>
+
+<p>ADB Integration with Axis2 is simple and straightforward. Given the
+extension mechanism of the Axis2 code generator, the obvious choice for the
+integrator is to write an extension. The extension that is added to support
+ADB is the SimpleDBExtension and can be found in the extensions list of the
+codegen-config.properties file</p>
+<h2>Things to Remember</h2>
+<ol>
+ <li>The SimpleDBExtension adds a prefix to the ADB packaging. This prefix
+ is curently adb, hence all the ADB generated code will be inside the
+ adb.* package. This prefix is used by the ant build file template and any
+ change done to this prefix needs to be carefully handled in order to keep
+ the ant build intact.</li>
+ <li>SimpleDBExtension is made to process requests only when the databinding
+ framework is specified as ADB (using the switch -d adb )</li>
+</ol>
+<hr/>
</body>
</html>
Modified: webservices/axis2/trunk/java/xdocs/adb/adb-howto.html
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/xdocs/adb/adb-howto.html?rev=351617&r1=351616&r2=351617&view=diff
==============================================================================
--- webservices/axis2/trunk/java/xdocs/adb/adb-howto.html (original)
+++ webservices/axis2/trunk/java/xdocs/adb/adb-howto.html Thu Dec 1 23:04:29 2005
@@ -6,6 +6,7 @@
<meta content="">
<meta content="">
<meta content="">
+ <meta content="">
<title>ADB - Howto</title>
</head>
@@ -136,6 +137,8 @@
<li>All top level elements become classes. This is rather a questioning
feature but unless classes are generated for the top level elements the
handling of elements become difficult and messy!</li>
+ <li>SimpleType restrictions are handled by replacing the relevant type with
+ the basetype</li>
</ol>
<p>Once the code is generated according to the rules it looks like the
@@ -245,6 +248,16 @@
<li><a href="adb-codegen-integration.html">ADB and Axis2
Integration</a></li>
</ul>
+
+<h2>Known Limitations</h2>
+ADB is meant to be a 'Simple' databinding framework and was not meant to
+compile all types of schemas. The following limitations are the most
+highlighted.
+<ol>
+ <li>Complex Extensions and Restrictions are not supported.</li>
+ <li>Choice (Particle) is not supported</li>
+ <li>SimpleType Unions are not supported</li>
+</ol>
<hr>
</body>
</html>
Modified: webservices/axis2/trunk/java/xdocs/adb/adb-tweaking.html
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/xdocs/adb/adb-tweaking.html?rev=351617&r1=351616&r2=351617&view=diff
==============================================================================
--- webservices/axis2/trunk/java/xdocs/adb/adb-tweaking.html (original)
+++ webservices/axis2/trunk/java/xdocs/adb/adb-tweaking.html Thu Dec 1 23:04:29 2005
@@ -1,5 +1,97 @@
+<html>
+<head>
+ <meta http-equiv="content-type" content="">
+ <title></title>
+</head>
+
<body>
-<h1> This is the ADB Tweaking guide. Sadly It's not complete yet! </h1>
+<h1>ADB Tweaking Guide</h1>
+
+<h2>Introduction</h2>
+
+<p>ADB is written with future extensions in mind, with a clear and flexible
+way to extend or modify it's functionality. This document explains available
+mechanisms to extend ADB and possibly adopt it to compile schemas to support
+other languages.</p>
+
+<h2>Know the Configuration</h2>
+
+<p>The configuration for the ADB framework is in the
+<strong>schema-compile.properties</strong> file found in the
+<strong>org.apache.axis2.databinding.schema</strong> package. This properties
+file has the following important properties</p>
+<ul>
+ <li>schema.bean.writer.class
+ <p>This is the writer class. This is used by the schema compiler to write
+ the beans and should implement the
+ <strong>org.apache.axis2.databinding.schema.writer.BeanWriter</strong>
+ inteface. The schema compiler delegates the bean writing task to the
+ specified instance of the BeanWriter.</p>
+ </li>
+ <li>schema.bean.writer.template
+ <p>This specifies the template to be used in the BeanWriter. The
+ beanWriter author is free to use any mechanism to write the classes but
+ the default mechanism is to use a xsl template. This property may be left
+ blank if the BeanWriter implementation does not require a template.</p>
+ </li>
+ <li>schema.bean.typemap
+ <p>This is the type map to be used by the schema compiler. it should be
+ an implementation of the
+ <strong>org.apache.axis2.databinding.schema.typemap</strong> interface.
+ The default typemap implementation encapsulates a hashmap with type QName
+ to Class name string mapping.</p>
+ </li>
+</ul>
+
+<h2>The First Tweak - Generate Plain Java Beans</h2>
+
+<p>The first, most simple tweak for the code generator could be to switch to
+plain bean generation. The default behavior of the ADB framework is to
+generate ADBBeans, but most users, if they want to use ADB as a standalone
+compiler, would love to have plain java beans. This can infact be done by
+simply changing the template used.</p>
+
+<p>The template for plain java beans is already available in the
+<strong>org.apache.axis2.databinding.schema.template </strong>package. To
+make this work replace the
+<strong>/org/apache/axis2/databinding/schema/template/ADBBeanTemplate.xsl
+</strong>with the
+<strong>/org/apache/axis2/databinding/schema/template/PlainBeanTemplate.xsl
+</strong>in the schema-compile.properties<strong>.</strong> Congratualtions!
+You just tweaked ADB to generate plain java beans.</p>
+
+<p>To generate custom formats, the templates need to be modified. The schema
+for the xml generated by the JavaBeanWriter is availble in the source tree
+under the Other directory in the codegen module. Advanced users with
+knowledge of XSLT can easily modify the templates to generate code in their
+own formats.</p>
+
+<h2>A More Advanced Tweak - Generate Code for Another Language</h2>
+
+<p>To generate code for another language, there are two main components are
+to be written.</p>
+<ul>
+ <li>The BeanWriter
+ <p>Implement the BeanWriter interface for this class. A nice example is
+ the
+ <strong>org.apache.axis2.databinding.schema.writer.JavaBeanWriter</strong>
+ which has a lot of reusable code. Infact if the language is OOP based
+ (such as C# or even C++), one would even be able to extend the
+ JavaBeanWriter itself.</p>
+ </li>
+ <li>The TypeMap
+ <p>Implement the TypeMap interface for this class. The
+ <strong>org.apache.axis2.databinding.schema.typemap.JavaTypeMap</strong>
+ class is a simple implementation for the typemap where the QName to class
+ name strings are kept inside a hashmap instance. This technique is fairly
+ sufficient and only the type names would need to change to support
+ another language.</p>
+ </li>
+</ul>
+
+<p>Surprisngly this is enough to have other language support for ADB. Change
+the configuration and you are ready to generate code for other lanuages!</p>
+<hr/>
</body>
</html>