You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "ant elder (JIRA)" <tu...@ws.apache.org> on 2006/05/23 11:16:30 UTC

[jira] Created: (TUSCANY-419) Template XML for JavaScript components

Template XML for JavaScript components
--------------------------------------

         Key: TUSCANY-419
         URL: http://issues.apache.org/jira/browse/TUSCANY-419
     Project: Tuscany
        Type: New Feature

  Components: Java SCA JavaScript Container  
    Versions: Java-M2    
    Reporter: ant elder
    Priority: Critical
     Fix For: Java-M2


Provide a template XML facility for JavaScript components


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (TUSCANY-419) Template XML for JavaScript components

Posted by "Venkatakrishnan (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-419?page=comments#action_12413720 ] 

Venkatakrishnan commented on TUSCANY-419:
-----------------------------------------

Hi Ant,

I looked up XMLBeans and did find the code for this. To recap the requirements that I have assumed for this.  If anything is more to this, please add and I will work on them : -
	- given a schema definition in an wsdl file  or in an  xsd file   create an xml instance for a given type defined in the schema definition.
       
Now I have some question, could you or anybody else please clarify them.

SDO based Generator (the patch that has been submitted earlier)
-----------------------------------------------------------------------------------------
- This generator based on SDOs will generate an XML instance given a type.   However, in this, you could also create an instance of an 'element' which is not defined in the schema.  The reason is that this generation is based only the schema types definitions and not element definitions.   For example I defined a type as follows in the helloworld.wsdl and defined no element based on this type. 
		<complexType name="ComplexGreetings">
                <sequence>
                    <element name="greet1" type="xsd:string"/>
                    <element name="greet2" type="xsd:double"/>
                </sequence>
        	</complexType>
Then using the generator I managed to create an instance of this type called 'ComplexGreetings' as follows: -
<?xml version="1.0" encoding="ASCII"?>
<helloworldaxis:complexgreetings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:helloworldaxis="http://helloworldaxis.samples.tuscany.apache.org" xsi:type="helloworldaxis:ComplexGreetings">
  <helloworldaxis:greet1></helloworldaxis:greet1>
  <helloworldaxis:greet2>0.0</helloworldaxis:greet2>
</helloworldaxis:complexgreetings>

Question : Is this right and permissable?  Can an instance of an element not defined in an xml schema definition allowed to be created?


XMLBeans based Generator 
---------------------------------------
I looked up the code for this and have developed some wrapper implementation to work around a few things.  But most function is right there in XMLBeans itself. 
- There was no way to load wsdl files and parse the schema within.  I have fixed this in the wrapper.  Now you may either load wsdl file or an xsd file.  I played around a bit with the wsdl extension classes for this and it works.  

The 'xml declaration'  - <?xml version="1.0" encoding="ASCII"?>  is not generated in the output.  If this is required to be generated it is very simple to do so.
Question : Should this be done?

- The XML Beans based approach allows you to create ONLY elements that are defined in the xml schema definition of the XSD or WSDL file.  If you mentioned a schema type and wanted an xml instance for it, this would not work.   Not sure if this would be ok, I extended a bit and now I am able to create instances for given schema types, just as it used to work in the case of the SDO generator.   But then the ugly thing is that the output xml instance has its root element named as 'xml-fragment' and there is no way to change this unless we parse this all over.
I am not comfortable with this.  I feel it is only right that one is not allowed to create element types that are not defined in the schema.  Am I right?  If so shall I do away with this extension?



> Template XML for JavaScript components
> --------------------------------------
>
>          Key: TUSCANY-419
>          URL: http://issues.apache.org/jira/browse/TUSCANY-419
>      Project: Tuscany
>         Type: New Feature

>   Components: Java SCA JavaScript Container
>     Versions: Java-M2
>     Reporter: ant elder
>     Priority: Critical
>      Fix For: Java-M2
>  Attachments: tuscany-sca-plugins patch 24-May.txt, tuscany-sca-tools patch 24-May.txt
>
> Provide a template XML facility for JavaScript components

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (TUSCANY-419) Template XML for JavaScript components

Posted by "ant elder (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-419?page=comments#action_12414014 ] 

ant elder commented on TUSCANY-419:
-----------------------------------

Thanks for the patches Venkata! 

As this is still a bit experimental and we need to work out how it will be used by the JavaScript container and what the APIs should look like so I've committed this to the sandbox for now: http://svn.apache.org/repos/asf/incubator/tuscany/sandbox/tools/



> Template XML for JavaScript components
> --------------------------------------
>
>          Key: TUSCANY-419
>          URL: http://issues.apache.org/jira/browse/TUSCANY-419
>      Project: Tuscany
>         Type: New Feature

>   Components: Java SCA JavaScript Container
>     Versions: Java-M2
>     Reporter: ant elder
>     Assignee: ant elder
>     Priority: Critical
>      Fix For: Java-M2
>  Attachments: tuscany-sca-plugins patch 24-May.txt, tuscany-sca-tools patch 24-May.txt, tuscany-sca-tools patch 30-May.txt
>
> Provide a template XML facility for JavaScript components

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Updated: (TUSCANY-419) Template XML for JavaScript components

Posted by "Venkatakrishnan (JIRA)" <tu...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/TUSCANY-419?page=all ]

Venkatakrishnan updated TUSCANY-419:
------------------------------------

    Attachment: tuscany-sca-tools patch 30-May.txt

Hi Ant.

This is an updated patch for the xml instance tool.  This contains two flavours of the generator - one that uses SDO and another that uses XMLBeans.  Take a look at the testcases for how one could go about using this.

Some points with respect to the generator based on XML Beans
- I have refactored / modified some code from the XMLBeans package.  I have 
- there is no xml declaration generated in the output
- where there are recursive / repititive definitions (as in the case of the MixedQuote type in sequences.xsd) there is only one outer instance created with a comment highlighting where an how many repititions could occur further within.  
- the output contains proper root element tags, only if the generation is based on element types declared in the input schema.  If it is based on data types for which there are no elements defined  then the root element is named as 'xml-fragment'.



> Template XML for JavaScript components
> --------------------------------------
>
>          Key: TUSCANY-419
>          URL: http://issues.apache.org/jira/browse/TUSCANY-419
>      Project: Tuscany
>         Type: New Feature

>   Components: Java SCA JavaScript Container
>     Versions: Java-M2
>     Reporter: ant elder
>     Priority: Critical
>      Fix For: Java-M2
>  Attachments: tuscany-sca-plugins patch 24-May.txt, tuscany-sca-tools patch 24-May.txt, tuscany-sca-tools patch 30-May.txt
>
> Provide a template XML facility for JavaScript components

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Assigned: (TUSCANY-419) Template XML for JavaScript components

Posted by "ant elder (JIRA)" <tu...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/TUSCANY-419?page=all ]

ant elder reassigned TUSCANY-419:
---------------------------------

    Assign To:     (was: ant elder)

> Template XML for JavaScript components
> --------------------------------------
>
>          Key: TUSCANY-419
>          URL: http://issues.apache.org/jira/browse/TUSCANY-419
>      Project: Tuscany
>         Type: New Feature

>   Components: Java SCA JavaScript Container
>     Versions: Java-M2
>     Reporter: ant elder
>     Priority: Critical
>      Fix For: Java-M2
>  Attachments: tuscany-sca-plugins patch 24-May.txt, tuscany-sca-tools patch 24-May.txt, tuscany-sca-tools patch 30-May.txt
>
> Provide a template XML facility for JavaScript components

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Assigned: (TUSCANY-419) Template XML for JavaScript components

Posted by "ant elder (JIRA)" <tu...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/TUSCANY-419?page=all ]

ant elder reassigned TUSCANY-419:
---------------------------------

    Assign To: ant elder

> Template XML for JavaScript components
> --------------------------------------
>
>          Key: TUSCANY-419
>          URL: http://issues.apache.org/jira/browse/TUSCANY-419
>      Project: Tuscany
>         Type: New Feature

>   Components: Java SCA JavaScript Container
>     Versions: Java-M2
>     Reporter: ant elder
>     Assignee: ant elder
>     Priority: Critical
>      Fix For: Java-M2
>  Attachments: tuscany-sca-plugins patch 24-May.txt, tuscany-sca-tools patch 24-May.txt, tuscany-sca-tools patch 30-May.txt
>
> Provide a template XML facility for JavaScript components

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Updated: (TUSCANY-419) Template XML for JavaScript components

Posted by "ant elder (JIRA)" <tu...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/TUSCANY-419?page=all ]

ant elder updated TUSCANY-419:
------------------------------

    Priority: Major  (was: Critical)

> Template XML for JavaScript components
> --------------------------------------
>
>                 Key: TUSCANY-419
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-419
>             Project: Tuscany
>          Issue Type: New Feature
>          Components: Java SCA JavaScript Container
>    Affects Versions: Java-M2
>            Reporter: ant elder
>             Fix For: Java-M2
>
>         Attachments: tuscany-sca-plugins patch 24-May.txt, tuscany-sca-tools patch 24-May.txt, tuscany-sca-tools patch 30-May.txt
>
>
> Provide a template XML facility for JavaScript components

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Closed: (TUSCANY-419) Template XML for JavaScript components

Posted by "ant elder (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-419?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ant elder closed TUSCANY-419.
-----------------------------

    Resolution: Fixed

We have this in the container now. Needs more work bu that can be done with new JIRAs. 

> Template XML for JavaScript components
> --------------------------------------
>
>                 Key: TUSCANY-419
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-419
>             Project: Tuscany
>          Issue Type: New Feature
>          Components: Java SCA JavaScript Container
>    Affects Versions: Java-M2
>            Reporter: ant elder
>             Fix For: Java-M2
>
>         Attachments: tuscany-sca-plugins patch 24-May.txt, tuscany-sca-tools patch 24-May.txt, tuscany-sca-tools patch 30-May.txt
>
>
> Provide a template XML facility for JavaScript components

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Updated: (TUSCANY-419) Template XML for JavaScript components

Posted by "Venkatakrishnan (JIRA)" <tu...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/TUSCANY-419?page=all ]

Venkatakrishnan updated TUSCANY-419:
------------------------------------

    Attachment: tuscany-sca-tools patch 24-May.txt
                tuscany-sca-plugins patch 24-May.txt

Hi... here are a couple of patches that will be required for this feature.

1) A tool that would generate and xml instance from an xsd (either an xsd file or a wsdl file)

2) A maven plugin for this tool.  Here is a sample of how this plugin could be used: -
<plugin>
                <groupId>org.apache.tuscany.sca.plugins</groupId>
                <artifactId>tuscany-plugin-xmlfromxsd</artifactId>
                <executions>
                    <execution>
                        <configuration>                          <sourceXSD>${basedir}/src/main/resources/wsdl/interopdoc.wsdl</sourceXSD>
                            <schemaTypeName>ComplexDocument</schemaTypeName>                          <schemaTypeNamespaceURI>http://soapinterop.org/</schemaTypeNamespaceURI>
                        </configuration>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
  

Hope this helps!

> Template XML for JavaScript components
> --------------------------------------
>
>          Key: TUSCANY-419
>          URL: http://issues.apache.org/jira/browse/TUSCANY-419
>      Project: Tuscany
>         Type: New Feature

>   Components: Java SCA JavaScript Container
>     Versions: Java-M2
>     Reporter: ant elder
>     Priority: Critical
>      Fix For: Java-M2
>  Attachments: tuscany-sca-plugins patch 24-May.txt, tuscany-sca-tools patch 24-May.txt
>
> Provide a template XML facility for JavaScript components

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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