Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Ws Wiki" for change 
notification.

The following page has been changed by MaryamMoazeni:
http://wiki.apache.org/ws/MaryamMoazeni/GSoC2006

------------------------------------------------------------------------------
  
  === Project Overview ===
  
- Axis2Databinding (ADB) does not cover all of XML Schemas. This project is 
aimed to implement some of these unsupported XML Schema features. The frist 
goal is to implement Simple Content extension and restriction and Complex 
Content restriction. However, I am also willing to handle some other 
unsupported schema constructs as well.  
+ Axis2Databinding (ADB) does not cover all of XML Schemas. This project is 
aimed to implement some of these unsupported XML Schema features. The frist 
goal is to implement Simple Content extension and restriction and Complex 
Content restriction. 
  
- === My Daily Notes ===
+ === Project Summary ===
+ 
+ This is a summary of what has been done during this project.
+ 
+ ==== Adding Support for Complex Content Restriction ====
+ 
+ This feature enables ADB to support XML Schema Complex Content Restriction. 
The relavant code resides in the following locations:
+ 
+ 
http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java
+ 
+ 
http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
+ 
+ 
http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
  
  
- '''[6/23/2006]'''
+ ==== Adding Support for Simple Content Extension ====
  
- ===== What I've Done So Far: =====
+ This feature enables ADB to support XML Schema Simple Content Extension. The 
relavant code resides in the following locations:
  
+ 
http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java
-    *Reviewed the adb-codgen module of Axis2. For this I needed to review XML 
Schema   
-    spec and XmlSchema API in more detail. I needed to test different schemas 
with the   
-    XmlSchema API to get to know its features. So far I have fully understood 
the way
-    SchemaCompiler works. In order to handle extension and restriction, it is 
needed to 
-    fill BeanWriterMetaInfoHolder during the processing of Content Models 
according to the
-    extension and restriction meta info in the SchemaCompiler. Then, most of 
the work 
-    needs to be passed to the JavaBeanWriter to handel the generation of codes 
according to
-    the BeanWriterMetaInfoHolder. I need to review the JavaBeanWriter more in 
depth to 
-    realize how to write the new schema constructs.   
-    
-    *Built Axis2 and generated code for different schemas in order to compare 
and analyze 
-    the outputs. 
  
-    *Looked around to get ideas from XMLBeans Project for implementing Simple 
Content 
-    extension and restriction. Tested some schemas with XMLBeans to see how 
are things
-    should be in the case of having Simple Content extension and restriction. 
+ 
http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
+ 
+ 
http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
+ 
+ 
http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
  
  
+ ==== Adding Support for Simple Content Restriction ====
  
- '''[6/27/2006]'''
+ This feature enables ADB to support XML Schema Simple Content Restriction. 
The relavant code resides in the following locations:
  
- OK, now I'm trying to see how can I make JavaBeanWriter work for restriction. 
At this time, my focus is on Complex Content restriction because I didn't want 
to get involved with primitive types and how to deal with them now.
+ 
http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java
  
- After passing the BeanWriterMetaInfoHolder related to the element or complex 
type to the JavaBeanWriter, a DOM tree is created based on meta info retrieved 
from the BeanWriterMetaInfoHolder. There is a "property" node added to the root 
node ("bean") of this tree. I think we can add some attributes about 
restriction at this node. I haven't read much about transformers yet, but I 
think we can add new attributes to the "property" node that shows if we can 
have setters for a certain element of the base type.
+ 
http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
  
- Therefore, we need to add some fields to the BeanWriterMetaInfoHolder Class 
regarding these meta info. In SchemaCompiler we should match the elements of 
the current type with that of base type and fill the BeanWriterMetaInfoHolder 
accordingly. 
+ 
http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
  
+ 
http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
- Also the "minOccurs" should be checked to throw exceptions whenever a 
"required" element from the base type is omitted in the current type.
- 
- '''[6/30/2006]'''
- 
- I reviewed the tranformation process. It seems that JavaBeanWriter is using 
ADBBeanTemplate.xsl template. After loading the template, a transformer is 
created based on that; therefore, the Java code is generated based on the 
ADBBeanTemplate.xsl.
- 
- I also reviewed the ADBBeanTemplate.xsl itself. I'm thinking of some ideas 
for implementation.
-  
- In the case of Complex Content restriction, overriding the '''setter''' and 
'''getter''' of the restricted element seems to be the right solution. XMLBeans 
doesn't go with this solution, but seems this methods is more preferable since 
ADB is aimed to be a lightweight schema compiler/Java bean generator. 
- 
- The overridden '''getter''' is always expected to return '''null'''. 
- So, I think in the DOM tree we should have the "property" node for each 
element of the base type ( removed or not removed ), but we can add the right 
attributes to indicate that this element is restricted and its '''setter''' and 
'''getter''' should be overridden.
- 
- I am wondering what are the restrictions one can impose in complex content 
other than removing optional elements in the base type? For instance, what 
happens when the base type is '''anyType'''?
- 
- To answer my question, I looked for a more formal definition for "inheritance 
by restriction". I found that : "Inheritance by restriction is when a new 
content model is defined that is guaranteed to be a subset of the base content 
model."
- Therefore, The set of instances permitted by the '''derived type''' is a 
subset of the set of instances permitted by the '''base type'''. 
- 
- Therefore, I have to find out about the '''anyType''' issue. Any Thoughts?!! 
:)
- 
- '''[7/01/2006]'''
- 
- There's a whole different scenario for Simple Content extension, since 
there's no elements permitted in the Simple Content ( only attributes & text ). 
In this case, '''nested classes''' are used instead of inheritance. This is an 
example tested by XMLBeans:
  
  
+ ==== Adding Support for References in Processing Attributes ====
- `<xs:element name="shoesize">`
-   `<xs:complexType>`
-     `<xs:simpleContent>`
-       `<xs:extension base="xs:integer">`
-         `<xs:attribute name="country" type="xs:string" />`
-       `</xs:extension>`
-     `</xs:simpleContent>`
-   `</xs:complexType>`
- `</xs:element>`
  
- XMLBeans generated the corresponding code:
+ This feature enables ADB to support references in processing attributes. The 
relavant code resides in the following location:
  
+ 
http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
- `public class shoesizeDocument `
- `{`
-     `getshoesize();`
  
-     `setshoesize();`
- 
- 
-     `public static class shoesizeImpl` 
-     `{`
-         `getcountry();`
- 
-         `setcountry();`
-     `}`
- `}`
- 
- 
- Any Comments?!! :)
- 
-  
- '''[7/07/2006]'''
- 
- I have started implementing the support for complex content restriction. 
- 
- At first, I decided to edit the "property" nodes of the DOM tree which were 
written when populating the parent meta info and add "isRestricted" attribute 
which shows that the getter and setter for this restricted element should be 
overridden.
- 
- But I couldn't get any result because a problem occurred when using:
-  
- `Element root = model.getDocumentElement();`
- 
- The root element is supposed to be the "bean" element, but it happens to be 
'''null''' here. I have to find out about the problem.
- 
-  
- But for now I decided to change my approach and instead of editting 
"property" nodes, I decided to add "restricted" nodes to the DOM tree per 
restricted elements.
- 
- I need to ask for Axis2 developers' suggestions to see which approach is 
better. 
- 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to