You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2006/05/18 11:25:09 UTC

svn commit: r407509 - in /incubator/tuscany/java/sampleapps/bigbank: account/ account/src/main/java/bigbank/account/services/accountdata/ webclient/ webclient/src/main/java/bigbank/webclient/ui/

Author: jsdelfino
Date: Thu May 18 02:25:08 2006
New Revision: 407509

URL: http://svn.apache.org/viewvc?rev=407509&view=rev
Log:
Generate SDOs with separate interfaces and implementations to have the same pattern in both the Ant generated version and the Maven generated version of the Bigbank sample

Modified:
    incubator/tuscany/java/sampleapps/bigbank/account/build.xml
    incubator/tuscany/java/sampleapps/bigbank/account/pom.xml
    incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceDASImpl.java
    incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceImpl.java
    incubator/tuscany/java/sampleapps/bigbank/webclient/build.xml
    incubator/tuscany/java/sampleapps/bigbank/webclient/pom.xml
    incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/ui/FormServlet.java

Modified: incubator/tuscany/java/sampleapps/bigbank/account/build.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/account/build.xml?rev=407509&r1=407508&r2=407509&view=diff
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/account/build.xml (original)
+++ incubator/tuscany/java/sampleapps/bigbank/account/build.xml Thu May 18 02:25:08 2006
@@ -20,6 +20,10 @@
         <fileset dir="${mainDir}/lib">
             <include name="tuscany-runtime-incubating-M1.jar"/>
         </fileset>
+        <fileset dir="${mainDir}/apache-tomcat-5.5.17/common/lib">
+            <include name="servlet-api.jar"/>
+            <include name="derby-10.1.2.1.jar"/>
+        </fileset>
     </path>
     <path id="java.classpath">
         <fileset dir="${mainDir}/lib">
@@ -27,13 +31,24 @@
         </fileset>
         <pathelement path="target/sample-bigbank-account.jar"/>
     </path>
+    <path id="tools.classpath">
+        <fileset dir="${mainDir}/lib">
+            <include name="tuscany-runtime-incubating-M1.jar"/>
+        </fileset>
+        <fileset dir="${mainDir}/lib/tools">
+            <include name="tuscany-tools-incubating-M1.jar"/>
+        </fileset>
+    </path>
 
-  <target name="init">
-    <mkdir dir="target/classes"/>
-  </target>
+    <target name="init">
+      <mkdir dir="target/classes"/>
+    </target>
 
-    <target name="compile" depends="init">
-      <javac srcdir="src/main/java" destdir="target/classes" debug="on" source="1.5" target="1.5">
+    <target name="compile" depends="init, xsd2sdo, wsdl2java">
+      <javac destdir="target/classes" debug="on" source="1.5" target="1.5">
+        <src path="target/sdo-source"/>
+        <src path="target/wsdl2java-source"/>
+        <src path="src/main/java"/>
         <classpath refid="javac.classpath"/>
       </javac>
       <copy todir="target/classes">
@@ -42,6 +57,38 @@
       <war destfile="target/sample-bigbank-account.war" webxml="src/main/webapp/WEB-INF/web.xml">
         <classes dir="target/classes"/>
       </war>
+    </target>
+
+    <target name="xsd2sdo">
+      <java classname="org.apache.tuscany.sdo.generate.XSD2JavaGenerator" fork="yes">
+        <arg value="-targetDirectory"/>
+        <arg value="target/sdo-source"/>
+        <arg value="src/main/resources/wsdl/AccountService.wsdl"/>
+        <classpath refid="tools.classpath"/>
+      </java>
+      <java classname="org.apache.tuscany.sdo.generate.XSD2JavaGenerator" fork="yes">
+        <arg value="-targetDirectory"/>
+        <arg value="target/sdo-source"/>
+        <arg value="src/main/resources/wsdl/stockquotes.webservicex.wsdl"/>
+        <classpath refid="tools.classpath"/>
+      </java>
+    </target>
+
+    <target name="wsdl2java">
+      <java classname="org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator" fork="yes">
+        <arg value="-targetDirectory"/>
+        <arg value="target/wsdl2java-source"/>
+        <arg value="src/main/resources/wsdl/AccountService.wsdl"/>
+        <classpath refid="tools.classpath"/>
+      </java>
+      <java classname="org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator" fork="yes">
+        <arg value="-targetDirectory"/>
+        <arg value="target/wsdl2java-source"/>
+        <arg value="-port"/>
+        <arg value="StockQuoteSoap"/>
+        <arg value="src/main/resources/wsdl/stockquotes.webservicex.wsdl"/>
+        <classpath refid="tools.classpath"/>
+      </java>
     </target>
 
     <target name="clean">

Modified: incubator/tuscany/java/sampleapps/bigbank/account/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/account/pom.xml?rev=407509&r1=407508&r2=407509&view=diff
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/account/pom.xml (original)
+++ incubator/tuscany/java/sampleapps/bigbank/account/pom.xml Thu May 18 02:25:08 2006
@@ -85,7 +85,6 @@
                             <schemaDir>${basedir}/src/main/resources/wsdl</schemaDir>
                             <noNotification>true</noNotification>
                             <noContainer>true</noContainer>
-                            <noInterfaces>true</noInterfaces>
                             <noUnsettable>true</noUnsettable>
                         </configuration>
                         <goals>

Modified: incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceDASImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceDASImpl.java?rev=407509&r1=407508&r2=407509&view=diff
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceDASImpl.java (original)
+++ incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceDASImpl.java Thu May 18 02:25:08 2006
@@ -187,7 +187,7 @@
 
     public AccountReport getAccountReport(final int customerID) throws RemoteException {
         try {
-            final AccountFactory accountFactory = AccountFactory.eINSTANCE;
+            final AccountFactory accountFactory = AccountFactory.INSTANCE;
             final AccountReport accountReport = accountFactory.createAccountReport();
             InputStream mapping = createConfigStream();
 
@@ -394,4 +394,4 @@
         }
 
     }
-}
\ No newline at end of file
+}

Modified: incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceImpl.java?rev=407509&r1=407508&r2=407509&view=diff
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceImpl.java (original)
+++ incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceImpl.java Thu May 18 02:25:08 2006
@@ -36,7 +36,7 @@
     }
 
     public AccountReport getAccountReport(int customerID) {
-        final AccountFactory accountFactory = AccountFactory.eINSTANCE;
+        final AccountFactory accountFactory = AccountFactory.INSTANCE;
         AccountReport accountReport = accountFactory.createAccountReport();
         List accounts = accountReport.getAccountSummaries();
 

Modified: incubator/tuscany/java/sampleapps/bigbank/webclient/build.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/webclient/build.xml?rev=407509&r1=407508&r2=407509&view=diff
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/webclient/build.xml (original)
+++ incubator/tuscany/java/sampleapps/bigbank/webclient/build.xml Thu May 18 02:25:08 2006
@@ -20,6 +20,10 @@
         <fileset dir="${mainDir}/lib">
             <include name="tuscany-runtime-incubating-M1.jar"/>
         </fileset>
+        <fileset dir="${mainDir}/apache-tomcat-5.5.17/common/lib">
+            <include name="servlet-api.jar"/>
+            <include name="jsp-api.jar"/>
+        </fileset>
     </path>
     <path id="java.classpath">
         <fileset dir="${mainDir}/lib">
@@ -27,13 +31,24 @@
         </fileset>
         <pathelement path="target/sample-bigbank-webclient.jar"/>
     </path>
+    <path id="tools.classpath">
+        <fileset dir="${mainDir}/lib">
+            <include name="tuscany-runtime-incubating-M1.jar"/>
+        </fileset>
+        <fileset dir="${mainDir}/lib/tools">
+            <include name="tuscany-tools-incubating-M1.jar"/>
+        </fileset>
+    </path>
 
-  <target name="init">
-    <mkdir dir="target/classes"/>
-  </target>
+    <target name="init">
+      <mkdir dir="target/classes"/>
+    </target>
 
-    <target name="compile" depends="init">
-      <javac srcdir="src/main/java" destdir="target/classes" debug="on" source="1.5" target="1.5">
+    <target name="compile" depends="init, xsd2sdo, wsdl2java">
+      <javac destdir="target/classes" debug="on" source="1.5" target="1.5">
+        <src path="target/sdo-source"/>
+        <src path="target/wsdl2java-source"/>
+        <src path="src/main/java"/>
         <classpath refid="javac.classpath"/>
       </javac>
       <copy todir="target/classes">
@@ -42,6 +57,24 @@
       <war destfile="target/sample-bigbank-webclient.war" webxml="src/main/webapp/WEB-INF/web.xml">
         <classes dir="target/classes"/>
       </war>
+    </target>
+
+    <target name="xsd2sdo">
+      <java classname="org.apache.tuscany.sdo.generate.XSD2JavaGenerator" fork="yes">
+        <arg value="-targetDirectory"/>
+        <arg value="target/sdo-source"/>
+        <arg value="src/main/resources/wsdl/AccountService.wsdl"/>
+        <classpath refid="tools.classpath"/>
+      </java>
+    </target>
+
+    <target name="wsdl2java">
+      <java classname="org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator" fork="yes">
+        <arg value="-targetDirectory"/>
+        <arg value="target/wsdl2java-source"/>
+        <arg value="src/main/resources/wsdl/AccountService.wsdl"/>
+        <classpath refid="tools.classpath"/>
+      </java>
     </target>
 
     <target name="clean">

Modified: incubator/tuscany/java/sampleapps/bigbank/webclient/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/webclient/pom.xml?rev=407509&r1=407508&r2=407509&view=diff
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/webclient/pom.xml (original)
+++ incubator/tuscany/java/sampleapps/bigbank/webclient/pom.xml Thu May 18 02:25:08 2006
@@ -66,7 +66,6 @@
                             <schemaFile>${basedir}/src/main/resources/wsdl/AccountService.wsdl</schemaFile>
                             <noNotification>true</noNotification>
                             <noContainer>true</noContainer>
-                            <noInterfaces>true</noInterfaces>
                             <noUnsettable>true</noUnsettable>
                             
                         </configuration>

Modified: incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/ui/FormServlet.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/ui/FormServlet.java?rev=407509&r1=407508&r2=407509&view=diff
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/ui/FormServlet.java (original)
+++ incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/ui/FormServlet.java Thu May 18 02:25:08 2006
@@ -108,7 +108,7 @@
 
                 String symbol = req.getParameter("symbol").trim().toUpperCase();
                 int quantity = Integer.parseInt(req.getParameter("quantity"));
-                StockSummary stockSummry = AccountFactory.eINSTANCE.createStockSummary();
+                StockSummary stockSummry = AccountFactory.INSTANCE.createStockSummary();
                 stockSummry.setSymbol(symbol);
                 stockSummry.setQuantity(quantity);
                 accountServices.purchaseStock(profileServices.getId(), stockSummry);
@@ -136,7 +136,7 @@
 
     private void createAccount(HttpServletRequest pReq, HttpServletResponse pResp, AccountService accountServices) throws ServletException {
         try {
-            CustomerProfileData customerProfileData = AccountFactory.eINSTANCE.createCustomerProfileData();
+            CustomerProfileData customerProfileData = AccountFactory.INSTANCE.createCustomerProfileData();
             customerProfileData.setFirstName(pReq.getParameter("firstName"));
             customerProfileData.setLastName(pReq.getParameter("lastName"));
             customerProfileData.setAddress(pReq.getParameter("address"));