cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r494369 [1/6] - in /incubator/cxf/trunk/tools2: common/ common/src/main/java/org/apache/cxf/tools/common/ wsdlto/core/ wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/ wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/ wsdlto...
Date Tue, 09 Jan 2007 10:50:52 GMT
Author: ema
Date: Tue Jan  9 02:50:47 2007
New Revision: 494369

URL: http://svn.apache.org/viewvc?view=rev&rev=494369
Log:
[CXF-310] Added generators and templates for tools2
Made tools can generate class for hello_world.wsdl
Ported test resouces from tools to tools2


Added:
    incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/
    incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/
    incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/
    incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/
    incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/
    incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/
    incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/PluginLoaderTest.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/plugin.xml   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AbstractGenerator.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AntGenerator.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ClientGenerator.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ImplGenerator.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/JAXWSProfile.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/Messages.properties   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServerGenerator.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/VelocityWriter.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/build.vm
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/client.vm
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/fault.vm
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/impl.vm
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/sei.vm
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/server.vm
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/common/
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/common/ProcessorTestBase.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/Invoice.xsd   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/InvoiceServer-issue305570.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/InvoiceServer.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/addNumbers.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/async_binding.xml   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/async_binding.xml.tmpl
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/basic_callback.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/binary_attachment.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/doc_lit_bare.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/handler_test.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_addr.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_async.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_collision.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_doc_lit.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_doc_lit_router.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_doc_wrapped_bare.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_exclude.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_holder.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_jaxws_base.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_jaxws_binding.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_messages.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_rpc_lit.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_schema_import.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_schema_import.xjb
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_soap12.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_with_enum_type.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_with_keywords_operation.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_wsdl_import.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/helloworld-nobinding.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/helloworld-noservice.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/helloworld-portname_servicename.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/interoptestdoclit.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/invalid_mep.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/jms_test.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/mapping-doc-literal.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/mime-inout.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/mime_binding.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/mime_fail_diff_parts.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/mime_fail_unique_root.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/multi_schema.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/router.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/schema1.xsd   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/schema2.xsd   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/schema3.xsd   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/schema4.xsd   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/soap_header.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/soapheader_test.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/ws_address_binding.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/wsdl_provider_test.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/xml_format_fail.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/xml_format_pass.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/xml_http_bare.wsdl   (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/xml_http_wrapped.wsdl   (with props)
Removed:
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/core/plugin.xml
Modified:
    incubator/cxf/trunk/tools2/common/pom.xml
    incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java
    incubator/cxf/trunk/tools2/wsdlto/core/pom.xml
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/DataBindingProfile.java
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/Messages.properties
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/cxf-tools-plugin.xml
    incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/pom.xml
    incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/FaultProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/InterfaceMapper.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/ParameterMapper.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/DummyDataBinding.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-plugin.xml
    incubator/cxf/trunk/tools2/wsdlto/test/pom.xml
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/core/PluginLoaderTest.java

Modified: incubator/cxf/trunk/tools2/common/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/common/pom.xml?view=diff&rev=494369&r1=494368&r2=494369
==============================================================================
--- incubator/cxf/trunk/tools2/common/pom.xml (original)
+++ incubator/cxf/trunk/tools2/common/pom.xml Tue Jan  9 02:50:47 2007
@@ -84,6 +84,19 @@
                 <artifactId>cxf-common-utilities</artifactId>
                 <version>${project.version}</version>
             </dependency>
+            
+            <dependency>
+	        <groupId>org.apache.cxf</groupId>
+	        <artifactId>cxf-rt-core</artifactId>
+	        <version>${project.version}</version>
+            </dependency>
+            
+            <dependency>
+	    	<groupId>org.apache.cxf</groupId>
+	    	<artifactId>cxf-api</artifactId>
+	    	<version>${project.version}</version>
+            </dependency>
+            
         </dependencies>
 
 </project>

Modified: incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java?view=diff&rev=494369&r1=494368&r2=494369
==============================================================================
--- incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java (original)
+++ incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java Tue Jan  9 02:50:47 2007
@@ -28,6 +28,7 @@
 import org.xml.sax.InputSource;
 
 import org.apache.cxf.tools.common.model.JavaModel;
+import org.apache.cxf.tools.util.ProcessorUtil;
 import org.apache.cxf.tools.util.PropertyUtil;
 import org.apache.cxf.tools.util.URIParserUtil;
 
@@ -181,7 +182,9 @@
         if (hasNamespace(ns)) {
             return mapNamespaceToPackageName(ns);
         } else {
-            return getPackageName();
+            String pkg = ProcessorUtil.parsePackageName(ns, null);
+            setPackageName(pkg);
+            return pkg;
         }
     }
 

Modified: incubator/cxf/trunk/tools2/wsdlto/core/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/pom.xml?view=diff&rev=494369&r1=494368&r2=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/pom.xml (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/pom.xml Tue Jan  9 02:50:47 2007
@@ -51,6 +51,7 @@
 	    <groupId>org.apache.cxf</groupId>
 	    <artifactId>cxf-tools2-validator</artifactId>
 	    <version>${project.version}</version>
+	    
 	</dependency>
 	<dependency>
 	    <groupId>org.apache.cxf</groupId>

Modified: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java?view=diff&rev=494369&r1=494368&r2=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java Tue Jan  9 02:50:47 2007
@@ -48,6 +48,7 @@
 import org.apache.cxf.tools.common.toolspec.parser.BadUsageException;
 import org.apache.cxf.tools.common.toolspec.parser.CommandDocument;
 import org.apache.cxf.tools.common.toolspec.parser.ErrorVisitor;
+import org.apache.cxf.tools.util.ClassCollector;
 import org.apache.cxf.tools.wsdlto.core.AbstractWSDLBuilder;
 import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
 import org.apache.cxf.tools.wsdlto.core.FrontEndProfile;
@@ -98,10 +99,9 @@
                 if (version == ToolConstants.WSDLVersion.WSDL11) {
                     AbstractWSDLBuilder<Definition> builder =
                         (AbstractWSDLBuilder<Definition>) frontend.getWSDLBuilder();
-                    Definition definition = builder.build(wsdlURL);
                     builder.setContext(context);
+                    Definition definition = builder.build(wsdlURL);
                     builder.customize();
-
                     context.put(Definition.class, builder.getWSDLModel());
                     if (context.optionSet(ToolConstants.CFG_VALIDATE_WSDL)) {
                         builder.validate(definition);
@@ -109,6 +109,8 @@
 
                     WSDLServiceBuilder serviceBuilder = new WSDLServiceBuilder(getBus());
                     service = serviceBuilder.buildService(definition, getServiceQName(definition));
+                    context.put(ServiceInfo.class, service);
+                    context.put(ClassCollector.class, new ClassCollector());
                 } else {
                     // TODO: wsdl2.0 support
                 }
@@ -123,7 +125,7 @@
                 processor.setEnvironment(context);
                 processor.process();
 
-                // Generate artifacts
+                // Generate artifacts                
                 for (FrontEndGenerator generator : frontend.getGenerators()) {
                     generator.generate(context);
                 }

Modified: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/DataBindingProfile.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/DataBindingProfile.java?view=diff&rev=494369&r1=494368&r2=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/DataBindingProfile.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/DataBindingProfile.java Tue Jan  9 02:50:47 2007
@@ -29,4 +29,5 @@
     
     void generate(ToolContext context) throws ToolException;
     String getType(QName qn);
+    String getWrappedElementType(QName wrapperElement, QName item);
 }

Modified: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/Messages.properties?view=diff&rev=494369&r1=494368&r2=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/Messages.properties (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/Messages.properties Tue Jan  9 02:50:47 2007
@@ -15,6 +15,6 @@
 FOUND_DATABINDINGS =  Found {1} databindings in <{0}> plugin.
 LOADING_DATABINDING = Loading <{0}> databinding from <{1}> plugin.
 DATABINDING_MISSING_NAME = Databinding must have a name, can not load THIS databinding from <{0}> plugin.
-
+LOAD_CONTAINER_CLASS_FAILED = Tools can not load the container class : {0}
 NO_SERVICE_IN_DEFINITION = There is no service in this wsdl : {0}
 CAN_NOT_FIND_SERVICE = Can not find the service : {0} in wsdl :{1}

Modified: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/cxf-tools-plugin.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/cxf-tools-plugin.xml?view=diff&rev=494369&r1=494368&r2=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/cxf-tools-plugin.xml (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/cxf-tools-plugin.xml Tue Jan  9 02:50:47 2007
@@ -23,10 +23,15 @@
 	<container name="JAXWSContainer" toolspec="jaxws-toolspec.xml"/>
 	<processor name="WSDLToJavaProcessor" package="org.apache.cxf.tools.wsdlto.frontend.jaxws.processor"/>
 	<builder name="JAXWSDefinitionBuilder" package="org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11"/>
-	<!--generators package="">
-	    <generator name=""/>
-	    <generator name=""/>
-	</generators-->
+	<generators package="org.apache.cxf.tools.wsdlto.frontend.jaxws.generators">
+	    <generator name="AntGenerator"/>
+	    <generator name="ClientGenerator"/>
+	    <generator name="FaultGenerator"/>
+	    <generator name="ImplGenerator"/>
+	    <generator name="SEIGenerator"/>
+	    <generator name="ServerGenerator"/>
+	    <generator name="ServiceGenerator"/>
+	</generators>
     </frontend>
     <databinding name="jaxb" package="org.apache.cxf.tools.wsdlto.databinding.jaxb" profile="JAXBDataBinding"/>
 </plugin>

Added: incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/PluginLoaderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/PluginLoaderTest.java?view=auto&rev=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/PluginLoaderTest.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/PluginLoaderTest.java Tue Jan  9 02:50:47 2007
@@ -0,0 +1,109 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.core;
+
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.plugin.DataBinding;
+import org.apache.cxf.tools.plugin.FrontEnd;
+import org.apache.cxf.tools.plugin.Generator;
+import org.apache.cxf.tools.plugin.Plugin;
+
+public class PluginLoaderTest extends TestCase {
+
+    public void testLoadPlugins() throws Exception {
+        PluginLoader loader = PluginLoader.getInstance();
+        assertEquals(1, loader.getPlugins().size());
+        assertEquals("default", getPlugin(loader, 0).getName());
+        
+        loader.loadPlugin("/org/apache/cxf/tools/wsdlto/core/plugin.xml");
+        assertEquals(2, loader.getPlugins().size());
+        Plugin plugin = getPlugin(loader, 1);
+        assertEquals("test", plugin.getName());
+        assertEquals("2.0", plugin.getVersion());
+        assertEquals("apache cxf", plugin.getProvider());
+        
+        Map<String, FrontEnd> frontends = loader.getFrontEnds();
+        assertNotNull(frontends);
+        assertEquals(1, frontends.size());
+
+        FrontEnd frontend = getFrontEnd(frontends, 0);
+
+        
+        assertEquals("jaxws", frontend.getName());
+        assertEquals("org.apache.cxf.tools.wsdlto.frontend.jaxws", frontend.getPackage());
+        assertEquals("JAXWSProfile", frontend.getProfile());
+        assertNotNull(frontend.getGenerators());
+        assertNotNull(frontend.getGenerators().getGenerator());
+        assertEquals(2, frontend.getGenerators().getGenerator().size());
+        assertEquals("AntGenerator", getGenerator(frontend, 0).getName());
+        assertEquals("ImplGenerator", getGenerator(frontend, 1).getName());
+
+        assertEquals("org.apache.cxf.tools.wsdlto.core", frontend.getContainer().getPackage());
+        assertEquals("DummyContainer", frontend.getContainer().getName());
+        assertEquals("dummy.toolspec", frontend.getContainer().getToolspec());
+
+        try {
+            loader.getFrontEndProfile("jaxws");
+            fail("JaxWs frontend not loaded yet");
+        } catch (ToolException e) {
+            assertEquals(getLogMessage("FRONTEND_PROFILE_LOAD_FAIL", frontend.getPackage()
+                                       + "."
+                                       + frontend.getProfile()),
+                         e.getMessage());
+        }
+        
+        Map<String, DataBinding> databindings = loader.getDataBindings();
+        assertNotNull(databindings);
+        assertEquals(1, databindings.size());
+        
+        DataBinding databinding = getDataBinding(databindings, 0);
+        assertEquals("jaxb", databinding.getName());
+        assertEquals("org.apache.cxf.tools.wsdlto.databinding.jaxb", databinding.getPackage());
+        assertEquals("JAXBBindingGenerator", databinding.getProfile());
+    }
+
+    protected String getLogMessage(String key, Object...params) {
+        return new Message(key, PluginLoader.LOG, params).toString();
+    }
+
+    protected Generator getGenerator(FrontEnd frontend, int index) {
+        return frontend.getGenerators().getGenerator().get(index);
+    }
+    
+    protected FrontEnd getFrontEnd(Map<String, FrontEnd> frontends, int index) {
+        int size = frontends.size();
+        return frontends.values().toArray(new FrontEnd[size])[index];
+    }
+
+    protected DataBinding getDataBinding(Map<String, DataBinding> databindings, int index) {
+        int size = databindings.size();
+        return databindings.values().toArray(new DataBinding[size])[index];
+    }
+    
+    protected Plugin getPlugin(PluginLoader loader, int index) {
+        int size = loader.getPlugins().size();
+        return loader.getPlugins().values().toArray(new Plugin[size])[index];
+    }
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/PluginLoaderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/PluginLoaderTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/plugin.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/plugin.xml?view=auto&rev=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/plugin.xml (added)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/plugin.xml Tue Jan  9 02:50:47 2007
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<plugin name="test" version="2.0" provider="apache cxf" xmlns="http://cxf.apache.org/tools/plugin">
+    <frontend name="jaxws" package="org.apache.cxf.tools.wsdlto.frontend.jaxws" profile="JAXWSProfile">
+	<container name="DummyContainer" toolspec="dummy.toolspec" package="org.apache.cxf.tools.wsdlto.core"/>
+	<builder name="JAXWSDefinitionBuilder" package="org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11"/>
+	<generators package="org.apache.cxf.tools.wsdlto.frontend.jaxws.generators">
+	    <generator name="AntGenerator"/>
+	    <generator name="ImplGenerator"/>
+	</generators>
+    </frontend>	
+    <databinding name="jaxb" package="org.apache.cxf.tools.wsdlto.databinding.jaxb" profile="JAXBBindingGenerator"/>
+</plugin>
+

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/plugin.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/plugin.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/plugin.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/pom.xml?view=diff&rev=494369&r1=494368&r2=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/pom.xml (original)
+++ incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/pom.xml Tue Jan  9 02:50:47 2007
@@ -50,10 +50,16 @@
 	    <artifactId>junit</artifactId>
 	    <scope>test</scope>
 	</dependency>
-
+        
+        <dependency>
+		    <groupId>org.apache.cxf</groupId>
+		    <artifactId>cxf-tools2-wsdlto-core</artifactId>
+		    <version>${project.version}</version>
+	</dependency>
+        
 	<dependency>
 	    <groupId>org.apache.cxf</groupId>
-	    <artifactId>cxf-tools2-wsdlto-core</artifactId>
+	    <artifactId>cxf-tools2-common</artifactId>
 	    <version>${project.version}</version>
 	</dependency>
 	

Modified: incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java?view=diff&rev=494369&r1=494368&r2=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java Tue Jan  9 02:50:47 2007
@@ -23,7 +23,6 @@
 import java.io.IOException;
 import java.util.Collection;
 import java.util.List;
-import java.util.Set;
 import java.util.logging.Logger;
 
 import javax.wsdl.Definition;
@@ -34,6 +33,8 @@
 import org.xml.sax.InputSource;
 
 import com.sun.codemodel.JCodeModel;
+import com.sun.tools.xjc.api.Mapping;
+import com.sun.tools.xjc.api.Property;
 import com.sun.tools.xjc.api.S2JJAXBModel;
 import com.sun.tools.xjc.api.TypeAndAnnotation;
 import com.sun.tools.xjc.api.XJC;
@@ -52,7 +53,7 @@
 import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
 public class JAXBDataBinding implements DataBindingProfile {
     private static final Logger LOG = LogUtils.getL7dLogger(JAXBDataBinding.class);
-    protected S2JJAXBModel rawJaxbModelGenCode;
+    private static S2JJAXBModel rawJaxbModelGenCode;
     private ToolContext env;
     private ServiceInfo serviceInfo;
     private Definition def;
@@ -62,9 +63,6 @@
         env = penv;
         serviceInfo = env.get(ServiceInfo.class);
         def = (Definition)env.get(Definition.class);
-        
-        Set<InputSource> jaxbBindings = (Set<InputSource>)env.get(ToolConstants.NS_JAXB_BINDINGS);
-
                 
         SchemaCompilerImpl schemaCompiler = (SchemaCompilerImpl)XJC.createSchemaCompiler();        
         
@@ -79,6 +77,8 @@
         
         Collection<SchemaInfo> schemas = serviceInfo.getTypeInfo().getSchemas();
         
+        Collection<InputSource> jaxbBindings = env.getJaxbBindingFile().values();
+        
         for (SchemaInfo schema : schemas) {
             Element element = schema.getElement();
             String tns = element.getAttribute("targetNamespace");
@@ -140,8 +140,7 @@
 
             if (rawJaxbModelGenCode instanceof S2JJAXBModel) {
                 S2JJAXBModel schem2JavaJaxbModel = (S2JJAXBModel)rawJaxbModelGenCode;
-                //TO DO....
-                // enable jaxb plugin
+                //TODO : enable jaxb plugin
                 JCodeModel jcodeModel = schem2JavaJaxbModel.generateCode(null, null);
                 
                 jcodeModel.build(fileCodeWriter);
@@ -158,11 +157,26 @@
     }
     
     public String getType(QName qname) {
-        TypeAndAnnotation typeAnno = rawJaxbModelGenCode.getJavaType(qname);        
-        if (typeAnno.getTypeClass() != null) {
+        Mapping mapping = rawJaxbModelGenCode.get(qname);
+        TypeAndAnnotation typeAnno = mapping.getType();
+        if (typeAnno != null && typeAnno.getTypeClass() != null) {
             return typeAnno.getTypeClass().fullName();
         }
         return null;
         
+    }
+    
+    public String getWrappedElementType(QName wrapperElement, QName item) {
+        Mapping mapping = rawJaxbModelGenCode.get(wrapperElement);
+        if (mapping != null) {
+            List<? extends Property> propList = mapping.getWrapperStyleDrilldown();
+            for (Property pro : propList) {
+                if (pro.elementName().getNamespaceURI().equals(item.getNamespaceURI()) 
+                    && pro.elementName().getLocalPart().equals(item.getLocalPart())) {
+                    return pro.type().fullName();
+                }
+            }
+        }
+        return null;
     }
 }

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AbstractGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AbstractGenerator.java?view=auto&rev=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AbstractGenerator.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AbstractGenerator.java Tue Jan  9 02:50:47 2007
@@ -0,0 +1,164 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.frontend.jaxws.generators;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.logging.Logger;
+
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.tools.common.FrontEndGenerator;
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.util.ClassCollector;
+import org.apache.cxf.tools.util.FileWriterUtil;
+import org.apache.cxf.version.Version;
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.Velocity;
+
+public abstract class AbstractGenerator implements FrontEndGenerator {
+
+    public static final String TEMPLATE_BASE = "org/apache/cxf/tools/wsdlto/frontend/jaxws/template";
+    private static final Logger LOG = LogUtils.getL7dLogger(AbstractGenerator.class);
+    protected ToolContext env;
+    //protected JavaModel javaModel;
+    protected Map<String, Object> attributes = new HashMap<String, Object>();
+    protected String name;
+    //protected ClassCollector collector;
+
+    public AbstractGenerator() {
+    }
+
+    public abstract boolean passthrough();
+
+    public abstract void generate(ToolContext penv) throws ToolException;
+
+    protected void doWrite(String templateName, Writer outputs) throws ToolException {
+        Template tmpl = null;
+        try {
+            tmpl = Velocity.getTemplate(templateName);
+        } catch (Exception e) {
+            Message msg = new Message("TEMPLATE_MISSING", LOG, templateName);
+            throw new ToolException(msg, e);
+        }
+
+        VelocityContext ctx = new VelocityContext();
+
+        for (Iterator iter = attributes.keySet().iterator(); iter.hasNext();) {
+            String key = (String)iter.next();
+            ctx.put(key, attributes.get(key));
+        }
+
+        VelocityWriter writer = new VelocityWriter(outputs);
+        try {
+            tmpl.merge(ctx, writer);
+            writer.close();
+        } catch (Exception e) {
+            Message msg = new Message("VELOCITY_ENGINE_WRITE_ERRORS", LOG);
+            throw new ToolException(msg, e);
+        }
+    }
+
+    protected boolean isCollision(String packageName, String filename) throws ToolException {        
+        return isCollision(packageName, filename, ".java");
+    }
+
+    protected boolean isCollision(String packageName, String filename, String ext) throws ToolException {
+        if (env.optionSet(ToolConstants.CFG_GEN_OVERWRITE)) {
+            return false;
+        }
+        FileWriterUtil fw = new FileWriterUtil((String)env.get(ToolConstants.CFG_OUTPUTDIR));
+        return fw.isCollision(packageName, filename + ext);
+    }
+
+    protected Writer parseOutputName(String packageName, String filename, String ext) throws ToolException {
+        FileWriterUtil fw = null;
+        Writer writer = null;
+
+        fw = new FileWriterUtil((String)env.get(ToolConstants.CFG_OUTPUTDIR));
+        try {
+            writer = fw.getWriter(packageName, filename + ext);
+        } catch (IOException ioe) {
+            Message msg = new Message("FAIL_TO_WRITE_FILE", LOG, packageName + "." + filename + ext);
+            throw new ToolException(msg, ioe);
+        }
+
+        return writer;
+    }
+
+    protected Writer parseOutputName(String packageName, String filename) throws ToolException {
+        ClassCollector collector = env.get(ClassCollector.class);
+        
+        if (ToolConstants.SEI_GENERATOR.equals(name)) {
+            collector.addSeiClassName(packageName , filename , packageName + "." + filename);
+        }
+        
+        if (ToolConstants.CLT_GENERATOR.equals(name)) {
+            collector.addClientClassName(packageName , filename , packageName + "." + filename);
+        }
+
+        if (ToolConstants.FAULT_GENERATOR.equals(name)) {
+            collector.addExceptionClassName(packageName , filename , packageName + "." + filename);
+        }
+        if (ToolConstants.SERVICE_GENERATOR.equals(name)) {
+            collector.addServiceClassName(packageName , filename , packageName + "." + filename);
+        }
+        if (ToolConstants.SVR_GENERATOR.equals(name)) {
+            collector.addServiceClassName(packageName , filename , packageName + "." + filename);
+
+        }
+
+
+        return parseOutputName(packageName, filename, ".java");
+    }
+
+    protected void setAttributes(String n, Object value) {
+        attributes.put(n, value);
+    }
+
+    protected void setCommonAttributes() {
+        attributes.put("currentdate", Calendar.getInstance().getTime());
+        attributes.put("version", Version.getCurrentVersion());
+    }
+
+    protected void clearAttributes() {
+        attributes.clear();
+    }
+
+    public void setEnvironment(ToolContext penv) {
+        this.env = penv;
+
+    }
+
+    public ToolContext getEnvironment() {
+        return this.env;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AbstractGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AbstractGenerator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AntGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AntGenerator.java?view=auto&rev=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AntGenerator.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AntGenerator.java Tue Jan  9 02:50:47 2007
@@ -0,0 +1,58 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.frontend.jaxws.generators;
+
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.common.model.JavaModel;
+
+public class AntGenerator extends AbstractGenerator {
+
+    private static final String ANT_TEMPLATE = TEMPLATE_BASE + "/build.vm";
+
+    public AntGenerator() {
+        this.name = ToolConstants.ANT_GENERATOR;
+    }
+
+    public boolean passthrough() {
+        if (env.optionSet(ToolConstants.CFG_ANT)
+                || env.optionSet(ToolConstants.CFG_ALL)
+                || env.optionSet(ToolConstants.CFG_GEN_ANT)) {
+            return false;
+        }
+        return true;
+    }
+
+    public void generate(ToolContext penv) throws ToolException {
+        this.env = penv;
+        JavaModel javaModel = env.getJavaModel();
+
+        if (passthrough()) {
+            return;
+        }
+        clearAttributes();
+        setAttributes("intfs", javaModel.getInterfaces().values());
+        setAttributes("wsdlLocation", javaModel.getLocation());
+        setCommonAttributes();
+
+        doWrite(ANT_TEMPLATE, parseOutputName(null, "build", ".xml"));
+    }
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AntGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AntGenerator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ClientGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ClientGenerator.java?view=auto&rev=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ClientGenerator.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ClientGenerator.java Tue Jan  9 02:50:47 2007
@@ -0,0 +1,112 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.frontend.jaxws.generators;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.common.model.JavaInterface;
+import org.apache.cxf.tools.common.model.JavaModel;
+import org.apache.cxf.tools.common.model.JavaPort;
+import org.apache.cxf.tools.common.model.JavaServiceClass;
+
+public class ClientGenerator extends AbstractGenerator {
+
+    private static final String CLT_TEMPLATE = TEMPLATE_BASE + "/client.vm";
+
+    public ClientGenerator() {
+        this.name = ToolConstants.CLT_GENERATOR;
+    }
+
+    public boolean passthrough() {       
+        if (env.optionSet(ToolConstants.CFG_GEN_CLIENT)
+            || env.optionSet(ToolConstants.CFG_CLIENT)
+            || env.optionSet(ToolConstants.CFG_ALL)) {
+            return false;
+        } 
+        if (env.optionSet(ToolConstants.CFG_GEN_ANT)
+            || env.optionSet(ToolConstants.CFG_GEN_TYPES)
+            || env.optionSet(ToolConstants.CFG_GEN_IMPL)
+            || env.optionSet(ToolConstants.CFG_GEN_SEI)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVER)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVICE)) {
+            return true;
+        }
+        
+        return true;
+        
+    }
+
+    public void generate(ToolContext penv) throws ToolException {
+        this.env = penv;
+        JavaModel javaModel = env.getJavaModel();
+
+        if (passthrough()) {
+            return;
+        }
+
+        Map<String, JavaInterface> interfaces = javaModel.getInterfaces();
+        JavaServiceClass js = null;
+        JavaPort jp = null;
+
+        for (Iterator iter = interfaces.keySet().iterator(); iter.hasNext();) {
+            String interfaceName = (String)iter.next();
+            JavaInterface intf = interfaces.get(interfaceName);
+
+            Iterator it = javaModel.getServiceClasses().values().iterator();
+            while (it.hasNext()) {
+                String serviceName = "";
+                js = (JavaServiceClass)it.next();
+                Iterator i = js.getPorts().iterator();
+                while (i.hasNext()) {
+                    jp = (JavaPort)i.next();
+                    if (jp.getPortType().equals(interfaceName)) {
+                        serviceName = js.getName();
+
+                        break;
+                    }
+                }
+                if (!"".equals(serviceName)) {
+                    break;
+                }
+            }
+
+
+            String clientClassName = interfaceName + "Client";
+            while (isCollision(intf.getPackageName(), clientClassName)) {
+                clientClassName = clientClassName + "_Client";
+            }
+
+            clearAttributes();
+            setAttributes("clientClassName", clientClassName);
+            setAttributes("intf", intf);
+            setAttributes("service", js);
+            setAttributes("port", jp);
+
+            setCommonAttributes();
+
+            doWrite(CLT_TEMPLATE, parseOutputName(intf.getPackageName(),
+                    clientClassName));
+        }
+    }
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ClientGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ClientGenerator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java?view=auto&rev=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java Tue Jan  9 02:50:47 2007
@@ -0,0 +1,85 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.frontend.jaxws.generators;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.common.model.JavaExceptionClass;
+import org.apache.cxf.tools.common.model.JavaField;
+import org.apache.cxf.tools.common.model.JavaModel;
+import org.apache.cxf.tools.util.ProcessorUtil;
+
+public class FaultGenerator extends AbstractGenerator {
+
+    private static final String FAULT_TEMPLATE = TEMPLATE_BASE + "/fault.vm";
+
+    public FaultGenerator() {
+        this.name = ToolConstants.FAULT_GENERATOR;
+    }
+
+
+    public boolean passthrough() {
+        if (env.optionSet(ToolConstants.CFG_GEN_TYPES)
+            || env.optionSet(ToolConstants.CFG_ALL)) {
+            return false;
+        } 
+        if (env.optionSet(ToolConstants.CFG_GEN_ANT)
+            || env.optionSet(ToolConstants.CFG_GEN_CLIENT)
+            || env.optionSet(ToolConstants.CFG_GEN_IMPL)
+            || env.optionSet(ToolConstants.CFG_GEN_SEI)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVER)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVICE)) {
+            return true;
+        }
+        
+        return false;
+    }
+
+    public void generate(ToolContext penv) throws ToolException {
+        this.env = penv;
+        JavaModel javaModel = env.getJavaModel();
+
+        if (passthrough()) {
+            return;
+        }
+
+        Map<String, JavaExceptionClass> exceptionClasses = javaModel
+                .getExceptionClasses();
+        for (Iterator iter = exceptionClasses.keySet().iterator(); iter
+                .hasNext();) {
+            String expClassName = (String)iter.next();
+            JavaExceptionClass expClz =
+                exceptionClasses.get(expClassName);
+
+            clearAttributes();
+            setAttributes("expClass", expClz);
+            for (JavaField jf : expClz.getFields()) {
+                setAttributes("paraName", ProcessorUtil.mangleNameToVariableName(jf.getName()));
+            }
+            setCommonAttributes();
+            doWrite(FAULT_TEMPLATE, parseOutputName(expClz.getPackageName(),
+                    expClz.getName()));
+        }
+    }
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java?view=auto&rev=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java Tue Jan  9 02:50:47 2007
@@ -0,0 +1,80 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.frontend.jaxws.generators;
+
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.common.model.JavaAnnotation;
+import org.apache.cxf.tools.common.model.JavaInterface;
+
+public class HandlerConfigGenerator extends AbstractGenerator {
+
+    //private static final String HANDLER_CHAIN_NAME = "";
+   // private JavaInterface intf;
+    private JavaAnnotation handlerChainAnnotation;
+
+    public HandlerConfigGenerator() {
+        this.name = ToolConstants.HANDLER_GENERATOR;
+    }
+
+    public JavaAnnotation getHandlerAnnotation() {
+        return handlerChainAnnotation;
+    }
+
+    public boolean passthrough() {
+       //TODO: enable the handler chain
+        /* if (this.intf.getHandlerChains() == null) {
+            return true;
+        }*/
+        return false;
+    }
+
+    public void setJavaInterface(JavaInterface javaInterface) {
+       // this.intf = javaInterface;
+    }
+
+    public void generate(ToolContext penv) throws ToolException {
+        
+       //TODO: Enable Handler Chain
+        this.env = penv;
+
+        if (passthrough()) {
+            return;
+        }
+
+       /* Element e = this.intf.getHandlerChains();
+        NodeList nl = e.getElementsByTagNameNS(ToolConstants.HANDLER_CHAINS_URI,
+                                               ToolConstants.HANDLER_CHAIN);
+        if (nl.getLength() > 0) {
+            String fName = ProcessorUtil.getHandlerConfigFileName(this.intf.getName());
+            handlerChainAnnotation = new JavaAnnotation("HandlerChain");
+            handlerChainAnnotation.addArgument("name", HANDLER_CHAIN_NAME);
+            handlerChainAnnotation.addArgument("file", fName + ".xml");
+            generateHandlerChainFile(e, parseOutputName(this.intf.getPackageName(),
+                                                        fName,
+                                                        ".xml"));
+        }*/
+    }
+
+    /*private void generateHandlerChainFile(Element hChains, Writer writer) throws ToolException {
+        XMLUtils.generateXMLFile(hChains, writer);
+    }*/
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ImplGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ImplGenerator.java?view=auto&rev=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ImplGenerator.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ImplGenerator.java Tue Jan  9 02:50:47 2007
@@ -0,0 +1,98 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.frontend.jaxws.generators;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.common.model.JavaInterface;
+import org.apache.cxf.tools.common.model.JavaModel;
+import org.apache.cxf.tools.common.model.JavaPort;
+import org.apache.cxf.tools.common.model.JavaServiceClass;
+
+public class ImplGenerator extends AbstractGenerator {
+
+    private static final String IMPL_TEMPLATE = TEMPLATE_BASE + "/impl.vm";
+
+
+    public ImplGenerator() {
+        this.name = ToolConstants.IMPL_GENERATOR;
+    }
+
+    public boolean passthrough() {       
+        if (env.optionSet(ToolConstants.CFG_GEN_IMPL)
+            || env.optionSet(ToolConstants.CFG_IMPL)
+            || env.optionSet(ToolConstants.CFG_ALL)) {
+            return false;
+        } 
+        if (env.optionSet(ToolConstants.CFG_GEN_ANT)
+            || env.optionSet(ToolConstants.CFG_GEN_TYPES)
+            || env.optionSet(ToolConstants.CFG_GEN_CLIENT)
+            || env.optionSet(ToolConstants.CFG_GEN_SEI)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVER)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVICE)) {
+            return true;
+        }
+        
+        return true;
+        
+        
+    }
+
+    public void generate(ToolContext penv) throws ToolException {
+        this.env = penv;
+        JavaModel javaModel = env.getJavaModel();
+
+        if (passthrough()) {
+            return;
+        }
+
+        Map<String, JavaInterface> interfaces = javaModel.getInterfaces();
+        Map<String, JavaServiceClass> services = javaModel.getServiceClasses();
+        String service = "";
+        String port = "";
+        if (!services.values().isEmpty()) {
+            JavaServiceClass javaservice = services.values().iterator().next();
+            service = javaservice.getServiceName();
+            if (javaservice.getPorts().size() != 0) {
+                JavaPort jport = (JavaPort)javaservice.getPorts().get(0);
+                port = jport.getPortName();
+            }
+        }
+        for (Iterator iter = interfaces.keySet().iterator(); iter.hasNext();) {
+            String interfaceName = (String)iter.next();
+            JavaInterface intf = interfaces.get(interfaceName);
+
+            clearAttributes();
+            setAttributes("intf", intf);
+
+            setAttributes("service", service);
+            setAttributes("port", port);
+
+            setCommonAttributes();
+
+            doWrite(IMPL_TEMPLATE, parseOutputName(intf.getPackageName(), intf.getName() + "Impl"));
+        }
+    }
+
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ImplGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ImplGenerator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/JAXWSProfile.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/JAXWSProfile.java?view=auto&rev=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/JAXWSProfile.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/JAXWSProfile.java Tue Jan  9 02:50:47 2007
@@ -0,0 +1,46 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.frontend.jaxws.generators;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.cxf.tools.common.FrontEndGenerator;
+import org.apache.cxf.tools.common.FrontEndGeneratorsProfile;
+
+/**
+ * Generates a service interface, service stub, and port accessor.
+ *
+ */
+public class JAXWSProfile implements FrontEndGeneratorsProfile {
+    public List<FrontEndGenerator> getPlugins() {
+        List<FrontEndGenerator> plugins = new ArrayList<FrontEndGenerator>();
+
+        plugins.add(new SEIGenerator());
+        plugins.add(new FaultGenerator());
+        plugins.add(new ServerGenerator());
+        plugins.add(new ImplGenerator());
+        plugins.add(new ClientGenerator());
+        plugins.add(new ServiceGenerator());
+        plugins.add(new AntGenerator());
+
+        return plugins;
+    }
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/JAXWSProfile.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/JAXWSProfile.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/Messages.properties?view=auto&rev=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/Messages.properties (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/Messages.properties Tue Jan  9 02:50:47 2007
@@ -0,0 +1,24 @@
+#
+#
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+#
+#
+TEMPLATE_MISSING = Can not find velocity tempalte file: {0}
+VELOCITY_ENGINE_WRITE_ERRORS = velocity engin write errors
+FAIL_TO_WRITE_FILE = Failed to write file : {0}
+FAIL_TO_GET_WSDL = Fail to get wsdl url from : {0}

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/Messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/Messages.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/Messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java?view=auto&rev=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java Tue Jan  9 02:50:47 2007
@@ -0,0 +1,94 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.frontend.jaxws.generators;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.common.model.JavaInterface;
+import org.apache.cxf.tools.common.model.JavaModel;
+
+public class SEIGenerator extends AbstractGenerator {
+
+    private static final String SEI_TEMPLATE = TEMPLATE_BASE + "/sei.vm";
+
+    public SEIGenerator() {
+        this.name = ToolConstants.SEI_GENERATOR;
+    }
+
+    public boolean passthrough() {      
+        if (env.optionSet(ToolConstants.CFG_GEN_SEI)
+            || env.optionSet(ToolConstants.CFG_ALL)) {
+            return false;
+        } 
+        if (env.optionSet(ToolConstants.CFG_GEN_ANT)
+            || env.optionSet(ToolConstants.CFG_GEN_TYPES)
+            || env.optionSet(ToolConstants.CFG_GEN_CLIENT)
+            || env.optionSet(ToolConstants.CFG_GEN_IMPL)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVER)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVICE)) {
+            return true;
+        }
+        
+        return false;
+        
+    }
+
+    private boolean hasHandlerConfig(JavaInterface intf) {
+        //TODO : enbale handler chain
+        //return intf.getHandlerChains() != null;
+        return false;
+    }
+
+    public void generate(ToolContext penv) throws ToolException {
+        this.env = penv;
+        JavaModel javaModel = env.getJavaModel();
+
+        if (passthrough()) {
+            return;
+        }
+
+        Map<String, JavaInterface> interfaces = javaModel.getInterfaces();
+        for (Iterator iter = interfaces.keySet().iterator(); iter.hasNext();) {
+            String interfaceName = (String)iter.next();
+            JavaInterface intf = interfaces.get(interfaceName);
+
+            if (hasHandlerConfig(intf)) {
+                HandlerConfigGenerator handlerGen = new HandlerConfigGenerator();
+                //REVISIT: find a better way to handle Handler gen, should not pass JavaInterface around.
+                handlerGen.setJavaInterface(intf);
+                handlerGen.generate(getEnvironment());
+
+                if (handlerGen.getHandlerAnnotation() != null) {
+                    intf.addAnnotation(handlerGen.getHandlerAnnotation().toString());
+                    intf.addImport("javax.jws.HandlerChain");
+                }
+            }
+            clearAttributes();
+            setAttributes("intf", intf);
+            setCommonAttributes();
+
+            doWrite(SEI_TEMPLATE, parseOutputName(intf.getPackageName(), intf.getName()));
+        }
+    }
+}
\ No newline at end of file

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServerGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServerGenerator.java?view=auto&rev=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServerGenerator.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServerGenerator.java Tue Jan  9 02:50:47 2007
@@ -0,0 +1,111 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.frontend.jaxws.generators;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.common.model.JavaInterface;
+import org.apache.cxf.tools.common.model.JavaModel;
+import org.apache.cxf.tools.common.model.JavaPort;
+import org.apache.cxf.tools.common.model.JavaServiceClass;
+
+public class ServerGenerator extends AbstractGenerator {
+
+    private static final String SRV_TEMPLATE = TEMPLATE_BASE + "/server.vm";
+
+    public ServerGenerator() {
+        this.name = ToolConstants.SVR_GENERATOR;
+    }
+
+    public boolean passthrough() {
+        if (env.optionSet(ToolConstants.CFG_GEN_SERVER)
+            || env.optionSet(ToolConstants.CFG_SERVER)
+            || env.optionSet(ToolConstants.CFG_ALL)) {
+            return false;
+        } 
+        if (env.optionSet(ToolConstants.CFG_GEN_ANT)
+            || env.optionSet(ToolConstants.CFG_GEN_TYPES)
+            || env.optionSet(ToolConstants.CFG_GEN_CLIENT)
+            || env.optionSet(ToolConstants.CFG_GEN_IMPL)
+            || env.optionSet(ToolConstants.CFG_GEN_SEI)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVICE)) {
+            return true;
+        }
+        return true;
+    }
+
+    public void generate(ToolContext penv) throws ToolException {
+        this.env = penv;
+        JavaModel javaModel = env.getJavaModel();
+
+        if (passthrough()) {
+            return;
+        }
+
+        Map<String, JavaInterface> interfaces = javaModel.getInterfaces();
+        for (Iterator iter = interfaces.keySet().iterator(); iter.hasNext();) {
+            String interfaceName = (String)iter.next();
+            JavaInterface intf = interfaces.get(interfaceName);
+            String address = "";
+
+            Iterator it = javaModel.getServiceClasses().values().iterator();
+            while (it.hasNext()) {
+                JavaServiceClass js = (JavaServiceClass)it.next();
+                Iterator i = js.getPorts().iterator();
+                while (i.hasNext()) {
+                    JavaPort jp = (JavaPort)i.next();
+                    if (interfaceName.equals(jp.getPortType())) {
+                        address = jp.getBindingAdress();
+                        break;
+                    }
+                }
+                if (!"".equals(address)) {
+                    break;
+                }
+            }
+
+
+            String serverClassName = interfaceName + "Server";
+
+            while (isCollision(intf.getPackageName(), serverClassName)) {
+                serverClassName = serverClassName + "_Server";
+            }
+
+            clearAttributes();
+            setAttributes("serverClassName", serverClassName);
+            setAttributes("intf", intf);
+            if (penv.optionSet(ToolConstants.CFG_IMPL_CLASS)) {
+                setAttributes("impl", 
+                              (String)penv.get(ToolConstants.CFG_IMPL_CLASS));
+            } else {
+                setAttributes("impl", intf.getName() + "Impl");
+            }
+            setAttributes("address", address);
+            setCommonAttributes();
+
+            doWrite(SRV_TEMPLATE, parseOutputName(intf.getPackageName(), serverClassName));
+        }
+    }
+
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServerGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServerGenerator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java?view=auto&rev=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java Tue Jan  9 02:50:47 2007
@@ -0,0 +1,82 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.frontend.jaxws.generators;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.common.model.JavaModel;
+import org.apache.cxf.tools.common.model.JavaServiceClass;
+
+public class ServiceGenerator extends AbstractGenerator {
+    //private static final Logger LOG = LogUtils.getL7dLogger(AbstractGenerator.class);
+    private static final String SERVICE_TEMPLATE = TEMPLATE_BASE + "/service.vm";
+
+    public ServiceGenerator() {
+        this.name = ToolConstants.SERVICE_GENERATOR;
+    }
+
+    public boolean passthrough() {
+        if (env.optionSet(ToolConstants.CFG_GEN_SERVICE)
+            || env.optionSet(ToolConstants.CFG_ALL)) {
+            return false;
+        } 
+        if (env.optionSet(ToolConstants.CFG_GEN_ANT)
+            || env.optionSet(ToolConstants.CFG_GEN_TYPES)
+            || env.optionSet(ToolConstants.CFG_GEN_CLIENT)
+            || env.optionSet(ToolConstants.CFG_GEN_IMPL)
+            || env.optionSet(ToolConstants.CFG_GEN_SEI)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVER)) {
+            return true;
+        }
+        return false;
+    }
+
+    public void generate(ToolContext penv) throws ToolException {
+        this.env = penv;
+        JavaModel javaModel = env.getJavaModel();
+
+        if (passthrough()) {
+            return;
+        }
+
+        Map<String, JavaServiceClass> serviceClasses = javaModel.getServiceClasses();
+
+        Iterator ite = serviceClasses.values().iterator();
+
+        while (ite.hasNext()) {
+
+            JavaServiceClass js = (JavaServiceClass)ite.next();
+
+            String location = (String)env.get(ToolConstants.CFG_WSDLURL);
+            
+            clearAttributes();
+
+            setAttributes("service", js);
+            setAttributes("wsdlLocation", location);
+            setCommonAttributes();
+
+            doWrite(SERVICE_TEMPLATE, parseOutputName(js.getPackageName(), js.getName()));
+        }
+    }
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/VelocityWriter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/VelocityWriter.java?view=auto&rev=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/VelocityWriter.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/VelocityWriter.java Tue Jan  9 02:50:47 2007
@@ -0,0 +1,67 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.frontend.jaxws.generators;
+
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.Writer;
+
+public class VelocityWriter extends BufferedWriter {
+    
+    private final String newLine = System.getProperty("line.separator");
+
+    public VelocityWriter(Writer out) {
+        super(out);
+    }
+
+    public VelocityWriter(Writer out, int size) {
+        super(out, size);
+    }
+
+    public void write(char[] chars) throws IOException {
+        String str = new String(chars);
+        if (str.indexOf("\r\n") >= 0 && newLine != null) {
+            super.write(str.replaceAll("\r\n", newLine));
+            return;
+        } else if (str.indexOf("\n") >= 0 && newLine != null) {
+            super.write(str.replaceAll("\n", newLine));
+            return;
+        } else {
+            super.write(str);
+        }
+       
+    }
+   
+    
+    
+    
+    public void write(String str) throws IOException {
+        if (str.indexOf("\r\n") >= 0  && newLine != null) {
+            super.write(str.replaceAll("\r\n", newLine));
+            return;
+        } else if (str.indexOf("\n") >= 0  && newLine != null) {
+            super.write(str.replaceAll("\r\n", newLine));
+            return;
+        } else {
+            super.write(str);
+        }
+    }
+
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/VelocityWriter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/VelocityWriter.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java?view=diff&rev=494369&r1=494368&r2=494369
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java Tue Jan  9 02:50:47 2007
@@ -43,13 +43,14 @@
             Message msg = new Message("FAIL_TO_CREATE_JAVA_MODEL", LOG);
             throw new ToolException(msg);
         }
+        context.setJavaModel(jmodel);
     }
 
     private JavaModel wsdlDefinitionToJavaModel(ServiceInfo serviceInfo) throws ToolException {
         JavaModel javaModel = new JavaModel();
         context.put(JavaModel.class, javaModel);
 
-        // TODO refactroing the internal processors to use the service model
+        //TODO : refactroing the internal processors to use the service model
 
         PortTypeProcessor portTypeProcessor = new PortTypeProcessor(context);
         portTypeProcessor.process(serviceInfo);



Mime
View raw message