summaryrefslogtreecommitdiffstats
path: root/sandbox/travelsample/contributions/tripbooking-contribution
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-05-31 13:07:26 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-05-31 13:07:26 +0000
commitf1891559c61043146be106bdec11a56d59e8b050 (patch)
tree9ee501a5bde240b5a4ad1d9301b49e4fe0f681e4 /sandbox/travelsample/contributions/tripbooking-contribution
parenta9ea1ca799531d693b07ab21001f869e2aa40204 (diff)
Move conversational behaviour into the care store component to make the front end simpler and allow removal of the SCA tours component if required. Also make payments work in the full app. Ad some more features to calendar and hotel to demonstrate interaction patterns
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@780423 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sandbox/travelsample/contributions/tripbooking-contribution')
-rw-r--r--sandbox/travelsample/contributions/tripbooking-contribution/src/main/java/scatours/tripbooking/TripBookingImpl.java54
1 files changed, 5 insertions, 49 deletions
diff --git a/sandbox/travelsample/contributions/tripbooking-contribution/src/main/java/scatours/tripbooking/TripBookingImpl.java b/sandbox/travelsample/contributions/tripbooking-contribution/src/main/java/scatours/tripbooking/TripBookingImpl.java
index aea855cef6..debbafda64 100644
--- a/sandbox/travelsample/contributions/tripbooking-contribution/src/main/java/scatours/tripbooking/TripBookingImpl.java
+++ b/sandbox/travelsample/contributions/tripbooking-contribution/src/main/java/scatours/tripbooking/TripBookingImpl.java
@@ -19,6 +19,7 @@
package scatours.tripbooking;
import org.osoa.sca.ComponentContext;
+import org.osoa.sca.ServiceReference;
import org.osoa.sca.annotations.Context;
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Service;
@@ -79,57 +80,12 @@ public class TripBookingImpl implements TripBooking{
}
// add trip to the shopping cart
- //ServiceReference<ShoppingCart> cart = componentContext.getServiceReference(ShoppingCart.class,
- // "shoppingCart");
- //cart.setConversationID(cartId);
- //cart.getService().addTrip(trip);
+ ServiceReference<ShoppingCart> cart = componentContext.getServiceReference(ShoppingCart.class,
+ "shoppingCart");
+ cart.setConversationID(cartId);
+ cart.getService().addTrip(cartId, trip);
return trip;
}
- /*
- @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
- }
- */
}