From eb06796859bc8746cb3f25e065d3211fdadf2d6b Mon Sep 17 00:00:00 2001 From: slaws Date: Sun, 8 Feb 2009 10:34:50 +0000 Subject: re-org the modules git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@742040 13f79535-47bb-0310-9956-ffa450edef68 --- .../META-INF/sca-contribution.xml | 22 -- sandbox/travelsample/calendar-contribution/pom.xml | 57 --- .../src/main/java/calendar/Calendar.java | 28 -- .../src/main/java/calendar/CalendarImpl.java | 48 --- .../src/main/resources/calendar.composite | 29 -- .../src/test/java/calendar/CalendarTestCase.java | 47 --- .../src/test/resources/calendar.composite | 29 -- .../car-contribution/META-INF/sca-contribution.xml | 23 -- sandbox/travelsample/car-contribution/pom.xml | 76 ---- .../car-contribution/src/scatours/car/CarImpl.java | 100 ------ .../car-contribution/src/scatours/car/CarInfo.java | 120 ------- sandbox/travelsample/chapter-01/pom.xml | 2 +- sandbox/travelsample/chapter-05/node/build.xml | 273 +++++++++++++++ sandbox/travelsample/chapter-05/node/pom.xml | 178 ++++++++++ .../chapter-05/node/src/scatours/LaunchNode.java | 66 ++++ sandbox/travelsample/chapter-05/pom.xml | 46 +++ .../ui-contribution/META-INF/sca-contribution.xml | 37 ++ .../chapter-05/ui-contribution/build.xml | 108 ++++++ .../chapter-05/ui-contribution/pom.xml | 102 ++++++ .../chapter-05/ui-contribution/scatours.composite | 178 ++++++++++ .../chapter-05/ui-contribution/scatours.html | 390 +++++++++++++++++++++ .../chapter-05/ui-contribution/scatours.odg | Bin 0 -> 11477 bytes .../chapter-05/ui-contribution/scatours.png | Bin 0 -> 11061 bytes .../chapter-05/ui-contribution/style.css | 135 +++++++ .../paymentprocess-contribution/log4j.properties | 36 ++ .../paymentprocesstest.composite | 47 +++ .../chapter-06/paymentprocess-contribution/pom.xml | 179 ++++++++++ .../resources/CreditCardPayment.wsdl | 117 +++++++ .../resources/EmailGateway.wsdl | 89 +++++ .../resources/META-INF/sca-contribution.xml | 23 ++ .../resources/PaymentProcess.wsdl | 83 +++++ .../resources/paymentprocess.bpel | 164 +++++++++ .../resources/paymentprocess.componentType | 38 ++ .../paymentprocess/PaymentProcessClientImpl.java | 38 ++ .../paymentprocess/PaymentProcessTestCase.java | 76 ++++ .../META-INF/sca-contribution.xml | 22 -- sandbox/travelsample/common-contribution/build.xml | 61 ---- sandbox/travelsample/common-contribution/pom.xml | 57 --- .../src/scatours/common/Book.java | 31 -- .../src/scatours/common/Search.java | 35 -- .../src/scatours/common/SearchCallback.java | 30 -- .../src/scatours/common/TripItem.java | 220 ------------ .../src/scatours/common/TripLeg.java | 97 ----- .../META-INF/sca-contribution.xml | 22 -- sandbox/travelsample/currency-contribution/pom.xml | 63 ---- .../currencyconverter/CurrencyConverter.java | 33 -- .../currencyconverter/CurrencyConverterImpl.java | 54 --- .../META-INF/sca-contribution.xml | 22 -- .../emailgatewaytest.composite | 37 -- .../travelsample/emailgateway-contribution/pom.xml | 155 -------- .../scatours/emailgateway/EmailGatewayImpl.java | 36 -- .../emailgateway/EmailGatewayClientImpl.java | 38 -- .../emailgateway/EmailGatewayTestCase.java | 80 ----- .../wsdl/EmailGateway.wsdl | 89 ----- .../META-INF/sca-contribution.xml | 23 -- sandbox/travelsample/flight-contribution/pom.xml | 76 ---- .../src/scatours/flight/FlightImpl.java | 127 ------- .../src/scatours/flight/FlightInfo.java | 142 -------- .../META-INF/sca-contribution.xml | 23 -- sandbox/travelsample/hotel-contribution/pom.xml | 76 ---- .../src/scatours/hotel/HotelImpl.java | 116 ------ .../src/scatours/hotel/HotelInfo.java | 120 ------- sandbox/travelsample/node/build.xml | 273 --------------- sandbox/travelsample/node/pom.xml | 178 ---------- .../travelsample/node/src/scatours/LaunchNode.java | 122 ------- .../META-INF/sca-contribution.xml | 25 -- .../payment-contribution/creditcard.composite | 38 -- sandbox/travelsample/payment-contribution/pom.xml | 155 -------- .../creditcard/impl/CreditCardPaymentImpl.java | 46 --- .../ws/impl/CreditCardPaymentWSImpl.java | 48 --- .../creditcard/CreditCardPaymentTestCase.java | 83 ----- .../wsdl/CreditCardPayment.wsdl | 116 ------ .../paymentprocess-contribution/log4j.properties | 36 -- .../paymentprocesstest.composite | 47 --- .../paymentprocess-contribution/pom.xml | 179 ---------- .../resources/CreditCardPayment.wsdl | 117 ------- .../resources/EmailGateway.wsdl | 89 ----- .../resources/META-INF/sca-contribution.xml | 23 -- .../resources/PaymentProcess.wsdl | 83 ----- .../resources/paymentprocess.bpel | 164 --------- .../resources/paymentprocess.componentType | 38 -- .../paymentprocess/PaymentProcessClientImpl.java | 38 -- .../paymentprocess/PaymentProcessTestCase.java | 76 ---- sandbox/travelsample/pom.xml | 34 +- .../META-INF/sca-contribution.xml | 26 -- sandbox/travelsample/scatours-contribution/pom.xml | 106 ------ .../src/scatours/SCAToursBooking.java | 32 -- .../src/scatours/SCAToursCart.java | 34 -- .../src/scatours/SCAToursImpl.java | 162 --------- .../src/scatours/SCAToursSearch.java | 32 -- .../META-INF/sca-contribution.xml | 22 ++ .../calendar-contribution/pom.xml | 57 +++ .../src/main/java/calendar/Calendar.java | 28 ++ .../src/main/java/calendar/CalendarImpl.java | 48 +++ .../src/main/resources/calendar.composite | 29 ++ .../src/test/java/calendar/CalendarTestCase.java | 47 +++ .../src/test/resources/calendar.composite | 29 ++ .../car-contribution/META-INF/sca-contribution.xml | 23 ++ .../shared-contributions/car-contribution/pom.xml | 76 ++++ .../car-contribution/src/scatours/car/CarImpl.java | 100 ++++++ .../car-contribution/src/scatours/car/CarInfo.java | 120 +++++++ .../META-INF/sca-contribution.xml | 22 ++ .../common-contribution/build.xml | 61 ++++ .../common-contribution/pom.xml | 57 +++ .../src/scatours/common/Book.java | 31 ++ .../src/scatours/common/Search.java | 35 ++ .../src/scatours/common/SearchCallback.java | 30 ++ .../src/scatours/common/TripItem.java | 220 ++++++++++++ .../src/scatours/common/TripLeg.java | 97 +++++ .../META-INF/sca-contribution.xml | 22 ++ .../currency-contribution/pom.xml | 63 ++++ .../currencyconverter/CurrencyConverter.java | 33 ++ .../currencyconverter/CurrencyConverterImpl.java | 54 +++ .../META-INF/sca-contribution.xml | 22 ++ .../emailgatewaytest.composite | 37 ++ .../emailgateway-contribution/pom.xml | 155 ++++++++ .../scatours/emailgateway/EmailGatewayImpl.java | 36 ++ .../emailgateway/EmailGatewayClientImpl.java | 38 ++ .../emailgateway/EmailGatewayTestCase.java | 81 +++++ .../wsdl/EmailGateway.wsdl | 89 +++++ .../META-INF/sca-contribution.xml | 23 ++ .../flight-contribution/pom.xml | 76 ++++ .../src/scatours/flight/FlightImpl.java | 127 +++++++ .../src/scatours/flight/FlightInfo.java | 142 ++++++++ .../META-INF/sca-contribution.xml | 23 ++ .../hotel-contribution/pom.xml | 76 ++++ .../src/scatours/hotel/HotelImpl.java | 116 ++++++ .../src/scatours/hotel/HotelInfo.java | 120 +++++++ .../META-INF/sca-contribution.xml | 25 ++ .../payment-contribution/creditcard.composite | 38 ++ .../payment-contribution/pom.xml | 155 ++++++++ .../creditcard/impl/CreditCardPaymentImpl.java | 46 +++ .../ws/impl/CreditCardPaymentWSImpl.java | 48 +++ .../creditcard/CreditCardPaymentTestCase.java | 85 +++++ .../wsdl/CreditCardPayment.wsdl | 116 ++++++ sandbox/travelsample/shared-contributions/pom.xml | 57 +++ .../META-INF/sca-contribution.xml | 26 ++ .../scatours-contribution/pom.xml | 106 ++++++ .../src/scatours/SCAToursBooking.java | 32 ++ .../src/scatours/SCAToursCart.java | 34 ++ .../src/scatours/SCAToursImpl.java | 162 +++++++++ .../src/scatours/SCAToursSearch.java | 32 ++ .../META-INF/sca-contribution.xml | 24 ++ .../shoppingcart-contribution/pom.xml | 88 +++++ .../src/scatours/shoppingcart/ShoppingCart.java | 39 +++ .../scatours/shoppingcart/ShoppingCartImpl.java | 89 +++++ .../META-INF/sca-contribution.xml | 24 ++ .../travelcatalog-contribution/pom.xml | 88 +++++ .../scatours/travelcatalog/TravelCatalogImpl.java | 137 ++++++++ .../travelcatalog/TravelCatalogSearch.java | 32 ++ .../META-INF/sca-contribution.xml | 23 ++ .../shared-contributions/trip-contribution/pom.xml | 76 ++++ .../src/scatours/trip/TripImpl.java | 106 ++++++ .../src/scatours/trip/TripInfo.java | 142 ++++++++ .../META-INF/sca-contribution.xml | 25 ++ .../tripbooking-contribution/build.xml | 61 ++++ .../tripbooking-contribution/pom.xml | 88 +++++ .../src/scatours/tripbooking/TripBooking.java | 36 ++ .../src/scatours/tripbooking/TripBookingImpl.java | 147 ++++++++ .../META-INF/sca-contribution.xml | 24 -- .../travelsample/shoppingcart-contribution/pom.xml | 88 ----- .../src/scatours/shoppingcart/ShoppingCart.java | 39 --- .../scatours/shoppingcart/ShoppingCartImpl.java | 89 ----- .../META-INF/sca-contribution.xml | 24 -- .../travelcatalog-contribution/pom.xml | 88 ----- .../scatours/travelcatalog/TravelCatalogImpl.java | 137 -------- .../travelcatalog/TravelCatalogSearch.java | 32 -- .../META-INF/sca-contribution.xml | 23 -- sandbox/travelsample/trip-contribution/pom.xml | 76 ---- .../src/scatours/trip/TripImpl.java | 106 ------ .../src/scatours/trip/TripInfo.java | 142 -------- .../META-INF/sca-contribution.xml | 25 -- .../tripbooking-contribution/build.xml | 61 ---- .../travelsample/tripbooking-contribution/pom.xml | 88 ----- .../src/scatours/tripbooking/TripBooking.java | 36 -- .../src/scatours/tripbooking/TripBookingImpl.java | 147 -------- .../ui-contribution/META-INF/sca-contribution.xml | 37 -- sandbox/travelsample/ui-contribution/build.xml | 108 ------ sandbox/travelsample/ui-contribution/pom.xml | 102 ------ .../ui-contribution/scatours.composite | 178 ---------- sandbox/travelsample/ui-contribution/scatours.html | 390 --------------------- sandbox/travelsample/ui-contribution/scatours.odg | Bin 11477 -> 0 bytes sandbox/travelsample/ui-contribution/scatours.png | Bin 11061 -> 0 bytes sandbox/travelsample/ui-contribution/style.css | 135 ------- 184 files changed, 7069 insertions(+), 7027 deletions(-) delete mode 100644 sandbox/travelsample/calendar-contribution/META-INF/sca-contribution.xml delete mode 100644 sandbox/travelsample/calendar-contribution/pom.xml delete mode 100644 sandbox/travelsample/calendar-contribution/src/main/java/calendar/Calendar.java delete mode 100644 sandbox/travelsample/calendar-contribution/src/main/java/calendar/CalendarImpl.java delete mode 100644 sandbox/travelsample/calendar-contribution/src/main/resources/calendar.composite delete mode 100644 sandbox/travelsample/calendar-contribution/src/test/java/calendar/CalendarTestCase.java delete mode 100644 sandbox/travelsample/calendar-contribution/src/test/resources/calendar.composite delete mode 100644 sandbox/travelsample/car-contribution/META-INF/sca-contribution.xml delete mode 100644 sandbox/travelsample/car-contribution/pom.xml delete mode 100644 sandbox/travelsample/car-contribution/src/scatours/car/CarImpl.java delete mode 100644 sandbox/travelsample/car-contribution/src/scatours/car/CarInfo.java create mode 100644 sandbox/travelsample/chapter-05/node/build.xml create mode 100644 sandbox/travelsample/chapter-05/node/pom.xml create mode 100644 sandbox/travelsample/chapter-05/node/src/scatours/LaunchNode.java create mode 100644 sandbox/travelsample/chapter-05/pom.xml create mode 100644 sandbox/travelsample/chapter-05/ui-contribution/META-INF/sca-contribution.xml create mode 100644 sandbox/travelsample/chapter-05/ui-contribution/build.xml create mode 100644 sandbox/travelsample/chapter-05/ui-contribution/pom.xml create mode 100644 sandbox/travelsample/chapter-05/ui-contribution/scatours.composite create mode 100644 sandbox/travelsample/chapter-05/ui-contribution/scatours.html create mode 100644 sandbox/travelsample/chapter-05/ui-contribution/scatours.odg create mode 100644 sandbox/travelsample/chapter-05/ui-contribution/scatours.png create mode 100644 sandbox/travelsample/chapter-05/ui-contribution/style.css create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/log4j.properties create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/paymentprocesstest.composite create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/pom.xml create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/CreditCardPayment.wsdl create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/EmailGateway.wsdl create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/META-INF/sca-contribution.xml create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/PaymentProcess.wsdl create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/paymentprocess.bpel create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/paymentprocess.componentType create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessClientImpl.java create mode 100644 sandbox/travelsample/chapter-06/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessTestCase.java delete mode 100644 sandbox/travelsample/common-contribution/META-INF/sca-contribution.xml delete mode 100644 sandbox/travelsample/common-contribution/build.xml delete mode 100644 sandbox/travelsample/common-contribution/pom.xml delete mode 100644 sandbox/travelsample/common-contribution/src/scatours/common/Book.java delete mode 100644 sandbox/travelsample/common-contribution/src/scatours/common/Search.java delete mode 100644 sandbox/travelsample/common-contribution/src/scatours/common/SearchCallback.java delete mode 100644 sandbox/travelsample/common-contribution/src/scatours/common/TripItem.java delete mode 100644 sandbox/travelsample/common-contribution/src/scatours/common/TripLeg.java delete mode 100644 sandbox/travelsample/currency-contribution/META-INF/sca-contribution.xml delete mode 100644 sandbox/travelsample/currency-contribution/pom.xml delete mode 100644 sandbox/travelsample/currency-contribution/src/scatours/currencyconverter/CurrencyConverter.java delete mode 100644 sandbox/travelsample/currency-contribution/src/scatours/currencyconverter/CurrencyConverterImpl.java delete mode 100644 sandbox/travelsample/emailgateway-contribution/META-INF/sca-contribution.xml delete mode 100644 sandbox/travelsample/emailgateway-contribution/emailgatewaytest.composite delete mode 100644 sandbox/travelsample/emailgateway-contribution/pom.xml delete mode 100644 sandbox/travelsample/emailgateway-contribution/src/scatours/emailgateway/EmailGatewayImpl.java delete mode 100644 sandbox/travelsample/emailgateway-contribution/test/scatours/emailgateway/EmailGatewayClientImpl.java delete mode 100644 sandbox/travelsample/emailgateway-contribution/test/scatours/emailgateway/EmailGatewayTestCase.java delete mode 100644 sandbox/travelsample/emailgateway-contribution/wsdl/EmailGateway.wsdl delete mode 100644 sandbox/travelsample/flight-contribution/META-INF/sca-contribution.xml delete mode 100644 sandbox/travelsample/flight-contribution/pom.xml delete mode 100644 sandbox/travelsample/flight-contribution/src/scatours/flight/FlightImpl.java delete mode 100644 sandbox/travelsample/flight-contribution/src/scatours/flight/FlightInfo.java delete mode 100644 sandbox/travelsample/hotel-contribution/META-INF/sca-contribution.xml delete mode 100644 sandbox/travelsample/hotel-contribution/pom.xml delete mode 100644 sandbox/travelsample/hotel-contribution/src/scatours/hotel/HotelImpl.java delete mode 100644 sandbox/travelsample/hotel-contribution/src/scatours/hotel/HotelInfo.java delete mode 100644 sandbox/travelsample/node/build.xml delete mode 100644 sandbox/travelsample/node/pom.xml delete mode 100644 sandbox/travelsample/node/src/scatours/LaunchNode.java delete mode 100644 sandbox/travelsample/payment-contribution/META-INF/sca-contribution.xml delete mode 100644 sandbox/travelsample/payment-contribution/creditcard.composite delete mode 100644 sandbox/travelsample/payment-contribution/pom.xml delete mode 100644 sandbox/travelsample/payment-contribution/src/payment/creditcard/impl/CreditCardPaymentImpl.java delete mode 100644 sandbox/travelsample/payment-contribution/src/payment/creditcard/ws/impl/CreditCardPaymentWSImpl.java delete mode 100644 sandbox/travelsample/payment-contribution/test/payment/creditcard/CreditCardPaymentTestCase.java delete mode 100644 sandbox/travelsample/payment-contribution/wsdl/CreditCardPayment.wsdl delete mode 100644 sandbox/travelsample/paymentprocess-contribution/log4j.properties delete mode 100644 sandbox/travelsample/paymentprocess-contribution/paymentprocesstest.composite delete mode 100644 sandbox/travelsample/paymentprocess-contribution/pom.xml delete mode 100644 sandbox/travelsample/paymentprocess-contribution/resources/CreditCardPayment.wsdl delete mode 100644 sandbox/travelsample/paymentprocess-contribution/resources/EmailGateway.wsdl delete mode 100644 sandbox/travelsample/paymentprocess-contribution/resources/META-INF/sca-contribution.xml delete mode 100644 sandbox/travelsample/paymentprocess-contribution/resources/PaymentProcess.wsdl delete mode 100644 sandbox/travelsample/paymentprocess-contribution/resources/paymentprocess.bpel delete mode 100644 sandbox/travelsample/paymentprocess-contribution/resources/paymentprocess.componentType delete mode 100644 sandbox/travelsample/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessClientImpl.java delete mode 100644 sandbox/travelsample/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessTestCase.java delete mode 100644 sandbox/travelsample/scatours-contribution/META-INF/sca-contribution.xml delete mode 100644 sandbox/travelsample/scatours-contribution/pom.xml delete mode 100644 sandbox/travelsample/scatours-contribution/src/scatours/SCAToursBooking.java delete mode 100644 sandbox/travelsample/scatours-contribution/src/scatours/SCAToursCart.java delete mode 100644 sandbox/travelsample/scatours-contribution/src/scatours/SCAToursImpl.java delete mode 100644 sandbox/travelsample/scatours-contribution/src/scatours/SCAToursSearch.java create mode 100644 sandbox/travelsample/shared-contributions/calendar-contribution/META-INF/sca-contribution.xml create mode 100644 sandbox/travelsample/shared-contributions/calendar-contribution/pom.xml create mode 100644 sandbox/travelsample/shared-contributions/calendar-contribution/src/main/java/calendar/Calendar.java create mode 100644 sandbox/travelsample/shared-contributions/calendar-contribution/src/main/java/calendar/CalendarImpl.java create mode 100644 sandbox/travelsample/shared-contributions/calendar-contribution/src/main/resources/calendar.composite create mode 100644 sandbox/travelsample/shared-contributions/calendar-contribution/src/test/java/calendar/CalendarTestCase.java create mode 100644 sandbox/travelsample/shared-contributions/calendar-contribution/src/test/resources/calendar.composite create mode 100644 sandbox/travelsample/shared-contributions/car-contribution/META-INF/sca-contribution.xml create mode 100644 sandbox/travelsample/shared-contributions/car-contribution/pom.xml create mode 100644 sandbox/travelsample/shared-contributions/car-contribution/src/scatours/car/CarImpl.java create mode 100644 sandbox/travelsample/shared-contributions/car-contribution/src/scatours/car/CarInfo.java create mode 100644 sandbox/travelsample/shared-contributions/common-contribution/META-INF/sca-contribution.xml create mode 100644 sandbox/travelsample/shared-contributions/common-contribution/build.xml create mode 100644 sandbox/travelsample/shared-contributions/common-contribution/pom.xml create mode 100644 sandbox/travelsample/shared-contributions/common-contribution/src/scatours/common/Book.java create mode 100644 sandbox/travelsample/shared-contributions/common-contribution/src/scatours/common/Search.java create mode 100644 sandbox/travelsample/shared-contributions/common-contribution/src/scatours/common/SearchCallback.java create mode 100644 sandbox/travelsample/shared-contributions/common-contribution/src/scatours/common/TripItem.java create mode 100644 sandbox/travelsample/shared-contributions/common-contribution/src/scatours/common/TripLeg.java create mode 100644 sandbox/travelsample/shared-contributions/currency-contribution/META-INF/sca-contribution.xml create mode 100644 sandbox/travelsample/shared-contributions/currency-contribution/pom.xml create mode 100644 sandbox/travelsample/shared-contributions/currency-contribution/src/scatours/currencyconverter/CurrencyConverter.java create mode 100644 sandbox/travelsample/shared-contributions/currency-contribution/src/scatours/currencyconverter/CurrencyConverterImpl.java create mode 100644 sandbox/travelsample/shared-contributions/emailgateway-contribution/META-INF/sca-contribution.xml create mode 100644 sandbox/travelsample/shared-contributions/emailgateway-contribution/emailgatewaytest.composite create mode 100644 sandbox/travelsample/shared-contributions/emailgateway-contribution/pom.xml create mode 100644 sandbox/travelsample/shared-contributions/emailgateway-contribution/src/scatours/emailgateway/EmailGatewayImpl.java create mode 100644 sandbox/travelsample/shared-contributions/emailgateway-contribution/test/scatours/emailgateway/EmailGatewayClientImpl.java create mode 100644 sandbox/travelsample/shared-contributions/emailgateway-contribution/test/scatours/emailgateway/EmailGatewayTestCase.java create mode 100644 sandbox/travelsample/shared-contributions/emailgateway-contribution/wsdl/EmailGateway.wsdl create mode 100644 sandbox/travelsample/shared-contributions/flight-contribution/META-INF/sca-contribution.xml create mode 100644 sandbox/travelsample/shared-contributions/flight-contribution/pom.xml create mode 100644 sandbox/travelsample/shared-contributions/flight-contribution/src/scatours/flight/FlightImpl.java create mode 100644 sandbox/travelsample/shared-contributions/flight-contribution/src/scatours/flight/FlightInfo.java create mode 100644 sandbox/travelsample/shared-contributions/hotel-contribution/META-INF/sca-contribution.xml create mode 100644 sandbox/travelsample/shared-contributions/hotel-contribution/pom.xml create mode 100644 sandbox/travelsample/shared-contributions/hotel-contribution/src/scatours/hotel/HotelImpl.java create mode 100644 sandbox/travelsample/shared-contributions/hotel-contribution/src/scatours/hotel/HotelInfo.java create mode 100644 sandbox/travelsample/shared-contributions/payment-contribution/META-INF/sca-contribution.xml create mode 100644 sandbox/travelsample/shared-contributions/payment-contribution/creditcard.composite create mode 100644 sandbox/travelsample/shared-contributions/payment-contribution/pom.xml create mode 100644 sandbox/travelsample/shared-contributions/payment-contribution/src/payment/creditcard/impl/CreditCardPaymentImpl.java create mode 100644 sandbox/travelsample/shared-contributions/payment-contribution/src/payment/creditcard/ws/impl/CreditCardPaymentWSImpl.java create mode 100644 sandbox/travelsample/shared-contributions/payment-contribution/test/payment/creditcard/CreditCardPaymentTestCase.java create mode 100644 sandbox/travelsample/shared-contributions/payment-contribution/wsdl/CreditCardPayment.wsdl create mode 100644 sandbox/travelsample/shared-contributions/pom.xml create mode 100644 sandbox/travelsample/shared-contributions/scatours-contribution/META-INF/sca-contribution.xml create mode 100644 sandbox/travelsample/shared-contributions/scatours-contribution/pom.xml create mode 100644 sandbox/travelsample/shared-contributions/scatours-contribution/src/scatours/SCAToursBooking.java create mode 100644 sandbox/travelsample/shared-contributions/scatours-contribution/src/scatours/SCAToursCart.java create mode 100644 sandbox/travelsample/shared-contributions/scatours-contribution/src/scatours/SCAToursImpl.java create mode 100644 sandbox/travelsample/shared-contributions/scatours-contribution/src/scatours/SCAToursSearch.java create mode 100644 sandbox/travelsample/shared-contributions/shoppingcart-contribution/META-INF/sca-contribution.xml create mode 100644 sandbox/travelsample/shared-contributions/shoppingcart-contribution/pom.xml create mode 100644 sandbox/travelsample/shared-contributions/shoppingcart-contribution/src/scatours/shoppingcart/ShoppingCart.java create mode 100644 sandbox/travelsample/shared-contributions/shoppingcart-contribution/src/scatours/shoppingcart/ShoppingCartImpl.java create mode 100644 sandbox/travelsample/shared-contributions/travelcatalog-contribution/META-INF/sca-contribution.xml create mode 100644 sandbox/travelsample/shared-contributions/travelcatalog-contribution/pom.xml create mode 100644 sandbox/travelsample/shared-contributions/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogImpl.java create mode 100644 sandbox/travelsample/shared-contributions/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogSearch.java create mode 100644 sandbox/travelsample/shared-contributions/trip-contribution/META-INF/sca-contribution.xml create mode 100644 sandbox/travelsample/shared-contributions/trip-contribution/pom.xml create mode 100644 sandbox/travelsample/shared-contributions/trip-contribution/src/scatours/trip/TripImpl.java create mode 100644 sandbox/travelsample/shared-contributions/trip-contribution/src/scatours/trip/TripInfo.java create mode 100644 sandbox/travelsample/shared-contributions/tripbooking-contribution/META-INF/sca-contribution.xml create mode 100644 sandbox/travelsample/shared-contributions/tripbooking-contribution/build.xml create mode 100644 sandbox/travelsample/shared-contributions/tripbooking-contribution/pom.xml create mode 100644 sandbox/travelsample/shared-contributions/tripbooking-contribution/src/scatours/tripbooking/TripBooking.java create mode 100644 sandbox/travelsample/shared-contributions/tripbooking-contribution/src/scatours/tripbooking/TripBookingImpl.java delete mode 100644 sandbox/travelsample/shoppingcart-contribution/META-INF/sca-contribution.xml delete mode 100644 sandbox/travelsample/shoppingcart-contribution/pom.xml delete mode 100644 sandbox/travelsample/shoppingcart-contribution/src/scatours/shoppingcart/ShoppingCart.java delete mode 100644 sandbox/travelsample/shoppingcart-contribution/src/scatours/shoppingcart/ShoppingCartImpl.java delete mode 100644 sandbox/travelsample/travelcatalog-contribution/META-INF/sca-contribution.xml delete mode 100644 sandbox/travelsample/travelcatalog-contribution/pom.xml delete mode 100644 sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogImpl.java delete mode 100644 sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogSearch.java delete mode 100644 sandbox/travelsample/trip-contribution/META-INF/sca-contribution.xml delete mode 100644 sandbox/travelsample/trip-contribution/pom.xml delete mode 100644 sandbox/travelsample/trip-contribution/src/scatours/trip/TripImpl.java delete mode 100644 sandbox/travelsample/trip-contribution/src/scatours/trip/TripInfo.java delete mode 100644 sandbox/travelsample/tripbooking-contribution/META-INF/sca-contribution.xml delete mode 100644 sandbox/travelsample/tripbooking-contribution/build.xml delete mode 100644 sandbox/travelsample/tripbooking-contribution/pom.xml delete mode 100644 sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBooking.java delete mode 100644 sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBookingImpl.java delete mode 100644 sandbox/travelsample/ui-contribution/META-INF/sca-contribution.xml delete mode 100644 sandbox/travelsample/ui-contribution/build.xml delete mode 100644 sandbox/travelsample/ui-contribution/pom.xml delete mode 100644 sandbox/travelsample/ui-contribution/scatours.composite delete mode 100644 sandbox/travelsample/ui-contribution/scatours.html delete mode 100644 sandbox/travelsample/ui-contribution/scatours.odg delete mode 100644 sandbox/travelsample/ui-contribution/scatours.png delete mode 100644 sandbox/travelsample/ui-contribution/style.css (limited to 'sandbox') diff --git a/sandbox/travelsample/calendar-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/calendar-contribution/META-INF/sca-contribution.xml deleted file mode 100644 index 327ce07643..0000000000 --- a/sandbox/travelsample/calendar-contribution/META-INF/sca-contribution.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/calendar-contribution/pom.xml b/sandbox/travelsample/calendar-contribution/pom.xml deleted file mode 100644 index ac4004355c..0000000000 --- a/sandbox/travelsample/calendar-contribution/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.5-SNAPSHOT - - - scatours-calendar-contribution - Apache Tuscany SCA Tours Calendar Contribution - - - - org.apache.tuscany.sca - tuscany-host-embedded - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 1.5-SNAPSHOT - runtime - - - - junit - junit - 4.5 - test - - - - - - ${artifactId} - - diff --git a/sandbox/travelsample/calendar-contribution/src/main/java/calendar/Calendar.java b/sandbox/travelsample/calendar-contribution/src/main/java/calendar/Calendar.java deleted file mode 100644 index 90736b92b4..0000000000 --- a/sandbox/travelsample/calendar-contribution/src/main/java/calendar/Calendar.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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 calendar; - -/** - * The Add service interface - */ -public interface Calendar { - - String getEndDate(String startDate, int duration); - -} diff --git a/sandbox/travelsample/calendar-contribution/src/main/java/calendar/CalendarImpl.java b/sandbox/travelsample/calendar-contribution/src/main/java/calendar/CalendarImpl.java deleted file mode 100644 index 343926da65..0000000000 --- a/sandbox/travelsample/calendar-contribution/src/main/java/calendar/CalendarImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 calendar; - -import java.text.DateFormat; -import java.util.Date; -import java.util.TimeZone; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Add service - */ -public class CalendarImpl implements Calendar { - - public String getEndDate(String startDate, int duration){ - String returnDate = "Invalid Date"; - - try { - Date date = DateFormat.getInstance().parse(startDate); - java.util.Calendar calendar = java.util.Calendar.getInstance(); - calendar.setTime(date); - calendar.add(java.util.Calendar.DATE, duration); - returnDate = DateFormat.getInstance().format(calendar.getTime()); - } catch (Exception ex){ - // do nothing - System.out.println(ex.toString()); - } - - return returnDate; - } -} diff --git a/sandbox/travelsample/calendar-contribution/src/main/resources/calendar.composite b/sandbox/travelsample/calendar-contribution/src/main/resources/calendar.composite deleted file mode 100644 index b72c450446..0000000000 --- a/sandbox/travelsample/calendar-contribution/src/main/resources/calendar.composite +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - diff --git a/sandbox/travelsample/calendar-contribution/src/test/java/calendar/CalendarTestCase.java b/sandbox/travelsample/calendar-contribution/src/test/java/calendar/CalendarTestCase.java deleted file mode 100644 index fee00fbb0a..0000000000 --- a/sandbox/travelsample/calendar-contribution/src/test/java/calendar/CalendarTestCase.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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 calendar; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -/** - * This shows how to test the Calculator service component. - */ -public class CalendarTestCase extends TestCase { - - private Calendar calendar; - private SCADomain scaDomain; - - @Override - protected void setUp() throws Exception { - scaDomain = SCADomain.newInstance("calendar.composite"); - calendar = scaDomain.getService(Calendar.class, "CalendarComponent"); - } - - @Override - protected void tearDown() throws Exception { - scaDomain.close(); - } - - public void testCalculator() throws Exception { - System.out.println(calendar.getEndDate("07/10/96 04:05", 3)); - } -} diff --git a/sandbox/travelsample/calendar-contribution/src/test/resources/calendar.composite b/sandbox/travelsample/calendar-contribution/src/test/resources/calendar.composite deleted file mode 100644 index b72c450446..0000000000 --- a/sandbox/travelsample/calendar-contribution/src/test/resources/calendar.composite +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - diff --git a/sandbox/travelsample/car-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/car-contribution/META-INF/sca-contribution.xml deleted file mode 100644 index f9c448e8ee..0000000000 --- a/sandbox/travelsample/car-contribution/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/car-contribution/pom.xml b/sandbox/travelsample/car-contribution/pom.xml deleted file mode 100644 index 06c29b25db..0000000000 --- a/sandbox/travelsample/car-contribution/pom.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.5-SNAPSHOT - - - scatours-car-contribution - Apache Tuscany SCA Tours Car Contribution - - - - org.apache.tuscany.sca - tuscany-sca-api - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-data-api - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - scatours-common-contribution - 1.5-SNAPSHOT - - - - junit - junit - 4.5 - test - - - - - - ${artifactId} - ${basedir}/src - - - ${basedir} - - **/*.java - **/.*/** - pom.xml - build.xml - target/** - src/** - - - - - diff --git a/sandbox/travelsample/car-contribution/src/scatours/car/CarImpl.java b/sandbox/travelsample/car-contribution/src/scatours/car/CarImpl.java deleted file mode 100644 index 059365a9ab..0000000000 --- a/sandbox/travelsample/car-contribution/src/scatours/car/CarImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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.car; - -import java.util.ArrayList; -import java.util.List; - -import org.osoa.sca.annotations.Callback; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -import scatours.common.Book; -import scatours.common.Search; -import scatours.common.SearchCallback; -import scatours.common.TripItem; -import scatours.common.TripLeg; - -/** - * An implementation of the Hotel service - */ -@Scope("STATELESS") -@Service(interfaces={Search.class, Book.class}) -public class CarImpl implements Search, Book { - - private List cars = new ArrayList(); - - @Callback - protected SearchCallback searchCallback; - - @Init - public void init() { - cars.add(new CarInfo("Premier Cars", - "BMW 5 Series", - "FLR", - "06/12/09", - "5", - 100.00, - "EUR", - "http://localhost:8085/tbd" )); - cars.add(new CarInfo("Premier Cars", - "Ford Focus", - "FLR", - "06/12/09", - "4", - 60.00, - "EUR", - "http://localhost:8085/tbd" )); - } - - public TripItem[] searchSynch(TripLeg tripLeg) { - List items = new ArrayList(); - - // find available hotels - for(CarInfo car : cars){ - if (car.getLocation().equals(tripLeg.getToLocation())){ - TripItem item = new TripItem("", - "", - TripItem.CAR, - car.getName(), - car.getDescription(), - car.getLocation(), - tripLeg.getFromDate(), - tripLeg.getToDate(), - car.getPricePerDay(), - car.getCurrency(), - car.getLink()); - items.add(item); - } - } - - return items.toArray(new TripItem[items.size()]); - } - - public void searchAsynch(TripLeg tripLeg) { - - // return available hotels - searchCallback.searchResults(searchSynch(tripLeg)); - } - - public String book(TripItem tripItem) { - return "car1"; - } -} diff --git a/sandbox/travelsample/car-contribution/src/scatours/car/CarInfo.java b/sandbox/travelsample/car-contribution/src/scatours/car/CarInfo.java deleted file mode 100644 index 2538c51e09..0000000000 --- a/sandbox/travelsample/car-contribution/src/scatours/car/CarInfo.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * 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.car; - - -public class CarInfo { - - private String name; - private String description; - private String location; - private String date; - private String seats; - private double pricePerDay; - private String currency; - private String link; - - public CarInfo() { - } - - public CarInfo(String name, - String description, - String location, - String date, - String seats, - double pricePerDay, - String currency, - String link) { - - this.name = name; - this.description = description; - this.location = location; - this.date = date; - this.seats = seats; - this.pricePerDay = pricePerDay; - this.currency = currency; - this.link = link; - } - - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getLocation() { - return location; - } - - public void setLocation(String location) { - this.location = location; - } - - public String getDate() { - return date; - } - - public void setDate(String date) { - this.date = date; - } - - public String getSeats() { - return seats; - } - - public void setSeats(String seats) { - this.seats = seats; - } - - public double getPricePerDay() { - return pricePerDay; - } - - public void setPricePerDay(double pricePerDay) { - this.pricePerDay = pricePerDay; - } - - public String getCurrency() { - return currency; - } - - public void setCurrency(String currency) { - this.currency = currency; - } - - public String getLink() { - return link; - } - - public void setLink(String link) { - this.link = link; - } -} diff --git a/sandbox/travelsample/chapter-01/pom.xml b/sandbox/travelsample/chapter-01/pom.xml index 64308ea187..0bd7127f06 100644 --- a/sandbox/travelsample/chapter-01/pom.xml +++ b/sandbox/travelsample/chapter-01/pom.xml @@ -26,7 +26,7 @@ scatours-chapter-01 - Apache Tuscany SCA Tours Chapter 01 + Apache Tuscany SCA Tours Chapter 01 Examples diff --git a/sandbox/travelsample/chapter-05/node/build.xml b/sandbox/travelsample/chapter-05/node/build.xml new file mode 100644 index 0000000000..a70be4e664 --- /dev/null +++ b/sandbox/travelsample/chapter-05/node/build.xml @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/travelsample/chapter-05/node/pom.xml b/sandbox/travelsample/chapter-05/node/pom.xml new file mode 100644 index 0000000000..d42e8b2fa6 --- /dev/null +++ b/sandbox/travelsample/chapter-05/node/pom.xml @@ -0,0 +1,178 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.5-SNAPSHOT + + + scatours-chapter-05-node + Apache Tuscany SCA Tours Chapter 05 Node + + + + org.apache.tuscany.sca + tuscany-node-api + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-node-launcher + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-domain-manager + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-node-runtime + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-widget-runtime + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-resource-runtime + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-atom-abdera + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jsonrpc-runtime + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-http-runtime + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-sca-axis2 + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ejb-runtime + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-ejb + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-bpel-ode + 1.5-SNAPSHOT + runtime + + + + org.apache.derby + derby + 10.3.1.4 + runtime + + + + + + ${artifactId} + ${basedir}/src + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + target/** + src/** + + + + + + org.apache.tuscany.sca + tuscany-maven-ant-generator + 1.5-SNAPSHOT + + + + launch.LaunchTutorialAdmin + + + generate + + + + + + + diff --git a/sandbox/travelsample/chapter-05/node/src/scatours/LaunchNode.java b/sandbox/travelsample/chapter-05/node/src/scatours/LaunchNode.java new file mode 100644 index 0000000000..777963c13e --- /dev/null +++ b/sandbox/travelsample/chapter-05/node/src/scatours/LaunchNode.java @@ -0,0 +1,66 @@ +/* + * 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.io.IOException; + +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.apache.tuscany.sca.node.launcher.NodeLauncher; + +public class LaunchNode { + public static void main(String[] args) throws Exception { + LaunchNode.launchFromFileSystemDir(); + } + + // OK for development but you must launch the node from this module + public static void launchFromFileSystemDir(){ + SCANode node = null; + + try { + node = SCANodeFactory.newInstance().createSCANode("scatours.composite", + new SCAContribution("common", "../../shared-contributions/common-contribution/target/classes"), + new SCAContribution("currency", "../../shared-contributions/currency-contribution/target/classes"), + new SCAContribution("hotel", "../../shared-contributions/hotel-contribution/target/classes"), + new SCAContribution("flight", "../../shared-contributions/flight-contribution/target/classes"), + new SCAContribution("car", "../../shared-contributions/car-contribution/target/classes"), + new SCAContribution("trip", "../../shared-contributions/trip-contribution/target/classes"), + new SCAContribution("tripbooking", "../../shared-contributions/tripbooking-contribution/target/classes"), + new SCAContribution("travelcatalog", "../../shared-contributions/travelcatalog-contribution/target/classes"), + new SCAContribution("payment", "../../shared-contributions/payment-contribution/target/classes"), + new SCAContribution("emailgateway", "../../shared-contributions/emailgateway-contribution/target/classes"), + new SCAContribution("shoppingcart", "../../shared-contributions/shoppingcart-contribution/target/classes"), + new SCAContribution("scatours", "../../shared-contributions/scatours-contribution/target/classes"), + new SCAContribution("ui", "../ui-contribution/target/classes")); + node.start(); + + System.out.println("Node started - Press enter to shutdown."); + try { + System.in.read(); + } catch (IOException e) {} + + node.stop(); + + } catch (Exception ex) { + System.out.println(ex.toString()); + } + } +} diff --git a/sandbox/travelsample/chapter-05/pom.xml b/sandbox/travelsample/chapter-05/pom.xml new file mode 100644 index 0000000000..8ea9d0f8cf --- /dev/null +++ b/sandbox/travelsample/chapter-05/pom.xml @@ -0,0 +1,46 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.4-SNAPSHOT + + + tuscany-scatours-chapter-05 + pom + Apache Tuscany SCA Tours Chapter 05 Examples + + + + default + + true + + + node + ui-contribution + + + + + + diff --git a/sandbox/travelsample/chapter-05/ui-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/chapter-05/ui-contribution/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..764030c28e --- /dev/null +++ b/sandbox/travelsample/chapter-05/ui-contribution/META-INF/sca-contribution.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/chapter-05/ui-contribution/build.xml b/sandbox/travelsample/chapter-05/ui-contribution/build.xml new file mode 100644 index 0000000000..0aa96f56de --- /dev/null +++ b/sandbox/travelsample/chapter-05/ui-contribution/build.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/travelsample/chapter-05/ui-contribution/pom.xml b/sandbox/travelsample/chapter-05/ui-contribution/pom.xml new file mode 100644 index 0000000000..e840ef994c --- /dev/null +++ b/sandbox/travelsample/chapter-05/ui-contribution/pom.xml @@ -0,0 +1,102 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.5-SNAPSHOT + + + scatours-chapter-05-ui-contribution + Apache Tuscany SCA Tours Chapter 05 User Interface Contribution + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.5-SNAPSHOT + test + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 1.5-SNAPSHOT + test + + + + org.apache.tuscany.sca + tuscany-host-tomcat + 1.5-SNAPSHOT + test + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + ${basedir}/src + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + target/** + src/** + + + + + + org.apache.tuscany.sca + tuscany-maven-ant-generator + 1.5-SNAPSHOT + + + + launch.LaunchTutorialAdmin + + + generate + + + + + + + diff --git a/sandbox/travelsample/chapter-05/ui-contribution/scatours.composite b/sandbox/travelsample/chapter-05/ui-contribution/scatours.composite new file mode 100644 index 0000000000..53fac26d3e --- /dev/null +++ b/sandbox/travelsample/chapter-05/ui-contribution/scatours.composite @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GBP + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/travelsample/chapter-05/ui-contribution/scatours.html b/sandbox/travelsample/chapter-05/ui-contribution/scatours.html new file mode 100644 index 0000000000..f4206548c0 --- /dev/null +++ b/sandbox/travelsample/chapter-05/ui-contribution/scatours.html @@ -0,0 +1,390 @@ + + + +SCA Tours + + + + + + + + + + + +
+
+

Search for trips, hotels, flights and cars

+
+ + + + + + + + + + + + + + + + + +
From Location:To Location:
Start Date:End Date:
Number of people: + +
+
+ +
+
+
+
+
+
+
+
+

Shopping Cart

+
+
+ Total Price:
+
+ +
+
+ + + diff --git a/sandbox/travelsample/chapter-05/ui-contribution/scatours.odg b/sandbox/travelsample/chapter-05/ui-contribution/scatours.odg new file mode 100644 index 0000000000..8ca8fbf133 Binary files /dev/null and b/sandbox/travelsample/chapter-05/ui-contribution/scatours.odg differ diff --git a/sandbox/travelsample/chapter-05/ui-contribution/scatours.png b/sandbox/travelsample/chapter-05/ui-contribution/scatours.png new file mode 100644 index 0000000000..f68cd84704 Binary files /dev/null and b/sandbox/travelsample/chapter-05/ui-contribution/scatours.png differ diff --git a/sandbox/travelsample/chapter-05/ui-contribution/style.css b/sandbox/travelsample/chapter-05/ui-contribution/style.css new file mode 100644 index 0000000000..6e17c2747b --- /dev/null +++ b/sandbox/travelsample/chapter-05/ui-contribution/style.css @@ -0,0 +1,135 @@ +/* + * 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. + */ + + + +/*******************************************/ + +p,table,li,h1,h2,h3 +{ +font-family: verdana, arial, 'sans serif'; +} + +p, h1, h2, h3, table, li, hr +{ +margin-left: 10pt; +} + +table +{ +border-color: black; +border-collapse: separate; +border-spacing: 0px 1px; + +margin-right: 10pt; +margin-left: 10pt; +width: 800px; +} + +.sourceDetailsTable +{ +width: 600px; +} + +tr, td +{ +margin-left: 0pt; +margin-right: 0pt; +padding-left: 10pt; +font-size: 90%; +} + +p,li,th +{ +font-size: 90%; +margin-left: 10pt; +} + +pre +{ +margin-left: 10pt; +} + +body +{ +#ffffff; +} + +h1,h2,h3,hr +{ +color: firebrick; +} + +a:link {COLOR: firebrick;} +a:visited {COLOR: firebrick;} +a:active {COLOR: navy;} + +.link +{ +COLOR: firebrick; +text-decoration: underline; +} + +.clickable +{ +cursor: pointer +} + +.unread_title +{ +font-weight: bold; +} + +.read_title +{ +font-weight: normal; +} + +.summary +{ +color: DimGrey; +} + +.hidden +{ +display: none; +} + +.source_name +{ +width: 600px; +} + +.alert_text +{ +width: 600px; +} + +.alert_data +{ +margin-left: 10px; +width: 800px; +height: 800px; +} + +.source_0 +{ +background-color: LightGreen; +} + diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/log4j.properties b/sandbox/travelsample/chapter-06/paymentprocess-contribution/log4j.properties new file mode 100644 index 0000000000..7ed0bcaf77 --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/log4j.properties @@ -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. +# + +# Set root logger level to WARN and its only appender to CONSOLE +log4j.rootLogger=OFF, CONSOLE + +# log4j properties to work with commandline tools. +log4j.category.org.mortbay=OFF +log4j.category.org.hibernate.type=OFF +log4j.category.org.objectweb=OFF +log4j.category.org.apache.ode.axis2=OFF +log4j.category.org.apache.ode.bpel.engine=DEBUG +log4j.category.org.apache.ode.daohib.bpel.CorrelatorDaoImpl=OFF +log4j.category.org.apache.ode.bpel.epr=OFF +log4j.category.org.apache.tuscany.sca.implementation.bpel=DEBUG +log4j.category.org.apache.tuscany.sca.implementation.bpel.ode=DEBUG +log4j.category.org.apache.tuscany.sca.implementation.bpel.provider=DEBUG + +# Console appender +log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender +log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout +log4j.appender.CONSOLE.layout.ConversionPattern=[%p] - %C{1}.%M(%L) | %m%n diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/paymentprocesstest.composite b/sandbox/travelsample/chapter-06/paymentprocess-contribution/paymentprocesstest.composite new file mode 100644 index 0000000000..f45dc01a57 --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/paymentprocesstest.composite @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/pom.xml b/sandbox/travelsample/chapter-06/paymentprocess-contribution/pom.xml new file mode 100644 index 0000000000..c1a9712a66 --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/pom.xml @@ -0,0 +1,179 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.5-SNAPSHOT + + + scatours-paymentprocess-contribution + Apache Tuscany SCA Tours Payment Process Contribution + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-bpel-ode + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + 1.5-SNAPSHOT + runtime + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + ${basedir}/src + ${basedir}/test + + + ${basedir}/resources + + + + + ${basedir}/resources + + + ${basedir} + + *.composite + *.properties + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.9 + + + wsimport + generate-sources + + wsimport + + + scatours.paymentprocess + ${basedir}/resources + + + PaymentProcess.wsdl + + ${project.build.directory}/jaxws-source + + false + true + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + 2.3.1 + + false + false + true + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + test-compile + + unpack + + + + + org.apache.ode + ode-dao-jpa-ojpa-derby + 1.1 + zip + true + ${project.build.directory}/test-classes/ + + + + + + + + + diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/CreditCardPayment.wsdl b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/CreditCardPayment.wsdl new file mode 100644 index 0000000000..a90c73cdfb --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/CreditCardPayment.wsdl @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/EmailGateway.wsdl b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/EmailGateway.wsdl new file mode 100644 index 0000000000..d9a5e36bc0 --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/EmailGateway.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/META-INF/sca-contribution.xml b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..8146abbceb --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/PaymentProcess.wsdl b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/PaymentProcess.wsdl new file mode 100644 index 0000000000..c4157cf475 --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/PaymentProcess.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/paymentprocess.bpel b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/paymentprocess.bpel new file mode 100644 index 0000000000..08c6b8f636 --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/paymentprocess.bpel @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Visa + 12345678 + 2 + 2010 + + Empty +
+ 1 The Road + Winchester + Hampshire + AB1 2CD + 12345678 +
+
+
+ 0.0 +
+
+
+ $authorizeRequestMessage.parameters +
+ + $makePaymentRequestMessage.parameters/CustomerId/text() + $authorizeRequestMessage.parameters/CreditCard/CardOwner/Name + + + $makePaymentRequestMessage.parameters/Amount/text() + $authorizeRequestMessage.parameters/Amount + +
+ + + + + + + + + + + Default + Payment Confirmation + Your payment has been confirmed + + + + + $sendEmailRequestMessage.parameters + + + $makePaymentRequestMessage.parameters/CustomerId/text() + $sendEmailRequestMessage.parameters/Email/To + + + + + + + + + + + + + OK + + + + $makePaymentResponseMessage.parameters + + + + + + +
+
diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/paymentprocess.componentType b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/paymentprocess.componentType new file mode 100644 index 0000000000..ecc2f55a47 --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/resources/paymentprocess.componentType @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessClientImpl.java b/sandbox/travelsample/chapter-06/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessClientImpl.java new file mode 100644 index 0000000000..8d9c2f918c --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessClientImpl.java @@ -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.paymentprocess; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * + */ +@Service(PaymentProcess.class) +public class PaymentProcessClientImpl implements PaymentProcess { + @Reference + protected PaymentProcess paymentProcess; + + public String makePayment(String customerId, float amount) { + // Delegate the external web service + return paymentProcess.makePayment(customerId, amount); + } + +} diff --git a/sandbox/travelsample/chapter-06/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessTestCase.java b/sandbox/travelsample/chapter-06/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessTestCase.java new file mode 100644 index 0000000000..f1b4bc6aba --- /dev/null +++ b/sandbox/travelsample/chapter-06/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessTestCase.java @@ -0,0 +1,76 @@ +/* + * 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.paymentprocess; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +/** + * + */ +public class PaymentProcessTestCase { + private static SCANode node; + + /** + * @throws java.lang.Exception + */ + @BeforeClass + public static void setUpBeforeClass() throws Exception { + SCANodeFactory factory = SCANodeFactory.newInstance(); + node = factory.createSCANodeFromClassLoader("paymentprocesstest.composite", PaymentProcess.class.getClassLoader()); + node.start(); + } + + @Test + @Ignore + public void testPaymentProcess() { + SCAClient client = (SCAClient) node; + PaymentProcess pp = client.getService(PaymentProcess.class, "PaymentProcessClient"); + System.out.println("Result = " + pp.makePayment("Fred", 100.00f)); + } + + @Test + //@Ignore + public void testWaitForInput() { + System.out.println("Press a key to end"); + try { + System.in.read(); + } catch (Exception ex) { + } + System.out.println("Shutting down"); + } + + /** + * @throws java.lang.Exception + */ + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (node != null) { + node.stop(); + node = null; + } + } + +} diff --git a/sandbox/travelsample/common-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/common-contribution/META-INF/sca-contribution.xml deleted file mode 100644 index c2b9fd12c7..0000000000 --- a/sandbox/travelsample/common-contribution/META-INF/sca-contribution.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/common-contribution/build.xml b/sandbox/travelsample/common-contribution/build.xml deleted file mode 100644 index b4fbc726cf..0000000000 --- a/sandbox/travelsample/common-contribution/build.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/travelsample/common-contribution/pom.xml b/sandbox/travelsample/common-contribution/pom.xml deleted file mode 100644 index e0b024b666..0000000000 --- a/sandbox/travelsample/common-contribution/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.5-SNAPSHOT - - - scatours-common-contribution - Apache Tuscany SCA Tours Common Artefacts Contribution - - - - org.apache.tuscany.sca - tuscany-sca-api - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-data-api - 1.5-SNAPSHOT - - - - junit - junit - 4.5 - test - - - - - - ${artifactId} - ${basedir}/src - - diff --git a/sandbox/travelsample/common-contribution/src/scatours/common/Book.java b/sandbox/travelsample/common-contribution/src/scatours/common/Book.java deleted file mode 100644 index f42db4341b..0000000000 --- a/sandbox/travelsample/common-contribution/src/scatours/common/Book.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.common; - -import java.util.List; - -import org.osoa.sca.annotations.Callback; -import org.osoa.sca.annotations.OneWay; -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface Book { - String book(TripItem tripItem); -} diff --git a/sandbox/travelsample/common-contribution/src/scatours/common/Search.java b/sandbox/travelsample/common-contribution/src/scatours/common/Search.java deleted file mode 100644 index 705753972e..0000000000 --- a/sandbox/travelsample/common-contribution/src/scatours/common/Search.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.common; - -import java.util.List; - -import org.osoa.sca.annotations.Callback; -import org.osoa.sca.annotations.OneWay; -import org.osoa.sca.annotations.Remotable; - -@Remotable -@Callback(SearchCallback.class) -public interface Search { - TripItem[] searchSynch(TripLeg tripLeg); - - @OneWay - void searchAsynch(TripLeg tripLeg); -} diff --git a/sandbox/travelsample/common-contribution/src/scatours/common/SearchCallback.java b/sandbox/travelsample/common-contribution/src/scatours/common/SearchCallback.java deleted file mode 100644 index 4bc88fd623..0000000000 --- a/sandbox/travelsample/common-contribution/src/scatours/common/SearchCallback.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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.common; - -import java.util.List; - -import org.apache.tuscany.sca.data.collection.Item; -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface SearchCallback { - void searchResults(TripItem[] items); -} diff --git a/sandbox/travelsample/common-contribution/src/scatours/common/TripItem.java b/sandbox/travelsample/common-contribution/src/scatours/common/TripItem.java deleted file mode 100644 index e991668cbc..0000000000 --- a/sandbox/travelsample/common-contribution/src/scatours/common/TripItem.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - * 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.common; - -import java.util.List; - - -public class TripItem { - - public static String FLIGHT = "Flight"; - public static String HOTEL = "Hotel"; - public static String CAR = "Car"; - public static String TRIP = "Trip"; - - private String id; - private String tripId; - private String type; - private String name; - private String description; - private String location; - private String fromDate; - private String toDate; - private double price; - private String currency; - private String link; - private TripItem[] tripItems; // used for a trip made up of trip items - private String customerDetails; - private String agentDetails; - private String bookingCode; - - public TripItem() { - } - - public TripItem(TripItem item) { - this.id = item.getId(); - this.tripId = item.getTripId(); - this.type = item.getType(); - this.name = item.getName(); - this.description = item.getDescription(); - this.location = item.getLocation(); - this.fromDate = item.getFromDate(); - this.toDate = item.getToDate(); - this.price = item.getPrice(); - this.currency = item.getCurrency(); - this.link = item.getLink(); - } - - public TripItem(String id, - String tripId, - String type, - String name, - String description, - String location, - String fromDate, - String toDate, - double price, - String currency, - String link) { - this.id = id; - this.tripId = tripId; - this.type = type; - this.name = name; - this.description = description; - this.location = location; - this.fromDate = fromDate; - this.toDate = toDate; - this.price = price; - this.currency = currency; - this.link = link; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTripId() { - return tripId; - } - - public void setTripId(String tripId) { - this.tripId = tripId; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getLocation() { - return location; - } - - public void setLocation(String location) { - this.location = location; - } - - public String getFromDate() { - return fromDate; - } - - public void setFromDate(String fromDate) { - this.fromDate = fromDate; - } - - public String getToDate() { - return toDate; - } - - public void setToDate(String toDate) { - this.toDate = toDate; - } - - public double getPrice() { - return price; - } - - public void setPrice(double price) { - this.price = price; - } - - public String getCurrency() { - return currency; - } - - public void setCurrency(String currency) { - this.currency = currency; - } - - public String getLink() { - return link; - } - - public void setLink(String link) { - this.link = link; - } - - public TripItem[] getTripItems() { - return tripItems; - } - - public void setTripItems(TripItem[] tripItems) { - this.tripItems = tripItems; - } - - public String getCustomerDetails() { - return customerDetails; - } - - public void setCustomerDetails(String customerDetails) { - this.customerDetails = customerDetails; - } - - public String getAgentDetails() { - return agentDetails; - } - - public void setAgentDetails(String agentDetails) { - this.agentDetails = agentDetails; - } - - public String getBookingCode() { - return bookingCode; - } - - public void setBookingCode(String bookingCode) { - this.bookingCode = bookingCode; - } - - @Override - public boolean equals(Object obj) { - - if (obj instanceof TripItem){ - if (((TripItem)obj).getId().equals(getId())){ - return true; - } - } - - return super.equals(obj); - } -} diff --git a/sandbox/travelsample/common-contribution/src/scatours/common/TripLeg.java b/sandbox/travelsample/common-contribution/src/scatours/common/TripLeg.java deleted file mode 100644 index 1af33aa6f9..0000000000 --- a/sandbox/travelsample/common-contribution/src/scatours/common/TripLeg.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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.common; - - -public class TripLeg { - - private String id; - private String fromLocation; - private String toLocation; - private String fromDate; - private String toDate; - private String noOfPeople; - - - public TripLeg() { - } - - public TripLeg(String id, - String fromLocation, - String toLocation, - String fromDate, - String toDate, - String noOfPeople) { - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getFromLocation() { - return fromLocation; - } - - public void setFromLocation(String fromLocation) { - this.fromLocation = fromLocation; - } - - public String getToLocation() { - return toLocation; - } - - public void setToLocation(String toLocation) { - this.toLocation = toLocation; - } - - public String getFromDate() { - return fromDate; - } - - public void setFromDate(String fromDate) { - this.fromDate = fromDate; - } - - public String getToDate() { - return toDate; - } - - public void setToDate(String toDate) { - this.toDate = toDate; - } - - public String getNoOfPeople() { - return noOfPeople; - } - - public void setNoOfPeople(String noOfPeople) { - this.noOfPeople = noOfPeople; - } - - - - - - -} diff --git a/sandbox/travelsample/currency-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/currency-contribution/META-INF/sca-contribution.xml deleted file mode 100644 index 549a3bc7a3..0000000000 --- a/sandbox/travelsample/currency-contribution/META-INF/sca-contribution.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/currency-contribution/pom.xml b/sandbox/travelsample/currency-contribution/pom.xml deleted file mode 100644 index 738c3d7f61..0000000000 --- a/sandbox/travelsample/currency-contribution/pom.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.5-SNAPSHOT - - - scatours-currency-contribution - Apache Tuscany SCA Tours Currency Converter Contribution - - - - org.apache.tuscany.sca - tuscany-host-embedded - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 1.5-SNAPSHOT - runtime - - - - junit - junit - 4.5 - test - - - - - - ${artifactId} - ${basedir}/src - - - ${basedir}/resources - - - - diff --git a/sandbox/travelsample/currency-contribution/src/scatours/currencyconverter/CurrencyConverter.java b/sandbox/travelsample/currency-contribution/src/scatours/currencyconverter/CurrencyConverter.java deleted file mode 100644 index 9b3851721f..0000000000 --- a/sandbox/travelsample/currency-contribution/src/scatours/currencyconverter/CurrencyConverter.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.currencyconverter; - -/** - * The CurrencyConverter service interface - */ -public interface CurrencyConverter { - - double getExchangeRate(String fromCurrencyCode, - String toCurrencyCode); - - double convert(String fromCurrencyCode, - String toCurrencyCode, - double amount); - -} diff --git a/sandbox/travelsample/currency-contribution/src/scatours/currencyconverter/CurrencyConverterImpl.java b/sandbox/travelsample/currency-contribution/src/scatours/currencyconverter/CurrencyConverterImpl.java deleted file mode 100644 index eddc59f555..0000000000 --- a/sandbox/travelsample/currency-contribution/src/scatours/currencyconverter/CurrencyConverterImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.currencyconverter; - -import java.util.HashMap; -import java.util.Map; - -import org.osoa.sca.annotations.Service; - -/** - * An implementation of the CurrencyConverter service - */ -@Service(interfaces={CurrencyConverter.class}) -public class CurrencyConverterImpl implements CurrencyConverter { - - // currency index - private Map currencyIndex = new HashMap(); - - // exchange rates - private final double rates [][] = {{ 1.00, 0.50, 0.66 }, - { 2.00, 1.00, 1.33 }, - { 1.50, 0.75, 1.00 } } ; - - public CurrencyConverterImpl(){ - currencyIndex.put("USD", new Integer(0)); - currencyIndex.put("GBP", new Integer(1)); - currencyIndex.put("EUR", new Integer(2)); - } - - public double getExchangeRate(String fromCurrencyCode, String toCurrencyCode){ - return rates[currencyIndex.get(fromCurrencyCode).intValue()] - [currencyIndex.get(toCurrencyCode).intValue()]; - } - - public double convert(String fromCurrencyCode, String toCurrencyCode, double amount){ - return amount * getExchangeRate(fromCurrencyCode, toCurrencyCode); - } -} diff --git a/sandbox/travelsample/emailgateway-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/emailgateway-contribution/META-INF/sca-contribution.xml deleted file mode 100644 index d77df2fd7e..0000000000 --- a/sandbox/travelsample/emailgateway-contribution/META-INF/sca-contribution.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/emailgateway-contribution/emailgatewaytest.composite b/sandbox/travelsample/emailgateway-contribution/emailgatewaytest.composite deleted file mode 100644 index 5be71b4d66..0000000000 --- a/sandbox/travelsample/emailgateway-contribution/emailgatewaytest.composite +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/emailgateway-contribution/pom.xml b/sandbox/travelsample/emailgateway-contribution/pom.xml deleted file mode 100644 index 118a06d942..0000000000 --- a/sandbox/travelsample/emailgateway-contribution/pom.xml +++ /dev/null @@ -1,155 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.5-SNAPSHOT - - - scatours-emailgateway-contribution - Apache Tuscany SCA Tours Email Gateway Contribution - - - - org.apache.tuscany.sca - tuscany-host-embedded - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-jsonrpc-runtime - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-ws-axis2 - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-host-jetty - 1.5-SNAPSHOT - runtime - - - - junit - junit - 4.5 - test - - - - - ${artifactId} - ${basedir}/src - ${basedir}/test - - - ${basedir} - - **/*.java - **/.*/** - pom.xml - build.xml - target/** - src/** - test/** - *.composite - - - - - - ${basedir} - - **/*.java - **/.*/** - pom.xml - build.xml - target/** - src/** - test/** - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.0 - - - add-source - generate-sources - - add-source - - - - target/jaxws-source - - - - - - - org.codehaus.mojo - jaxws-maven-plugin - 1.9 - - - wsimport - generate-sources - - wsimport - - - scatours.emailgateway - ${basedir}/wsdl - - - EmailGateway.wsdl - - ${project.build.directory}/jaxws-source - - false - true - - - - - - - diff --git a/sandbox/travelsample/emailgateway-contribution/src/scatours/emailgateway/EmailGatewayImpl.java b/sandbox/travelsample/emailgateway-contribution/src/scatours/emailgateway/EmailGatewayImpl.java deleted file mode 100644 index 6e971c3267..0000000000 --- a/sandbox/travelsample/emailgateway-contribution/src/scatours/emailgateway/EmailGatewayImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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.emailgateway; - -import org.osoa.sca.annotations.Service; - - -/** - * - */ -@Service(EmailGateway.class) -public class EmailGatewayImpl implements EmailGateway { - - public String sendEmail(EmailType email) { - System.out.println("Sending mail to " + email.getTo()); - return "SENT"; - } - -} diff --git a/sandbox/travelsample/emailgateway-contribution/test/scatours/emailgateway/EmailGatewayClientImpl.java b/sandbox/travelsample/emailgateway-contribution/test/scatours/emailgateway/EmailGatewayClientImpl.java deleted file mode 100644 index a6b76c525f..0000000000 --- a/sandbox/travelsample/emailgateway-contribution/test/scatours/emailgateway/EmailGatewayClientImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.emailgateway; - -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Service; - -/** - * - */ -@Service(EmailGateway.class) -public class EmailGatewayClientImpl implements EmailGateway { - @Reference - protected EmailGateway emailGateway; - - public String sendEmail(EmailType email) { - // Delegate the external web service - return emailGateway.sendEmail(email); - } - -} diff --git a/sandbox/travelsample/emailgateway-contribution/test/scatours/emailgateway/EmailGatewayTestCase.java b/sandbox/travelsample/emailgateway-contribution/test/scatours/emailgateway/EmailGatewayTestCase.java deleted file mode 100644 index 00cca75f0e..0000000000 --- a/sandbox/travelsample/emailgateway-contribution/test/scatours/emailgateway/EmailGatewayTestCase.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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.emailgateway; - -import org.apache.tuscany.sca.node.SCAClient; -import org.apache.tuscany.sca.node.SCANode; -import org.apache.tuscany.sca.node.SCANodeFactory; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; - -/** - * - */ -public class EmailGatewayTestCase { - private static SCANode node; - - /** - * @throws java.lang.Exception - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception { - SCANodeFactory factory = SCANodeFactory.newInstance(); - node = factory.createSCANodeFromClassLoader("emailgatewaytest.composite", EmailGateway.class.getClassLoader()); - node.start(); - } - - @Test - public void testEmailGateway() { - SCAClient client = (SCAClient) node; - EmailGateway cc = client.getService(EmailGateway.class, "EmailGatewayClient"); - ObjectFactory objectFactory = new ObjectFactory(); - EmailType email = objectFactory.createEmailType(); - email.setTo("Fred"); - email.setTitle("An email"); - email.setBody("A message"); - System.out.println(cc.sendEmail(email)); - } - - @Test - //@Ignore - public void testWaitForInput() { - System.out.println("Press a key to end"); - try { - System.in.read(); - } catch (Exception ex) { - } - System.out.println("Shutting down"); - } - - /** - * @throws java.lang.Exception - */ - @AfterClass - public static void tearDownAfterClass() throws Exception { - if (node != null) { - node.stop(); - node = null; - } - } - -} diff --git a/sandbox/travelsample/emailgateway-contribution/wsdl/EmailGateway.wsdl b/sandbox/travelsample/emailgateway-contribution/wsdl/EmailGateway.wsdl deleted file mode 100644 index c103ad947d..0000000000 --- a/sandbox/travelsample/emailgateway-contribution/wsdl/EmailGateway.wsdl +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/flight-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/flight-contribution/META-INF/sca-contribution.xml deleted file mode 100644 index 394be817a9..0000000000 --- a/sandbox/travelsample/flight-contribution/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/flight-contribution/pom.xml b/sandbox/travelsample/flight-contribution/pom.xml deleted file mode 100644 index 8782ab83d3..0000000000 --- a/sandbox/travelsample/flight-contribution/pom.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.5-SNAPSHOT - - - scatours-flight-contribution - Apache Tuscany SCA Tours Flight Contribution - - - - org.apache.tuscany.sca - tuscany-sca-api - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-data-api - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - scatours-common-contribution - 1.5-SNAPSHOT - - - - junit - junit - 4.5 - test - - - - - - ${artifactId} - ${basedir}/src - - - ${basedir} - - **/*.java - **/.*/** - pom.xml - build.xml - target/** - src/** - - - - - diff --git a/sandbox/travelsample/flight-contribution/src/scatours/flight/FlightImpl.java b/sandbox/travelsample/flight-contribution/src/scatours/flight/FlightImpl.java deleted file mode 100644 index 72c1c7201c..0000000000 --- a/sandbox/travelsample/flight-contribution/src/scatours/flight/FlightImpl.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * 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.flight; - -import java.util.ArrayList; -import java.util.List; - -import org.osoa.sca.annotations.Callback; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -import scatours.common.Book; -import scatours.common.Search; -import scatours.common.SearchCallback; -import scatours.common.TripItem; -import scatours.common.TripLeg; - -/** - * An implementation of the Hotel service - */ -@Scope("STATELESS") -@Service(interfaces={Search.class, Book.class}) -public class FlightImpl implements Search, Book { - - private List flights = new ArrayList(); - - @Callback - protected SearchCallback searchCallback; - - @Init - public void init() { - flights.add(new FlightInfo("EA26", - "Europe Airlines Airbus A300", - "LGW", - "FLR", - "06/12/09", - "06/12/09", - "350", - 250, - "EUR", - "http://localhost:8085/tbd" )); - flights.add(new FlightInfo("EA27", - "Europe Airlines Airbus A300", - "FLR", - "LGW", - "13/12/09", - "13/12/09", - "350", - 250, - "EUR", - "http://localhost:8085/tbd" )); - - } - - public TripItem[] searchSynch(TripLeg tripLeg) { - List items = new ArrayList(); - - // find outbound leg - for(FlightInfo flight : flights){ - if ((flight.getFromLocation().equals(tripLeg.getFromLocation())) && - (flight.getToLocation().equals(tripLeg.getToLocation())) && - (flight.getFromDate().equals(tripLeg.getFromDate()))){ - TripItem item = new TripItem("", - "", - TripItem.FLIGHT, - flight.getName(), - flight.getDescription(), - flight.getFromLocation() + " - " + flight.getToLocation(), - flight.getFromDate(), - flight.getToDate(), - flight.getPricePerSeat(), - flight.getCurrency(), - flight.getLink()); - items.add(item); - } - } - - // find return leg - for(FlightInfo flight : flights){ - if ((flight.getFromLocation().equals(tripLeg.getToLocation())) && - (flight.getToLocation().equals(tripLeg.getFromLocation())) && - (flight.getFromDate().equals(tripLeg.getToDate()))){ - TripItem item = new TripItem("", - "", - TripItem.FLIGHT, - flight.getName(), - flight.getDescription(), - flight.getFromLocation() + " - " + flight.getToLocation(), - flight.getFromDate(), - tripLeg.getToDate(), - flight.getPricePerSeat(), - flight.getCurrency(), - flight.getLink()); - items.add(item); - } - } - - return items.toArray(new TripItem[items.size()]); - } - - public void searchAsynch(TripLeg tripLeg) { - - // return available hotels - searchCallback.searchResults(searchSynch(tripLeg)); - } - - public String book(TripItem tripItem) { - return "flight1"; - } -} diff --git a/sandbox/travelsample/flight-contribution/src/scatours/flight/FlightInfo.java b/sandbox/travelsample/flight-contribution/src/scatours/flight/FlightInfo.java deleted file mode 100644 index fb5fb9fef5..0000000000 --- a/sandbox/travelsample/flight-contribution/src/scatours/flight/FlightInfo.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * 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.flight; - - -public class FlightInfo { - - private String name; - private String description; - private String fromLocation; - private String toLocation; - private String fromDate; - private String toDate; - private String seats; - private double pricePerSeat; - private String currency; - private String link; - - public FlightInfo() { - } - - public FlightInfo(String name, - String description, - String fromLocation, - String toLocation, - String fromDate, - String toDate, - String seats, - double pricePerSeat, - String currency, - String link) { - - - this.name = name; - this.description = description; - this.fromLocation = fromLocation; - this.toLocation = toLocation; - this.fromDate = fromDate; - this.toDate = toDate; - this.seats = seats; - this.pricePerSeat = pricePerSeat; - this.currency = currency; - this.link = link; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getFromLocation() { - return fromLocation; - } - - public void setFromLocation(String fromLocation) { - this.fromLocation = fromLocation; - } - - public String getToLocation() { - return toLocation; - } - - public void setToLocation(String toLocation) { - this.toLocation = toLocation; - } - - public String getFromDate() { - return fromDate; - } - - public void setFromDate(String fromDate) { - this.fromDate = fromDate; - } - - public String getToDate() { - return toDate; - } - - public void setToDate(String toDate) { - this.toDate = toDate; - } - - public String getSeats() { - return seats; - } - - public void setSeats(String seats) { - this.seats = seats; - } - - public double getPricePerSeat() { - return pricePerSeat; - } - - public void setPricePerSeat(double pricePerSeat) { - this.pricePerSeat = pricePerSeat; - } - - public String getCurrency() { - return currency; - } - - public void setCurrency(String currency) { - this.currency = currency; - } - - public String getLink() { - return link; - } - - public void setLink(String link) { - this.link = link; - } -} \ No newline at end of file diff --git a/sandbox/travelsample/hotel-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/hotel-contribution/META-INF/sca-contribution.xml deleted file mode 100644 index 765c8d1cc3..0000000000 --- a/sandbox/travelsample/hotel-contribution/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/hotel-contribution/pom.xml b/sandbox/travelsample/hotel-contribution/pom.xml deleted file mode 100644 index 4b49632937..0000000000 --- a/sandbox/travelsample/hotel-contribution/pom.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.5-SNAPSHOT - - - scatours-hotel-contribution - Apache Tuscany SCA Tours Hotel Contribution - - - - org.apache.tuscany.sca - tuscany-sca-api - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-data-api - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - scatours-common-contribution - 1.5-SNAPSHOT - - - - junit - junit - 4.5 - test - - - - - - ${artifactId} - ${basedir}/src - - - ${basedir} - - **/*.java - **/.*/** - pom.xml - build.xml - target/** - src/** - - - - - diff --git a/sandbox/travelsample/hotel-contribution/src/scatours/hotel/HotelImpl.java b/sandbox/travelsample/hotel-contribution/src/scatours/hotel/HotelImpl.java deleted file mode 100644 index a9a6d1bbde..0000000000 --- a/sandbox/travelsample/hotel-contribution/src/scatours/hotel/HotelImpl.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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.hotel; - -import java.util.ArrayList; -import java.util.List; - -import org.osoa.sca.annotations.Callback; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -import scatours.common.Book; -import scatours.common.Search; -import scatours.common.SearchCallback; -import scatours.common.TripItem; -import scatours.common.TripLeg; - -/** - * An implementation of the Hotel service - */ -@Scope("STATELESS") -@Service(interfaces={Search.class, Book.class}) -public class HotelImpl implements Search, Book { - - private List hotels = new ArrayList(); - - @Callback - protected SearchCallback searchCallback; - - @Init - public void init() { - hotels.add(new HotelInfo("Deep Bay Hotel", - "Wonderful sea views and a relaxed atmosphere", - "FLR", - "06/12/09", - "200", - 100, - "EUR", - "http://localhost:8085/tbd" )); - hotels.add(new HotelInfo("Long Bay Hotel", - "Friendly staff and an ocean breeze", - "FLR", - "06/12/09", - "200", - 100, - "EUR", - "http://localhost:8085/tbd" )); - hotels.add(new HotelInfo("City Hotel", - "Smart rooms and early breakfasts", - "FLR", - "06/12/09", - "200", - 100, - "EUR", - "http://localhost:8085/tbd" )); - hotels.add(new HotelInfo("County Hotel", - "The smell of the open country", - "FLR", - "06/12/09", - "200", - 100, - "EUR", - "http://localhost:8085/tbd" )); - } - - public TripItem[] searchSynch(TripLeg tripLeg) { - List items = new ArrayList(); - - // find available hotels - for(HotelInfo hotel : hotels){ - if (hotel.getLocation().equals(tripLeg.getToLocation())){ - TripItem item = new TripItem("", - "", - TripItem.HOTEL, - hotel.getName(), - hotel.getDescription(), - hotel.getLocation(), - tripLeg.getFromDate(), - tripLeg.getToDate(), - hotel.getPricePerBed(), - hotel.getCurrency(), - hotel.getLink()); - items.add(item); - } - } - - return items.toArray(new TripItem[items.size()]); - } - - public void searchAsynch(TripLeg tripLeg) { - - // return available hotels - searchCallback.searchResults(searchSynch(tripLeg)); - } - - public String book(TripItem tripItem) { - return "hotel1"; - } -} diff --git a/sandbox/travelsample/hotel-contribution/src/scatours/hotel/HotelInfo.java b/sandbox/travelsample/hotel-contribution/src/scatours/hotel/HotelInfo.java deleted file mode 100644 index 3b0d11d16e..0000000000 --- a/sandbox/travelsample/hotel-contribution/src/scatours/hotel/HotelInfo.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * 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.hotel; - - -public class HotelInfo { - - private String name; - private String description; - private String location; - private String date; - private String beds; - private double pricePerBed; - private String currency; - private String link; - - public HotelInfo() { - } - - public HotelInfo(String name, - String description, - String location, - String date, - String beds, - double pricePerBed, - String currency, - String link) { - - this.name = name; - this.description = description; - this.location = location; - this.date = date; - this.beds = beds; - this.pricePerBed = pricePerBed; - this.currency = currency; - this.link = link; - } - - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getLocation() { - return location; - } - - public void setLocation(String location) { - this.location = location; - } - - public String getDate() { - return date; - } - - public void setDate(String date) { - this.date = date; - } - - public String getBeds() { - return beds; - } - - public void setBeds(String beds) { - this.beds = beds; - } - - public double getPricePerBed() { - return pricePerBed; - } - - public void setPricePerBed(double pricePerBed) { - this.pricePerBed = pricePerBed; - } - - public String getCurrency() { - return currency; - } - - public void setCurrency(String currency) { - this.currency = currency; - } - - public String getLink() { - return link; - } - - public void setLink(String link) { - this.link = link; - } -} diff --git a/sandbox/travelsample/node/build.xml b/sandbox/travelsample/node/build.xml deleted file mode 100644 index ff93d7a224..0000000000 --- a/sandbox/travelsample/node/build.xml +++ /dev/null @@ -1,273 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/travelsample/node/pom.xml b/sandbox/travelsample/node/pom.xml deleted file mode 100644 index 77f8073b0b..0000000000 --- a/sandbox/travelsample/node/pom.xml +++ /dev/null @@ -1,178 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.5-SNAPSHOT - - - scatours-node - Apache Tuscany SCA Tours Node - - - - org.apache.tuscany.sca - tuscany-node-api - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-node-launcher - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-domain-manager - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-implementation-node-runtime - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-implementation-widget-runtime - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-implementation-resource-runtime - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-atom-abdera - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-jsonrpc-runtime - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-http-runtime - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-ws-axis2 - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-sca-axis2 - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-ejb-runtime - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-implementation-ejb - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-implementation-bpel-ode - 1.5-SNAPSHOT - runtime - - - - org.apache.derby - derby - 10.3.1.4 - runtime - - - - - - ${artifactId} - ${basedir}/src - - - ${basedir} - - **/*.java - **/.*/** - pom.xml - build.xml - target/** - src/** - - - - - - org.apache.tuscany.sca - tuscany-maven-ant-generator - 1.5-SNAPSHOT - - - - launch.LaunchTutorialAdmin - - - generate - - - - - - - diff --git a/sandbox/travelsample/node/src/scatours/LaunchNode.java b/sandbox/travelsample/node/src/scatours/LaunchNode.java deleted file mode 100644 index 007406061e..0000000000 --- a/sandbox/travelsample/node/src/scatours/LaunchNode.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * 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.io.IOException; - -import org.apache.tuscany.sca.node.SCAContribution; -import org.apache.tuscany.sca.node.SCANode; -import org.apache.tuscany.sca.node.SCANodeFactory; -import org.apache.tuscany.sca.node.launcher.NodeLauncher; - -public class LaunchNode { - public static void main(String[] args) throws Exception { - LaunchNode.launchFromFileSystemDir(); - } - - // OK for development but you must launch the node from this module - public static void launchFromFileSystemJar(){ - SCANode node = null; - - try { - node = SCANodeFactory.newInstance().createSCANode("scatours.composite", - new SCAContribution("common", "../common-contribution/target/scatours-common-contribution.jar"), - new SCAContribution("currency", "../currency-contribution/target/scatours-currency-contribution.jar"), - 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("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(); - - System.out.println("Node started - Press enter to shutdown."); - try { - System.in.read(); - } catch (IOException e) {} - - node.stop(); - - } catch (Exception ex) { - System.out.println(ex.toString()); - } - } - - // OK for development but you must launch the node from this module - public static void launchFromFileSystemDir(){ - SCANode node = null; - - try { - node = SCANodeFactory.newInstance().createSCANode("scatours.composite", - new SCAContribution("common", "../common-contribution/target/classes"), - new SCAContribution("currency", "../currency-contribution/target/classes"), - 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("tripbooking", "../tripbooking-contribution/target/classes"), - new SCAContribution("travelcatalog", "../travelcatalog-contribution/target/classes"), - new SCAContribution("payment", "../payment-contribution/target/classes"), - new SCAContribution("emailgateway", "../emailgateway-contribution/target/classes"), - new SCAContribution("paymentprocess", "../paymentprocess-contribution/target/classes"), - new SCAContribution("shoppingcart", "../shoppingcart-contribution/target/classes"), - new SCAContribution("scatours", "../scatours-contribution/target/classes"), - new SCAContribution("ui", "../ui-contribution/target/classes")); - node.start(); - - System.out.println("Node started - Press enter to shutdown."); - try { - System.in.read(); - } catch (IOException e) {} - - node.stop(); - - } catch (Exception ex) { - System.out.println(ex.toString()); - } - } - - // OK for samples but you can only load one contribution - public static void launchFromClasspath(){ - SCANode node = null; - - try { - node = SCANodeFactory.newInstance().createSCANodeFromClassLoader("scatours.composite", null); - node.start(); - - System.out.println("Node started - Press enter to shutdown."); - try { - System.in.read(); - } catch (IOException e) {} - - node.stop(); - - } catch (Exception ex) { - System.out.println(ex.toString()); - } - } - - // have to be running the domain in this case - public static void launchFromDomain()throws Exception { - NodeLauncher.main(new String[] {"http://localhost:9990/node-config/SCAToursNode"}); - } -} diff --git a/sandbox/travelsample/payment-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/payment-contribution/META-INF/sca-contribution.xml deleted file mode 100644 index d22f4816ab..0000000000 --- a/sandbox/travelsample/payment-contribution/META-INF/sca-contribution.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/payment-contribution/creditcard.composite b/sandbox/travelsample/payment-contribution/creditcard.composite deleted file mode 100644 index 184304e829..0000000000 --- a/sandbox/travelsample/payment-contribution/creditcard.composite +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/payment-contribution/pom.xml b/sandbox/travelsample/payment-contribution/pom.xml deleted file mode 100644 index 98a1166a66..0000000000 --- a/sandbox/travelsample/payment-contribution/pom.xml +++ /dev/null @@ -1,155 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.5-SNAPSHOT - - - scatours-payment-contribution - Apache Tuscany SCA Tours Payment Contribution - - - - org.apache.tuscany.sca - tuscany-host-embedded - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-jsonrpc-runtime - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-ws-axis2 - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-host-jetty - 1.5-SNAPSHOT - runtime - - - - junit - junit - 4.5 - test - - - - - ${artifactId} - ${basedir}/src - ${basedir}/test - - - ${basedir} - - **/*.java - **/.*/** - pom.xml - build.xml - target/** - src/** - test/** - *.composite - - - - - - ${basedir} - - **/*.java - **/.*/** - pom.xml - build.xml - target/** - src/** - test/** - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.0 - - - add-source - generate-sources - - add-source - - - - target/jaxws-source - - - - - - - org.codehaus.mojo - jaxws-maven-plugin - 1.9 - - - wsimport - generate-sources - - wsimport - - - payment.creditcard - ${basedir}/wsdl - - - CreditCardPayment.wsdl - - ${project.build.directory}/jaxws-source - - false - true - - - - - - - diff --git a/sandbox/travelsample/payment-contribution/src/payment/creditcard/impl/CreditCardPaymentImpl.java b/sandbox/travelsample/payment-contribution/src/payment/creditcard/impl/CreditCardPaymentImpl.java deleted file mode 100644 index 2a9c537775..0000000000 --- a/sandbox/travelsample/payment-contribution/src/payment/creditcard/impl/CreditCardPaymentImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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 payment.creditcard.impl; - -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Service; - -import payment.creditcard.CreditCardDetailsType; -import payment.creditcard.CreditCardPayment; - -/** - * - */ -@Service(CreditCardPayment.class) -public class CreditCardPaymentImpl implements CreditCardPayment { - - @Reference - protected CreditCardPayment creditCardPayment; - - public String authorize(CreditCardDetailsType creditCard, float amount) { - // Validate some of the fields in CreditCardDetailsType - if (creditCard.getCreditCardType() == null) { - return "UnknownCreditCardType"; - } - // Delegate the external web service - return creditCardPayment.authorize(creditCard, amount); - } - -} diff --git a/sandbox/travelsample/payment-contribution/src/payment/creditcard/ws/impl/CreditCardPaymentWSImpl.java b/sandbox/travelsample/payment-contribution/src/payment/creditcard/ws/impl/CreditCardPaymentWSImpl.java deleted file mode 100644 index f0c61cd14d..0000000000 --- a/sandbox/travelsample/payment-contribution/src/payment/creditcard/ws/impl/CreditCardPaymentWSImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 payment.creditcard.ws.impl; - -import org.osoa.sca.annotations.Service; - -import payment.creditcard.CreditCardDetailsType; -import payment.creditcard.CreditCardPayment; - -/** - * - */ -@Service(CreditCardPayment.class) -public class CreditCardPaymentWSImpl implements CreditCardPayment { - - public String authorize(CreditCardDetailsType creditCard, float amount) { - if (creditCard != null){ - System.out.println("Checking card: name = " + - creditCard.getCardOwner().getName() + - " number = " + - creditCard.getCreditCardNumber() + - " for amount " + - amount); - } else { - System.out.println("Checking card is null"); - } - - return "OK"; - } - -} diff --git a/sandbox/travelsample/payment-contribution/test/payment/creditcard/CreditCardPaymentTestCase.java b/sandbox/travelsample/payment-contribution/test/payment/creditcard/CreditCardPaymentTestCase.java deleted file mode 100644 index 48378e6cd0..0000000000 --- a/sandbox/travelsample/payment-contribution/test/payment/creditcard/CreditCardPaymentTestCase.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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 payment.creditcard; - -import org.apache.tuscany.sca.node.SCAClient; -import org.apache.tuscany.sca.node.SCANode; -import org.apache.tuscany.sca.node.SCANodeFactory; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; - -/** - * - */ -public class CreditCardPaymentTestCase { - private static SCANode node; - - /** - * @throws java.lang.Exception - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception { - SCANodeFactory factory = SCANodeFactory.newInstance(); - node = factory.createSCANodeFromClassLoader("creditcard.composite", CreditCardPayment.class.getClassLoader()); - node.start(); - } - - @Test - public void testCreditCardPayment() { - SCAClient client = (SCAClient) node; - CreditCardPayment cc = client.getService(CreditCardPayment.class, "CreditCardPaymentWSClient"); - - ObjectFactory objectFactory = new ObjectFactory(); - CreditCardDetailsType ccDetails = objectFactory.createCreditCardDetailsType(); - ccDetails.setCreditCardType(CreditCardTypeType.fromValue("Visa")); - PayerType ccOwner = objectFactory.createPayerType(); - ccOwner.setName("Fred"); - ccDetails.setCardOwner(ccOwner); - - System.out.println(cc.authorize(ccDetails, 100.00f)); - } - - @Test - //@Ignore - public void testWaitForInput() { - System.out.println("Press a key to end"); - try { - System.in.read(); - } catch (Exception ex) { - } - System.out.println("Shutting down"); - } - - /** - * @throws java.lang.Exception - */ - @AfterClass - public static void tearDownAfterClass() throws Exception { - if (node != null) { - node.stop(); - node = null; - } - } - -} diff --git a/sandbox/travelsample/payment-contribution/wsdl/CreditCardPayment.wsdl b/sandbox/travelsample/payment-contribution/wsdl/CreditCardPayment.wsdl deleted file mode 100644 index b40c341389..0000000000 --- a/sandbox/travelsample/payment-contribution/wsdl/CreditCardPayment.wsdl +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/paymentprocess-contribution/log4j.properties b/sandbox/travelsample/paymentprocess-contribution/log4j.properties deleted file mode 100644 index 7ed0bcaf77..0000000000 --- a/sandbox/travelsample/paymentprocess-contribution/log4j.properties +++ /dev/null @@ -1,36 +0,0 @@ -# -# 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. -# - -# Set root logger level to WARN and its only appender to CONSOLE -log4j.rootLogger=OFF, CONSOLE - -# log4j properties to work with commandline tools. -log4j.category.org.mortbay=OFF -log4j.category.org.hibernate.type=OFF -log4j.category.org.objectweb=OFF -log4j.category.org.apache.ode.axis2=OFF -log4j.category.org.apache.ode.bpel.engine=DEBUG -log4j.category.org.apache.ode.daohib.bpel.CorrelatorDaoImpl=OFF -log4j.category.org.apache.ode.bpel.epr=OFF -log4j.category.org.apache.tuscany.sca.implementation.bpel=DEBUG -log4j.category.org.apache.tuscany.sca.implementation.bpel.ode=DEBUG -log4j.category.org.apache.tuscany.sca.implementation.bpel.provider=DEBUG - -# Console appender -log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender -log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout -log4j.appender.CONSOLE.layout.ConversionPattern=[%p] - %C{1}.%M(%L) | %m%n diff --git a/sandbox/travelsample/paymentprocess-contribution/paymentprocesstest.composite b/sandbox/travelsample/paymentprocess-contribution/paymentprocesstest.composite deleted file mode 100644 index f45dc01a57..0000000000 --- a/sandbox/travelsample/paymentprocess-contribution/paymentprocesstest.composite +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/paymentprocess-contribution/pom.xml b/sandbox/travelsample/paymentprocess-contribution/pom.xml deleted file mode 100644 index c1a9712a66..0000000000 --- a/sandbox/travelsample/paymentprocess-contribution/pom.xml +++ /dev/null @@ -1,179 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.5-SNAPSHOT - - - scatours-paymentprocess-contribution - Apache Tuscany SCA Tours Payment Process Contribution - - - - org.apache.tuscany.sca - tuscany-host-embedded - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-implementation-bpel-ode - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-ws-axis2 - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-host-jetty - 1.5-SNAPSHOT - runtime - - - - junit - junit - 4.5 - test - - - - - ${artifactId} - ${basedir}/src - ${basedir}/test - - - ${basedir}/resources - - - - - ${basedir}/resources - - - ${basedir} - - *.composite - *.properties - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.0 - - - add-source - generate-sources - - add-source - - - - target/jaxws-source - - - - - - - org.codehaus.mojo - jaxws-maven-plugin - 1.9 - - - wsimport - generate-sources - - wsimport - - - scatours.paymentprocess - ${basedir}/resources - - - PaymentProcess.wsdl - - ${project.build.directory}/jaxws-source - - false - true - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - 2.3.1 - - false - false - true - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unpack - test-compile - - unpack - - - - - org.apache.ode - ode-dao-jpa-ojpa-derby - 1.1 - zip - true - ${project.build.directory}/test-classes/ - - - - - - - - - diff --git a/sandbox/travelsample/paymentprocess-contribution/resources/CreditCardPayment.wsdl b/sandbox/travelsample/paymentprocess-contribution/resources/CreditCardPayment.wsdl deleted file mode 100644 index a90c73cdfb..0000000000 --- a/sandbox/travelsample/paymentprocess-contribution/resources/CreditCardPayment.wsdl +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/paymentprocess-contribution/resources/EmailGateway.wsdl b/sandbox/travelsample/paymentprocess-contribution/resources/EmailGateway.wsdl deleted file mode 100644 index d9a5e36bc0..0000000000 --- a/sandbox/travelsample/paymentprocess-contribution/resources/EmailGateway.wsdl +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/paymentprocess-contribution/resources/META-INF/sca-contribution.xml b/sandbox/travelsample/paymentprocess-contribution/resources/META-INF/sca-contribution.xml deleted file mode 100644 index 8146abbceb..0000000000 --- a/sandbox/travelsample/paymentprocess-contribution/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/paymentprocess-contribution/resources/PaymentProcess.wsdl b/sandbox/travelsample/paymentprocess-contribution/resources/PaymentProcess.wsdl deleted file mode 100644 index c4157cf475..0000000000 --- a/sandbox/travelsample/paymentprocess-contribution/resources/PaymentProcess.wsdl +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/paymentprocess-contribution/resources/paymentprocess.bpel b/sandbox/travelsample/paymentprocess-contribution/resources/paymentprocess.bpel deleted file mode 100644 index 08c6b8f636..0000000000 --- a/sandbox/travelsample/paymentprocess-contribution/resources/paymentprocess.bpel +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Visa - 12345678 - 2 - 2010 - - Empty -
- 1 The Road - Winchester - Hampshire - AB1 2CD - 12345678 -
-
-
- 0.0 -
-
-
- $authorizeRequestMessage.parameters -
- - $makePaymentRequestMessage.parameters/CustomerId/text() - $authorizeRequestMessage.parameters/CreditCard/CardOwner/Name - - - $makePaymentRequestMessage.parameters/Amount/text() - $authorizeRequestMessage.parameters/Amount - -
- - - - - - - - - - - Default - Payment Confirmation - Your payment has been confirmed - - - - - $sendEmailRequestMessage.parameters - - - $makePaymentRequestMessage.parameters/CustomerId/text() - $sendEmailRequestMessage.parameters/Email/To - - - - - - - - - - - - - OK - - - - $makePaymentResponseMessage.parameters - - - - - - -
-
diff --git a/sandbox/travelsample/paymentprocess-contribution/resources/paymentprocess.componentType b/sandbox/travelsample/paymentprocess-contribution/resources/paymentprocess.componentType deleted file mode 100644 index ecc2f55a47..0000000000 --- a/sandbox/travelsample/paymentprocess-contribution/resources/paymentprocess.componentType +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessClientImpl.java b/sandbox/travelsample/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessClientImpl.java deleted file mode 100644 index 8d9c2f918c..0000000000 --- a/sandbox/travelsample/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessClientImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.paymentprocess; - -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Service; - -/** - * - */ -@Service(PaymentProcess.class) -public class PaymentProcessClientImpl implements PaymentProcess { - @Reference - protected PaymentProcess paymentProcess; - - public String makePayment(String customerId, float amount) { - // Delegate the external web service - return paymentProcess.makePayment(customerId, amount); - } - -} diff --git a/sandbox/travelsample/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessTestCase.java b/sandbox/travelsample/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessTestCase.java deleted file mode 100644 index f1b4bc6aba..0000000000 --- a/sandbox/travelsample/paymentprocess-contribution/test/scatours/paymentprocess/PaymentProcessTestCase.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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.paymentprocess; - -import org.apache.tuscany.sca.node.SCAClient; -import org.apache.tuscany.sca.node.SCANode; -import org.apache.tuscany.sca.node.SCANodeFactory; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; - -/** - * - */ -public class PaymentProcessTestCase { - private static SCANode node; - - /** - * @throws java.lang.Exception - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception { - SCANodeFactory factory = SCANodeFactory.newInstance(); - node = factory.createSCANodeFromClassLoader("paymentprocesstest.composite", PaymentProcess.class.getClassLoader()); - node.start(); - } - - @Test - @Ignore - public void testPaymentProcess() { - SCAClient client = (SCAClient) node; - PaymentProcess pp = client.getService(PaymentProcess.class, "PaymentProcessClient"); - System.out.println("Result = " + pp.makePayment("Fred", 100.00f)); - } - - @Test - //@Ignore - public void testWaitForInput() { - System.out.println("Press a key to end"); - try { - System.in.read(); - } catch (Exception ex) { - } - System.out.println("Shutting down"); - } - - /** - * @throws java.lang.Exception - */ - @AfterClass - public static void tearDownAfterClass() throws Exception { - if (node != null) { - node.stop(); - node = null; - } - } - -} diff --git a/sandbox/travelsample/pom.xml b/sandbox/travelsample/pom.xml index 29576a5214..54ef35775a 100644 --- a/sandbox/travelsample/pom.xml +++ b/sandbox/travelsample/pom.xml @@ -27,7 +27,7 @@ tuscany-scatours pom - Apache Tuscany SCA Tours Sample + Apache Tuscany SCA Tours Assembly Examples @@ -36,26 +36,18 @@ true - calendar-contribution - common-contribution - currency-contribution - hotel-contribution - flight-contribution - car-contribution - trip-contribution - payment-contribution - paymentprocess-contribution - emailgateway-contribution - travelcatalog-contribution - tripbooking-contribution - shoppingcart-contribution - scatours-contribution - ui-contribution - - domain - node - - gettingstarted + shared-contributions + chapter-01 + + + + chapter-05 + + + + + + diff --git a/sandbox/travelsample/scatours-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/scatours-contribution/META-INF/sca-contribution.xml deleted file mode 100644 index 368e95ebd0..0000000000 --- a/sandbox/travelsample/scatours-contribution/META-INF/sca-contribution.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/scatours-contribution/pom.xml b/sandbox/travelsample/scatours-contribution/pom.xml deleted file mode 100644 index 500d23f4b8..0000000000 --- a/sandbox/travelsample/scatours-contribution/pom.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.5-SNAPSHOT - - - scatours-scatours-contribution - Apache Tuscany SCA Tours SCATours Contribution - - - - org.apache.tuscany.sca - tuscany-sca-api - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-data-api - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - scatours-common-contribution - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - scatours-currency-contribution - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - scatours-travelcatalog-contribution - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - scatours-tripbooking-contribution - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - scatours-shoppingcart-contribution - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - scatours-paymentprocess-contribution - 1.5-SNAPSHOT - - - - junit - junit - 4.5 - test - - - - - - ${artifactId} - ${basedir}/src - - - ${basedir} - - **/*.java - **/.*/** - pom.xml - build.xml - target/** - src/** - - - - - diff --git a/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursBooking.java b/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursBooking.java deleted file mode 100644 index ac39443e9c..0000000000 --- a/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursBooking.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 bookTrip(String cartId, TripItem tripId); -} diff --git a/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursCart.java b/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursCart.java deleted file mode 100644 index 61e32ec4a2..0000000000 --- a/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursCart.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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.Conversational; -import org.osoa.sca.annotations.Remotable; - -import scatours.common.TripItem; - -/** - * The ShoppingCart service interface - */ -@Remotable -public interface SCAToursCart{ - String newCart(); - TripItem[] getTrips(String cartId); - void checkout(String cartId); -} diff --git a/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursImpl.java b/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursImpl.java deleted file mode 100644 index c0f7bec6ea..0000000000 --- a/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursImpl.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * 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.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -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.Scope; -import org.osoa.sca.annotations.Service; - -import scatours.common.TripItem; -import scatours.common.TripLeg; -import scatours.paymentprocess.PaymentProcess; -import scatours.shoppingcart.ShoppingCart; -import scatours.travelcatalog.TravelCatalogSearch; -import scatours.tripbooking.TripBooking; - -/** - * An implementation of the Trip service - */ -@Scope("COMPOSITE") -@Service(interfaces={SCAToursSearch.class, SCAToursBooking.class, SCAToursCart.class}) -public class SCAToursImpl implements SCAToursSearch, SCAToursBooking, SCAToursCart{ - - @Reference - protected TravelCatalogSearch travelCatalogSearch; - - @Reference - protected TripBooking tripBooking; - - @Reference - protected ShoppingCart shoppingCart; - - @Context - protected ComponentContext componentContext; - - private Map carts = new HashMap(); - private Map trips = new HashMap(); - //private Map searchItemsCache = new HashMap(); - - // SCAToursSearch 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; - } - - // SCAToursBooking methods - - public String bookTrip(String cartId, TripItem trip){ - TripItem bookedTrip = tripBooking.bookTrip(cartId, trip); - carts.get(cartId).addTrip(bookedTrip); - return bookedTrip.getBookingCode(); - } - - // SCAToursCart methods - - public String newCart(){ - String cartId = UUID.randomUUID().toString(); - ServiceReference shoppingCart = componentContext.getServiceReference(ShoppingCart.class, - "shoppingCart"); - shoppingCart.setConversationID(cartId); - carts.put(cartId, shoppingCart.getService()); - - return cartId; - } - - public TripItem[] getTrips(String cartId){ - return carts.get(cartId).getTrips(); - } - - public void checkout(String cartId){ - shoppingCart.checkout("Fred"); - } - -/* - public String addTrip(String cartId){ - String tripId = UUID.randomUUID().toString(); - ServiceReference tripReference = componentContext.getServiceReference(TripBooking.class, - "tripBooking"); - tripReference.setConversationID(tripId); - trips.put(tripId, tripReference.getService()); - - carts.get(cartId).addItem(tripId); - return tripId; - } - - public void removeTrip(String cartId, String tripId) { - carts.get(cartId).removeItem(tripId); - } - - public void addTripItem(String cartId, String tripId, String tripItemId){ - TripItem item = searchItemsCache.get(tripItemId); - TripItem itemCopy = new TripItem(item); - itemCopy.setTripId(tripId); - trips.get(tripId).addTripItem(itemCopy); - } - - public void removeTripItem(String cartId, String tripId, String tripItemId){ - trips.get(tripId).removeTripItem(tripItemId); - } - - public TripItem[] getTripItems(String cartId) { - List returnTripItems = new ArrayList(); - - for( String tripId : carts.get(cartId).getItems()){ - returnTripItems.addAll(Arrays.asList(trips.get(tripId).getTripItems())); - } - - return returnTripItems.toArray(new TripItem[returnTripItems.size()]); - } - - public double getTotalPrice(String cartId){ - double total = 0.0; - - for( String tripId : carts.get(cartId).getItems()){ - total += trips.get(tripId).getTripPrice(); - } - - return total; - } - - public void checkout(String cartId){ - // get users credentials. Hard coded for now but should - // come from the security context - String customerId = "Fred Bloggs"; - float amount = (float)getTotalPrice(cartId); - - paymentProcess.makePayment(customerId, amount); - } - -*/ -} diff --git a/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursSearch.java b/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursSearch.java deleted file mode 100644 index f0f435fc06..0000000000 --- a/sandbox/travelsample/scatours-contribution/src/scatours/SCAToursSearch.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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; -import scatours.common.TripLeg; - -/** - * The Trip service interface - */ -@Remotable -public interface SCAToursSearch { - TripItem[] search(TripLeg tripLeg); -} diff --git a/sandbox/travelsample/shared-contributions/calendar-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/shared-contributions/calendar-contribution/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..327ce07643 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/calendar-contribution/META-INF/sca-contribution.xml @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/calendar-contribution/pom.xml b/sandbox/travelsample/shared-contributions/calendar-contribution/pom.xml new file mode 100644 index 0000000000..ac4004355c --- /dev/null +++ b/sandbox/travelsample/shared-contributions/calendar-contribution/pom.xml @@ -0,0 +1,57 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.5-SNAPSHOT + + + scatours-calendar-contribution + Apache Tuscany SCA Tours Calendar Contribution + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.5-SNAPSHOT + runtime + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + + diff --git a/sandbox/travelsample/shared-contributions/calendar-contribution/src/main/java/calendar/Calendar.java b/sandbox/travelsample/shared-contributions/calendar-contribution/src/main/java/calendar/Calendar.java new file mode 100644 index 0000000000..90736b92b4 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/calendar-contribution/src/main/java/calendar/Calendar.java @@ -0,0 +1,28 @@ +/* + * 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 calendar; + +/** + * The Add service interface + */ +public interface Calendar { + + String getEndDate(String startDate, int duration); + +} diff --git a/sandbox/travelsample/shared-contributions/calendar-contribution/src/main/java/calendar/CalendarImpl.java b/sandbox/travelsample/shared-contributions/calendar-contribution/src/main/java/calendar/CalendarImpl.java new file mode 100644 index 0000000000..343926da65 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/calendar-contribution/src/main/java/calendar/CalendarImpl.java @@ -0,0 +1,48 @@ +/* + * 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 calendar; + +import java.text.DateFormat; +import java.util.Date; +import java.util.TimeZone; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * An implementation of the Add service + */ +public class CalendarImpl implements Calendar { + + public String getEndDate(String startDate, int duration){ + String returnDate = "Invalid Date"; + + try { + Date date = DateFormat.getInstance().parse(startDate); + java.util.Calendar calendar = java.util.Calendar.getInstance(); + calendar.setTime(date); + calendar.add(java.util.Calendar.DATE, duration); + returnDate = DateFormat.getInstance().format(calendar.getTime()); + } catch (Exception ex){ + // do nothing + System.out.println(ex.toString()); + } + + return returnDate; + } +} diff --git a/sandbox/travelsample/shared-contributions/calendar-contribution/src/main/resources/calendar.composite b/sandbox/travelsample/shared-contributions/calendar-contribution/src/main/resources/calendar.composite new file mode 100644 index 0000000000..b72c450446 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/calendar-contribution/src/main/resources/calendar.composite @@ -0,0 +1,29 @@ + + + + + + + + + diff --git a/sandbox/travelsample/shared-contributions/calendar-contribution/src/test/java/calendar/CalendarTestCase.java b/sandbox/travelsample/shared-contributions/calendar-contribution/src/test/java/calendar/CalendarTestCase.java new file mode 100644 index 0000000000..fee00fbb0a --- /dev/null +++ b/sandbox/travelsample/shared-contributions/calendar-contribution/src/test/java/calendar/CalendarTestCase.java @@ -0,0 +1,47 @@ +/* + * 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 calendar; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +/** + * This shows how to test the Calculator service component. + */ +public class CalendarTestCase extends TestCase { + + private Calendar calendar; + private SCADomain scaDomain; + + @Override + protected void setUp() throws Exception { + scaDomain = SCADomain.newInstance("calendar.composite"); + calendar = scaDomain.getService(Calendar.class, "CalendarComponent"); + } + + @Override + protected void tearDown() throws Exception { + scaDomain.close(); + } + + public void testCalculator() throws Exception { + System.out.println(calendar.getEndDate("07/10/96 04:05", 3)); + } +} diff --git a/sandbox/travelsample/shared-contributions/calendar-contribution/src/test/resources/calendar.composite b/sandbox/travelsample/shared-contributions/calendar-contribution/src/test/resources/calendar.composite new file mode 100644 index 0000000000..b72c450446 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/calendar-contribution/src/test/resources/calendar.composite @@ -0,0 +1,29 @@ + + + + + + + + + diff --git a/sandbox/travelsample/shared-contributions/car-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/shared-contributions/car-contribution/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..f9c448e8ee --- /dev/null +++ b/sandbox/travelsample/shared-contributions/car-contribution/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/car-contribution/pom.xml b/sandbox/travelsample/shared-contributions/car-contribution/pom.xml new file mode 100644 index 0000000000..06c29b25db --- /dev/null +++ b/sandbox/travelsample/shared-contributions/car-contribution/pom.xml @@ -0,0 +1,76 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.5-SNAPSHOT + + + scatours-car-contribution + Apache Tuscany SCA Tours Car Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-data-api + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + scatours-common-contribution + 1.5-SNAPSHOT + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + ${basedir}/src + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + target/** + src/** + + + + + diff --git a/sandbox/travelsample/shared-contributions/car-contribution/src/scatours/car/CarImpl.java b/sandbox/travelsample/shared-contributions/car-contribution/src/scatours/car/CarImpl.java new file mode 100644 index 0000000000..059365a9ab --- /dev/null +++ b/sandbox/travelsample/shared-contributions/car-contribution/src/scatours/car/CarImpl.java @@ -0,0 +1,100 @@ +/* + * 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.car; + +import java.util.ArrayList; +import java.util.List; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import scatours.common.Book; +import scatours.common.Search; +import scatours.common.SearchCallback; +import scatours.common.TripItem; +import scatours.common.TripLeg; + +/** + * An implementation of the Hotel service + */ +@Scope("STATELESS") +@Service(interfaces={Search.class, Book.class}) +public class CarImpl implements Search, Book { + + private List cars = new ArrayList(); + + @Callback + protected SearchCallback searchCallback; + + @Init + public void init() { + cars.add(new CarInfo("Premier Cars", + "BMW 5 Series", + "FLR", + "06/12/09", + "5", + 100.00, + "EUR", + "http://localhost:8085/tbd" )); + cars.add(new CarInfo("Premier Cars", + "Ford Focus", + "FLR", + "06/12/09", + "4", + 60.00, + "EUR", + "http://localhost:8085/tbd" )); + } + + public TripItem[] searchSynch(TripLeg tripLeg) { + List items = new ArrayList(); + + // find available hotels + for(CarInfo car : cars){ + if (car.getLocation().equals(tripLeg.getToLocation())){ + TripItem item = new TripItem("", + "", + TripItem.CAR, + car.getName(), + car.getDescription(), + car.getLocation(), + tripLeg.getFromDate(), + tripLeg.getToDate(), + car.getPricePerDay(), + car.getCurrency(), + car.getLink()); + items.add(item); + } + } + + return items.toArray(new TripItem[items.size()]); + } + + public void searchAsynch(TripLeg tripLeg) { + + // return available hotels + searchCallback.searchResults(searchSynch(tripLeg)); + } + + public String book(TripItem tripItem) { + return "car1"; + } +} diff --git a/sandbox/travelsample/shared-contributions/car-contribution/src/scatours/car/CarInfo.java b/sandbox/travelsample/shared-contributions/car-contribution/src/scatours/car/CarInfo.java new file mode 100644 index 0000000000..2538c51e09 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/car-contribution/src/scatours/car/CarInfo.java @@ -0,0 +1,120 @@ +/* + * 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.car; + + +public class CarInfo { + + private String name; + private String description; + private String location; + private String date; + private String seats; + private double pricePerDay; + private String currency; + private String link; + + public CarInfo() { + } + + public CarInfo(String name, + String description, + String location, + String date, + String seats, + double pricePerDay, + String currency, + String link) { + + this.name = name; + this.description = description; + this.location = location; + this.date = date; + this.seats = seats; + this.pricePerDay = pricePerDay; + this.currency = currency; + this.link = link; + } + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + public String getSeats() { + return seats; + } + + public void setSeats(String seats) { + this.seats = seats; + } + + public double getPricePerDay() { + return pricePerDay; + } + + public void setPricePerDay(double pricePerDay) { + this.pricePerDay = pricePerDay; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } +} diff --git a/sandbox/travelsample/shared-contributions/common-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/shared-contributions/common-contribution/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..c2b9fd12c7 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/common-contribution/META-INF/sca-contribution.xml @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/common-contribution/build.xml b/sandbox/travelsample/shared-contributions/common-contribution/build.xml new file mode 100644 index 0000000000..b4fbc726cf --- /dev/null +++ b/sandbox/travelsample/shared-contributions/common-contribution/build.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/travelsample/shared-contributions/common-contribution/pom.xml b/sandbox/travelsample/shared-contributions/common-contribution/pom.xml new file mode 100644 index 0000000000..e0b024b666 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/common-contribution/pom.xml @@ -0,0 +1,57 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.5-SNAPSHOT + + + scatours-common-contribution + Apache Tuscany SCA Tours Common Artefacts Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-data-api + 1.5-SNAPSHOT + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + ${basedir}/src + + diff --git a/sandbox/travelsample/shared-contributions/common-contribution/src/scatours/common/Book.java b/sandbox/travelsample/shared-contributions/common-contribution/src/scatours/common/Book.java new file mode 100644 index 0000000000..f42db4341b --- /dev/null +++ b/sandbox/travelsample/shared-contributions/common-contribution/src/scatours/common/Book.java @@ -0,0 +1,31 @@ +/* + * 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.common; + +import java.util.List; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.OneWay; +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Book { + String book(TripItem tripItem); +} diff --git a/sandbox/travelsample/shared-contributions/common-contribution/src/scatours/common/Search.java b/sandbox/travelsample/shared-contributions/common-contribution/src/scatours/common/Search.java new file mode 100644 index 0000000000..705753972e --- /dev/null +++ b/sandbox/travelsample/shared-contributions/common-contribution/src/scatours/common/Search.java @@ -0,0 +1,35 @@ +/* + * 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.common; + +import java.util.List; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.OneWay; +import org.osoa.sca.annotations.Remotable; + +@Remotable +@Callback(SearchCallback.class) +public interface Search { + TripItem[] searchSynch(TripLeg tripLeg); + + @OneWay + void searchAsynch(TripLeg tripLeg); +} diff --git a/sandbox/travelsample/shared-contributions/common-contribution/src/scatours/common/SearchCallback.java b/sandbox/travelsample/shared-contributions/common-contribution/src/scatours/common/SearchCallback.java new file mode 100644 index 0000000000..4bc88fd623 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/common-contribution/src/scatours/common/SearchCallback.java @@ -0,0 +1,30 @@ +/* + * 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.common; + +import java.util.List; + +import org.apache.tuscany.sca.data.collection.Item; +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface SearchCallback { + void searchResults(TripItem[] items); +} diff --git a/sandbox/travelsample/shared-contributions/common-contribution/src/scatours/common/TripItem.java b/sandbox/travelsample/shared-contributions/common-contribution/src/scatours/common/TripItem.java new file mode 100644 index 0000000000..e991668cbc --- /dev/null +++ b/sandbox/travelsample/shared-contributions/common-contribution/src/scatours/common/TripItem.java @@ -0,0 +1,220 @@ +/* + * 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.common; + +import java.util.List; + + +public class TripItem { + + public static String FLIGHT = "Flight"; + public static String HOTEL = "Hotel"; + public static String CAR = "Car"; + public static String TRIP = "Trip"; + + private String id; + private String tripId; + private String type; + private String name; + private String description; + private String location; + private String fromDate; + private String toDate; + private double price; + private String currency; + private String link; + private TripItem[] tripItems; // used for a trip made up of trip items + private String customerDetails; + private String agentDetails; + private String bookingCode; + + public TripItem() { + } + + public TripItem(TripItem item) { + this.id = item.getId(); + this.tripId = item.getTripId(); + this.type = item.getType(); + this.name = item.getName(); + this.description = item.getDescription(); + this.location = item.getLocation(); + this.fromDate = item.getFromDate(); + this.toDate = item.getToDate(); + this.price = item.getPrice(); + this.currency = item.getCurrency(); + this.link = item.getLink(); + } + + public TripItem(String id, + String tripId, + String type, + String name, + String description, + String location, + String fromDate, + String toDate, + double price, + String currency, + String link) { + this.id = id; + this.tripId = tripId; + this.type = type; + this.name = name; + this.description = description; + this.location = location; + this.fromDate = fromDate; + this.toDate = toDate; + this.price = price; + this.currency = currency; + this.link = link; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTripId() { + return tripId; + } + + public void setTripId(String tripId) { + this.tripId = tripId; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public String getFromDate() { + return fromDate; + } + + public void setFromDate(String fromDate) { + this.fromDate = fromDate; + } + + public String getToDate() { + return toDate; + } + + public void setToDate(String toDate) { + this.toDate = toDate; + } + + public double getPrice() { + return price; + } + + public void setPrice(double price) { + this.price = price; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } + + public TripItem[] getTripItems() { + return tripItems; + } + + public void setTripItems(TripItem[] tripItems) { + this.tripItems = tripItems; + } + + public String getCustomerDetails() { + return customerDetails; + } + + public void setCustomerDetails(String customerDetails) { + this.customerDetails = customerDetails; + } + + public String getAgentDetails() { + return agentDetails; + } + + public void setAgentDetails(String agentDetails) { + this.agentDetails = agentDetails; + } + + public String getBookingCode() { + return bookingCode; + } + + public void setBookingCode(String bookingCode) { + this.bookingCode = bookingCode; + } + + @Override + public boolean equals(Object obj) { + + if (obj instanceof TripItem){ + if (((TripItem)obj).getId().equals(getId())){ + return true; + } + } + + return super.equals(obj); + } +} diff --git a/sandbox/travelsample/shared-contributions/common-contribution/src/scatours/common/TripLeg.java b/sandbox/travelsample/shared-contributions/common-contribution/src/scatours/common/TripLeg.java new file mode 100644 index 0000000000..1af33aa6f9 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/common-contribution/src/scatours/common/TripLeg.java @@ -0,0 +1,97 @@ +/* + * 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.common; + + +public class TripLeg { + + private String id; + private String fromLocation; + private String toLocation; + private String fromDate; + private String toDate; + private String noOfPeople; + + + public TripLeg() { + } + + public TripLeg(String id, + String fromLocation, + String toLocation, + String fromDate, + String toDate, + String noOfPeople) { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getFromLocation() { + return fromLocation; + } + + public void setFromLocation(String fromLocation) { + this.fromLocation = fromLocation; + } + + public String getToLocation() { + return toLocation; + } + + public void setToLocation(String toLocation) { + this.toLocation = toLocation; + } + + public String getFromDate() { + return fromDate; + } + + public void setFromDate(String fromDate) { + this.fromDate = fromDate; + } + + public String getToDate() { + return toDate; + } + + public void setToDate(String toDate) { + this.toDate = toDate; + } + + public String getNoOfPeople() { + return noOfPeople; + } + + public void setNoOfPeople(String noOfPeople) { + this.noOfPeople = noOfPeople; + } + + + + + + +} diff --git a/sandbox/travelsample/shared-contributions/currency-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/shared-contributions/currency-contribution/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..549a3bc7a3 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/currency-contribution/META-INF/sca-contribution.xml @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/currency-contribution/pom.xml b/sandbox/travelsample/shared-contributions/currency-contribution/pom.xml new file mode 100644 index 0000000000..738c3d7f61 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/currency-contribution/pom.xml @@ -0,0 +1,63 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.5-SNAPSHOT + + + scatours-currency-contribution + Apache Tuscany SCA Tours Currency Converter Contribution + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.5-SNAPSHOT + runtime + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + ${basedir}/src + + + ${basedir}/resources + + + + diff --git a/sandbox/travelsample/shared-contributions/currency-contribution/src/scatours/currencyconverter/CurrencyConverter.java b/sandbox/travelsample/shared-contributions/currency-contribution/src/scatours/currencyconverter/CurrencyConverter.java new file mode 100644 index 0000000000..9b3851721f --- /dev/null +++ b/sandbox/travelsample/shared-contributions/currency-contribution/src/scatours/currencyconverter/CurrencyConverter.java @@ -0,0 +1,33 @@ +/* + * 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.currencyconverter; + +/** + * The CurrencyConverter service interface + */ +public interface CurrencyConverter { + + double getExchangeRate(String fromCurrencyCode, + String toCurrencyCode); + + double convert(String fromCurrencyCode, + String toCurrencyCode, + double amount); + +} diff --git a/sandbox/travelsample/shared-contributions/currency-contribution/src/scatours/currencyconverter/CurrencyConverterImpl.java b/sandbox/travelsample/shared-contributions/currency-contribution/src/scatours/currencyconverter/CurrencyConverterImpl.java new file mode 100644 index 0000000000..eddc59f555 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/currency-contribution/src/scatours/currencyconverter/CurrencyConverterImpl.java @@ -0,0 +1,54 @@ +/* + * 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.currencyconverter; + +import java.util.HashMap; +import java.util.Map; + +import org.osoa.sca.annotations.Service; + +/** + * An implementation of the CurrencyConverter service + */ +@Service(interfaces={CurrencyConverter.class}) +public class CurrencyConverterImpl implements CurrencyConverter { + + // currency index + private Map currencyIndex = new HashMap(); + + // exchange rates + private final double rates [][] = {{ 1.00, 0.50, 0.66 }, + { 2.00, 1.00, 1.33 }, + { 1.50, 0.75, 1.00 } } ; + + public CurrencyConverterImpl(){ + currencyIndex.put("USD", new Integer(0)); + currencyIndex.put("GBP", new Integer(1)); + currencyIndex.put("EUR", new Integer(2)); + } + + public double getExchangeRate(String fromCurrencyCode, String toCurrencyCode){ + return rates[currencyIndex.get(fromCurrencyCode).intValue()] + [currencyIndex.get(toCurrencyCode).intValue()]; + } + + public double convert(String fromCurrencyCode, String toCurrencyCode, double amount){ + return amount * getExchangeRate(fromCurrencyCode, toCurrencyCode); + } +} diff --git a/sandbox/travelsample/shared-contributions/emailgateway-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/shared-contributions/emailgateway-contribution/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..d77df2fd7e --- /dev/null +++ b/sandbox/travelsample/shared-contributions/emailgateway-contribution/META-INF/sca-contribution.xml @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/emailgateway-contribution/emailgatewaytest.composite b/sandbox/travelsample/shared-contributions/emailgateway-contribution/emailgatewaytest.composite new file mode 100644 index 0000000000..5be71b4d66 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/emailgateway-contribution/emailgatewaytest.composite @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/emailgateway-contribution/pom.xml b/sandbox/travelsample/shared-contributions/emailgateway-contribution/pom.xml new file mode 100644 index 0000000000..118a06d942 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/emailgateway-contribution/pom.xml @@ -0,0 +1,155 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.5-SNAPSHOT + + + scatours-emailgateway-contribution + Apache Tuscany SCA Tours Email Gateway Contribution + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jsonrpc-runtime + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + 1.5-SNAPSHOT + runtime + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + ${basedir}/src + ${basedir}/test + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + target/** + src/** + test/** + *.composite + + + + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + target/** + src/** + test/** + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.9 + + + wsimport + generate-sources + + wsimport + + + scatours.emailgateway + ${basedir}/wsdl + + + EmailGateway.wsdl + + ${project.build.directory}/jaxws-source + + false + true + + + + + + + diff --git a/sandbox/travelsample/shared-contributions/emailgateway-contribution/src/scatours/emailgateway/EmailGatewayImpl.java b/sandbox/travelsample/shared-contributions/emailgateway-contribution/src/scatours/emailgateway/EmailGatewayImpl.java new file mode 100644 index 0000000000..6e971c3267 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/emailgateway-contribution/src/scatours/emailgateway/EmailGatewayImpl.java @@ -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.emailgateway; + +import org.osoa.sca.annotations.Service; + + +/** + * + */ +@Service(EmailGateway.class) +public class EmailGatewayImpl implements EmailGateway { + + public String sendEmail(EmailType email) { + System.out.println("Sending mail to " + email.getTo()); + return "SENT"; + } + +} diff --git a/sandbox/travelsample/shared-contributions/emailgateway-contribution/test/scatours/emailgateway/EmailGatewayClientImpl.java b/sandbox/travelsample/shared-contributions/emailgateway-contribution/test/scatours/emailgateway/EmailGatewayClientImpl.java new file mode 100644 index 0000000000..a6b76c525f --- /dev/null +++ b/sandbox/travelsample/shared-contributions/emailgateway-contribution/test/scatours/emailgateway/EmailGatewayClientImpl.java @@ -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.emailgateway; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * + */ +@Service(EmailGateway.class) +public class EmailGatewayClientImpl implements EmailGateway { + @Reference + protected EmailGateway emailGateway; + + public String sendEmail(EmailType email) { + // Delegate the external web service + return emailGateway.sendEmail(email); + } + +} diff --git a/sandbox/travelsample/shared-contributions/emailgateway-contribution/test/scatours/emailgateway/EmailGatewayTestCase.java b/sandbox/travelsample/shared-contributions/emailgateway-contribution/test/scatours/emailgateway/EmailGatewayTestCase.java new file mode 100644 index 0000000000..c471e024e3 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/emailgateway-contribution/test/scatours/emailgateway/EmailGatewayTestCase.java @@ -0,0 +1,81 @@ +/* + * 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.emailgateway; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +/** + * + */ +public class EmailGatewayTestCase { + private static SCANode node; + + /** + * @throws java.lang.Exception + */ + @BeforeClass + public static void setUpBeforeClass() throws Exception { + SCANodeFactory factory = SCANodeFactory.newInstance(); + node = factory.createSCANodeFromClassLoader("emailgatewaytest.composite", EmailGateway.class.getClassLoader()); + node.start(); + } + + @Test + public void testEmailGateway() { + SCAClient client = (SCAClient) node; + EmailGateway cc = client.getService(EmailGateway.class, "EmailGatewayClient"); + ObjectFactory objectFactory = new ObjectFactory(); + EmailType email = objectFactory.createEmailType(); + email.setTo("Fred"); + email.setTitle("An email"); + email.setBody("A message"); + System.out.println(cc.sendEmail(email)); + } + + @Test + //@Ignore + public void testWaitForInput() { + System.out.println("Press a key to end"); + /* try { + System.in.read(); + } catch (Exception ex) { + } + System.out.println("Shutting down"); +*/ + } + + /** + * @throws java.lang.Exception + */ + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (node != null) { + node.stop(); + node = null; + } + } + +} diff --git a/sandbox/travelsample/shared-contributions/emailgateway-contribution/wsdl/EmailGateway.wsdl b/sandbox/travelsample/shared-contributions/emailgateway-contribution/wsdl/EmailGateway.wsdl new file mode 100644 index 0000000000..c103ad947d --- /dev/null +++ b/sandbox/travelsample/shared-contributions/emailgateway-contribution/wsdl/EmailGateway.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/flight-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/shared-contributions/flight-contribution/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..394be817a9 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/flight-contribution/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/flight-contribution/pom.xml b/sandbox/travelsample/shared-contributions/flight-contribution/pom.xml new file mode 100644 index 0000000000..8782ab83d3 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/flight-contribution/pom.xml @@ -0,0 +1,76 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.5-SNAPSHOT + + + scatours-flight-contribution + Apache Tuscany SCA Tours Flight Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-data-api + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + scatours-common-contribution + 1.5-SNAPSHOT + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + ${basedir}/src + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + target/** + src/** + + + + + diff --git a/sandbox/travelsample/shared-contributions/flight-contribution/src/scatours/flight/FlightImpl.java b/sandbox/travelsample/shared-contributions/flight-contribution/src/scatours/flight/FlightImpl.java new file mode 100644 index 0000000000..72c1c7201c --- /dev/null +++ b/sandbox/travelsample/shared-contributions/flight-contribution/src/scatours/flight/FlightImpl.java @@ -0,0 +1,127 @@ +/* + * 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.flight; + +import java.util.ArrayList; +import java.util.List; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import scatours.common.Book; +import scatours.common.Search; +import scatours.common.SearchCallback; +import scatours.common.TripItem; +import scatours.common.TripLeg; + +/** + * An implementation of the Hotel service + */ +@Scope("STATELESS") +@Service(interfaces={Search.class, Book.class}) +public class FlightImpl implements Search, Book { + + private List flights = new ArrayList(); + + @Callback + protected SearchCallback searchCallback; + + @Init + public void init() { + flights.add(new FlightInfo("EA26", + "Europe Airlines Airbus A300", + "LGW", + "FLR", + "06/12/09", + "06/12/09", + "350", + 250, + "EUR", + "http://localhost:8085/tbd" )); + flights.add(new FlightInfo("EA27", + "Europe Airlines Airbus A300", + "FLR", + "LGW", + "13/12/09", + "13/12/09", + "350", + 250, + "EUR", + "http://localhost:8085/tbd" )); + + } + + public TripItem[] searchSynch(TripLeg tripLeg) { + List items = new ArrayList(); + + // find outbound leg + for(FlightInfo flight : flights){ + if ((flight.getFromLocation().equals(tripLeg.getFromLocation())) && + (flight.getToLocation().equals(tripLeg.getToLocation())) && + (flight.getFromDate().equals(tripLeg.getFromDate()))){ + TripItem item = new TripItem("", + "", + TripItem.FLIGHT, + flight.getName(), + flight.getDescription(), + flight.getFromLocation() + " - " + flight.getToLocation(), + flight.getFromDate(), + flight.getToDate(), + flight.getPricePerSeat(), + flight.getCurrency(), + flight.getLink()); + items.add(item); + } + } + + // find return leg + for(FlightInfo flight : flights){ + if ((flight.getFromLocation().equals(tripLeg.getToLocation())) && + (flight.getToLocation().equals(tripLeg.getFromLocation())) && + (flight.getFromDate().equals(tripLeg.getToDate()))){ + TripItem item = new TripItem("", + "", + TripItem.FLIGHT, + flight.getName(), + flight.getDescription(), + flight.getFromLocation() + " - " + flight.getToLocation(), + flight.getFromDate(), + tripLeg.getToDate(), + flight.getPricePerSeat(), + flight.getCurrency(), + flight.getLink()); + items.add(item); + } + } + + return items.toArray(new TripItem[items.size()]); + } + + public void searchAsynch(TripLeg tripLeg) { + + // return available hotels + searchCallback.searchResults(searchSynch(tripLeg)); + } + + public String book(TripItem tripItem) { + return "flight1"; + } +} diff --git a/sandbox/travelsample/shared-contributions/flight-contribution/src/scatours/flight/FlightInfo.java b/sandbox/travelsample/shared-contributions/flight-contribution/src/scatours/flight/FlightInfo.java new file mode 100644 index 0000000000..fb5fb9fef5 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/flight-contribution/src/scatours/flight/FlightInfo.java @@ -0,0 +1,142 @@ +/* + * 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.flight; + + +public class FlightInfo { + + private String name; + private String description; + private String fromLocation; + private String toLocation; + private String fromDate; + private String toDate; + private String seats; + private double pricePerSeat; + private String currency; + private String link; + + public FlightInfo() { + } + + public FlightInfo(String name, + String description, + String fromLocation, + String toLocation, + String fromDate, + String toDate, + String seats, + double pricePerSeat, + String currency, + String link) { + + + this.name = name; + this.description = description; + this.fromLocation = fromLocation; + this.toLocation = toLocation; + this.fromDate = fromDate; + this.toDate = toDate; + this.seats = seats; + this.pricePerSeat = pricePerSeat; + this.currency = currency; + this.link = link; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getFromLocation() { + return fromLocation; + } + + public void setFromLocation(String fromLocation) { + this.fromLocation = fromLocation; + } + + public String getToLocation() { + return toLocation; + } + + public void setToLocation(String toLocation) { + this.toLocation = toLocation; + } + + public String getFromDate() { + return fromDate; + } + + public void setFromDate(String fromDate) { + this.fromDate = fromDate; + } + + public String getToDate() { + return toDate; + } + + public void setToDate(String toDate) { + this.toDate = toDate; + } + + public String getSeats() { + return seats; + } + + public void setSeats(String seats) { + this.seats = seats; + } + + public double getPricePerSeat() { + return pricePerSeat; + } + + public void setPricePerSeat(double pricePerSeat) { + this.pricePerSeat = pricePerSeat; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } +} \ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/hotel-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/shared-contributions/hotel-contribution/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..765c8d1cc3 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/hotel-contribution/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/hotel-contribution/pom.xml b/sandbox/travelsample/shared-contributions/hotel-contribution/pom.xml new file mode 100644 index 0000000000..4b49632937 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/hotel-contribution/pom.xml @@ -0,0 +1,76 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.5-SNAPSHOT + + + scatours-hotel-contribution + Apache Tuscany SCA Tours Hotel Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-data-api + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + scatours-common-contribution + 1.5-SNAPSHOT + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + ${basedir}/src + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + target/** + src/** + + + + + diff --git a/sandbox/travelsample/shared-contributions/hotel-contribution/src/scatours/hotel/HotelImpl.java b/sandbox/travelsample/shared-contributions/hotel-contribution/src/scatours/hotel/HotelImpl.java new file mode 100644 index 0000000000..a9a6d1bbde --- /dev/null +++ b/sandbox/travelsample/shared-contributions/hotel-contribution/src/scatours/hotel/HotelImpl.java @@ -0,0 +1,116 @@ +/* + * 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.hotel; + +import java.util.ArrayList; +import java.util.List; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import scatours.common.Book; +import scatours.common.Search; +import scatours.common.SearchCallback; +import scatours.common.TripItem; +import scatours.common.TripLeg; + +/** + * An implementation of the Hotel service + */ +@Scope("STATELESS") +@Service(interfaces={Search.class, Book.class}) +public class HotelImpl implements Search, Book { + + private List hotels = new ArrayList(); + + @Callback + protected SearchCallback searchCallback; + + @Init + public void init() { + hotels.add(new HotelInfo("Deep Bay Hotel", + "Wonderful sea views and a relaxed atmosphere", + "FLR", + "06/12/09", + "200", + 100, + "EUR", + "http://localhost:8085/tbd" )); + hotels.add(new HotelInfo("Long Bay Hotel", + "Friendly staff and an ocean breeze", + "FLR", + "06/12/09", + "200", + 100, + "EUR", + "http://localhost:8085/tbd" )); + hotels.add(new HotelInfo("City Hotel", + "Smart rooms and early breakfasts", + "FLR", + "06/12/09", + "200", + 100, + "EUR", + "http://localhost:8085/tbd" )); + hotels.add(new HotelInfo("County Hotel", + "The smell of the open country", + "FLR", + "06/12/09", + "200", + 100, + "EUR", + "http://localhost:8085/tbd" )); + } + + public TripItem[] searchSynch(TripLeg tripLeg) { + List items = new ArrayList(); + + // find available hotels + for(HotelInfo hotel : hotels){ + if (hotel.getLocation().equals(tripLeg.getToLocation())){ + TripItem item = new TripItem("", + "", + TripItem.HOTEL, + hotel.getName(), + hotel.getDescription(), + hotel.getLocation(), + tripLeg.getFromDate(), + tripLeg.getToDate(), + hotel.getPricePerBed(), + hotel.getCurrency(), + hotel.getLink()); + items.add(item); + } + } + + return items.toArray(new TripItem[items.size()]); + } + + public void searchAsynch(TripLeg tripLeg) { + + // return available hotels + searchCallback.searchResults(searchSynch(tripLeg)); + } + + public String book(TripItem tripItem) { + return "hotel1"; + } +} diff --git a/sandbox/travelsample/shared-contributions/hotel-contribution/src/scatours/hotel/HotelInfo.java b/sandbox/travelsample/shared-contributions/hotel-contribution/src/scatours/hotel/HotelInfo.java new file mode 100644 index 0000000000..3b0d11d16e --- /dev/null +++ b/sandbox/travelsample/shared-contributions/hotel-contribution/src/scatours/hotel/HotelInfo.java @@ -0,0 +1,120 @@ +/* + * 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.hotel; + + +public class HotelInfo { + + private String name; + private String description; + private String location; + private String date; + private String beds; + private double pricePerBed; + private String currency; + private String link; + + public HotelInfo() { + } + + public HotelInfo(String name, + String description, + String location, + String date, + String beds, + double pricePerBed, + String currency, + String link) { + + this.name = name; + this.description = description; + this.location = location; + this.date = date; + this.beds = beds; + this.pricePerBed = pricePerBed; + this.currency = currency; + this.link = link; + } + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + public String getBeds() { + return beds; + } + + public void setBeds(String beds) { + this.beds = beds; + } + + public double getPricePerBed() { + return pricePerBed; + } + + public void setPricePerBed(double pricePerBed) { + this.pricePerBed = pricePerBed; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } +} diff --git a/sandbox/travelsample/shared-contributions/payment-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/shared-contributions/payment-contribution/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..d22f4816ab --- /dev/null +++ b/sandbox/travelsample/shared-contributions/payment-contribution/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/payment-contribution/creditcard.composite b/sandbox/travelsample/shared-contributions/payment-contribution/creditcard.composite new file mode 100644 index 0000000000..184304e829 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/payment-contribution/creditcard.composite @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/payment-contribution/pom.xml b/sandbox/travelsample/shared-contributions/payment-contribution/pom.xml new file mode 100644 index 0000000000..98a1166a66 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/payment-contribution/pom.xml @@ -0,0 +1,155 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.5-SNAPSHOT + + + scatours-payment-contribution + Apache Tuscany SCA Tours Payment Contribution + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jsonrpc-runtime + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 1.5-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + 1.5-SNAPSHOT + runtime + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + ${basedir}/src + ${basedir}/test + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + target/** + src/** + test/** + *.composite + + + + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + target/** + src/** + test/** + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.9 + + + wsimport + generate-sources + + wsimport + + + payment.creditcard + ${basedir}/wsdl + + + CreditCardPayment.wsdl + + ${project.build.directory}/jaxws-source + + false + true + + + + + + + diff --git a/sandbox/travelsample/shared-contributions/payment-contribution/src/payment/creditcard/impl/CreditCardPaymentImpl.java b/sandbox/travelsample/shared-contributions/payment-contribution/src/payment/creditcard/impl/CreditCardPaymentImpl.java new file mode 100644 index 0000000000..2a9c537775 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/payment-contribution/src/payment/creditcard/impl/CreditCardPaymentImpl.java @@ -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 payment.creditcard.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import payment.creditcard.CreditCardDetailsType; +import payment.creditcard.CreditCardPayment; + +/** + * + */ +@Service(CreditCardPayment.class) +public class CreditCardPaymentImpl implements CreditCardPayment { + + @Reference + protected CreditCardPayment creditCardPayment; + + public String authorize(CreditCardDetailsType creditCard, float amount) { + // Validate some of the fields in CreditCardDetailsType + if (creditCard.getCreditCardType() == null) { + return "UnknownCreditCardType"; + } + // Delegate the external web service + return creditCardPayment.authorize(creditCard, amount); + } + +} diff --git a/sandbox/travelsample/shared-contributions/payment-contribution/src/payment/creditcard/ws/impl/CreditCardPaymentWSImpl.java b/sandbox/travelsample/shared-contributions/payment-contribution/src/payment/creditcard/ws/impl/CreditCardPaymentWSImpl.java new file mode 100644 index 0000000000..f0c61cd14d --- /dev/null +++ b/sandbox/travelsample/shared-contributions/payment-contribution/src/payment/creditcard/ws/impl/CreditCardPaymentWSImpl.java @@ -0,0 +1,48 @@ +/* + * 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 payment.creditcard.ws.impl; + +import org.osoa.sca.annotations.Service; + +import payment.creditcard.CreditCardDetailsType; +import payment.creditcard.CreditCardPayment; + +/** + * + */ +@Service(CreditCardPayment.class) +public class CreditCardPaymentWSImpl implements CreditCardPayment { + + public String authorize(CreditCardDetailsType creditCard, float amount) { + if (creditCard != null){ + System.out.println("Checking card: name = " + + creditCard.getCardOwner().getName() + + " number = " + + creditCard.getCreditCardNumber() + + " for amount " + + amount); + } else { + System.out.println("Checking card is null"); + } + + return "OK"; + } + +} diff --git a/sandbox/travelsample/shared-contributions/payment-contribution/test/payment/creditcard/CreditCardPaymentTestCase.java b/sandbox/travelsample/shared-contributions/payment-contribution/test/payment/creditcard/CreditCardPaymentTestCase.java new file mode 100644 index 0000000000..656197dcb9 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/payment-contribution/test/payment/creditcard/CreditCardPaymentTestCase.java @@ -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 payment.creditcard; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +/** + * + */ +public class CreditCardPaymentTestCase { + private static SCANode node; + + /** + * @throws java.lang.Exception + */ + @BeforeClass + public static void setUpBeforeClass() throws Exception { + SCANodeFactory factory = SCANodeFactory.newInstance(); + node = factory.createSCANodeFromClassLoader("creditcard.composite", CreditCardPayment.class.getClassLoader()); + node.start(); + } + + @Test + public void testCreditCardPayment() { + SCAClient client = (SCAClient) node; + CreditCardPayment cc = client.getService(CreditCardPayment.class, "CreditCardPaymentWSClient"); + + ObjectFactory objectFactory = new ObjectFactory(); + CreditCardDetailsType ccDetails = objectFactory.createCreditCardDetailsType(); + ccDetails.setCreditCardType(CreditCardTypeType.fromValue("Visa")); + PayerType ccOwner = objectFactory.createPayerType(); + ccOwner.setName("Fred"); + ccDetails.setCardOwner(ccOwner); + + System.out.println(cc.authorize(ccDetails, 100.00f)); + } + + @Test + //@Ignore + public void testWaitForInput() { +/* + System.out.println("Press a key to end"); + try { + System.in.read(); + } catch (Exception ex) { + } + System.out.println("Shutting down"); +*/ + } + + /** + * @throws java.lang.Exception + */ + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (node != null) { + node.stop(); + node = null; + } + } + +} diff --git a/sandbox/travelsample/shared-contributions/payment-contribution/wsdl/CreditCardPayment.wsdl b/sandbox/travelsample/shared-contributions/payment-contribution/wsdl/CreditCardPayment.wsdl new file mode 100644 index 0000000000..b40c341389 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/payment-contribution/wsdl/CreditCardPayment.wsdl @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/pom.xml b/sandbox/travelsample/shared-contributions/pom.xml new file mode 100644 index 0000000000..39dde3875f --- /dev/null +++ b/sandbox/travelsample/shared-contributions/pom.xml @@ -0,0 +1,57 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.4-SNAPSHOT + + + tuscany-scatours-common-contributions + pom + Apache Tuscany SCA Tours Common Contributions + + + + default + + true + + + calendar-contribution + car-contribution + common-contribution + currency-contribution + emailgateway-contribution + flight-contribution + hotel-contribution + payment-contribution + shoppingcart-contribution + travelcatalog-contribution + tripbooking-contribution + trip-contribution + scatours-contribution + + + + + + diff --git a/sandbox/travelsample/shared-contributions/scatours-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/shared-contributions/scatours-contribution/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..368e95ebd0 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/scatours-contribution/META-INF/sca-contribution.xml @@ -0,0 +1,26 @@ + + + + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/scatours-contribution/pom.xml b/sandbox/travelsample/shared-contributions/scatours-contribution/pom.xml new file mode 100644 index 0000000000..500d23f4b8 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/scatours-contribution/pom.xml @@ -0,0 +1,106 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.5-SNAPSHOT + + + scatours-scatours-contribution + Apache Tuscany SCA Tours SCATours Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-data-api + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + scatours-common-contribution + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + scatours-currency-contribution + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + scatours-travelcatalog-contribution + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + scatours-tripbooking-contribution + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + scatours-shoppingcart-contribution + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + scatours-paymentprocess-contribution + 1.5-SNAPSHOT + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + ${basedir}/src + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + target/** + src/** + + + + + diff --git a/sandbox/travelsample/shared-contributions/scatours-contribution/src/scatours/SCAToursBooking.java b/sandbox/travelsample/shared-contributions/scatours-contribution/src/scatours/SCAToursBooking.java new file mode 100644 index 0000000000..ac39443e9c --- /dev/null +++ b/sandbox/travelsample/shared-contributions/scatours-contribution/src/scatours/SCAToursBooking.java @@ -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; + + +import org.osoa.sca.annotations.Remotable; + +import scatours.common.TripItem; + +/** + * The SCA Tours trip booking service interface + */ +@Remotable +public interface SCAToursBooking { + String bookTrip(String cartId, TripItem tripId); +} diff --git a/sandbox/travelsample/shared-contributions/scatours-contribution/src/scatours/SCAToursCart.java b/sandbox/travelsample/shared-contributions/scatours-contribution/src/scatours/SCAToursCart.java new file mode 100644 index 0000000000..61e32ec4a2 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/scatours-contribution/src/scatours/SCAToursCart.java @@ -0,0 +1,34 @@ +/* + * 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.Conversational; +import org.osoa.sca.annotations.Remotable; + +import scatours.common.TripItem; + +/** + * The ShoppingCart service interface + */ +@Remotable +public interface SCAToursCart{ + String newCart(); + TripItem[] getTrips(String cartId); + void checkout(String cartId); +} diff --git a/sandbox/travelsample/shared-contributions/scatours-contribution/src/scatours/SCAToursImpl.java b/sandbox/travelsample/shared-contributions/scatours-contribution/src/scatours/SCAToursImpl.java new file mode 100644 index 0000000000..c0f7bec6ea --- /dev/null +++ b/sandbox/travelsample/shared-contributions/scatours-contribution/src/scatours/SCAToursImpl.java @@ -0,0 +1,162 @@ +/* + * 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.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +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.Scope; +import org.osoa.sca.annotations.Service; + +import scatours.common.TripItem; +import scatours.common.TripLeg; +import scatours.paymentprocess.PaymentProcess; +import scatours.shoppingcart.ShoppingCart; +import scatours.travelcatalog.TravelCatalogSearch; +import scatours.tripbooking.TripBooking; + +/** + * An implementation of the Trip service + */ +@Scope("COMPOSITE") +@Service(interfaces={SCAToursSearch.class, SCAToursBooking.class, SCAToursCart.class}) +public class SCAToursImpl implements SCAToursSearch, SCAToursBooking, SCAToursCart{ + + @Reference + protected TravelCatalogSearch travelCatalogSearch; + + @Reference + protected TripBooking tripBooking; + + @Reference + protected ShoppingCart shoppingCart; + + @Context + protected ComponentContext componentContext; + + private Map carts = new HashMap(); + private Map trips = new HashMap(); + //private Map searchItemsCache = new HashMap(); + + // SCAToursSearch 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; + } + + // SCAToursBooking methods + + public String bookTrip(String cartId, TripItem trip){ + TripItem bookedTrip = tripBooking.bookTrip(cartId, trip); + carts.get(cartId).addTrip(bookedTrip); + return bookedTrip.getBookingCode(); + } + + // SCAToursCart methods + + public String newCart(){ + String cartId = UUID.randomUUID().toString(); + ServiceReference shoppingCart = componentContext.getServiceReference(ShoppingCart.class, + "shoppingCart"); + shoppingCart.setConversationID(cartId); + carts.put(cartId, shoppingCart.getService()); + + return cartId; + } + + public TripItem[] getTrips(String cartId){ + return carts.get(cartId).getTrips(); + } + + public void checkout(String cartId){ + shoppingCart.checkout("Fred"); + } + +/* + public String addTrip(String cartId){ + String tripId = UUID.randomUUID().toString(); + ServiceReference tripReference = componentContext.getServiceReference(TripBooking.class, + "tripBooking"); + tripReference.setConversationID(tripId); + trips.put(tripId, tripReference.getService()); + + carts.get(cartId).addItem(tripId); + return tripId; + } + + public void removeTrip(String cartId, String tripId) { + carts.get(cartId).removeItem(tripId); + } + + public void addTripItem(String cartId, String tripId, String tripItemId){ + TripItem item = searchItemsCache.get(tripItemId); + TripItem itemCopy = new TripItem(item); + itemCopy.setTripId(tripId); + trips.get(tripId).addTripItem(itemCopy); + } + + public void removeTripItem(String cartId, String tripId, String tripItemId){ + trips.get(tripId).removeTripItem(tripItemId); + } + + public TripItem[] getTripItems(String cartId) { + List returnTripItems = new ArrayList(); + + for( String tripId : carts.get(cartId).getItems()){ + returnTripItems.addAll(Arrays.asList(trips.get(tripId).getTripItems())); + } + + return returnTripItems.toArray(new TripItem[returnTripItems.size()]); + } + + public double getTotalPrice(String cartId){ + double total = 0.0; + + for( String tripId : carts.get(cartId).getItems()){ + total += trips.get(tripId).getTripPrice(); + } + + return total; + } + + public void checkout(String cartId){ + // get users credentials. Hard coded for now but should + // come from the security context + String customerId = "Fred Bloggs"; + float amount = (float)getTotalPrice(cartId); + + paymentProcess.makePayment(customerId, amount); + } + +*/ +} diff --git a/sandbox/travelsample/shared-contributions/scatours-contribution/src/scatours/SCAToursSearch.java b/sandbox/travelsample/shared-contributions/scatours-contribution/src/scatours/SCAToursSearch.java new file mode 100644 index 0000000000..f0f435fc06 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/scatours-contribution/src/scatours/SCAToursSearch.java @@ -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; + +import org.osoa.sca.annotations.Remotable; + +import scatours.common.TripItem; +import scatours.common.TripLeg; + +/** + * The Trip service interface + */ +@Remotable +public interface SCAToursSearch { + TripItem[] search(TripLeg tripLeg); +} diff --git a/sandbox/travelsample/shared-contributions/shoppingcart-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/shared-contributions/shoppingcart-contribution/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..f4010d04b1 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/shoppingcart-contribution/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/shoppingcart-contribution/pom.xml b/sandbox/travelsample/shared-contributions/shoppingcart-contribution/pom.xml new file mode 100644 index 0000000000..79621c1370 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/shoppingcart-contribution/pom.xml @@ -0,0 +1,88 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.5-SNAPSHOT + + + scatours-shoppingcart-contribution + Apache Tuscany SCA Tours Shopping Cart Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-data-api + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + scatours-common-contribution + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + scatours-currency-contribution + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + scatours-paymentprocess-contribution + 1.5-SNAPSHOT + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + ${basedir}/src + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + target/** + src/** + + + + + diff --git a/sandbox/travelsample/shared-contributions/shoppingcart-contribution/src/scatours/shoppingcart/ShoppingCart.java b/sandbox/travelsample/shared-contributions/shoppingcart-contribution/src/scatours/shoppingcart/ShoppingCart.java new file mode 100644 index 0000000000..f7595c71fe --- /dev/null +++ b/sandbox/travelsample/shared-contributions/shoppingcart-contribution/src/scatours/shoppingcart/ShoppingCart.java @@ -0,0 +1,39 @@ +/* + * 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.shoppingcart; + +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.EndsConversation; +import org.osoa.sca.annotations.Remotable; + +import scatours.common.TripItem; + +/** + * The ShoppingCart service interface + */ +@Remotable +@Conversational +public interface ShoppingCart{ + void addTrip(TripItem trip); + void removeTrip(TripItem trip); + TripItem[] getTrips(); + + @EndsConversation + void checkout(String name); +} diff --git a/sandbox/travelsample/shared-contributions/shoppingcart-contribution/src/scatours/shoppingcart/ShoppingCartImpl.java b/sandbox/travelsample/shared-contributions/shoppingcart-contribution/src/scatours/shoppingcart/ShoppingCartImpl.java new file mode 100644 index 0000000000..5b6bc4007c --- /dev/null +++ b/sandbox/travelsample/shared-contributions/shoppingcart-contribution/src/scatours/shoppingcart/ShoppingCartImpl.java @@ -0,0 +1,89 @@ +/* + * 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.shoppingcart; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +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.Reference; + +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + + +import scatours.common.TripItem; +import scatours.paymentprocess.PaymentProcess; + +/** + * An implementation of the Trip service + */ +@Scope("CONVERSATION") +@Service(interfaces={ShoppingCart.class}) +public class ShoppingCartImpl implements ShoppingCart{ + + // @Reference + // protected PaymentProcess paymentProcess; + + @ConversationID + protected String cartId; + + private List trips = new ArrayList(); + + // Trip methods + + @Init + public void initCart() { + System.out.println("Cart init for id: " + cartId); + } + + @Destroy + public void destroyCart() { + System.out.println("Cart destroy for id: " + cartId); + } + + public void addTrip(TripItem trip) { + trips.add(trip); + } + + public void removeTrip(TripItem trip) { + trips.remove(trip); + } + + public TripItem[] getTrips(){ + return trips.toArray(new TripItem[trips.size()]); + } + + public void checkout(String customerName){ + // get users credentials. Hard coded for now but should + // come from the security context + String customerId = customerName; + + // get the total for all the trips + float amount = (float)0.0; + + //paymentProcess.makePayment(customerId, amount); + } + +} diff --git a/sandbox/travelsample/shared-contributions/travelcatalog-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/shared-contributions/travelcatalog-contribution/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..286b9c2a05 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/travelcatalog-contribution/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/travelcatalog-contribution/pom.xml b/sandbox/travelsample/shared-contributions/travelcatalog-contribution/pom.xml new file mode 100644 index 0000000000..c82a50c012 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/travelcatalog-contribution/pom.xml @@ -0,0 +1,88 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.5-SNAPSHOT + + + scatours-travelcatalog-contribution + Apache Tuscany SCA Tours Travel Catalog Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-data-api + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + scatours-common-contribution + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + scatours-currency-contribution + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + scatours-tripbooking-contribution + 1.5-SNAPSHOT + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + ${basedir}/src + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + target/** + src/** + + + + + diff --git a/sandbox/travelsample/shared-contributions/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogImpl.java b/sandbox/travelsample/shared-contributions/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogImpl.java new file mode 100644 index 0000000000..2369baaff1 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogImpl.java @@ -0,0 +1,137 @@ +/* + * 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; + +/** + * 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; + + @Reference + protected Search tripSearch; + + @Property + public String quoteCurrencyCode = "USD"; + + @Reference + protected CurrencyConverter currencyConverter; + + @Context + protected ComponentContext componentContext; + + private int responsesReceived = 0; + + private List searchResults = new ArrayList(); + + // TravelSearch methods + + public TripItem[] search(TripLeg tripLeg) { + + searchResults.clear(); + responsesReceived = 0; + + ServiceReference dynamicHotelSearch = + componentContext.getServiceReference(Search.class, "hotelSearch"); + + dynamicHotelSearch.setCallbackID("HotelSearchCallbackID-" + tripLeg.getId()); + dynamicHotelSearch.getService().searchAsynch(tripLeg); + + flightSearch.searchAsynch(tripLeg); + carSearch.searchAsynch(tripLeg); + tripSearch.searchAsynch(tripLeg); + + while (responsesReceived < 4){ + 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); + + if (items != null) { + for(int i = 0; i < items.length; i++ ){ + searchResults.add(items[i]); + } + } + + responsesReceived++; + try { + synchronized (this) { + this.notifyAll(); + } + } catch (Exception ex) { + } + } +} diff --git a/sandbox/travelsample/shared-contributions/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogSearch.java b/sandbox/travelsample/shared-contributions/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogSearch.java new file mode 100644 index 0000000000..df22724de2 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogSearch.java @@ -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); +} diff --git a/sandbox/travelsample/shared-contributions/trip-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/shared-contributions/trip-contribution/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..8a4f6abf02 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/trip-contribution/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/trip-contribution/pom.xml b/sandbox/travelsample/shared-contributions/trip-contribution/pom.xml new file mode 100644 index 0000000000..e858b5cf1e --- /dev/null +++ b/sandbox/travelsample/shared-contributions/trip-contribution/pom.xml @@ -0,0 +1,76 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.5-SNAPSHOT + + + scatours-trip-contribution + Apache Tuscany SCA Tours Prepackaged Trip Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-data-api + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + scatours-common-contribution + 1.5-SNAPSHOT + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + ${basedir}/src + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + target/** + src/** + + + + + diff --git a/sandbox/travelsample/shared-contributions/trip-contribution/src/scatours/trip/TripImpl.java b/sandbox/travelsample/shared-contributions/trip-contribution/src/scatours/trip/TripImpl.java new file mode 100644 index 0000000000..9d51c8078b --- /dev/null +++ b/sandbox/travelsample/shared-contributions/trip-contribution/src/scatours/trip/TripImpl.java @@ -0,0 +1,106 @@ +/* + * 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.trip; + +import java.util.ArrayList; +import java.util.List; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import scatours.common.Book; +import scatours.common.Search; +import scatours.common.SearchCallback; +import scatours.common.TripItem; +import scatours.common.TripLeg; + +/** + * An implementation of the Hotel service + */ +@Scope("STATELESS") +@Service(interfaces={Search.class, Book.class}) +public class TripImpl implements Search, Book { + + private List trips = new ArrayList(); + + @Callback + protected SearchCallback searchCallback; + + @Init + public void init() { + trips.add(new TripInfo("FS1DEC06", + "Florence and Siena pre-packaged tour", + "LGW", + "FLR", + "06/12/09", + "13/12/09", + "27", + 450, + "EUR", + "http://localhost:8085/tbd" )); + trips.add(new TripInfo("FS1DEC13", + "Florence and Siena pre-packaged tour 2", + "LGW", + "FLR", + "13/12/09", + "20/12/09", + "27", + 550, + "EUR", + "http://localhost:8085/tbd" )); + } + + public TripItem[] searchSynch(TripLeg tripLeg) { + List items = new ArrayList(); + + // find the pre-package trip + for(TripInfo trip : trips){ + if ((trip.getFromLocation().equals(tripLeg.getFromLocation())) && + (trip.getToLocation().equals(tripLeg.getToLocation())) && + (trip.getFromDate().equals(tripLeg.getFromDate()))){ + TripItem item = new TripItem("", + "", + TripItem.TRIP, + trip.getName(), + trip.getDescription(), + trip.getFromLocation() + " - " + trip.getToLocation(), + trip.getFromDate(), + trip.getToDate(), + trip.getPricePerPerson(), + trip.getCurrency(), + trip.getLink()); + items.add(item); + } + } + + return items.toArray(new TripItem[items.size()]); + } + + public void searchAsynch(TripLeg tripLeg) { + + // return available hotels + searchCallback.searchResults(searchSynch(tripLeg)); + } + + public String book(TripItem tripItem) { + return "trip1"; + } +} diff --git a/sandbox/travelsample/shared-contributions/trip-contribution/src/scatours/trip/TripInfo.java b/sandbox/travelsample/shared-contributions/trip-contribution/src/scatours/trip/TripInfo.java new file mode 100644 index 0000000000..343a3d2cef --- /dev/null +++ b/sandbox/travelsample/shared-contributions/trip-contribution/src/scatours/trip/TripInfo.java @@ -0,0 +1,142 @@ +/* + * 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.trip; + + +public class TripInfo { + + private String name; + private String description; + private String fromLocation; + private String toLocation; + private String fromDate; + private String toDate; + private String spaces; + private double pricePerPerson; + private String currency; + private String link; + + public TripInfo() { + } + + public TripInfo(String name, + String description, + String fromLocation, + String toLocation, + String fromDate, + String toDate, + String spaces, + double pricePerPerson, + String currency, + String link) { + + + this.name = name; + this.description = description; + this.fromLocation = fromLocation; + this.toLocation = toLocation; + this.fromDate = fromDate; + this.toDate = toDate; + this.spaces = spaces; + this.pricePerPerson = pricePerPerson; + this.currency = currency; + this.link = link; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getFromLocation() { + return fromLocation; + } + + public void setFromLocation(String fromLocation) { + this.fromLocation = fromLocation; + } + + public String getToLocation() { + return toLocation; + } + + public void setToLocation(String toLocation) { + this.toLocation = toLocation; + } + + public String getFromDate() { + return fromDate; + } + + public void setFromDate(String fromDate) { + this.fromDate = fromDate; + } + + public String getToDate() { + return toDate; + } + + public void setToDate(String toDate) { + this.toDate = toDate; + } + + public String getSpaces() { + return spaces; + } + + public void setSpaces(String spaces) { + this.spaces = spaces; + } + + public double getPricePerPerson() { + return pricePerPerson; + } + + public void setPricePerPerson(double pricePerPerson) { + this.pricePerPerson = pricePerPerson; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } +} \ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/tripbooking-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/shared-contributions/tripbooking-contribution/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..2accecffaa --- /dev/null +++ b/sandbox/travelsample/shared-contributions/tripbooking-contribution/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + + + \ No newline at end of file diff --git a/sandbox/travelsample/shared-contributions/tripbooking-contribution/build.xml b/sandbox/travelsample/shared-contributions/tripbooking-contribution/build.xml new file mode 100644 index 0000000000..b4fbc726cf --- /dev/null +++ b/sandbox/travelsample/shared-contributions/tripbooking-contribution/build.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/travelsample/shared-contributions/tripbooking-contribution/pom.xml b/sandbox/travelsample/shared-contributions/tripbooking-contribution/pom.xml new file mode 100644 index 0000000000..b0e7b2fef7 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/tripbooking-contribution/pom.xml @@ -0,0 +1,88 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.5-SNAPSHOT + + + scatours-tripbooking-contribution + Apache Tuscany SCA Tours Trip Booking Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-data-api + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + scatours-common-contribution + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + scatours-currency-contribution + 1.5-SNAPSHOT + + + + org.apache.tuscany.sca + scatours-shoppingcart-contribution + 1.5-SNAPSHOT + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + ${basedir}/src + + + ${basedir} + + **/*.java + **/.*/** + pom.xml + build.xml + target/** + src/** + + + + + diff --git a/sandbox/travelsample/shared-contributions/tripbooking-contribution/src/scatours/tripbooking/TripBooking.java b/sandbox/travelsample/shared-contributions/tripbooking-contribution/src/scatours/tripbooking/TripBooking.java new file mode 100644 index 0000000000..2255b29d35 --- /dev/null +++ b/sandbox/travelsample/shared-contributions/tripbooking-contribution/src/scatours/tripbooking/TripBooking.java @@ -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.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 +public interface TripBooking { + + TripItem bookTrip(String cartId, TripItem trip); +} diff --git a/sandbox/travelsample/shared-contributions/tripbooking-contribution/src/scatours/tripbooking/TripBookingImpl.java b/sandbox/travelsample/shared-contributions/tripbooking-contribution/src/scatours/tripbooking/TripBookingImpl.java new file mode 100644 index 0000000000..fd199fd19f --- /dev/null +++ b/sandbox/travelsample/shared-contributions/tripbooking-contribution/src/scatours/tripbooking/TripBookingImpl.java @@ -0,0 +1,147 @@ +/* + * 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.ComponentContext; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.ConversationID; +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Reference; + +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + + +import scatours.common.Book; +import scatours.common.Search; +import scatours.common.TripItem; +import scatours.shoppingcart.ShoppingCart; + +/** + * An implementation of the Trip service + */ +@Service(interfaces={TripBooking.class}) +public class TripBookingImpl implements TripBooking{ + + @Reference + protected Book hotelBook; + + @Reference + protected Book flightBook; + + @Reference + protected Book carBook; + + @Reference + protected Book tripBook; + + @Reference + protected ShoppingCart shoppingCart; + + @Context + protected ComponentContext componentContext; + + public TripItem bookTrip(String cartId, TripItem trip) { + + String bookingCode = ""; + + // book any nested items + TripItem[] nestedItems = trip.getTripItems(); + if (nestedItems != null){ + for(int i = 0; i < nestedItems.length; i++ ){ + TripItem tripItem = nestedItems[i]; + if (tripItem.getType().equals(TripItem.CAR)){ + tripItem.setBookingCode(carBook.book(tripItem)); + } else if (tripItem.getType().equals(TripItem.FLIGHT)){ + tripItem.setBookingCode(flightBook.book(tripItem)); + } else if (tripItem.getType().equals(TripItem.HOTEL)){ + tripItem.setBookingCode(hotelBook.book(tripItem)); + } else { + tripItem.setBookingCode(tripItem.getType() + " is invalid"); + } + } + } + + // book the top level item if it's a packaged trip + if (trip.getType().equals(TripItem.TRIP)){ + bookingCode = tripBook.book(trip); + trip.setBookingCode(bookingCode); + } + + // add trip to the shopping cart + //ServiceReference cart = componentContext.getServiceReference(ShoppingCart.class, + // "shoppingCart"); + //cart.setConversationID(cartId); + //cart.getService().addTrip(trip); + + return trip; + } + + /* + @ConversationID + protected String conversationId; + + private Map tripItems = new HashMap(); + + // 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 + } + */ +} diff --git a/sandbox/travelsample/shoppingcart-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/shoppingcart-contribution/META-INF/sca-contribution.xml deleted file mode 100644 index f4010d04b1..0000000000 --- a/sandbox/travelsample/shoppingcart-contribution/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/shoppingcart-contribution/pom.xml b/sandbox/travelsample/shoppingcart-contribution/pom.xml deleted file mode 100644 index 79621c1370..0000000000 --- a/sandbox/travelsample/shoppingcart-contribution/pom.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.5-SNAPSHOT - - - scatours-shoppingcart-contribution - Apache Tuscany SCA Tours Shopping Cart Contribution - - - - org.apache.tuscany.sca - tuscany-sca-api - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-data-api - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - scatours-common-contribution - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - scatours-currency-contribution - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - scatours-paymentprocess-contribution - 1.5-SNAPSHOT - - - - junit - junit - 4.5 - test - - - - - - ${artifactId} - ${basedir}/src - - - ${basedir} - - **/*.java - **/.*/** - pom.xml - build.xml - target/** - src/** - - - - - diff --git a/sandbox/travelsample/shoppingcart-contribution/src/scatours/shoppingcart/ShoppingCart.java b/sandbox/travelsample/shoppingcart-contribution/src/scatours/shoppingcart/ShoppingCart.java deleted file mode 100644 index f7595c71fe..0000000000 --- a/sandbox/travelsample/shoppingcart-contribution/src/scatours/shoppingcart/ShoppingCart.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.shoppingcart; - -import org.osoa.sca.annotations.Conversational; -import org.osoa.sca.annotations.EndsConversation; -import org.osoa.sca.annotations.Remotable; - -import scatours.common.TripItem; - -/** - * The ShoppingCart service interface - */ -@Remotable -@Conversational -public interface ShoppingCart{ - void addTrip(TripItem trip); - void removeTrip(TripItem trip); - TripItem[] getTrips(); - - @EndsConversation - void checkout(String name); -} diff --git a/sandbox/travelsample/shoppingcart-contribution/src/scatours/shoppingcart/ShoppingCartImpl.java b/sandbox/travelsample/shoppingcart-contribution/src/scatours/shoppingcart/ShoppingCartImpl.java deleted file mode 100644 index 4fc9306785..0000000000 --- a/sandbox/travelsample/shoppingcart-contribution/src/scatours/shoppingcart/ShoppingCartImpl.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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.shoppingcart; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -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.Reference; - -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - - -import scatours.common.TripItem; -import scatours.paymentprocess.PaymentProcess; - -/** - * An implementation of the Trip service - */ -@Scope("CONVERSATION") -@Service(interfaces={ShoppingCart.class}) -public class ShoppingCartImpl implements ShoppingCart{ - - @Reference - protected PaymentProcess paymentProcess; - - @ConversationID - protected String cartId; - - private List trips = new ArrayList(); - - // Trip methods - - @Init - public void initCart() { - System.out.println("Cart init for id: " + cartId); - } - - @Destroy - public void destroyCart() { - System.out.println("Cart destroy for id: " + cartId); - } - - public void addTrip(TripItem trip) { - trips.add(trip); - } - - public void removeTrip(TripItem trip) { - trips.remove(trip); - } - - public TripItem[] getTrips(){ - return trips.toArray(new TripItem[trips.size()]); - } - - public void checkout(String customerName){ - // get users credentials. Hard coded for now but should - // come from the security context - String customerId = customerName; - - // get the total for all the trips - float amount = (float)0.0; - - paymentProcess.makePayment(customerId, amount); - } - -} diff --git a/sandbox/travelsample/travelcatalog-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/travelcatalog-contribution/META-INF/sca-contribution.xml deleted file mode 100644 index 286b9c2a05..0000000000 --- a/sandbox/travelsample/travelcatalog-contribution/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/travelcatalog-contribution/pom.xml b/sandbox/travelsample/travelcatalog-contribution/pom.xml deleted file mode 100644 index c82a50c012..0000000000 --- a/sandbox/travelsample/travelcatalog-contribution/pom.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.5-SNAPSHOT - - - scatours-travelcatalog-contribution - Apache Tuscany SCA Tours Travel Catalog Contribution - - - - org.apache.tuscany.sca - tuscany-sca-api - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-data-api - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - scatours-common-contribution - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - scatours-currency-contribution - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - scatours-tripbooking-contribution - 1.5-SNAPSHOT - - - - junit - junit - 4.5 - test - - - - - - ${artifactId} - ${basedir}/src - - - ${basedir} - - **/*.java - **/.*/** - pom.xml - build.xml - target/** - src/** - - - - - diff --git a/sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogImpl.java b/sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogImpl.java deleted file mode 100644 index 2369baaff1..0000000000 --- a/sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogImpl.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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; - -/** - * 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; - - @Reference - protected Search tripSearch; - - @Property - public String quoteCurrencyCode = "USD"; - - @Reference - protected CurrencyConverter currencyConverter; - - @Context - protected ComponentContext componentContext; - - private int responsesReceived = 0; - - private List searchResults = new ArrayList(); - - // TravelSearch methods - - public TripItem[] search(TripLeg tripLeg) { - - searchResults.clear(); - responsesReceived = 0; - - ServiceReference dynamicHotelSearch = - componentContext.getServiceReference(Search.class, "hotelSearch"); - - dynamicHotelSearch.setCallbackID("HotelSearchCallbackID-" + tripLeg.getId()); - dynamicHotelSearch.getService().searchAsynch(tripLeg); - - flightSearch.searchAsynch(tripLeg); - carSearch.searchAsynch(tripLeg); - tripSearch.searchAsynch(tripLeg); - - while (responsesReceived < 4){ - 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); - - if (items != null) { - for(int i = 0; i < items.length; i++ ){ - searchResults.add(items[i]); - } - } - - responsesReceived++; - try { - synchronized (this) { - this.notifyAll(); - } - } catch (Exception ex) { - } - } -} diff --git a/sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogSearch.java b/sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogSearch.java deleted file mode 100644 index df22724de2..0000000000 --- a/sandbox/travelsample/travelcatalog-contribution/src/scatours/travelcatalog/TravelCatalogSearch.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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); -} diff --git a/sandbox/travelsample/trip-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/trip-contribution/META-INF/sca-contribution.xml deleted file mode 100644 index 8a4f6abf02..0000000000 --- a/sandbox/travelsample/trip-contribution/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/trip-contribution/pom.xml b/sandbox/travelsample/trip-contribution/pom.xml deleted file mode 100644 index e858b5cf1e..0000000000 --- a/sandbox/travelsample/trip-contribution/pom.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.5-SNAPSHOT - - - scatours-trip-contribution - Apache Tuscany SCA Tours Prepackaged Trip Contribution - - - - org.apache.tuscany.sca - tuscany-sca-api - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-data-api - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - scatours-common-contribution - 1.5-SNAPSHOT - - - - junit - junit - 4.5 - test - - - - - - ${artifactId} - ${basedir}/src - - - ${basedir} - - **/*.java - **/.*/** - pom.xml - build.xml - target/** - src/** - - - - - diff --git a/sandbox/travelsample/trip-contribution/src/scatours/trip/TripImpl.java b/sandbox/travelsample/trip-contribution/src/scatours/trip/TripImpl.java deleted file mode 100644 index 9d51c8078b..0000000000 --- a/sandbox/travelsample/trip-contribution/src/scatours/trip/TripImpl.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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.trip; - -import java.util.ArrayList; -import java.util.List; - -import org.osoa.sca.annotations.Callback; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -import scatours.common.Book; -import scatours.common.Search; -import scatours.common.SearchCallback; -import scatours.common.TripItem; -import scatours.common.TripLeg; - -/** - * An implementation of the Hotel service - */ -@Scope("STATELESS") -@Service(interfaces={Search.class, Book.class}) -public class TripImpl implements Search, Book { - - private List trips = new ArrayList(); - - @Callback - protected SearchCallback searchCallback; - - @Init - public void init() { - trips.add(new TripInfo("FS1DEC06", - "Florence and Siena pre-packaged tour", - "LGW", - "FLR", - "06/12/09", - "13/12/09", - "27", - 450, - "EUR", - "http://localhost:8085/tbd" )); - trips.add(new TripInfo("FS1DEC13", - "Florence and Siena pre-packaged tour 2", - "LGW", - "FLR", - "13/12/09", - "20/12/09", - "27", - 550, - "EUR", - "http://localhost:8085/tbd" )); - } - - public TripItem[] searchSynch(TripLeg tripLeg) { - List items = new ArrayList(); - - // find the pre-package trip - for(TripInfo trip : trips){ - if ((trip.getFromLocation().equals(tripLeg.getFromLocation())) && - (trip.getToLocation().equals(tripLeg.getToLocation())) && - (trip.getFromDate().equals(tripLeg.getFromDate()))){ - TripItem item = new TripItem("", - "", - TripItem.TRIP, - trip.getName(), - trip.getDescription(), - trip.getFromLocation() + " - " + trip.getToLocation(), - trip.getFromDate(), - trip.getToDate(), - trip.getPricePerPerson(), - trip.getCurrency(), - trip.getLink()); - items.add(item); - } - } - - return items.toArray(new TripItem[items.size()]); - } - - public void searchAsynch(TripLeg tripLeg) { - - // return available hotels - searchCallback.searchResults(searchSynch(tripLeg)); - } - - public String book(TripItem tripItem) { - return "trip1"; - } -} diff --git a/sandbox/travelsample/trip-contribution/src/scatours/trip/TripInfo.java b/sandbox/travelsample/trip-contribution/src/scatours/trip/TripInfo.java deleted file mode 100644 index 343a3d2cef..0000000000 --- a/sandbox/travelsample/trip-contribution/src/scatours/trip/TripInfo.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * 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.trip; - - -public class TripInfo { - - private String name; - private String description; - private String fromLocation; - private String toLocation; - private String fromDate; - private String toDate; - private String spaces; - private double pricePerPerson; - private String currency; - private String link; - - public TripInfo() { - } - - public TripInfo(String name, - String description, - String fromLocation, - String toLocation, - String fromDate, - String toDate, - String spaces, - double pricePerPerson, - String currency, - String link) { - - - this.name = name; - this.description = description; - this.fromLocation = fromLocation; - this.toLocation = toLocation; - this.fromDate = fromDate; - this.toDate = toDate; - this.spaces = spaces; - this.pricePerPerson = pricePerPerson; - this.currency = currency; - this.link = link; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getFromLocation() { - return fromLocation; - } - - public void setFromLocation(String fromLocation) { - this.fromLocation = fromLocation; - } - - public String getToLocation() { - return toLocation; - } - - public void setToLocation(String toLocation) { - this.toLocation = toLocation; - } - - public String getFromDate() { - return fromDate; - } - - public void setFromDate(String fromDate) { - this.fromDate = fromDate; - } - - public String getToDate() { - return toDate; - } - - public void setToDate(String toDate) { - this.toDate = toDate; - } - - public String getSpaces() { - return spaces; - } - - public void setSpaces(String spaces) { - this.spaces = spaces; - } - - public double getPricePerPerson() { - return pricePerPerson; - } - - public void setPricePerPerson(double pricePerPerson) { - this.pricePerPerson = pricePerPerson; - } - - public String getCurrency() { - return currency; - } - - public void setCurrency(String currency) { - this.currency = currency; - } - - public String getLink() { - return link; - } - - public void setLink(String link) { - this.link = link; - } -} \ No newline at end of file diff --git a/sandbox/travelsample/tripbooking-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/tripbooking-contribution/META-INF/sca-contribution.xml deleted file mode 100644 index 2accecffaa..0000000000 --- a/sandbox/travelsample/tripbooking-contribution/META-INF/sca-contribution.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/tripbooking-contribution/build.xml b/sandbox/travelsample/tripbooking-contribution/build.xml deleted file mode 100644 index b4fbc726cf..0000000000 --- a/sandbox/travelsample/tripbooking-contribution/build.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/travelsample/tripbooking-contribution/pom.xml b/sandbox/travelsample/tripbooking-contribution/pom.xml deleted file mode 100644 index b0e7b2fef7..0000000000 --- a/sandbox/travelsample/tripbooking-contribution/pom.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.5-SNAPSHOT - - - scatours-tripbooking-contribution - Apache Tuscany SCA Tours Trip Booking Contribution - - - - org.apache.tuscany.sca - tuscany-sca-api - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-data-api - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - scatours-common-contribution - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - scatours-currency-contribution - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - scatours-shoppingcart-contribution - 1.5-SNAPSHOT - - - - junit - junit - 4.5 - test - - - - - - ${artifactId} - ${basedir}/src - - - ${basedir} - - **/*.java - **/.*/** - pom.xml - build.xml - target/** - src/** - - - - - diff --git a/sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBooking.java b/sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBooking.java deleted file mode 100644 index 2255b29d35..0000000000 --- a/sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBooking.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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 -public interface TripBooking { - - TripItem bookTrip(String cartId, TripItem trip); -} diff --git a/sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBookingImpl.java b/sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBookingImpl.java deleted file mode 100644 index fd199fd19f..0000000000 --- a/sandbox/travelsample/tripbooking-contribution/src/scatours/tripbooking/TripBookingImpl.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * 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.ComponentContext; -import org.osoa.sca.ServiceReference; -import org.osoa.sca.annotations.Context; -import org.osoa.sca.annotations.ConversationID; -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Reference; - -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - - -import scatours.common.Book; -import scatours.common.Search; -import scatours.common.TripItem; -import scatours.shoppingcart.ShoppingCart; - -/** - * An implementation of the Trip service - */ -@Service(interfaces={TripBooking.class}) -public class TripBookingImpl implements TripBooking{ - - @Reference - protected Book hotelBook; - - @Reference - protected Book flightBook; - - @Reference - protected Book carBook; - - @Reference - protected Book tripBook; - - @Reference - protected ShoppingCart shoppingCart; - - @Context - protected ComponentContext componentContext; - - public TripItem bookTrip(String cartId, TripItem trip) { - - String bookingCode = ""; - - // book any nested items - TripItem[] nestedItems = trip.getTripItems(); - if (nestedItems != null){ - for(int i = 0; i < nestedItems.length; i++ ){ - TripItem tripItem = nestedItems[i]; - if (tripItem.getType().equals(TripItem.CAR)){ - tripItem.setBookingCode(carBook.book(tripItem)); - } else if (tripItem.getType().equals(TripItem.FLIGHT)){ - tripItem.setBookingCode(flightBook.book(tripItem)); - } else if (tripItem.getType().equals(TripItem.HOTEL)){ - tripItem.setBookingCode(hotelBook.book(tripItem)); - } else { - tripItem.setBookingCode(tripItem.getType() + " is invalid"); - } - } - } - - // book the top level item if it's a packaged trip - if (trip.getType().equals(TripItem.TRIP)){ - bookingCode = tripBook.book(trip); - trip.setBookingCode(bookingCode); - } - - // add trip to the shopping cart - //ServiceReference cart = componentContext.getServiceReference(ShoppingCart.class, - // "shoppingCart"); - //cart.setConversationID(cartId); - //cart.getService().addTrip(trip); - - return trip; - } - - /* - @ConversationID - protected String conversationId; - - private Map tripItems = new HashMap(); - - // 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 - } - */ -} diff --git a/sandbox/travelsample/ui-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/ui-contribution/META-INF/sca-contribution.xml deleted file mode 100644 index 764030c28e..0000000000 --- a/sandbox/travelsample/ui-contribution/META-INF/sca-contribution.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sandbox/travelsample/ui-contribution/build.xml b/sandbox/travelsample/ui-contribution/build.xml deleted file mode 100644 index 981e37ca97..0000000000 --- a/sandbox/travelsample/ui-contribution/build.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/travelsample/ui-contribution/pom.xml b/sandbox/travelsample/ui-contribution/pom.xml deleted file mode 100644 index 9c4a00a6f3..0000000000 --- a/sandbox/travelsample/ui-contribution/pom.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.5-SNAPSHOT - - - scatours-ui-contribution - Apache Tuscany SCA Tours User Interface Contribution - - - - org.apache.tuscany.sca - tuscany-host-embedded - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 1.5-SNAPSHOT - test - - - - org.apache.tuscany.sca - tuscany-binding-ws-axis2 - 1.5-SNAPSHOT - test - - - - org.apache.tuscany.sca - tuscany-host-tomcat - 1.5-SNAPSHOT - test - - - - junit - junit - 4.5 - test - - - - - - ${artifactId} - ${basedir}/src - - - ${basedir} - - **/*.java - **/.*/** - pom.xml - build.xml - target/** - src/** - - - - - - org.apache.tuscany.sca - tuscany-maven-ant-generator - 1.5-SNAPSHOT - - - - launch.LaunchTutorialAdmin - - - generate - - - - - - - diff --git a/sandbox/travelsample/ui-contribution/scatours.composite b/sandbox/travelsample/ui-contribution/scatours.composite deleted file mode 100644 index 1bd437a92e..0000000000 --- a/sandbox/travelsample/ui-contribution/scatours.composite +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - GBP - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/travelsample/ui-contribution/scatours.html b/sandbox/travelsample/ui-contribution/scatours.html deleted file mode 100644 index f4206548c0..0000000000 --- a/sandbox/travelsample/ui-contribution/scatours.html +++ /dev/null @@ -1,390 +0,0 @@ - - - -SCA Tours - - - - - - - - - - - -
-
-

Search for trips, hotels, flights and cars

-
- - - - - - - - - - - - - - - - - -
From Location:To Location:
Start Date:End Date:
Number of people: - -
-
- -
-
-
-
-
-
-
-
-

Shopping Cart

-
-
- Total Price:
-
- -
-
- - - diff --git a/sandbox/travelsample/ui-contribution/scatours.odg b/sandbox/travelsample/ui-contribution/scatours.odg deleted file mode 100644 index 8ca8fbf133..0000000000 Binary files a/sandbox/travelsample/ui-contribution/scatours.odg and /dev/null differ diff --git a/sandbox/travelsample/ui-contribution/scatours.png b/sandbox/travelsample/ui-contribution/scatours.png deleted file mode 100644 index f68cd84704..0000000000 Binary files a/sandbox/travelsample/ui-contribution/scatours.png and /dev/null differ diff --git a/sandbox/travelsample/ui-contribution/style.css b/sandbox/travelsample/ui-contribution/style.css deleted file mode 100644 index 6e17c2747b..0000000000 --- a/sandbox/travelsample/ui-contribution/style.css +++ /dev/null @@ -1,135 +0,0 @@ -/* - * 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. - */ - - - -/*******************************************/ - -p,table,li,h1,h2,h3 -{ -font-family: verdana, arial, 'sans serif'; -} - -p, h1, h2, h3, table, li, hr -{ -margin-left: 10pt; -} - -table -{ -border-color: black; -border-collapse: separate; -border-spacing: 0px 1px; - -margin-right: 10pt; -margin-left: 10pt; -width: 800px; -} - -.sourceDetailsTable -{ -width: 600px; -} - -tr, td -{ -margin-left: 0pt; -margin-right: 0pt; -padding-left: 10pt; -font-size: 90%; -} - -p,li,th -{ -font-size: 90%; -margin-left: 10pt; -} - -pre -{ -margin-left: 10pt; -} - -body -{ -#ffffff; -} - -h1,h2,h3,hr -{ -color: firebrick; -} - -a:link {COLOR: firebrick;} -a:visited {COLOR: firebrick;} -a:active {COLOR: navy;} - -.link -{ -COLOR: firebrick; -text-decoration: underline; -} - -.clickable -{ -cursor: pointer -} - -.unread_title -{ -font-weight: bold; -} - -.read_title -{ -font-weight: normal; -} - -.summary -{ -color: DimGrey; -} - -.hidden -{ -display: none; -} - -.source_name -{ -width: 600px; -} - -.alert_text -{ -width: 600px; -} - -.alert_data -{ -margin-left: 10px; -width: 800px; -height: 800px; -} - -.source_0 -{ -background-color: LightGreen; -} - -- cgit v1.2.3