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 2008/01/09 23:03:02 UTC

svn commit: r610594 - in /incubator/tuscany/java/sca/tutorial: assets/services/db/ cloud/ store-db/ store-db/META-INF/ store-db/launch/ store-db/uiservices/ store-eu/uiservices/ store-merger/launch/ store-supplier/uiservices/

Author: jsdelfino
Date: Wed Jan  9 14:01:08 2008
New Revision: 610594

URL: http://svn.apache.org/viewvc?rev=610594&view=rev
Log:
Integrating store-db with the other modules. Starting to fix the HTML of the other tutorial modules as well. Temporarily disabled the EJB component preventing the nodes to initialize correctly.

Added:
    incubator/tuscany/java/sca/tutorial/cloud/CatalogEJB.componentType.off
      - copied unchanged from r609080, incubator/tuscany/java/sca/tutorial/cloud/CatalogEJB.componentType
    incubator/tuscany/java/sca/tutorial/cloud/catalog-jee.composite.off
      - copied unchanged from r609080, incubator/tuscany/java/sca/tutorial/cloud/catalog-jee.composite
    incubator/tuscany/java/sca/tutorial/store-db/META-INF/
    incubator/tuscany/java/sca/tutorial/store-db/META-INF/sca-contribution.xml   (with props)
Removed:
    incubator/tuscany/java/sca/tutorial/cloud/CatalogEJB.componentType
    incubator/tuscany/java/sca/tutorial/cloud/catalog-jee.composite
Modified:
    incubator/tuscany/java/sca/tutorial/assets/services/db/ShoppingCartTableImpl.java
    incubator/tuscany/java/sca/tutorial/store-db/launch/LaunchStoreDB.java
    incubator/tuscany/java/sca/tutorial/store-db/store-db.composite
    incubator/tuscany/java/sca/tutorial/store-db/uiservices/store.html
    incubator/tuscany/java/sca/tutorial/store-eu/uiservices/store.html
    incubator/tuscany/java/sca/tutorial/store-merger/launch/LaunchStoreMerger.java
    incubator/tuscany/java/sca/tutorial/store-supplier/uiservices/store.html

Modified: incubator/tuscany/java/sca/tutorial/assets/services/db/ShoppingCartTableImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/assets/services/db/ShoppingCartTableImpl.java?rev=610594&r1=610593&r2=610594&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/assets/services/db/ShoppingCartTableImpl.java (original)
+++ incubator/tuscany/java/sca/tutorial/assets/services/db/ShoppingCartTableImpl.java Wed Jan  9 14:01:08 2008
@@ -46,7 +46,7 @@
 
     @Init
     public void init() throws Exception {
-        Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
+        Class.forName("org.apache.derby.jdbc.EmbeddedDriver", true, getClass().getClassLoader());
         connection = DriverManager.getConnection("jdbc:derby:target/" + database, "", "");
     }
 

Added: incubator/tuscany/java/sca/tutorial/store-db/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store-db/META-INF/sca-contribution.xml?rev=610594&view=auto
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store-db/META-INF/sca-contribution.xml (added)
+++ incubator/tuscany/java/sca/tutorial/store-db/META-INF/sca-contribution.xml Wed Jan  9 14:01:08 2008
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    * 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.    
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+	          targetNamespace="http://store"
+              xmlns:s="http://store">
+   <deployable composite="s:store-db"/>
+   <import.java package="services"/>
+   <import.java package="services.merger"/>
+   <import.java package="services.db"/>
+</contribution>
\ No newline at end of file

Propchange: incubator/tuscany/java/sca/tutorial/store-db/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/tutorial/store-db/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/tutorial/store-db/launch/LaunchStoreDB.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store-db/launch/LaunchStoreDB.java?rev=610594&r1=610593&r2=610594&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store-db/launch/LaunchStoreDB.java (original)
+++ incubator/tuscany/java/sca/tutorial/store-db/launch/LaunchStoreDB.java Wed Jan  9 14:01:08 2008
@@ -19,31 +19,42 @@
 
 package launch;
 
+import java.io.File;
 import java.net.URL;
 
 import javax.xml.namespace.QName;
 
 import org.apache.tuscany.sca.node.SCANode;
 import org.apache.tuscany.sca.node.SCANodeFactory;
-import org.apache.tuscany.sca.node.util.SCAContributionUtil;
 
 public class LaunchStoreDB {
     public static void main(String[] args) throws Exception {
         System.out.println("Starting ...");
+        
+        URL storeDBContribution = new File("./target/classes").toURL();
+        URL assetsContribution = new File("../assets/target/classes").toURL();
+        URL derbyContribution = new File(System.getProperty("user.home") + "/.m2/repository/org/apache/derby/derby/10.1.2.1/derby-10.1.2.1.jar").toURL();
+        URL dataAPIContribution = new File(System.getProperty("user.home") + "/.m2/repository/org/apache/tuscany/sca/tuscany-implementation-data-api/1.2-incubating-SNAPSHOT/tuscany-implementation-data-api-1.2-incubating-SNAPSHOT.jar").toURL();
+        
         SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
         SCANode node = nodeFactory.createSCANode(null, "http://localhost:9998");
         
-        URL contribution = SCAContributionUtil.findContributionFromClass(LaunchStoreDB.class);
-        node.addContribution("http://store", contribution);
+        node.addContribution("http://org/apache/derby", derbyContribution);
+        node.addContribution("http://org/apache/tuscany/sca/implementation-data-api", dataAPIContribution);
+        node.addContribution("http://assets", assetsContribution);
+        node.addContribution("http://store-db", storeDBContribution);
         
         node.addToDomainLevelComposite(new QName("http://store", "store-db"));
-        node.start();
+        //FIXME looks like we can't start/stop individual nodes anymore
+        node.getDomain().start();
 
         System.out.println("store-db.composite ready for big business !!!");
         System.in.read();
         
         System.out.println("Stopping ...");
-        node.stop();
+        //FIXME looks like we can't start/stop individual nodes anymore
+        node.getDomain().stop();
+        //node.stop();
         node.destroy();
         System.out.println();
     }

Modified: incubator/tuscany/java/sca/tutorial/store-db/store-db.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store-db/store-db.composite?rev=610594&r1=610593&r2=610594&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store-db/store-db.composite (original)
+++ incubator/tuscany/java/sca/tutorial/store-db/store-db.composite Wed Jan  9 14:01:08 2008
@@ -42,7 +42,7 @@
 		<implementation.java class="services.merger.MergedCatalogImpl"/> 
 		<property name="currencyCode">USD</property>
 		<service name="Catalog">
-			<t:binding.jsonrpc/>
+			<t:binding.jsonrpc uri="http://localhost:8102/Catalog"/>
    		</service>
 		<reference name="fruitsCatalog" target="FruitsCatalog"/>	
 		<reference name="vegetablesCatalog" target="CloudVegetablesCatalog"/>	
@@ -59,10 +59,10 @@
 		<implementation.java class="services.db.ShoppingCartTableImpl"/>
 		<property name="database">cart-db</property>
 		<service name="Cart">
-			<t:binding.atom/>
+			<t:binding.atom uri="http://localhost:8102/ShoppingCart/Cart"/>
 		</service>    	
 		<service name="Total">
-			<t:binding.jsonrpc/>
+			<t:binding.jsonrpc uri="http://localhost:8102/ShoppingCart/Total"/>
 		</service>    	
 	</component>
     

Modified: incubator/tuscany/java/sca/tutorial/store-db/uiservices/store.html
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store-db/uiservices/store.html?rev=610594&r1=610593&r2=610594&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store-db/uiservices/store.html (original)
+++ incubator/tuscany/java/sca/tutorial/store-db/uiservices/store.html Wed Jan  9 14:01:08 2008
@@ -79,7 +79,7 @@
 			if (items[i].checked) {
 				var entry = '<entry xmlns="http://www.w3.org/2005/Atom"><title>item</title><content type="text/xml">' +
                 	'<Item xmlns="http://services/">' +
-                	'<name>' + catalogItems[i].name + '</name>' + '<price>' + catalogItems[i].price + '</price>' +
+                	'<name xmlns="">' + catalogItems[i].name + '</name>' + '<price xmlns="">' + catalogItems[i].price + '</price>' +
                  	'</Item>' + '</content></entry>';
 				shoppingCart.post(entry, shoppingCart_postResponse);
 				items[i].checked = false;

Modified: incubator/tuscany/java/sca/tutorial/store-eu/uiservices/store.html
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store-eu/uiservices/store.html?rev=610594&r1=610593&r2=610594&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store-eu/uiservices/store.html (original)
+++ incubator/tuscany/java/sca/tutorial/store-eu/uiservices/store.html Wed Jan  9 14:01:08 2008
@@ -79,7 +79,7 @@
 			if (items[i].checked) {
 				var entry = '<entry xmlns="http://www.w3.org/2005/Atom"><title>item</title><content type="text/xml">' +
                 	'<Item xmlns="http://services/">' +
-                	'<name>' + catalogItems[i].name + '</name>' + '<price>' + catalogItems[i].price + '</price>' +
+                	'<name xmlns="">' + catalogItems[i].name + '</name>' + '<price xmlns="">' + catalogItems[i].price + '</price>' +
                  	'</Item>' + '</content></entry>';
 				shoppingCart.post(entry, shoppingCart_postResponse);
 				items[i].checked = false;

Modified: incubator/tuscany/java/sca/tutorial/store-merger/launch/LaunchStoreMerger.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store-merger/launch/LaunchStoreMerger.java?rev=610594&r1=610593&r2=610594&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store-merger/launch/LaunchStoreMerger.java (original)
+++ incubator/tuscany/java/sca/tutorial/store-merger/launch/LaunchStoreMerger.java Wed Jan  9 14:01:08 2008
@@ -40,7 +40,7 @@
         
         node.addContribution("http://org/apache/tuscany/sca/implementation-data-api", dataAPIContribution);
         node.addContribution("http://assets", assetsContribution);
-        node.addContribution("http://store", storeMergerContribution);
+        node.addContribution("http://store-merger", storeMergerContribution);
         
         node.addToDomainLevelComposite(new QName("http://store", "store-merger"));
         //FIXME looks like we can't start/stop individual nodes anymore

Modified: incubator/tuscany/java/sca/tutorial/store-supplier/uiservices/store.html
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store-supplier/uiservices/store.html?rev=610594&r1=610593&r2=610594&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store-supplier/uiservices/store.html (original)
+++ incubator/tuscany/java/sca/tutorial/store-supplier/uiservices/store.html Wed Jan  9 14:01:08 2008
@@ -79,7 +79,7 @@
 			if (items[i].checked) {
 				var entry = '<entry xmlns="http://www.w3.org/2005/Atom"><title>item</title><content type="text/xml">' +
                 	'<Item xmlns="http://services/">' +
-                	'<name>' + catalogItems[i].name + '</name>' + '<price>' + catalogItems[i].price + '</price>' +
+                	'<name xmlns="">' + catalogItems[i].name + '</name>' + '<price xmlns="">' + catalogItems[i].price + '</price>' +
                  	'</Item>' + '</content></entry>';
 				shoppingCart.post(entry, shoppingCart_postResponse);
 				items[i].checked = false;



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