Author: jsdelfino
Date: Tue Jan  8 09:47:16 2008
New Revision: 610080

URL: http://svn.apache.org/viewvc?rev=610080&view=rev
Log:
Added sca-contribution.xml. Worked around strange behavior of the node/domain 
API in the Launch class. Fixed the externally visible service URIs.

Added:
    incubator/tuscany/java/sca/tutorial/store-merger/META-INF/
    
incubator/tuscany/java/sca/tutorial/store-merger/META-INF/sca-contribution.xml  
 (with props)
Modified:
    
incubator/tuscany/java/sca/tutorial/store-merger/launch/LaunchStoreMerger.java
    incubator/tuscany/java/sca/tutorial/store-merger/store-merger.composite
    incubator/tuscany/java/sca/tutorial/store-merger/uiservices/store.html

Added: 
incubator/tuscany/java/sca/tutorial/store-merger/META-INF/sca-contribution.xml
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store-merger/META-INF/sca-contribution.xml?rev=610080&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/tutorial/store-merger/META-INF/sca-contribution.xml 
(added)
+++ 
incubator/tuscany/java/sca/tutorial/store-merger/META-INF/sca-contribution.xml 
Tue Jan  8 09:47:16 2008
@@ -0,0 +1,26 @@
+<?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-merger"/>
+   <import.java package="services"/>
+   <import.java package="services.merger"/>
+</contribution>
\ No newline at end of file

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

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

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=610080&r1=610079&r2=610080&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/tutorial/store-merger/launch/LaunchStoreMerger.java 
(original)
+++ 
incubator/tuscany/java/sca/tutorial/store-merger/launch/LaunchStoreMerger.java 
Tue Jan  8 09:47:16 2008
@@ -19,25 +19,31 @@
 
 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 LaunchStoreMerger {
     public static void main(String[] args) throws Exception {
         System.out.println("Starting ...");
+        
+        URL storeMergerContribution = new File("./target/classes").toURL();
+        URL assetsContribution = new File("../assets/target/classes").toURL();
+        
         SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
         SCANode node = nodeFactory.createSCANode(null, 
"http://localhost:9998";);
+        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();
         
-        URL contribution = 
SCAContributionUtil.findContributionFromClass(LaunchStoreMerger.class);
-        node.addContribution("http://store";, contribution);
+        
node.addContribution("http://org/apache/tuscany/sca/implementation-data-api";, 
dataAPIContribution);
+        node.addContribution("http://assets";, assetsContribution);
+        node.addContribution("http://store";, storeMergerContribution);
         
         node.addToDomainLevelComposite(new QName("http://store";, 
"store-merger"));
-        node.start();
+        node.getDomain().start();
 
         System.out.println("store-merger.composite ready for big business 
!!!");
         System.in.read();

Modified: 
incubator/tuscany/java/sca/tutorial/store-merger/store-merger.composite
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store-merger/store-merger.composite?rev=610080&r1=610079&r2=610080&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store-merger/store-merger.composite 
(original)
+++ incubator/tuscany/java/sca/tutorial/store-merger/store-merger.composite Tue 
Jan  8 09:47:16 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:8101/Catalog"/>
                </service>
                <reference name="fruitsCatalog" target="FruitsCatalog"/>        
                <reference name="vegetablesCatalog" 
target="CloudVegetablesCatalog"/>   
@@ -58,10 +58,10 @@
        <component name="ShoppingCart">
                <implementation.java class="services.ShoppingCartImpl"/>
                <service name="Cart">
-                       <t:binding.atom/>
+                       <t:binding.atom 
uri="http://localhost:8101/ShoppingCart/Cart"/>
                </service>      
                <service name="Total">
-                       <t:binding.jsonrpc/>
+                       <t:binding.jsonrpc 
uri="http://localhost:8101/ShoppingCart/Total"/>
                </service>      
        </component>
     

Modified: incubator/tuscany/java/sca/tutorial/store-merger/uiservices/store.html
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store-merger/uiservices/store.html?rev=610080&r1=610079&r2=610080&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store-merger/uiservices/store.html 
(original)
+++ incubator/tuscany/java/sca/tutorial/store-merger/uiservices/store.html Tue 
Jan  8 09:47:16 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to