You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by de...@apache.org on 2007/08/13 12:13:23 UTC

svn commit: r565295 [2/14] - in /webservices/axis2/site/1_3: ./ adb/ jibx/ src/

Added: webservices/axis2/site/1_3/adb/adb-advanced.html
URL: http://svn.apache.org/viewvc/webservices/axis2/site/1_3/adb/adb-advanced.html?view=auto&rev=565295
==============================================================================
--- webservices/axis2/site/1_3/adb/adb-advanced.html (added)
+++ webservices/axis2/site/1_3/adb/adb-advanced.html Mon Aug 13 03:13:18 2007
@@ -0,0 +1,417 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+
+
+
+
+
+
+
+
+<html>
+  <head>
+    <title>Apache Axis2 - </title>
+    <style type="text/css" media="all">
+      @import url("../../css/maven-base.css");
+      @import url("../../css/maven-theme.css");
+      @import url("../../css/site.css");
+    </style>
+    <link rel="stylesheet" href="../../css/print.css" type="text/css" media="print" />
+        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+      </head>
+  <body class="composite">
+    <div id="banner">
+                  <a href="../" id="bannerLeft">
+    
+                                    <img src="http://www.apache.org/images/asf_logo_wide.png" alt="" />
+    
+            </a>
+                          <span id="bannerRight">
+    
+                                    <img src="http://ws.apache.org/axis2/images/axis.jpg" alt="" />
+    
+            </span>
+            <div class="clear">
+        <hr/>
+      </div>
+    </div>
+    <div id="breadcrumbs">
+          
+  
+
+  
+    
+  
+  
+            <div class="xleft">
+        Last Published: 08/13/2007
+                      </div>
+            <div class="xright">      <a href="../../index.html">Axis2/Java</a>
+          |
+          <a href="http://ws.apache.org/axis2/c">Axis2/C</a>
+          |
+          <a href="../../../../">Apache WS</a>
+          |
+          <a href="http://www.apache.org">Apache</a>
+          
+  
+
+  
+    
+  
+  
+  </div>
+      <div class="clear">
+        <hr/>
+      </div>
+    </div>
+    <div id="leftColumn">
+      <div id="navcolumn">
+           
+  
+
+  
+    
+  
+  
+                   <h5>Axis2/Java</h5>
+        <ul>
+              
+    <li class="none">
+              <a href="../../index.html">Home</a>
+        </li>
+          </ul>
+          <h5>Downloads</h5>
+        <ul>
+              
+    <li class="none">
+              <a href="../../download.cgi">Releases</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../modules/index.html">Modules</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../tools/index.html">Tools</a>
+        </li>
+          </ul>
+          <h5>Documentation</h5>
+        <ul>
+              
+          
+              
+      
+            
+      
+            
+      
+            
+      
+            
+      
+            
+      
+            
+      
+            
+      
+              
+        <li class="expanded">
+              <a href="../../1_3/contents.html">Version 1.3</a>
+                <ul>
+                  
+    <li class="none">
+              <a href="../../1_3/toc.html">Table of Contents</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/installationguide.html">Installation Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/quickstartguide.html">QuickStart Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/userguide.html">User Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/pojoguide.html">POJO Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/spring.html">Spring Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/webadminguide.html">Web Administrator's Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/migration.html">Migration Guide (from Axis1)</a>
+        </li>
+              </ul>
+        </li>
+              
+    <li class="none">
+              <a href="../../1_2/contents.html">Version 1.2</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../1_1_1/contents.html">Version 1.1.1</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../1_1/contents.html">Version 1.1</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../1_0/index.html">Version 1.0</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../0_95/index.html">Version 0.95</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../0_94/index.html">Version 0.94</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../0_93/index.html">Version 0.93</a>
+        </li>
+          </ul>
+          <h5>Resources</h5>
+        <ul>
+              
+    <li class="none">
+              <a href="../../faq.html">FAQ</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../articles.html">Articles</a>
+        </li>
+              
+    <li class="none">
+              <a href="http://wiki.apache.org/ws/FrontPage/Axis2/">Wiki</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../refLib.html">Reference Library</a>
+        </li>
+              
+    <li class="none">
+              <a href="http://ws.apache.org/axis2/1_3/api/index.html">Online Java Docs</a>
+        </li>
+          </ul>
+          <h5>Get Involved</h5>
+        <ul>
+              
+    <li class="none">
+              <a href="../../overview.html">Overview</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../svn.html">Checkout the Source</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../mail-lists.html">Mailing Lists</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../release-process.html">Release Process</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../guidelines.html">Developer Guidelines</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../siteHowTo.html">Build the Site</a>
+        </li>
+          </ul>
+          <h5>Project Information</h5>
+        <ul>
+              
+    <li class="none">
+              <a href="../../team-list.html">Project Team</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../issue-tracking.html">Issue Tracking</a>
+        </li>
+              
+    <li class="none">
+              <a href="http://svn.apache.org/viewcvs.cgi/webservices/axis2/trunk/?root=Apache-SVN">Source Code</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../thanks.html">Acknowledgements</a>
+        </li>
+              
+    <li class="none">
+              <a href="http://www.apache.org/licenses/LICENSE-2.0.html">License</a>
+        </li>
+          </ul>
+                                       <a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy">
+            <img alt="Built by Maven" src="../../images/logos/maven-feather.png"></img>
+          </a>
+                       
+  
+
+  
+    
+  
+  
+        </div>
+    </div>
+    <div id="bodyColumn">
+      <div id="contentBox">
+        <html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta name="generator" content="HTML Tidy for Windows (vers 14 June 2007), see www.w3.org"></meta>
+<meta http-equiv="content-type" content="text/html; charset=us-ascii"></meta>
+Advanced Axis2 Databinding Framework Features
+<link href="../../css/axis-docs.css" rel="stylesheet" type="text/css" media="all"></link>
+</head>
+
+<h1>Advanced Axis2 Databinding Framework Features</h1>
+<p>The aim of this section is provide an insight into the newly
+added advanced features of the Axis2 Databinding (ADB)
+Framework.</p>
+<h2>Content</h2>
+<ul>
+<li><a href="#typeSupport">xsi:type Support</a></li>
+<li><a href="#helper">Helper Mode</a></li>
+<li><a href="#more">Additional ADB Topics</a></li>
+</ul>
+<a name="typeSupport"></a>
+<h2>xsi:type Support</h2>
+This is implemented by adding a extension mapping class. The
+code that calls the extension mapper is generated inside the
+Factory.parse method of the beans and gets activated when the
+xsi:type attribute is present. The following code fragment shows
+what the generated type mapper looks like :
+<pre>
+            public static java.lang.Object getTypeObject(java.lang.String namespaceURI,
+                                java.lang.String typeName,
+                                javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{
+              
+                  if (
+                  &quot;http://soapinterop.org/types&quot;.equals(namespaceURI) &amp;&amp;
+                  &quot;SOAPStruct&quot;.equals(typeName)){
+                            return  com.test.SOAPStruct.Factory.parse(reader);
+                  }
+              throw new java.lang.RuntimeException(&quot;Unsupported type &quot; + namespaceURI + &quot; &quot; + typeName);
+            }
+</pre>
+Inside every Factory.parse method, the extension mapper gets
+called when a xsi:type attribute is encountered
+<strong>and</strong> that type is not the type that is currently
+being parsed.
+The following code fragment shows how the ADB deserialize method
+calls the mapper class:
+<pre>
+             if (reader.getAttributeValue(&quot;http://www.w3.org/2001/XMLSchema-instance&quot;,&quot;type&quot;)!=null){
+                  java.lang.String fullTypeName = reader.getAttributeValue(&quot;http://www.w3.org/2001/XMLSchema-instance&quot;,
+                        &quot;type&quot;);
+                  if (fullTypeName!=null){
+                    java.lang.String nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(&quot;:&quot;));
+                    nsPrefix = nsPrefix==null?&quot;&quot;:nsPrefix;
+
+                    java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(&quot;:&quot;)+1);
+                    if (!&quot;SOAPStruct&quot;.equals(type)){
+                        //find namespace for the prefix
+                        java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix);
+                        return (SOAPStruct)org.soapinterop.types.ExtensionMapper.getTypeObject(
+                             nsUri,type,reader);
+                      }
+
+                  }
+              }
+</pre>
+<p>This makes xsi:type based parsing possible and results in proper
+xsi:type based serializations at runtime.</p>
+<p>By default, the mapping package is derived from the
+targetnamespace of the first schema that is encountered. The
+package name can also be explicitly set by a CompilerOption:</p>
+<pre>
+   
+        CompilerOptions compilerOptions = new CompilerOptions();
+        compilerOptions.setWriteOutput(true);
+        <strong>compilerOptions.setMapperClassPackage(&quot;com.test&quot;);</strong>
+        compilerOptions.setOutputLocation(new File(&quot;src&quot;));
+        try {
+            SchemaCompiler schemaCompiler = new SchemaCompiler(compilerOptions);
+            XmlSchemaCollection xmlSchemaCollection = new XmlSchemaCollection();
+            XmlSchema xmlSchema =xmlSchemaCollection.read(new FileReader(&quot;schema/sample.xsd&quot;),null);
+            schemaCompiler.compile(xmlSchema);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+</pre>
+<a name="helper"></a>
+<h2>Helper mode</h2>
+<p>Helper mode is a fairly new feature. In the helper mode, the
+beans are plain Java beans and all the
+deserialization/serialization code is moved to a helper class. For
+example, the simple schema mentioned in the ADB-howto document will
+yield four classes instead of the two previously generated:</p>
+<ol type="1">
+<li>MyElement.java</li>
+<li>MyElementHelper.java</li>
+<li>SOAPStruct.java</li>
+<li>SOAPStructHelper.java</li>
+</ol>
+The helpers basically contain all the serialization code that
+otherwise would go into the ADBBeans. Hence the beans in the helper
+mode are much more simplified. Also note that the helper mode is
+available only if you are in unpacked mode. The code generator by
+default does not expand the classes.
+Helper mode can be switched on by using the setHelperMode method
+in CompilerOptions:
+<pre>
+<strong>compilerOptions.setHelperMode(true);</strong>
+</pre>
+<a name="more"></a>
+<h2>Additional ADB Topics</h2>
+<ul>
+<li><a href="adb-tweaking.html">Tweaking the ADB Code
+Generator</a>- explains available mechanisms to extend ADB and
+possibly adopt it to compile schemas to support other
+languages.</li>
+<li><a href="adb-codegen-integration.html">ADB and Axis2
+Integration</a> - explains how the ADB schema compiler was attached
+to the Axis2 framework</li>
+</ul>
+<hr></hr>
+
+</html>
+      </div>
+    </div>
+    <div class="clear">
+      <hr/>
+    </div>
+    <div id="footer">
+      <div class="xright">&#169;  
+          2004-2007
+    
+          Apache Software Foundation
+          
+  
+
+  
+    
+  
+  
+  </div>
+      <div class="clear">
+        <hr/>
+      </div>
+    </div>
+  </body>
+</html>

Added: webservices/axis2/site/1_3/adb/adb-codegen-integration.html
URL: http://svn.apache.org/viewvc/webservices/axis2/site/1_3/adb/adb-codegen-integration.html?view=auto&rev=565295
==============================================================================
--- webservices/axis2/site/1_3/adb/adb-codegen-integration.html (added)
+++ webservices/axis2/site/1_3/adb/adb-codegen-integration.html Mon Aug 13 03:13:18 2007
@@ -0,0 +1,389 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+
+
+
+
+
+
+
+
+<html>
+  <head>
+    <title>Apache Axis2 - </title>
+    <style type="text/css" media="all">
+      @import url("../../css/maven-base.css");
+      @import url("../../css/maven-theme.css");
+      @import url("../../css/site.css");
+    </style>
+    <link rel="stylesheet" href="../../css/print.css" type="text/css" media="print" />
+        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+      </head>
+  <body class="composite">
+    <div id="banner">
+                  <a href="../" id="bannerLeft">
+    
+                                    <img src="http://www.apache.org/images/asf_logo_wide.png" alt="" />
+    
+            </a>
+                          <span id="bannerRight">
+    
+                                    <img src="http://ws.apache.org/axis2/images/axis.jpg" alt="" />
+    
+            </span>
+            <div class="clear">
+        <hr/>
+      </div>
+    </div>
+    <div id="breadcrumbs">
+          
+  
+
+  
+    
+  
+  
+            <div class="xleft">
+        Last Published: 08/13/2007
+                      </div>
+            <div class="xright">      <a href="../../index.html">Axis2/Java</a>
+          |
+          <a href="http://ws.apache.org/axis2/c">Axis2/C</a>
+          |
+          <a href="../../../../">Apache WS</a>
+          |
+          <a href="http://www.apache.org">Apache</a>
+          
+  
+
+  
+    
+  
+  
+  </div>
+      <div class="clear">
+        <hr/>
+      </div>
+    </div>
+    <div id="leftColumn">
+      <div id="navcolumn">
+           
+  
+
+  
+    
+  
+  
+                   <h5>Axis2/Java</h5>
+        <ul>
+              
+    <li class="none">
+              <a href="../../index.html">Home</a>
+        </li>
+          </ul>
+          <h5>Downloads</h5>
+        <ul>
+              
+    <li class="none">
+              <a href="../../download.cgi">Releases</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../modules/index.html">Modules</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../tools/index.html">Tools</a>
+        </li>
+          </ul>
+          <h5>Documentation</h5>
+        <ul>
+              
+          
+              
+      
+            
+      
+            
+      
+            
+      
+            
+      
+            
+      
+            
+      
+            
+      
+              
+        <li class="expanded">
+              <a href="../../1_3/contents.html">Version 1.3</a>
+                <ul>
+                  
+    <li class="none">
+              <a href="../../1_3/toc.html">Table of Contents</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/installationguide.html">Installation Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/quickstartguide.html">QuickStart Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/userguide.html">User Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/pojoguide.html">POJO Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/spring.html">Spring Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/webadminguide.html">Web Administrator's Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/migration.html">Migration Guide (from Axis1)</a>
+        </li>
+              </ul>
+        </li>
+              
+    <li class="none">
+              <a href="../../1_2/contents.html">Version 1.2</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../1_1_1/contents.html">Version 1.1.1</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../1_1/contents.html">Version 1.1</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../1_0/index.html">Version 1.0</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../0_95/index.html">Version 0.95</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../0_94/index.html">Version 0.94</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../0_93/index.html">Version 0.93</a>
+        </li>
+          </ul>
+          <h5>Resources</h5>
+        <ul>
+              
+    <li class="none">
+              <a href="../../faq.html">FAQ</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../articles.html">Articles</a>
+        </li>
+              
+    <li class="none">
+              <a href="http://wiki.apache.org/ws/FrontPage/Axis2/">Wiki</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../refLib.html">Reference Library</a>
+        </li>
+              
+    <li class="none">
+              <a href="http://ws.apache.org/axis2/1_3/api/index.html">Online Java Docs</a>
+        </li>
+          </ul>
+          <h5>Get Involved</h5>
+        <ul>
+              
+    <li class="none">
+              <a href="../../overview.html">Overview</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../svn.html">Checkout the Source</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../mail-lists.html">Mailing Lists</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../release-process.html">Release Process</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../guidelines.html">Developer Guidelines</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../siteHowTo.html">Build the Site</a>
+        </li>
+          </ul>
+          <h5>Project Information</h5>
+        <ul>
+              
+    <li class="none">
+              <a href="../../team-list.html">Project Team</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../issue-tracking.html">Issue Tracking</a>
+        </li>
+              
+    <li class="none">
+              <a href="http://svn.apache.org/viewcvs.cgi/webservices/axis2/trunk/?root=Apache-SVN">Source Code</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../thanks.html">Acknowledgements</a>
+        </li>
+              
+    <li class="none">
+              <a href="http://www.apache.org/licenses/LICENSE-2.0.html">License</a>
+        </li>
+          </ul>
+                                       <a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy">
+            <img alt="Built by Maven" src="../../images/logos/maven-feather.png"></img>
+          </a>
+                       
+  
+
+  
+    
+  
+  
+        </div>
+    </div>
+    <div id="bodyColumn">
+      <div id="contentBox">
+        <html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta name="generator" content="HTML Tidy for Windows (vers 14 June 2007), see www.w3.org"></meta>
+ADB Integration With Axis2
+<link href="../../css/axis-docs.css" rel="stylesheet" type="text/css" media="all"></link>
+</head>
+
+<h1>ADB Integration With Axis2</h1>
+<p>This document will assist you in writing an extension using the
+integrator in order to integrate ADB with Axis2.</p>
+<h2>Content</h2>
+<ul>
+<li><a href="#intro">Introduction</a></li>
+<li><a href="#select_modes">Selection of Generation Modes for
+ADB</a></li>
+<li><a href="#remember">Things to Remember</a></li>
+</ul>
+<h2><a name="intro">Introduction</a></h2>
+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
+(<strong>org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension</strong>)
+and can be found in the extensions list of the
+codegen-config.properties file.
+<a name="select_modes"></a>
+<h2>Selection of Generation Modes for ADB</h2>
+The extension sets the options for the code generator via the
+CompilerOptions, depending on the user's settings. The following
+table summarizes the use of options. Please refer to the <a href="adb-howto.html">ADB-How to document</a> for the
+different generation modes and their descriptions.
+<table class="bodyTable">
+<tbody>
+<tr class="a">
+<td><strong>User parameters</strong></td>
+<td><strong>Selected code generation parameters</strong></td>
+</tr>
+<tr class="b">
+<td>None (no parameter other than mandatory ones)</td>
+<td>wrapClasses=false,writeClasses=false</td>
+</tr>
+<tr class="a">
+<td>-ss (server side)</td>
+<td>wrapClasses=false,writeClasses=true</td>
+</tr>
+<tr class="b">
+<td>-u (unwrap classes)</td>
+<td>wrapClasses=false,writeClasses=true</td>
+</tr>
+</tbody>
+</table>
+The following parameters (prefixed with -E) can be used to
+override these settings manually:
+<table class="bodyTable">
+<tbody>
+<tr class="a">
+<td><strong>Parameter Name</strong></td>
+<td><strong>Allowed values</strong></td>
+<td><strong>Description</strong></td>
+</tr>
+<tr class="b">
+<td>r</td>
+<td>true, false</td>
+<td>Sets the write flag. If set to true the classes will be written
+by ADB</td>
+</tr>
+<tr class="a">
+<td>w</td>
+<td>true, false</td>
+<td>Sets the wrapping flag. if true the classes will be
+wrapped.</td>
+</tr>
+</tbody>
+</table>
+<p>Note that these parameters have no corresponding long names and
+MUST be prefixed with a -E to be processed by the code generator.
+For example:</p>
+<pre>
+WSDL2Java .... -Er true
+</pre>
+<a name="remember"></a>
+<h2>Things to Remember</h2>
+<ol type="1">
+<li>SimpleDBExtension is for the ADB databinding framework only and
+will process requests only when this framework is specified during
+code generation (using the switch -d adb). In the most recent
+release, the default has been set as ADB and hence if the -d option
+is missing then the databinding framework will be ADB.</li>
+</ol>
+<hr></hr>
+
+</html>
+      </div>
+    </div>
+    <div class="clear">
+      <hr/>
+    </div>
+    <div id="footer">
+      <div class="xright">&#169;  
+          2004-2007
+    
+          Apache Software Foundation
+          
+  
+
+  
+    
+  
+  
+  </div>
+      <div class="clear">
+        <hr/>
+      </div>
+    </div>
+  </body>
+</html>

Added: webservices/axis2/site/1_3/adb/adb-howto.html
URL: http://svn.apache.org/viewvc/webservices/axis2/site/1_3/adb/adb-howto.html?view=auto&rev=565295
==============================================================================
--- webservices/axis2/site/1_3/adb/adb-howto.html (added)
+++ webservices/axis2/site/1_3/adb/adb-howto.html Mon Aug 13 03:13:18 2007
@@ -0,0 +1,700 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+
+
+
+
+
+
+
+
+<html>
+  <head>
+    <title>Apache Axis2 - </title>
+    <style type="text/css" media="all">
+      @import url("../../css/maven-base.css");
+      @import url("../../css/maven-theme.css");
+      @import url("../../css/site.css");
+    </style>
+    <link rel="stylesheet" href="../../css/print.css" type="text/css" media="print" />
+        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+      </head>
+  <body class="composite">
+    <div id="banner">
+                  <a href="../" id="bannerLeft">
+    
+                                    <img src="http://www.apache.org/images/asf_logo_wide.png" alt="" />
+    
+            </a>
+                          <span id="bannerRight">
+    
+                                    <img src="http://ws.apache.org/axis2/images/axis.jpg" alt="" />
+    
+            </span>
+            <div class="clear">
+        <hr/>
+      </div>
+    </div>
+    <div id="breadcrumbs">
+          
+  
+
+  
+    
+  
+  
+            <div class="xleft">
+        Last Published: 08/13/2007
+                      </div>
+            <div class="xright">      <a href="../../index.html">Axis2/Java</a>
+          |
+          <a href="http://ws.apache.org/axis2/c">Axis2/C</a>
+          |
+          <a href="../../../../">Apache WS</a>
+          |
+          <a href="http://www.apache.org">Apache</a>
+          
+  
+
+  
+    
+  
+  
+  </div>
+      <div class="clear">
+        <hr/>
+      </div>
+    </div>
+    <div id="leftColumn">
+      <div id="navcolumn">
+           
+  
+
+  
+    
+  
+  
+                   <h5>Axis2/Java</h5>
+        <ul>
+              
+    <li class="none">
+              <a href="../../index.html">Home</a>
+        </li>
+          </ul>
+          <h5>Downloads</h5>
+        <ul>
+              
+    <li class="none">
+              <a href="../../download.cgi">Releases</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../modules/index.html">Modules</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../tools/index.html">Tools</a>
+        </li>
+          </ul>
+          <h5>Documentation</h5>
+        <ul>
+              
+          
+              
+      
+            
+      
+            
+      
+            
+      
+            
+      
+            
+      
+            
+      
+            
+      
+              
+        <li class="expanded">
+              <a href="../../1_3/contents.html">Version 1.3</a>
+                <ul>
+                  
+    <li class="none">
+              <a href="../../1_3/toc.html">Table of Contents</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/installationguide.html">Installation Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/quickstartguide.html">QuickStart Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/userguide.html">User Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/pojoguide.html">POJO Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/spring.html">Spring Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/webadminguide.html">Web Administrator's Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/migration.html">Migration Guide (from Axis1)</a>
+        </li>
+              </ul>
+        </li>
+              
+    <li class="none">
+              <a href="../../1_2/contents.html">Version 1.2</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../1_1_1/contents.html">Version 1.1.1</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../1_1/contents.html">Version 1.1</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../1_0/index.html">Version 1.0</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../0_95/index.html">Version 0.95</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../0_94/index.html">Version 0.94</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../0_93/index.html">Version 0.93</a>
+        </li>
+          </ul>
+          <h5>Resources</h5>
+        <ul>
+              
+    <li class="none">
+              <a href="../../faq.html">FAQ</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../articles.html">Articles</a>
+        </li>
+              
+    <li class="none">
+              <a href="http://wiki.apache.org/ws/FrontPage/Axis2/">Wiki</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../refLib.html">Reference Library</a>
+        </li>
+              
+    <li class="none">
+              <a href="http://ws.apache.org/axis2/1_3/api/index.html">Online Java Docs</a>
+        </li>
+          </ul>
+          <h5>Get Involved</h5>
+        <ul>
+              
+    <li class="none">
+              <a href="../../overview.html">Overview</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../svn.html">Checkout the Source</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../mail-lists.html">Mailing Lists</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../release-process.html">Release Process</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../guidelines.html">Developer Guidelines</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../siteHowTo.html">Build the Site</a>
+        </li>
+          </ul>
+          <h5>Project Information</h5>
+        <ul>
+              
+    <li class="none">
+              <a href="../../team-list.html">Project Team</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../issue-tracking.html">Issue Tracking</a>
+        </li>
+              
+    <li class="none">
+              <a href="http://svn.apache.org/viewcvs.cgi/webservices/axis2/trunk/?root=Apache-SVN">Source Code</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../thanks.html">Acknowledgements</a>
+        </li>
+              
+    <li class="none">
+              <a href="http://www.apache.org/licenses/LICENSE-2.0.html">License</a>
+        </li>
+          </ul>
+                                       <a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy">
+            <img alt="Built by Maven" src="../../images/logos/maven-feather.png"></img>
+          </a>
+                       
+  
+
+  
+    
+  
+  
+        </div>
+    </div>
+    <div id="bodyColumn">
+      <div id="contentBox">
+        <html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta name="generator" content="HTML Tidy for Windows (vers 14 June 2007), see www.w3.org"></meta>
+<meta http-equiv="content-type" content="text/html; charset=us-ascii"></meta>
+ADB - Howto
+<link href="../../css/axis-docs.css" rel="stylesheet" type="text/css" media="all"></link>
+</head>
+
+<h1>Axis2 Databinding Framework</h1>
+<p>This document aims to provide an architectural overview of the
+Axis2 Databinding Framework (referred to as ADB from here onwards)
+and be a guide to anyone who wants to use and modify ADB. The
+information is presented under the following topics.</p>
+<h2>Content</h2>
+<ul>
+<li><a href="#intro">Introduction</a></li>
+<li><a href="#archi">Architectural Overview</a></li>
+<li><a href="#code_depend">Code and Dependencies</a></li>
+<li><a href="#code_gen">Invoking the ADB Code Generator</a>
+<ul>
+<li><a href="#schema_compiler">As a Stand-alone Schema
+Compiler</a></li>
+<li><a href="#api">Through the API</a></li>
+</ul>
+</li>
+<li><a href="#gen_modes">Generation Modes</a></li>
+<li><a href="#deep">Deep into Generated Code</a>
+<ul>
+<li><a href="#example">An Example!</a></li>
+</ul>
+</li>
+<li><a href="#limitation">Known Limitations</a></li>
+<li><a href="#more">Want to Learn More?</a></li>
+</ul>
+<a name="intro"></a>
+<h2>Introduction</h2>
+The objective of the Axis2 Databinding framework is to provide a
+lightweight and simple schema compiler/Java bean generator for
+Axis2. By no means is it intended to be a fully functional schema
+compiler like XMLBeans. Note that ADB is written in a fashion that
+allows it to be used as a stand-alone schema compiler and also to
+be extended to generate code for other languages.
+<a name="archi"></a>
+<h2>Architectural Overview</h2>
+ADB is built on a modular architecture that allows it to utilize
+a pre-configured writer depending on the configuration. The 'big
+block diagram' for the code generator architecture is depicted
+below.
+<img src="images/ADB.jpg" alt="ADB architecture"></img>
+ADB utilizes the WS-Commons <a href="http://ws.apache.org/commons/XmlSchema/index.html">XmlSchema
+library</a> for reading the Schema. The object model for the schema
+comes in the form of an XmlSchema object. The schema compiler keeps
+an instance of the writer (in the default case it's the
+JavaBeanWriter) which actually writes the classes. The writers may
+use whatever technique they prefer, in the case of the
+JavaBeanWriter, it uses an XSLT template. The SchemaCompiler also
+uses a typemapper object that tells it what classnames to use for
+the QNames that it encounters. This type mapper is also part of the
+configuration and the users can override the default type mapper by
+overriding the property setting.
+<a name="code_depend"></a>
+<h2>Code and Dependencies</h2>
+As explained in the previous section, the schema compiler
+depends on the WS-Commons XmlSchema library. The XSLT
+transformations are dependent on the JVM's DOM implementation
+(either Crimson or Xerces) which means that the underlying JVM
+should be 1.4 or higher. Apart from that ADB has no dependencies on
+any other special jar files. The code for the schema compiler is
+completely in the <strong>org.apache.axis2.schema.*</strong>
+package. This package resides in the codegen module of the Axis2
+source tree.
+The following are the important classes and files of ADB:
+<ol type="1">
+<li><strong>SchemaCompiler</strong> - The work horse that really
+compiles the schema into classes.</li>
+<li><strong>BeanWriter</strong> - BeanWriters handle the the actual
+rendering of the classes. BeanWriter is the interface that writers
+need to implement in order to be used by the SchemaCompiler.</li>
+<li><strong>JavaBeanWriter</strong> - The default implementation of
+the BeanWriter interface.</li>
+<li><strong>TypeMap</strong> - represents the interface that the
+schema compiler uses to find class names for a given QName.</li>
+<li><strong>JavaTypeMap</strong> - the default implementation of
+the TypeMap</li>
+<li><strong>ADBBeanTemplate.xsl</strong> - the XSLtemplate the
+JavaBeanWriter uses.</li>
+<li><strong>Schema-compile.properties</strong> - The property file
+for the schema compiler</li>
+</ol>
+The easiest way to obtain the ADB binaries is to run the maven
+build for the Axis2 adb-codegen module. This will generate the
+<strong>axis2-adb-codegen-{$version}.jar</strong> inside the target
+folder which is directly usable when the ADB schema compiler is
+required.
+The runtime dependencies for the ADB generated classes is in the
+Axis2 adb module and the kernal module. Hence to compile and work
+with the generated classes the
+<strong>axis2-adb-{$version}.jar</strong> and
+<strong>axis2-kernal-{$version}.jar</strong> needs to be in the
+classpath in addition to other dependencies such as StAX, Axiom,
+Commons-logging and javax.activation.
+<a name="code_gen"></a>
+<h2>Invoking the ADB Code Generator</h2>
+<a name="schema_compiler"></a>
+<h3>As a Standalone Schema Compiler</h3>
+ADB comes with a XSD2Java code generator that allows the schemas
+to be compiled just by giving the schema file reference. This main
+class is presently rather primitive and does not provide much
+control over the code generation process. This is bound to improve
+in the near future.
+XSD2Java accepts the following parameters:
+<ol type="1">
+<li>The Schema file name - This should be a complete file name
+pointing to the local file system</li>
+<li>The output folder name - This should be the name of a folder
+within the local file system</li>
+</ol>
+Since the code generator presently has no validations built into
+it, the compiler is likely to show various error messages if these
+parameters are not supplied properly.
+<a name="api"></a>
+<h3>Through the API</h3>
+This is the only way to harness the full potential of the schema
+compiler. The current Axis2 integration of ADB happens through this
+API. The most important classes and methods of the Schema compiler
+are as follows.
+<ul>
+<li><strong>SchemaCompiler - Constructor</strong>
+The constructor of the schema compiler expects a CompilerOptions
+object. This compilerOptions object is more of a holder for the
+parameters that are passed to the SchemaCompiler. The only
+mandatory parameter in the CompilerOptions is the output
+directory.
+</li>
+<li><strong>SchemaCompiler - Compile(XMLSchema schema)</strong>
+The compile method to call for a single schema. The expected
+object is a XMLSchema which is part of the XmlSchema library.
+</li>
+<li><strong>SchemaCompiler - Compile(List schemaList)</strong>
+Similar to the previous method but accepts a list of schemas
+instead of one.
+</li>
+</ul>
+For a comprehensive code sample in invoking the schema compiler
+through the API, the following classes would be helpful. One would
+also need an understanding of the generation modes of the ADB
+schema compiler when using it through the API. Hence the following
+section includes a brief description of the generation modes.
+<ul>
+<li><strong>org.apache.axis2.schema.XSD2Java</strong></li>
+<li><strong>org.apache.axis2.schema.ExtensionUtility</strong></li>
+</ul>
+<a name="gen_modes"></a>
+<h2>Generation Modes</h2>
+ADB extension provides several generation modes for the data
+bound classes.
+<ol type="1">
+<li><strong>Integrated Mode</strong>
+In this mode the classes are generated as inner classes of the
+stub, message receiver or the interface. The ADB framework does not
+actually write the classes but instead provides a map of DOM
+document objects that contains the model for the databinding
+classes. The Axis2 codegen engine in turn parses these documents
+within its own XSLT parser to create the necessary classes.
+Implementers are free to use these models differently for their own
+particular needs.
+Integrated mode is intended to be used by tool builders.
+</li>
+<li><strong>Wrapped Mode</strong>
+In the wrapped mode, the ADB databinder generates one class that
+contains all the databound classes. This is convenient when the
+number of classes need to be limited.
+</li>
+<li><strong>Expanded Mode</strong>
+This is the usual mode where the code generator generates a
+class for each of the outer elements and the named complex types.
+The command line tool (XSD2Java) always generates code in the
+expanded mode.
+</li>
+</ol>
+The rules for generating code (described in the next section)
+applies regardless of the mode. Switching these modes can be done
+by passing the correct options via the CompilerOptions object. The
+following table lists the options and the effects of using
+them.
+<table class="bodyTable">
+<tbody>
+<tr class="a">
+<td><strong>Field Name in Options</strong></td>
+<td><strong>Description</strong></td>
+</tr>
+<tr class="b">
+<td>writeOutput</td>
+<td>This determines whether to write the output or not. If the flag
+is on then the classes will be written by ADB. The default is
+off.</td>
+</tr>
+<tr class="a">
+<td>wrapClasses</td>
+<td>This determines whether to wrap the generated classes. If the
+flag is on then a single class (with adb added to the end of the
+specified package) will be generated. The default is off.</td>
+</tr>
+<tr class="b">
+<td>mapperClassPackage</td>
+<td>The package name for the mapper class. Please see the advanced
+section for details of the mapper class.</td>
+</tr>
+<tr class="a">
+<td>helperMode</td>
+<td>The switch that determines whether to switch to helper mode or
+not. Please see the advanced section for details of helper
+mode.</td>
+</tr>
+<tr class="b">
+<td>ns2PackageMap</td>
+<td>A map that stores the namespace name against the package name
+These details are used to override the default packages</td>
+</tr>
+</tbody>
+</table>
+<a name="deep"></a>
+<h2>Deep into Generated Code</h2>
+When the schema compiler is invoked (one-way or another) it
+generates code depending on the following rules:
+<ol type="1">
+<li>All named complex types become bean classes. Any attribute or
+element encapsulated in this complex type will become a field in
+the generated class. Note that the support for constructs other
+than xsd:sequence and xsd:all is not yet implemented.</li>
+<li>All top level elements become classes. This is a rather obvious
+feature since unless classes are generated for the top level
+elements the handling of elements becomes difficult and messy!</li>
+<li>SimpleType restrictions are handled by replacing the relevant
+type with the basetype</li>
+</ol>
+Once the code is generated according to the rules it looks like
+the following. Consider the following schema:
+<pre>
+&lt;schema xmlns=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;
+xmlns:tns=&quot;http://soapinterop.org/types&quot; targetNamespace=&quot;http://soapinterop.org/types&quot; 
+elementFormDefault=&quot;qualified&quot; &gt;
+&lt;import namespace=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;/&gt;
+ &lt;complexType name=&quot;SOAPStruct&quot;&gt;
+  &lt;sequence&gt;
+   &lt;element name=&quot;varString&quot; type=&quot;xsd:string&quot;/&gt;
+   &lt;element name=&quot;varInt&quot; type=&quot;xsd:int&quot;/&gt;
+   &lt;element name=&quot;varFloat&quot; type=&quot;xsd:float&quot;/&gt;
+  &lt;/sequence&gt;
+ &lt;/complexType&gt;
+&lt;element name=&quot;myElement&quot; type=&quot;tns:SOAPStruct&quot;/&gt;
+&lt;/schema&gt;
+</pre>
+For comprehension let us consider the expanded mode for the code
+generator. Unless specifically mentioned, the rest of this document
+assumes that the expanded mode of the code generation is used. This
+particular schema will generate the following two classes in the
+designated package, which in this case would be
+<strong>org.soapinterop.types</strong>. The package name is derived
+from the target namespace of the schema.
+<ol type="1">
+<li>MyElement.java</li>
+<li>SOAPStruct.java</li>
+</ol>
+As explained earlier, SOAPStruct refers to the complexType.
+MyElement is the class that refers to the element. Just as
+expected, the SOAPStruct bean has getters and setters for
+varString, varInt and varFloat which are String, int and float
+respectively. MyElement on the other hand has a single field
+representing the SOAPStruct object that it encapsulates.
+The most important aspect of the generated code is that it
+encapsulates two methods for creating and serializing the beans.
+Note that to make this work, the generated beans implement the
+<strong>org.apache.axis2.databinding.ADBBean</strong> interface
+The creator and serializer methods look like the following:
+<ul>
+<li>
+<pre>
+public javax.xml.stream.XMLStreamReader
+    getPullParser(javax.xml.namespace.QName qName)
+</pre>
+This method returns a pull parser that throws the right events
+for this particular object. However there is a subtle difference
+between element based classes and complexType based classes
+<ol type="1">
+<li>An element based bean class (like MyElement.java in the
+example) will <strong><em>ignore the passed in QName</em></strong>.
+Instead of using the passed in QName it'll utilize its own QName
+which is embedded in the class under the constant MY_QNAME, during
+the code generation. Hence it is usual to call getPullparser() with
+a null parameter for elements.</li>
+<li>A ComplexType based bean class (like SOAPStruct.java in the
+example) will use the passed-in QName to return an instance of the
+ADBpullparser. This will effectively wrap the elements inside with
+an element having the passed QName</li>
+</ol>
+</li>
+<li>
+<pre>
+ public org.apache.axiom.om.OMElement getOMElement(
+            final javax.xml.namespace.QName parentQName,
+            final org.apache.axiom.om.OMFactory factory){
+</pre>
+This method returns an OMElement representing the ADB bean
+object.
+<ol type="1">
+<li>Inside the getOMElement method an anonymous ADBDataSource class
+is created. This anonymous class implements a serialize() method
+where the serialization logic for that particular bean class is
+handled. Finally an OMSourcedElementImpl object with the above
+anonymous class type object as the data source is returned.</li>
+</ol>
+</li>
+<li>
+<pre>
+ public static [Object].Factory. 
+             parse(javax.xml.stream.XMLStreamReader reader) 
+             throws java.lang.Exception 
+</pre>
+This method returns a populated instance of the class in
+question. Note that
+<pre>
+[Object]
+</pre>
+will be replaced by the actual class that contains this method. Say
+for SOAPStruct the method looks like
+<pre>
+public static SOAPStruct.Factory. 
+                parse(javax.xml.stream.XMLStreamReader reader) 
+                throws java.lang.Exception
+</pre>
+Also note that the above parse method is available in the
+<strong>Factory</strong> nested class within the relevant top level
+class. Hence one will have to get the static Factory instance
+before calling the parse method.
+</li>
+</ul>
+<a name="example"></a>
+<h3>An Example!</h3>
+Consider the following XML fragment
+<pre>
+&lt;myElement xmlns=&quot;http://soapinterop.org/types&quot;&gt;
+  &lt;varInt&gt;5&lt;/varInt&gt;
+  &lt;varString&gt;Hello&lt;/varString&gt;
+  &lt;varFloat&gt;3.3&lt;/varFloat&gt;
+&lt;/myElement&gt;
+</pre>
+Enthusiastic readers might already have figured out that this
+XML fragment complies with the Schema mentioned above. The
+following code snippet shows how to build a populated instance of
+MyElement with the XML above:
+<pre>
+XMLStreamReader reader = XMLInputFactory.newInstance().
+                                createXMLStreamReader(
+                                        new ByteArrayInputStream(xmlString.getBytes()));
+MyElement elt = MyElement.Factory.parse(reader);
+</pre>
+Optionally, the above xml fragment can be reproduced with the
+following code fragment:
+<pre>
+OMElement omElement = myElement.getOMElement
+                (MyElement.MY_QNAME, OMAbstractFactory.getSOAP12Factory());
+String xmlString = omElement.toStringWithConsume();
+</pre>
+Although this example takes on the tedious effort of creating a
+reader out of a String, inside the Axis2 environment an
+XMLStreamReader can be directly obtained from the OMElement! Hence,
+the parse method becomes a huge advantage for hassle free object
+creation.
+Similarly the reader obtained from the object can also be
+utilized as needed. The following code fragment shows how to
+utilize the getPullParser method to create an OMElement :
+<pre>
+XMLStreamReader reader = elt.getPullParser(null);
+OMElement omElt =  new StAXOMBuilder(reader).getDocumentElement();
+</pre>
+That's all to it! If you are interested in learning more on ADB
+the following documents may also be helpful. However, be sure to
+check the limitations section that follows if you are planning to
+use ADB for something serious.
+<a name="limitation"></a>
+<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 type="1">
+<li>Complex Type Extensions and Restrictions.</li>
+</ol>
+<a name="more"></a>
+<h2>Want to Learn More?</h2>
+<ul>
+<li><a href="adb-advanced.html">Advanced features of the ADB code
+generator</a> - explains xsi:type based deserialization and helper
+mode</li>
+<li><a href="adb-tweaking.html">Tweaking the ADB Code Generator</a>
+- explains available mechanisms to extend ADB and possibly adopt it
+to compile schemas to support other languages.</li>
+<li><a href="adb-codegen-integration.html">ADB and Axis2
+Integration</a> - explains how the ADB schema compiler was attached
+to the Axis2 framework</li>
+</ul>
+
+</html>
+      </div>
+    </div>
+    <div class="clear">
+      <hr/>
+    </div>
+    <div id="footer">
+      <div class="xright">&#169;  
+          2004-2007
+    
+          Apache Software Foundation
+          
+  
+
+  
+    
+  
+  
+  </div>
+      <div class="clear">
+        <hr/>
+      </div>
+    </div>
+  </body>
+</html>

Added: webservices/axis2/site/1_3/adb/adb-tweaking.html
URL: http://svn.apache.org/viewvc/webservices/axis2/site/1_3/adb/adb-tweaking.html?view=auto&rev=565295
==============================================================================
--- webservices/axis2/site/1_3/adb/adb-tweaking.html (added)
+++ webservices/axis2/site/1_3/adb/adb-tweaking.html Mon Aug 13 03:13:18 2007
@@ -0,0 +1,408 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+
+
+
+
+
+
+
+
+<html>
+  <head>
+    <title>Apache Axis2 - </title>
+    <style type="text/css" media="all">
+      @import url("../../css/maven-base.css");
+      @import url("../../css/maven-theme.css");
+      @import url("../../css/site.css");
+    </style>
+    <link rel="stylesheet" href="../../css/print.css" type="text/css" media="print" />
+        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+      </head>
+  <body class="composite">
+    <div id="banner">
+                  <a href="../" id="bannerLeft">
+    
+                                    <img src="http://www.apache.org/images/asf_logo_wide.png" alt="" />
+    
+            </a>
+                          <span id="bannerRight">
+    
+                                    <img src="http://ws.apache.org/axis2/images/axis.jpg" alt="" />
+    
+            </span>
+            <div class="clear">
+        <hr/>
+      </div>
+    </div>
+    <div id="breadcrumbs">
+          
+  
+
+  
+    
+  
+  
+            <div class="xleft">
+        Last Published: 08/13/2007
+                      </div>
+            <div class="xright">      <a href="../../index.html">Axis2/Java</a>
+          |
+          <a href="http://ws.apache.org/axis2/c">Axis2/C</a>
+          |
+          <a href="../../../../">Apache WS</a>
+          |
+          <a href="http://www.apache.org">Apache</a>
+          
+  
+
+  
+    
+  
+  
+  </div>
+      <div class="clear">
+        <hr/>
+      </div>
+    </div>
+    <div id="leftColumn">
+      <div id="navcolumn">
+           
+  
+
+  
+    
+  
+  
+                   <h5>Axis2/Java</h5>
+        <ul>
+              
+    <li class="none">
+              <a href="../../index.html">Home</a>
+        </li>
+          </ul>
+          <h5>Downloads</h5>
+        <ul>
+              
+    <li class="none">
+              <a href="../../download.cgi">Releases</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../modules/index.html">Modules</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../tools/index.html">Tools</a>
+        </li>
+          </ul>
+          <h5>Documentation</h5>
+        <ul>
+              
+          
+              
+      
+            
+      
+            
+      
+            
+      
+            
+      
+            
+      
+            
+      
+            
+      
+              
+        <li class="expanded">
+              <a href="../../1_3/contents.html">Version 1.3</a>
+                <ul>
+                  
+    <li class="none">
+              <a href="../../1_3/toc.html">Table of Contents</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/installationguide.html">Installation Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/quickstartguide.html">QuickStart Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/userguide.html">User Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/pojoguide.html">POJO Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/spring.html">Spring Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/webadminguide.html">Web Administrator's Guide</a>
+        </li>
+                  
+    <li class="none">
+              <a href="../../1_3/migration.html">Migration Guide (from Axis1)</a>
+        </li>
+              </ul>
+        </li>
+              
+    <li class="none">
+              <a href="../../1_2/contents.html">Version 1.2</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../1_1_1/contents.html">Version 1.1.1</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../1_1/contents.html">Version 1.1</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../1_0/index.html">Version 1.0</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../0_95/index.html">Version 0.95</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../0_94/index.html">Version 0.94</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../0_93/index.html">Version 0.93</a>
+        </li>
+          </ul>
+          <h5>Resources</h5>
+        <ul>
+              
+    <li class="none">
+              <a href="../../faq.html">FAQ</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../articles.html">Articles</a>
+        </li>
+              
+    <li class="none">
+              <a href="http://wiki.apache.org/ws/FrontPage/Axis2/">Wiki</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../refLib.html">Reference Library</a>
+        </li>
+              
+    <li class="none">
+              <a href="http://ws.apache.org/axis2/1_3/api/index.html">Online Java Docs</a>
+        </li>
+          </ul>
+          <h5>Get Involved</h5>
+        <ul>
+              
+    <li class="none">
+              <a href="../../overview.html">Overview</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../svn.html">Checkout the Source</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../mail-lists.html">Mailing Lists</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../release-process.html">Release Process</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../guidelines.html">Developer Guidelines</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../siteHowTo.html">Build the Site</a>
+        </li>
+          </ul>
+          <h5>Project Information</h5>
+        <ul>
+              
+    <li class="none">
+              <a href="../../team-list.html">Project Team</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../issue-tracking.html">Issue Tracking</a>
+        </li>
+              
+    <li class="none">
+              <a href="http://svn.apache.org/viewcvs.cgi/webservices/axis2/trunk/?root=Apache-SVN">Source Code</a>
+        </li>
+              
+    <li class="none">
+              <a href="../../thanks.html">Acknowledgements</a>
+        </li>
+              
+    <li class="none">
+              <a href="http://www.apache.org/licenses/LICENSE-2.0.html">License</a>
+        </li>
+          </ul>
+                                       <a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy">
+            <img alt="Built by Maven" src="../../images/logos/maven-feather.png"></img>
+          </a>
+                       
+  
+
+  
+    
+  
+  
+        </div>
+    </div>
+    <div id="bodyColumn">
+      <div id="contentBox">
+        <html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta name="generator" content="HTML Tidy for Windows (vers 14 June 2007), see www.w3.org"></meta>
+ADB Tweaking Guide
+<link href="../../css/axis-docs.css" rel="stylesheet" type="text/css" media="all"></link>
+</head>
+
+<h1>ADB Tweaking Guide</h1>
+<p>This document explains the mechanisms available to extend ADB
+and possibly adopt it to compile schemas to support other
+languages.</p>
+<h2>Content</h2>
+<ul>
+<li><a href="#intro">Introduction</a></li>
+<li><a href="#config">Know the Configuration</a></li>
+<li><a href="#first_tweak">The First Tweak - Generate Plain Java
+Beans</a></li>
+<li><a href="#advanced_tweak">A More Advanced Tweak - Generate Code
+for Another Language</a></li>
+</ul>
+<a name="intro"></a>
+<h2>Introduction</h2>
+ADB was written with future extensibility in mind, with a clear
+and flexible way to extend or modify its functionality. Available
+mechanisms to extend ADB and possibly adopt it to compile schemas
+to support other languages are described below.
+<a name="config"></a>
+<h2>Know the Configuration</h2>
+The configuration for the ADB framework is in the
+<strong>schema-compile.properties</strong> file found in the
+<strong>org.apache.axis2.schema</strong> package. This properties
+file has the following important properties
+<ul>
+<li>schema.bean.writer.class
+This is the writer class. This is used by the schema compiler to
+write the beans and should implement the
+<strong>org.apache.axis2.schema.writer.BeanWriter</strong>
+interface. The schema compiler delegates the bean writing task to
+the specified instance of the BeanWriter.
+</li>
+<li>schema.bean.writer.template
+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 use a
+template.
+</li>
+<li>schema.bean.typemap
+This is the type map to be used by the schema compiler. It
+should be an implementation of the
+<strong>org.apache.axis2.schema.typemap.TypeMap</strong> interface.
+The default typemap implementation encapsulates a hashmap with type
+QName to Class name string mapping.
+</li>
+</ul>
+<a name="first_tweak"></a>
+<h2>The First Tweak - Generate Plain Java Beans</h2>
+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 prefer to have plain java
+beans. This can in fact be done by simply changing the template
+used.
+The template for plain java beans is already available in the
+<strong>org.apache.axis2.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>
+<p>Congratulations! 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 available
+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>
+<a name="advanced_tweak"></a>
+<h2>A More Advanced Tweak - Generate Code for Another Language</h2>
+<p>To generate code for another language, there are two main
+components that need to be written.</p>
+<ul>
+<li>The BeanWriter
+Implement the BeanWriter interface for this class. A nice
+example is the
+<strong>org.apache.axis2.schema.writer.JavaBeanWriter</strong>
+which has a lot of reusable code. In fact if the target language is
+object-oriented (such as C# or even C++), one would even be able to
+extend the JavaBeanWriter itself.
+</li>
+<li>The TypeMap
+Implement the TypeMap interface for this class. The
+<strong>org.apache.axis2.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.
+</li>
+</ul>
+<p>Surprisingly, this is all that needs to be done to have other
+language support for ADB. Change the configuration and you are
+ready to generate code for other languages!</p>
+<p>This tweaking guide is supposed to be a simple guideline for
+anyone who wishes to dig deep into the mechanics of the ADB code
+generator. Users are free to experiment with it and modify the
+schema compiler accordingly to their needs. Also note that the
+intention of this section is <em>not</em> to be a step by step
+guide to custom code generation. Anyone who wish to do so would
+need to dig into the code and get their hands dirty!</p>
+
+</html>
+      </div>
+    </div>
+    <div class="clear">
+      <hr/>
+    </div>
+    <div id="footer">
+      <div class="xright">&#169;  
+          2004-2007
+    
+          Apache Software Foundation
+          
+  
+
+  
+    
+  
+  
+  </div>
+      <div class="clear">
+        <hr/>
+      </div>
+    </div>
+  </body>
+</html>



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org