tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r712648 - in /tuscany/sandbox/travelsample: ./ node/ node/src/scatours/ scatours-contribution/ scatours-contribution/META-INF/ scatours-contribution/src/ scatours-contribution/src/scatours/ shoppingcart-contribution/ shoppingcart-contributi...
Date Mon, 10 Nov 2008 11:48:38 GMT
Author: slaws
Date: Mon Nov 10 03:48:37 2008
New Revision: 712648

URL: http://svn.apache.org/viewvc?rev=712648&view=rev
Log:
Add in an SCATours component and have it reference catalog, tripBooking and cart components. 

Added:
    tuscany/sandbox/travelsample/scatours-contribution/   (with props)
    tuscany/sandbox/travelsample/scatours-contribution/META-INF/
    tuscany/sandbox/travelsample/scatours-contribution/META-INF/sca-contribution.xml   (with props)
    tuscany/sandbox/travelsample/scatours-contribution/pom.xml   (with props)
    tuscany/sandbox/travelsample/scatours-contribution/src/
    tuscany/sandbox/travelsample/scatours-contribution/src/scatours/
    tuscany/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursBooking.java   (with props)
    tuscany/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursImpl.java   (with props)
    tuscany/sandbox/travelsample/shoppingcart-contribution/   (with props)
    tuscany/sandbox/travelsample/shoppingcart-contribution/META-INF/
    tuscany/sandbox/travelsample/shoppingcart-contribution/META-INF/sca-contribution.xml   (with props)
    tuscany/sandbox/travelsample/shoppingcart-contribution/pom.xml   (with props)
    tuscany/sandbox/travelsample/shoppingcart-contribution/src/
    tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/
    tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/
    tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/TravelBooking.java   (with props)
    tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/TravelImpl.java   (with props)
    tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/TravelSearch.java   (with props)
    tuscany/sandbox/travelsample/travelcatalog-contribution/   (with props)
    tuscany/sandbox/travelsample/travelcatalog-contribution/META-INF/
    tuscany/sandbox/travelsample/travelcatalog-contribution/META-INF/sca-contribution.xml   (with props)
    tuscany/sandbox/travelsample/travelcatalog-contribution/pom.xml   (with props)
    tuscany/sandbox/travelsample/travelcatalog-contribution/src/
    tuscany/sandbox/travelsample/travelcatalog-contribution/src/scatours/
    tuscany/sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/
    tuscany/sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogImpl.java   (with props)
    tuscany/sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogSearch.java   (with props)
    tuscany/sandbox/travelsample/tripbooking-contribution/   (with props)
    tuscany/sandbox/travelsample/tripbooking-contribution/META-INF/
    tuscany/sandbox/travelsample/tripbooking-contribution/META-INF/sca-contribution.xml   (with props)
    tuscany/sandbox/travelsample/tripbooking-contribution/build.xml   (with props)
    tuscany/sandbox/travelsample/tripbooking-contribution/pom.xml   (with props)
    tuscany/sandbox/travelsample/tripbooking-contribution/src/
    tuscany/sandbox/travelsample/tripbooking-contribution/src/scatours/
    tuscany/sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/
    tuscany/sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBooking.java   (with props)
    tuscany/sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBookingImpl.java   (with props)
Modified:
    tuscany/sandbox/travelsample/node/build.xml
    tuscany/sandbox/travelsample/node/src/scatours/LaunchNode.java
    tuscany/sandbox/travelsample/pom.xml
    tuscany/sandbox/travelsample/ui-contribution/META-INF/sca-contribution.xml
    tuscany/sandbox/travelsample/ui-contribution/build.xml
    tuscany/sandbox/travelsample/ui-contribution/scatours.composite
    tuscany/sandbox/travelsample/ui-contribution/scatours.html

Modified: tuscany/sandbox/travelsample/node/build.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/node/build.xml?rev=712648&r1=712647&r2=712648&view=diff
==============================================================================
--- tuscany/sandbox/travelsample/node/build.xml (original)
+++ tuscany/sandbox/travelsample/node/build.xml Mon Nov 10 03:48:37 2008
@@ -155,7 +155,8 @@
         <include name="axis2-kernel-1.4.1.jar"/>
         <include name="axis2-mtompolicy-1.4.1.jar"/>
         <include name="backport-util-concurrent-3.1.jar"/>
-        <include name="bcprov-jdk13-132.jar"/>
+        <include name="bcel-5.2.jar"/>
+        <include name="bcprov-jdk15-132.jar"/>
         <include name="cglib-nodep-2.1_3.jar"/>
         <include name="commons-codec-1.3.jar"/>
         <include name="commons-collections-3.1.jar"/>
@@ -174,6 +175,7 @@
         <include name="htmlparser-1.0.5.jar"/>
         <include name="httpcore-4.0-beta1.jar"/>
         <include name="httpcore-nio-4.0-beta1.jar"/>
+        <include name="jakarta-regexp-1.4.jar"/>
         <include name="jaxb-api-2.1.jar"/>
         <include name="jaxb-impl-2.1.7.jar"/>
         <include name="jaxen-1.1.1.jar"/>

Modified: tuscany/sandbox/travelsample/node/src/scatours/LaunchNode.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/node/src/scatours/LaunchNode.java?rev=712648&r1=712647&r2=712648&view=diff
==============================================================================
--- tuscany/sandbox/travelsample/node/src/scatours/LaunchNode.java (original)
+++ tuscany/sandbox/travelsample/node/src/scatours/LaunchNode.java Mon Nov 10 03:48:37 2008
@@ -42,8 +42,9 @@
                                                                new SCAContribution("hotel", "../hotel-contribution/target/scatours-hotel-contribution.jar"),
                                                                new SCAContribution("flight", "../flight-contribution/target/scatours-flight-contribution.jar"),
                                                                new SCAContribution("car", "../car-contribution/target/scatours-car-contribution.jar"),
-                                                               new SCAContribution("trip", "../trip-contribution/target/scatours-trip-contribution.jar"),
-                                                               new SCAContribution("travel", "../trip-contribution/target/scatours-travel-contribution.jar"),
+                                                               new SCAContribution("tripbooking", "../tripbooking-contribution/target/scatours-tripbooking-contribution.jar"),
+                                                               new SCAContribution("travelcatalog", "../travelcatalog-contribution/target/scatours-travelcatalog-contribution.jar"),
+                                                               new SCAContribution("scatours", "../scatours-contribution/target/scatours-scatours-contribution.jar"),
                                                                new SCAContribution("ui", "../ui-contribution/target/scatours-ui-contribution.jar"));
 
             node.start();
@@ -71,8 +72,9 @@
                                                                new SCAContribution("hotel", "../hotel-contribution/target/classes"),
                                                                new SCAContribution("flight", "../flight-contribution/target/classes"),
                                                                new SCAContribution("car", "../car-contribution/target/classes"),
-                                                               new SCAContribution("trip", "../trip-contribution/target/classes"),
-                                                               new SCAContribution("travel", "../travel-contribution/target/classes"),
+                                                               new SCAContribution("tripbooking", "../tripbooking-contribution/target/classes"),
+                                                               new SCAContribution("travelcatalog", "../travelcatalog-contribution/target/classes"),
+                                                               new SCAContribution("scatours", "../scatours-contribution/target/classes"),
                                                                new SCAContribution("ui", "../ui-contribution/target/classes"));
             node.start();
             

Modified: tuscany/sandbox/travelsample/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/pom.xml?rev=712648&r1=712647&r2=712648&view=diff
==============================================================================
--- tuscany/sandbox/travelsample/pom.xml (original)
+++ tuscany/sandbox/travelsample/pom.xml Mon Nov 10 03:48:37 2008
@@ -43,8 +43,10 @@
                 <module>flight-contribution</module>
                 <module>car-contribution</module>
                 <module>payment-contribution</module>
-                <module>trip-contribution</module>
-                <module>travel-contribution</module>
+                <module>travelcatalog-contribution</module>
+                <module>tripbooking-contribution</module>
+                <module>shoppingcart-contribution</module>
+                <module>scatours-contribution</module>
                 <module>ui-contribution</module>
 
                 <module>domain</module>

Propchange: tuscany/sandbox/travelsample/scatours-contribution/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Nov 10 03:48:37 2008
@@ -0,0 +1,4 @@
+.classpath
+.project
+.settings
+target

Added: tuscany/sandbox/travelsample/scatours-contribution/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/scatours-contribution/META-INF/sca-contribution.xml?rev=712648&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/scatours-contribution/META-INF/sca-contribution.xml (added)
+++ tuscany/sandbox/travelsample/scatours-contribution/META-INF/sca-contribution.xml Mon Nov 10 03:48:37 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">
+   <import.java package="scatours.common"/>
+   <import.java package="scatours.currencyconverter"/>
+   <import.java package="scatours.travelcatalog"/>
+   <import.java package="scatours.tripbooking"/>
+   <export.java package="scatours"/>
+</contribution>
\ No newline at end of file

Propchange: tuscany/sandbox/travelsample/scatours-contribution/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/travelsample/scatours-contribution/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: tuscany/sandbox/travelsample/scatours-contribution/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: tuscany/sandbox/travelsample/scatours-contribution/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/scatours-contribution/pom.xml?rev=712648&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/scatours-contribution/pom.xml (added)
+++ tuscany/sandbox/travelsample/scatours-contribution/pom.xml Mon Nov 10 03:48:37 2008
@@ -0,0 +1,100 @@
+<?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.    
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-sca</artifactId>
+        <version>1.4-SNAPSHOT</version>
+        <!--relativePath>../../pom.xml</relativePath-->
+    </parent>
+    <artifactId>scatours-scatours-contribution</artifactId>
+    <name>Apache Tuscany SCA Tours SCATours Contribution</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-sca-api</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-data-api</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>scatours-common-contribution</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>   
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>scatours-currency-contribution</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency> 
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>scatours-travelcatalog-contribution</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency> 
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>scatours-tripbooking-contribution</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency> 
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>scatours-shoppingcart-contribution</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>         
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.5</version>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+       <finalName>${artifactId}</finalName>
+       <sourceDirectory>${basedir}/src</sourceDirectory>
+       <resources>
+          <resource>
+              <directory>${basedir}</directory>
+              <excludes>
+                  <exclude>**/*.java</exclude>
+                  <exclude>**/.*/**</exclude>
+                  <exclude>pom.xml</exclude>
+                  <exclude>build.xml</exclude>
+                  <exclude>target/**</exclude>
+                  <exclude>src/**</exclude>
+              </excludes>
+          </resource>
+       </resources>
+    </build>
+</project>

Propchange: tuscany/sandbox/travelsample/scatours-contribution/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/travelsample/scatours-contribution/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: tuscany/sandbox/travelsample/scatours-contribution/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: tuscany/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursBooking.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursBooking.java?rev=712648&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursBooking.java (added)
+++ tuscany/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursBooking.java Mon Nov 10 03:48:37 2008
@@ -0,0 +1,36 @@
+/*
+ * 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 scatours;
+
+
+import org.osoa.sca.annotations.Remotable;
+
+import scatours.common.TripItem;
+
+/**
+ * The SCA Tours trip booking service interface
+ */
+@Remotable
+public interface SCAToursBooking {
+    String newTrip();
+    void addTripItem(String tripId, String tripItemId);
+    void removeTripItem(String tripId, String tripItemId);
+    TripItem[] getTripItems(String tripId);
+    double getTotalPrice(String tripId);
+}

Propchange: tuscany/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursBooking.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursBooking.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursImpl.java?rev=712648&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursImpl.java (added)
+++ tuscany/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursImpl.java Mon Nov 10 03:48:37 2008
@@ -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 scatours;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.tuscany.sca.data.collection.Entry;
+import org.apache.tuscany.sca.data.collection.NotFoundException;
+import org.osoa.sca.CallableReference;
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.RequestContext;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+import scatours.common.Search;
+import scatours.common.SearchCallback;
+import scatours.common.TripItem;
+import scatours.common.TripLeg;
+import scatours.currencyconverter.CurrencyConverter;
+import scatours.travelcatalog.TravelCatalogSearch;
+import scatours.trip.Trip;
+import scatours.tripbooking.TripBooking;
+
+/**
+ * An implementation of the Trip service
+ */
+@Scope("COMPOSITE")
+@Service(interfaces={TravelCatalogSearch.class, SCAToursBooking.class})
+public class SCAToursImpl implements TravelCatalogSearch, SCAToursBooking{
+    
+    @Reference
+    protected TravelCatalogSearch travelCatalogSearch;
+    
+    @Reference 
+    protected TripBooking tripBooking;
+    
+    @Context
+    protected ComponentContext componentContext;  
+    
+    private Map<String,TripBooking> trips = new HashMap<String,TripBooking>();
+    private Map<String, TripItem> searchItemsCache = new HashMap<String, TripItem>();
+    
+    // TravelSearch methods
+    
+    public TripItem[] search(TripLeg tripLeg) {
+        
+        TripItem[] searchItems = travelCatalogSearch.search(tripLeg);
+        
+        for (int i =0; i< searchItems.length; i++){
+            searchItemsCache.put(searchItems[i].getId(), searchItems[i]);
+        }
+        return searchItems;
+    } 
+
+    // TravelBooking methods
+    
+    public String newTrip(){
+        String tripId = UUID.randomUUID().toString();
+        ServiceReference<TripBooking> tripReference = componentContext.getServiceReference(TripBooking.class, 
+                                                                                          "tripBooking");
+        tripReference.setConversationID(tripId);
+        trips.put(tripId, tripReference.getService());
+        return tripId;
+    }
+    
+    public void addTripItem(String tripId, String tripItemId){
+        trips.get(tripId).addTripItem(searchItemsCache.get(tripItemId));
+    }
+    
+    public void removeTripItem(String tripId, String tripItemId){
+        trips.get(tripId).removeTripItem(tripItemId);
+    } 
+    
+    public TripItem[] getTripItems(String tripId) {
+        return trips.get(tripId).getTripItems();
+    }
+    
+    public double getTotalPrice(String tripId){ 
+        return trips.get(tripId).getTripPrice();
+    }
+    
+    public void bookTrip(String tripId) {
+        trips.get(tripId).bookTrip();
+    }
+}

Propchange: tuscany/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: tuscany/sandbox/travelsample/shoppingcart-contribution/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Nov 10 03:48:37 2008
@@ -0,0 +1,4 @@
+.classpath
+.project
+.settings
+target

Added: tuscany/sandbox/travelsample/shoppingcart-contribution/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/shoppingcart-contribution/META-INF/sca-contribution.xml?rev=712648&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/shoppingcart-contribution/META-INF/sca-contribution.xml (added)
+++ tuscany/sandbox/travelsample/shoppingcart-contribution/META-INF/sca-contribution.xml Mon Nov 10 03:48:37 2008
@@ -0,0 +1,25 @@
+<?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">
+   <import.java package="scatours.common"/>
+   <import.java package="scatours.currencyconverter"/>
+   <import.java package="scatours.tripbooking"/>
+   <export.java package="scatours.shoppingcart"/>
+</contribution>
\ No newline at end of file

Propchange: tuscany/sandbox/travelsample/shoppingcart-contribution/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/travelsample/shoppingcart-contribution/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: tuscany/sandbox/travelsample/shoppingcart-contribution/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: tuscany/sandbox/travelsample/shoppingcart-contribution/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/shoppingcart-contribution/pom.xml?rev=712648&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/shoppingcart-contribution/pom.xml (added)
+++ tuscany/sandbox/travelsample/shoppingcart-contribution/pom.xml Mon Nov 10 03:48:37 2008
@@ -0,0 +1,88 @@
+<?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.    
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-sca</artifactId>
+        <version>1.4-SNAPSHOT</version>
+        <!--relativePath>../../pom.xml</relativePath-->
+    </parent>
+    <artifactId>scatours-shoppingcart-contribution</artifactId>
+    <name>Apache Tuscany SCA Tours Shopping Cart Contribution</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-sca-api</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-data-api</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>scatours-common-contribution</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>   
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>scatours-currency-contribution</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency> 
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>scatours-trip-contribution</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency> 
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.5</version>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+       <finalName>${artifactId}</finalName>
+       <sourceDirectory>${basedir}/src</sourceDirectory>
+       <resources>
+          <resource>
+              <directory>${basedir}</directory>
+              <excludes>
+                  <exclude>**/*.java</exclude>
+                  <exclude>**/.*/**</exclude>
+                  <exclude>pom.xml</exclude>
+                  <exclude>build.xml</exclude>
+                  <exclude>target/**</exclude>
+                  <exclude>src/**</exclude>
+              </excludes>
+          </resource>
+       </resources>
+    </build>
+</project>

Propchange: tuscany/sandbox/travelsample/shoppingcart-contribution/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/travelsample/shoppingcart-contribution/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: tuscany/sandbox/travelsample/shoppingcart-contribution/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/TravelBooking.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/TravelBooking.java?rev=712648&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/TravelBooking.java (added)
+++ tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/TravelBooking.java Mon Nov 10 03:48:37 2008
@@ -0,0 +1,38 @@
+/*
+ * 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 scatours.travel;
+
+
+import org.osoa.sca.annotations.Remotable;
+
+import scatours.common.TripItem;
+
+/**
+ * The TravelBooking service interface
+ */
+@Remotable
+public interface TravelBooking {
+       
+    String newTrip();
+    void addTripItem(String tripId, String id);
+    void removeTripItem(String tripId, String id);
+    TripItem[] getTripItems(String tripId);
+    double getTotalPrice(String tripId);
+    void purchaseTrip(String tripId);
+}

Propchange: tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/TravelBooking.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/TravelBooking.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/TravelImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/TravelImpl.java?rev=712648&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/TravelImpl.java (added)
+++ tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/TravelImpl.java Mon Nov 10 03:48:37 2008
@@ -0,0 +1,171 @@
+/*
+ * 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 scatours.travel;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.tuscany.sca.data.collection.Entry;
+import org.apache.tuscany.sca.data.collection.NotFoundException;
+import org.osoa.sca.CallableReference;
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.RequestContext;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+import scatours.common.Search;
+import scatours.common.SearchCallback;
+import scatours.common.TripItem;
+import scatours.common.TripLeg;
+import scatours.currencyconverter.CurrencyConverter;
+import scatours.trip.Trip;
+
+/**
+ * An implementation of the Trip service
+ */
+@Scope("COMPOSITE")
+@Service(interfaces={TravelSearch.class, TravelBooking.class})
+public class TravelImpl implements TravelSearch, SearchCallback, TravelBooking{
+    
+    @Reference
+    protected CurrencyConverter currencyConverter;
+    
+    @Reference 
+    protected Search hotelSearch;
+    
+    @Reference 
+    protected Search flightSearch;
+    
+    @Reference 
+    protected Search carSearch;
+    
+    @Reference
+    protected Trip trip;
+        
+    @Property
+    public String quoteCurrencyCode = "USD";
+    
+    @Context
+    protected ComponentContext componentContext;    
+    
+    private int responsesReceived = 0;
+    
+    private List<TripItem> searchResults = new ArrayList<TripItem>();
+    private Map<String,Trip> trips = new HashMap<String,Trip>();
+    
+    // TravelSearch methods
+    
+    public TripItem[] search(TripLeg tripLeg) {
+        
+        searchResults.clear();
+        responsesReceived = 0;
+        
+        ServiceReference<Search> dynamicHotelSearch = 
+            componentContext.getServiceReference(Search.class, "hotelSearch");
+        
+        dynamicHotelSearch.setCallbackID("HotelSearchCallbackID-" + tripLeg.getId());        
+        dynamicHotelSearch.getService().searchAsynch(tripLeg);
+        
+        flightSearch.searchAsynch(tripLeg);
+        carSearch.searchAsynch(tripLeg);
+        
+        while (responsesReceived < 3){
+            try {
+                synchronized (this) {
+                    this.wait();
+                }
+            } catch (InterruptedException ex){
+                // do nothing
+            }
+        }
+        
+        for (TripItem tripItem : searchResults){
+            tripItem.setId(UUID.randomUUID().toString());
+            tripItem.setTripId(tripLeg.getId());
+            tripItem.setPrice(currencyConverter.convert(tripItem.getCurrency(), 
+                                                        quoteCurrencyCode, 
+                                                        tripItem.getPrice()));
+            tripItem.setCurrency(quoteCurrencyCode);
+        }
+        
+        return searchResults.toArray(new TripItem[searchResults.size()]);
+    }
+    
+    // SearchCallback methods
+    
+    public void searchResults(TripItem[] items){
+        RequestContext requestContext = componentContext.getRequestContext();
+        Object callbackID = requestContext.getServiceReference().getCallbackID();
+        System.out.println(callbackID);
+        
+        for(int i = 0; i < items.length; i++ ){
+            searchResults.add(items[i]);
+        }
+        
+        responsesReceived++;
+        try {
+            synchronized (this) {
+                this.notifyAll();
+            }
+        } catch (Exception ex) {
+        }
+    }    
+
+    // TravelBooking methods
+    
+    public String newTrip(){
+        String tripId = UUID.randomUUID().toString();
+        ServiceReference<Trip> tripReference = componentContext.getServiceReference(Trip.class, 
+                                                                                    "trip");
+        tripReference.setConversationID(tripId);
+        trips.put(tripId, tripReference.getService());
+        return tripId;
+    }
+    
+    public void addTripItem(String tripId, String id){
+        for (TripItem tripItem : searchResults) {
+            if (tripItem.getId().equals(id)){
+                trips.get(tripId).addTripItem(tripItem);
+            }
+        }
+    }
+    
+    public void removeTripItem(String tripId, String id){
+        trips.get(tripId).removeTripItem(id);
+    } 
+    
+    public TripItem[] getTripItems(String tripId) {
+        return trips.get(tripId).getTripItems();
+    }
+    
+    public double getTotalPrice(String tripId){ 
+        return trips.get(tripId).getTripPrice();
+    }
+    
+    public void purchaseTrip(String tripId) {
+        trips.get(tripId).purchaseTrip();
+    }
+}

Propchange: tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/TravelImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/TravelImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/TravelSearch.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/TravelSearch.java?rev=712648&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/TravelSearch.java (added)
+++ tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/TravelSearch.java Mon Nov 10 03:48:37 2008
@@ -0,0 +1,32 @@
+/*
+ * 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 scatours.travel;
+
+import org.osoa.sca.annotations.Remotable;
+
+import scatours.common.TripItem;
+import scatours.common.TripLeg;
+
+/**
+ * The Trip service interface
+ */
+@Remotable
+public interface TravelSearch {
+    TripItem[] search(TripLeg tripLeg);
+}

Propchange: tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/TravelSearch.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/travelsample/shoppingcart-contribution/src/scatours/travel/TravelSearch.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: tuscany/sandbox/travelsample/travelcatalog-contribution/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Nov 10 03:48:37 2008
@@ -0,0 +1,4 @@
+.classpath
+.project
+.settings
+target

Added: tuscany/sandbox/travelsample/travelcatalog-contribution/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/travelcatalog-contribution/META-INF/sca-contribution.xml?rev=712648&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/travelcatalog-contribution/META-INF/sca-contribution.xml (added)
+++ tuscany/sandbox/travelsample/travelcatalog-contribution/META-INF/sca-contribution.xml Mon Nov 10 03:48:37 2008
@@ -0,0 +1,24 @@
+<?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">
+   <import.java package="scatours.common"/>
+   <import.java package="scatours.currencyconverter"/>
+   <export.java package="scatours.travelcatalog"/>
+</contribution>
\ No newline at end of file

Propchange: tuscany/sandbox/travelsample/travelcatalog-contribution/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/travelsample/travelcatalog-contribution/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: tuscany/sandbox/travelsample/travelcatalog-contribution/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: tuscany/sandbox/travelsample/travelcatalog-contribution/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/travelcatalog-contribution/pom.xml?rev=712648&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/travelcatalog-contribution/pom.xml (added)
+++ tuscany/sandbox/travelsample/travelcatalog-contribution/pom.xml Mon Nov 10 03:48:37 2008
@@ -0,0 +1,88 @@
+<?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.    
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-sca</artifactId>
+        <version>1.4-SNAPSHOT</version>
+        <!--relativePath>../../pom.xml</relativePath-->
+    </parent>
+    <artifactId>scatours-travelcatalog-contribution</artifactId>
+    <name>Apache Tuscany SCA Tours Travel Catalog Contribution</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-sca-api</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-data-api</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>scatours-common-contribution</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>   
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>scatours-currency-contribution</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency> 
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>scatours-trip-contribution</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency> 
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.5</version>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+       <finalName>${artifactId}</finalName>
+       <sourceDirectory>${basedir}/src</sourceDirectory>
+       <resources>
+          <resource>
+              <directory>${basedir}</directory>
+              <excludes>
+                  <exclude>**/*.java</exclude>
+                  <exclude>**/.*/**</exclude>
+                  <exclude>pom.xml</exclude>
+                  <exclude>build.xml</exclude>
+                  <exclude>target/**</exclude>
+                  <exclude>src/**</exclude>
+              </excludes>
+          </resource>
+       </resources>
+    </build>
+</project>

Propchange: tuscany/sandbox/travelsample/travelcatalog-contribution/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/travelsample/travelcatalog-contribution/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: tuscany/sandbox/travelsample/travelcatalog-contribution/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: tuscany/sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogImpl.java?rev=712648&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogImpl.java (added)
+++ tuscany/sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogImpl.java Mon Nov 10 03:48:37 2008
@@ -0,0 +1,132 @@
+/*
+ * 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 scatours.travelcatalog;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.tuscany.sca.data.collection.Entry;
+import org.apache.tuscany.sca.data.collection.NotFoundException;
+import org.osoa.sca.CallableReference;
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.RequestContext;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+import scatours.common.Search;
+import scatours.common.SearchCallback;
+import scatours.common.TripItem;
+import scatours.common.TripLeg;
+import scatours.currencyconverter.CurrencyConverter;
+import scatours.trip.Trip;
+
+/**
+ * An implementation of the Trip service
+ */
+@Scope("COMPOSITE")
+@Service(interfaces={TravelCatalogSearch.class})
+public class TravelCatalogImpl implements TravelCatalogSearch, SearchCallback{
+    
+    @Reference 
+    protected Search hotelSearch;
+    
+    @Reference 
+    protected Search flightSearch;
+    
+    @Reference 
+    protected Search carSearch;
+           
+    @Property
+    public String quoteCurrencyCode = "USD";
+    
+    @Reference
+    protected CurrencyConverter currencyConverter;    
+    
+    @Context
+    protected ComponentContext componentContext;
+    
+    private int responsesReceived = 0;
+    
+    private List<TripItem> searchResults = new ArrayList<TripItem>();
+    
+    // TravelSearch methods
+    
+    public TripItem[] search(TripLeg tripLeg) {
+        
+        searchResults.clear();
+        responsesReceived = 0;
+        
+        ServiceReference<Search> dynamicHotelSearch = 
+            componentContext.getServiceReference(Search.class, "hotelSearch");
+        
+        dynamicHotelSearch.setCallbackID("HotelSearchCallbackID-" + tripLeg.getId());        
+        dynamicHotelSearch.getService().searchAsynch(tripLeg);
+        
+        flightSearch.searchAsynch(tripLeg);
+        carSearch.searchAsynch(tripLeg);
+        
+        while (responsesReceived < 3){
+            try {
+                synchronized (this) {
+                    this.wait();
+                }
+            } catch (InterruptedException ex){
+                // do nothing
+            }
+        }
+        
+        for (TripItem tripItem : searchResults){
+            tripItem.setId(UUID.randomUUID().toString());
+            tripItem.setTripId(tripLeg.getId());
+            tripItem.setPrice(currencyConverter.convert(tripItem.getCurrency(), 
+                                                        quoteCurrencyCode, 
+                                                        tripItem.getPrice()));
+            tripItem.setCurrency(quoteCurrencyCode);
+        }
+        
+        return searchResults.toArray(new TripItem[searchResults.size()]);
+    }
+    
+    // SearchCallback methods
+    
+    public void searchResults(TripItem[] items){
+        RequestContext requestContext = componentContext.getRequestContext();
+        Object callbackID = requestContext.getServiceReference().getCallbackID();
+        System.out.println(callbackID);
+        
+        for(int i = 0; i < items.length; i++ ){
+            searchResults.add(items[i]);
+        }
+        
+        responsesReceived++;
+        try {
+            synchronized (this) {
+                this.notifyAll();
+            }
+        } catch (Exception ex) {
+        }
+    }    
+}

Propchange: tuscany/sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogSearch.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogSearch.java?rev=712648&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogSearch.java (added)
+++ tuscany/sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogSearch.java Mon Nov 10 03:48:37 2008
@@ -0,0 +1,32 @@
+/*
+ * 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 scatours.travelcatalog;
+
+import org.osoa.sca.annotations.Remotable;
+
+import scatours.common.TripItem;
+import scatours.common.TripLeg;
+
+/**
+ * The Trip service interface
+ */
+@Remotable
+public interface TravelCatalogSearch {
+    TripItem[] search(TripLeg tripLeg);
+}

Propchange: tuscany/sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogSearch.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogSearch.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: tuscany/sandbox/travelsample/tripbooking-contribution/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Nov 10 03:48:37 2008
@@ -0,0 +1,4 @@
+.classpath
+.project
+.settings
+target

Added: tuscany/sandbox/travelsample/tripbooking-contribution/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/tripbooking-contribution/META-INF/sca-contribution.xml?rev=712648&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/tripbooking-contribution/META-INF/sca-contribution.xml (added)
+++ tuscany/sandbox/travelsample/tripbooking-contribution/META-INF/sca-contribution.xml Mon Nov 10 03:48:37 2008
@@ -0,0 +1,24 @@
+<?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">
+   <import.java package="scatours.common"/>
+   <import.java package="scatours.currencyconverter"/>
+   <export.java package="scatours.tripbooking"/>
+</contribution>
\ No newline at end of file

Propchange: tuscany/sandbox/travelsample/tripbooking-contribution/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/travelsample/tripbooking-contribution/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: tuscany/sandbox/travelsample/tripbooking-contribution/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: tuscany/sandbox/travelsample/tripbooking-contribution/build.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/tripbooking-contribution/build.xml?rev=712648&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/tripbooking-contribution/build.xml (added)
+++ tuscany/sandbox/travelsample/tripbooking-contribution/build.xml Mon Nov 10 03:48:37 2008
@@ -0,0 +1,61 @@
+<!--
+ * 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.    
+-->
+<project name="gettingstarted" default="compile">
+	<property environment="env"/> 
+	
+    <target name="compile">
+    	<mkdir dir="target/classes"/>
+        <javac srcdir="src" destdir="target/classes" 
+        	           debug="on" source="1.5" target="1.5">
+            <classpath>
+            	<pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+            </classpath>
+        </javac>   	
+    </target>
+	
+    <target name="run">
+        <java classname="client.CurrencyConverterClient" fork="true">
+            <classpath>
+            	<pathelement path="src"/>
+                <pathelement path="target/classes"/>
+                <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+            </classpath>
+        </java>     
+    </target> 	
+	
+    <target name="runtrip">
+        <java classname="client.TripClient" fork="true">
+            <classpath>
+            	<pathelement path="src"/>
+                <pathelement path="target/classes"/>
+            	<pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+            </classpath>
+        </java>    	
+    </target>	
+	
+    <target name="runtripws">
+        <java classname="client.TripWsClient" fork="true">
+            <classpath>
+            	<pathelement path="src"/>
+                <pathelement path="target/classes"/>
+                <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+            </classpath>
+        </java>     
+    </target>   	
+</project>

Propchange: tuscany/sandbox/travelsample/tripbooking-contribution/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/travelsample/tripbooking-contribution/build.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: tuscany/sandbox/travelsample/tripbooking-contribution/build.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: tuscany/sandbox/travelsample/tripbooking-contribution/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/tripbooking-contribution/pom.xml?rev=712648&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/tripbooking-contribution/pom.xml (added)
+++ tuscany/sandbox/travelsample/tripbooking-contribution/pom.xml Mon Nov 10 03:48:37 2008
@@ -0,0 +1,82 @@
+<?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.    
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-sca</artifactId>
+        <version>1.4-SNAPSHOT</version>
+        <!--relativePath>../../pom.xml</relativePath-->
+    </parent>
+    <artifactId>scatours-tripbooking-contribution</artifactId>
+    <name>Apache Tuscany SCA Tours Trip Booking Contribution</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-sca-api</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-data-api</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>scatours-common-contribution</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>   
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>scatours-currency-contribution</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency> 
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.5</version>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+       <finalName>${artifactId}</finalName>
+       <sourceDirectory>${basedir}/src</sourceDirectory>
+       <resources>
+          <resource>
+              <directory>${basedir}</directory>
+              <excludes>
+                  <exclude>**/*.java</exclude>
+                  <exclude>**/.*/**</exclude>
+                  <exclude>pom.xml</exclude>
+                  <exclude>build.xml</exclude>
+                  <exclude>target/**</exclude>
+                  <exclude>src/**</exclude>
+              </excludes>
+          </resource>
+       </resources>
+    </build>
+</project>

Propchange: tuscany/sandbox/travelsample/tripbooking-contribution/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/travelsample/tripbooking-contribution/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: tuscany/sandbox/travelsample/tripbooking-contribution/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: tuscany/sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBooking.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBooking.java?rev=712648&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBooking.java (added)
+++ tuscany/sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBooking.java Mon Nov 10 03:48:37 2008
@@ -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 scatours.tripbooking;
+
+import org.osoa.sca.annotations.Conversational;
+import org.osoa.sca.annotations.Destroy;
+import org.osoa.sca.annotations.EndsConversation;
+import org.osoa.sca.annotations.Init;
+import org.osoa.sca.annotations.Remotable;
+
+import scatours.common.TripItem;
+
+/**
+ * The Trip service interface
+ */
+@Remotable
+@Conversational
+public interface TripBooking {
+       
+    void addTripItem(TripItem tripItem);
+    
+    void removeTripItem(String tripItemId);
+    
+    TripItem[] getTripItems();
+    
+    double getTripPrice();
+    
+    @EndsConversation
+    void bookTrip();
+}

Propchange: tuscany/sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBooking.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBooking.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBookingImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBookingImpl.java?rev=712648&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBookingImpl.java (added)
+++ tuscany/sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBookingImpl.java Mon Nov 10 03:48:37 2008
@@ -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 scatours.tripbooking;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+import org.osoa.sca.annotations.ConversationID;
+import org.osoa.sca.annotations.Destroy;
+import org.osoa.sca.annotations.Init;
+
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+
+import scatours.common.TripItem;
+
+/**
+ * An implementation of the Trip service
+ */
+@Scope("CONVERSATION")
+@Service(interfaces={TripBooking.class})
+public class TripBookingImpl implements TripBooking{
+
+    @ConversationID
+    protected String conversationId;
+    
+    private Map<String, TripItem> tripItems = new HashMap<String, TripItem>();
+     
+    // Trip methods
+    
+    @Init
+    public void initTrip() {
+        System.out.println("Trip init for id: " + conversationId);
+    }
+    
+    @Destroy
+    public void destroyTrip() {
+        System.out.println("Trip destroy for id: " + conversationId);
+    }
+    
+    
+    public void addTripItem(TripItem tripItem){
+        tripItems.put(tripItem.getId(), tripItem);
+    }
+    
+    public void removeTripItem(String id){
+        tripItems.remove(id);
+    }  
+    
+    public TripItem[] getTripItems() {
+        return tripItems.values().toArray(new TripItem[tripItems.size()]);
+    }
+    
+    public double getTripPrice(){ 
+        double totalPrice = 0.0;
+        
+        for (TripItem tripItem : tripItems.values()){
+            totalPrice += tripItem.getPrice();
+        }
+        
+        return totalPrice;
+    }
+    
+    public void bookTrip() {
+        // TODO
+    }
+}

Propchange: tuscany/sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBookingImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBookingImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: tuscany/sandbox/travelsample/ui-contribution/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/ui-contribution/META-INF/sca-contribution.xml?rev=712648&r1=712647&r2=712648&view=diff
==============================================================================
--- tuscany/sandbox/travelsample/ui-contribution/META-INF/sca-contribution.xml (original)
+++ tuscany/sandbox/travelsample/ui-contribution/META-INF/sca-contribution.xml Mon Nov 10 03:48:37 2008
@@ -19,12 +19,13 @@
 -->
 <contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
    xmlns:scatours="http://scatours">
+   <deployable composite="scatours:scatours"/>
    <import.java package="scatours.common"/>
    <import.java package="scatours.currencyconverter"/>
    <import.java package="scatours.hotel"/>
    <import.java package="scatours.flight"/>
    <import.java package="scatours.car"/>
-   <import.java package="scatours.trip"/>
-   <import.java package="scatours.travel"/>
-   <deployable composite="scatours:scatours"/>
+   <import.java package="scatours.tripbooking"/>
+   <import.java package="scatours.travelcatalog"/>
+   <import.java package="scatours"/>
 </contribution>
\ No newline at end of file

Modified: tuscany/sandbox/travelsample/ui-contribution/build.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/ui-contribution/build.xml?rev=712648&r1=712647&r2=712648&view=diff
==============================================================================
--- tuscany/sandbox/travelsample/ui-contribution/build.xml (original)
+++ tuscany/sandbox/travelsample/ui-contribution/build.xml Mon Nov 10 03:48:37 2008
@@ -94,8 +94,10 @@
         <include name="XmlSchema-1.4.2.jar"/>
         <include name="activation-1.1.jar"/>
         <include name="asm-all-3.1.jar"/>
+        <include name="bcel-5.2.jar"/>
         <include name="cglib-nodep-2.1_3.jar"/>
         <include name="geronimo-commonj_1.1_spec-1.0.jar"/>
+        <include name="jakarta-regexp-1.4.jar"/>
         <include name="jaxb-api-2.1.jar"/>
         <include name="jaxb-impl-2.1.7.jar"/>
         <include name="jaxws-api-2.1.jar"/>
@@ -103,6 +105,8 @@
         <include name="jsr250-api-1.0.jar"/>
         <include name="stax-api-1.0-2.jar"/>
         <include name="wstx-asl-3.2.4.jar"/>
+        <include name="xalan-2.7.0.jar"/>
+        <include name="xml-apis-1.3.03.jar"/>
     </fileset>
 
 </project>

Modified: tuscany/sandbox/travelsample/ui-contribution/scatours.composite
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/ui-contribution/scatours.composite?rev=712648&r1=712647&r2=712648&view=diff
==============================================================================
--- tuscany/sandbox/travelsample/ui-contribution/scatours.composite (original)
+++ tuscany/sandbox/travelsample/ui-contribution/scatours.composite Mon Nov 10 03:48:37 2008
@@ -23,36 +23,35 @@
            xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
            name="scatours">
            
-    <component name="SCATours">
+    <component name="UserInterfaceComponent">
         <tuscany:implementation.widget location="scatours.html"/>
         <service name="Widget">
             <tuscany:binding.http uri="/scatours"/>
         </service>
-        <reference name="hotel" target="HotelComponent">
+        <reference name="scaToursSearch" target="SCAToursComponent/TravelCatalogSearch">
             <tuscany:binding.jsonrpc/>
-        </reference>
-        <reference name="flight" target="FlightComponent">
-            <tuscany:binding.jsonrpc/>
-        </reference>
-        <reference name="car" target="CarComponent">
-            <tuscany:binding.jsonrpc/>
-        </reference>
-        <reference name="travelSearch" target="TravelComponent/TravelSearch">
+        </reference> 
+        <reference name="scaToursBooking" target="SCAToursComponent/SCAToursBooking">
             <tuscany:binding.jsonrpc/>
         </reference>
-        <reference name="travelBooking" target="TravelComponent/TravelBooking">
-            <tuscany:binding.jsonrpc/>
-        </reference>  
     </component>
     
-    <component name="TravelComponent">
-        <implementation.java class="scatours.travel.TravelImpl"/>
-        <service name="TravelSearch">
+    <component name="SCAToursComponent">
+        <implementation.java class="scatours.SCAToursImpl"/>
+        <service name="TravelCatalogSearch">
             <tuscany:binding.jsonrpc/>
         </service>
-        <service name="TravelBooking">
+        <service name="SCAToursBooking">
             <tuscany:binding.jsonrpc/>
         </service>
+        <reference name="travelCatalogSearch" target="TravelCatalogComponent/TravelCatalogSearch"/>
+        <reference name="tripBooking" target="TripBookingComponent/TripBooking"/>
+        <!--reference name="shoppingCart" target="ShoppingCartComponent/shoppingCart"/-->
+    </component>
+    
+    <component name="TravelCatalogComponent">
+        <implementation.java class="scatours.travelcatalog.TravelCatalogImpl"/>
+        <service name="TravelCatalogSearch"/>
         <reference name="hotelSearch" target="HotelComponent">
             <binding.sca/>
         </reference>
@@ -69,15 +68,12 @@
         </reference>        
         <reference name="currencyConverter" target="CurrencyConverterComponent">
         </reference>
-        <reference name="trip" target="TripComponent">
-        </reference> 
         <property name="quoteCurrencyCode">GBP</property>
     </component>
     
-    <component name="TripComponent">
-        <implementation.java class="scatours.trip.TripImpl"/>
-        <service name="Trip">
-        </service>
+    <component name="TripBookingComponent">
+        <implementation.java class="scatours.tripbooking.TripBookingImpl"/>
+        <service name="TripBooking"/>
     </component>    
         
     <component name="HotelComponent">
@@ -114,5 +110,17 @@
         <service name="CurrencyConverter">
         </service>
     </component>
+    
+    <!-- component name="ShoppingCartComponent">
+        <implementation.java class="scatours.shoppingcart.ShoppingCartImpl"/>
+        <service name="CurrencyConverter">
+        </service>
+    </component>    
+    
+    <component name="PaymentComponent">
+        <implementation.java class="scatours.payment.PaymentImpl"/>
+        <service name="CurrencyConverter">
+        </service>
+    </component-->  
 
 </composite>

Modified: tuscany/sandbox/travelsample/ui-contribution/scatours.html
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/ui-contribution/scatours.html?rev=712648&r1=712647&r2=712648&view=diff
==============================================================================
--- tuscany/sandbox/travelsample/ui-contribution/scatours.html (original)
+++ tuscany/sandbox/travelsample/ui-contribution/scatours.html Mon Nov 10 03:48:37 2008
@@ -24,27 +24,19 @@
 
 <script type="text/javascript" src="scatours.js"></script>
 
-<script language="JavaScript">
-
-	//@Reference
-	var hotel = new Reference("hotel");
-    
-    //@Reference
-    var flight = new Reference("flight");
-    
-    //@Reference
-    var car = new Reference("car");    
+<script language="JavaScript">   
 	
     //@Reference
-    var travelSearch = new Reference("travelSearch");
+    var scaToursSearch = new Reference("scaToursSearch");
     
     //@Reference
-    var travelBooking = new Reference("travelBooking");
+    var scaToursBooking = new Reference("scaToursBooking");
         
     //local state
     var currentTripId;
-    var searchResponseItems;
-     
+    var searchItems;
+    var cartItems;
+         
     //the constructor for trip leg beans
     function TripLegType(id,
                          fromLocation,
@@ -77,21 +69,9 @@
 	       alert(e);
 	   }
     }
-    
-    function searchHotels() {       
-        hotel.searchSynch(getTripLeg(), search_response);
-    }
-    
-    function searchFlights() {       
-        flight.searchSynch(getTripLeg(), search_response);
-    }    
-    
-    function searchCars() {       
-        car.searchSynch(getTripLeg(), search_response);
-    } 
-        
-    function searchPackages() {        
-        travelSearch.search(getTripLeg(), search_response);
+            
+    function searchTravelCatalog() {        
+        scaToursSearch.search(getTripLeg(), search_response);
     }
         
     function search_response(items, exception) {
@@ -119,21 +99,27 @@
         
         document.getElementById('searchResponse').innerHTML = responseHTML;
         
-        searchResponseItems = items;
+        searchItems = items;
     }  
     
-    function processSelection() {        
+    function processSelection() {
+        // do nothing at the moment
+    }
+         
+    function addItemsToCart() {     
         var items  = document.tripForm.items;
-        var j = 0;
+
         for (var i=0; i<items.length; i++) {
+            
+            // notify the server of the change
             if (items[i].checked == true) {
-                travelBooking.addTripItem(currentTripId, items[i].value);
+                scaToursBooking.addTripItem(currentTripId, items[i].value);
             } else {
-                travelBooking.removeTripItem(currentTripId, items[i].value);
+                scaToursBooking.removeTripItem(currentTripId, items[i].value);
             }
         }
         
-        travelBooking.getTripItems(currentTripId,getTripItems_response);
+        scaToursBooking.getTripItems(currentTripId,getTripItems_response);
     }
     
     function getTripItems_response(items, exception) {
@@ -160,7 +146,7 @@
         
         document.getElementById('tripItems').innerHTML = itemsHTML;  
           
-        travelBooking.getTotalPrice(currentTripId, getTotalPrice_response);
+        scaToursBooking.getTotalPrice(currentTripId, getTotalPrice_response);
     }    
     
     function getTotalPrice_response(totalPrice, exception) {
@@ -172,7 +158,7 @@
     }
     
     function newTrip() { 
-        travelBooking.newTrip(newTrip_response);
+        scaToursBooking.newTrip(newTrip_response);
         
         document.getElementById('searchResponse').innerHTML = "";
         document.getElementById('tripItems').innerHTML = "";
@@ -185,18 +171,21 @@
             return;
         }
         currentTripId = tripId
-        document.getElementById('tripId').innerHTML = "Trip: " + tripId;
+        document.getElementById('tripId').innerHTML = "Trip Reference: " + tripId;
     }    
     
-    function purchaseTrip() {        
-        travelBooking.purchaseTrip(currentTripId);
+    function bookTrip() {        
+        travelBooking.bookTrip(currentTripId);
         
         document.getElementById('searchResponse').innerHTML = "";
         document.getElementById('tripItems').innerHTML = "Thank you for shopping with SCA Tours";
         document.getElementById('totalPrice').innerHTML = "";
         searchResponseItems = null;
         tripItems = null;
-    }    
+    }   
+    
+    function purchase() { 
+    }
 	
 </script>
 
@@ -234,22 +223,22 @@
                 </tr>
             </table>
             <br/>
-            <input type="button" onClick="searchPackages()" value="SearchPackages"> 
-            <input type="button" onClick="searchHotels()" value="Search Hotels">
-            <input type="button" onClick="searchFlights()" value="Search Flights">
-            <input type="button" onClick="searchCars()" value="Search Cars"> 
+            <input type="button" onClick="searchTravelCatalog()" value="Search"> 
         </form>
         <form name="tripForm">
             <h3>Search Results</h3> 
             <div id="searchResponse"></div>
-            <br> 
+            <br/> 
+            <input type="button" onClick="addItemsToCart()" value="Add Items"> 
+            <br/>
+            <h3>Shopping Cart</h3>
             <h3><div id="tripId"></h3>
             <div id="tripItems"></div>
-            <br>            
+            <br/>            
             <div id="totalPrice"></div>
-            <br>
+            <br/>            
+            <input type="button" onClick="bookTrip()" value="Book"> 
             <input type="button" onClick="newTrip()" value="Create New Trip"> 
-            <input type="button" onClick="purchaseTrip()" value="Purchase Trip"> 
         </form> 
 	</div>
   



Mime
View raw message