You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2006/01/03 06:19:51 UTC

svn commit: r365543 - /webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java

Author: dims
Date: Mon Jan  2 21:19:47 2006
New Revision: 365543

URL: http://svn.apache.org/viewcvs?rev=365543&view=rev
Log:
Am trying to get a logical directory structure for the generated code, With this checkin, here's the directory structure for perf.wsdl 

work\build.xml
work\resources\services.xml
work\src\samples\perf\InputElement.java
work\src\samples\perf\OutputElement.java
work\src\samples\perf\PerfPortTypeMessageReceiver.java
work\src\samples\perf\PerfPortTypeSkeleton.java
work\src\samples\perf\PerfPortTypeStub.java
work\test\samples\perf\PerfPortTypeTest.java

- Basically, the tests are under test, sources are under src, the descriptors are under resources and the build.xml is in the main directory
- Note that services.xml can have multiple services (once http://issues.apache.org/jira/browse/AXIS2-352 gets resolved), so we can't use the name of the service in the directory as we were doing before.

TODO:
- Fix build.xml to generate an AAR file.
- Maybe we can add targets to start a SimpleHTTPServer and run the test as well :) 


Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java?rev=365543&r1=365542&r2=365543&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java Mon Jan  2 21:19:47 2006
@@ -82,7 +82,7 @@
     private static final String DATABINDING_PACKAGE_NAME_SUFFIX = ".databinding";
     private static final String TEST_SERVICE_CLASS_NAME_SUFFIX = "SkeletonTest";
     private static final String MESSAGE_RECEIVER_SUFFIX = "MessageReceiver";
-    private static final String SERVICE_XML_OUTPUT_FOLDER_NAME = "service_descriptors.";
+    private static final String SERVICE_XML_OUTPUT_FOLDER_NAME = "resources.";
 
 
     protected CodeGenConfiguration configuration;
@@ -328,8 +328,6 @@
      * in this case we modify the package name to have make the class a inner class of the stub
      */
     private void updateMapperClassnames(WSDLInterface boundInterface,String fullyQulifiedIncludingClassNamePrefix) {
-
-
         Map classNameMap = mapper.getAllMappedNames();
         Iterator keys = classNameMap.keySet().iterator();
         while (keys.hasNext()) {
@@ -401,7 +399,7 @@
                     wsdlInterface, axisBinding);
             CallbackHandlerWriter callbackWriter =
                     new CallbackHandlerWriter(
-                            getOutputDirectoryForSourceFiles(this.configuration.getOutputLocation()),
+                            getOutputDirectory(this.configuration.getOutputLocation(), "src"),
                             this.configuration.getOutputLanguage());
             writeClass(interfaceModel, callbackWriter);
         }
@@ -418,7 +416,7 @@
             Document classModel = createDOMDocumentForTestCase(binding);
             TestClassWriter callbackWriter =
                     new TestClassWriter(
-                            getOutputDirectoryForSourceFiles(this.configuration.getOutputLocation()),
+                            getOutputDirectory(this.configuration.getOutputLocation(), "test"),
                             this.configuration.getOutputLanguage());
             writeClass(classModel, callbackWriter);
         }
@@ -437,7 +435,7 @@
         Document interfaceModel = createDOMDocumentForInterface(axisInterface, axisBinding);
         InterfaceWriter interfaceWriter =
                 new InterfaceWriter(
-                        getOutputDirectoryForSourceFiles(this.configuration.getOutputLocation()),
+                        getOutputDirectory(this.configuration.getOutputLocation(), "src"),
                         this.configuration.getOutputLanguage());
         writeClass(interfaceModel, interfaceWriter);
 
@@ -456,7 +454,7 @@
         //Note -  One can generate the skeleton using the interface XML
         Document skeletonModel = createDOMDocumentForSkeleton(axisInteface, axisBinding);
         ClassWriter skeletonWriter = new SkeletonWriter(
-                getOutputDirectoryForSourceFiles(this.configuration.getOutputLocation()),
+                getOutputDirectory(this.configuration.getOutputLocation(), "src"),
                 this.configuration.getOutputLanguage());
         writeClass(skeletonModel, skeletonWriter);
 
@@ -497,7 +495,7 @@
             Document skeletonModel = createDOMDocumentForServiceXML(
                     axisInterface, false, axisBinding);
             ClassWriter serviceXmlWriter = new ServiceXMLWriter(
-                    this.configuration.getOutputLocation(),
+                    getOutputDirectory(this.configuration.getOutputLocation(), "resources"),
                     this.configuration.getOutputLanguage());
             writeClass(skeletonModel, serviceXmlWriter);
         }
@@ -517,7 +515,7 @@
                 axisBinding, service);
         InterfaceImplementationWriter writer =
                 new InterfaceImplementationWriter(
-                        getOutputDirectoryForSourceFiles(this.configuration.getOutputLocation()),
+                        getOutputDirectory(this.configuration.getOutputLocation(), "src"),
                         this.configuration.getOutputLanguage());
         writeClass(interfaceImplModel, writer);
     }
@@ -528,7 +526,7 @@
                     binding);
             MessageReceiverWriter writer =
                     new MessageReceiverWriter(
-                            getOutputDirectoryForSourceFiles(this.configuration.getOutputLocation()),
+                            getOutputDirectory(this.configuration.getOutputLocation(), "src"),
                             this.configuration.getOutputLanguage());
             writeClass(classModel, writer);
         }
@@ -760,7 +758,7 @@
             //name
             addAttribute(doc,
                     "package",
-                    SERVICE_XML_OUTPUT_FOLDER_NAME + localPart,
+                    "",
                     rootElement);
             addAttribute(doc,
                     "classpackage",
@@ -1462,10 +1460,10 @@
      * Get the output directory for source files
      * 
      * @param outputDir
-     * @return
+     * @return file
      */
-    protected File getOutputDirectoryForSourceFiles(File outputDir) {
-        outputDir = new File(outputDir, "src");
+    protected File getOutputDirectory(File outputDir, String dir2) {
+        outputDir = new File(outputDir, dir2);
         if (!outputDir.exists()) {
             outputDir.mkdirs();
         }