diff options
Diffstat (limited to 'sandbox/travelsample/ui-contribution')
4 files changed, 77 insertions, 75 deletions
diff --git a/sandbox/travelsample/ui-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/ui-contribution/META-INF/sca-contribution.xml index debc0e2ea5..d3ea737a06 100644 --- a/sandbox/travelsample/ui-contribution/META-INF/sca-contribution.xml +++ b/sandbox/travelsample/ui-contribution/META-INF/sca-contribution.xml @@ -19,12 +19,13 @@ --> <contribution xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:scatours="http://scatours"> + <deployable composite="scatours:scatours"/> <import.java package="scatours.common"/> <import.java package="scatours.currencyconverter"/> <import.java package="scatours.hotel"/> <import.java package="scatours.flight"/> <import.java package="scatours.car"/> - <import.java package="scatours.trip"/> - <import.java package="scatours.travel"/> - <deployable composite="scatours:scatours"/> + <import.java package="scatours.tripbooking"/> + <import.java package="scatours.travelcatalog"/> + <import.java package="scatours"/> </contribution>
\ No newline at end of file diff --git a/sandbox/travelsample/ui-contribution/build.xml b/sandbox/travelsample/ui-contribution/build.xml index 78f39b4176..2152c6fe8a 100644 --- a/sandbox/travelsample/ui-contribution/build.xml +++ b/sandbox/travelsample/ui-contribution/build.xml @@ -94,8 +94,10 @@ <include name="XmlSchema-1.4.2.jar"/> <include name="activation-1.1.jar"/> <include name="asm-all-3.1.jar"/> + <include name="bcel-5.2.jar"/> <include name="cglib-nodep-2.1_3.jar"/> <include name="geronimo-commonj_1.1_spec-1.0.jar"/> + <include name="jakarta-regexp-1.4.jar"/> <include name="jaxb-api-2.1.jar"/> <include name="jaxb-impl-2.1.7.jar"/> <include name="jaxws-api-2.1.jar"/> @@ -103,6 +105,8 @@ <include name="jsr250-api-1.0.jar"/> <include name="stax-api-1.0-2.jar"/> <include name="wstx-asl-3.2.4.jar"/> + <include name="xalan-2.7.0.jar"/> + <include name="xml-apis-1.3.03.jar"/> </fileset> </project> diff --git a/sandbox/travelsample/ui-contribution/scatours.composite b/sandbox/travelsample/ui-contribution/scatours.composite index 8e9a403d4a..e9193bf0fa 100644 --- a/sandbox/travelsample/ui-contribution/scatours.composite +++ b/sandbox/travelsample/ui-contribution/scatours.composite @@ -23,36 +23,35 @@ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0" name="scatours"> - <component name="SCATours"> + <component name="UserInterfaceComponent"> <tuscany:implementation.widget location="scatours.html"/> <service name="Widget"> <tuscany:binding.http uri="/scatours"/> </service> - <reference name="hotel" target="HotelComponent"> + <reference name="scaToursSearch" target="SCAToursComponent/TravelCatalogSearch"> <tuscany:binding.jsonrpc/> - </reference> - <reference name="flight" target="FlightComponent"> - <tuscany:binding.jsonrpc/> - </reference> - <reference name="car" target="CarComponent"> - <tuscany:binding.jsonrpc/> - </reference> - <reference name="travelSearch" target="TravelComponent/TravelSearch"> + </reference> + <reference name="scaToursBooking" target="SCAToursComponent/SCAToursBooking"> <tuscany:binding.jsonrpc/> </reference> - <reference name="travelBooking" target="TravelComponent/TravelBooking"> - <tuscany:binding.jsonrpc/> - </reference> </component> - <component name="TravelComponent"> - <implementation.java class="scatours.travel.TravelImpl"/> - <service name="TravelSearch"> + <component name="SCAToursComponent"> + <implementation.java class="scatours.SCAToursImpl"/> + <service name="TravelCatalogSearch"> <tuscany:binding.jsonrpc/> </service> - <service name="TravelBooking"> + <service name="SCAToursBooking"> <tuscany:binding.jsonrpc/> </service> + <reference name="travelCatalogSearch" target="TravelCatalogComponent/TravelCatalogSearch"/> + <reference name="tripBooking" target="TripBookingComponent/TripBooking"/> + <!--reference name="shoppingCart" target="ShoppingCartComponent/shoppingCart"/--> + </component> + + <component name="TravelCatalogComponent"> + <implementation.java class="scatours.travelcatalog.TravelCatalogImpl"/> + <service name="TravelCatalogSearch"/> <reference name="hotelSearch" target="HotelComponent"> <binding.sca/> </reference> @@ -69,15 +68,12 @@ </reference> <reference name="currencyConverter" target="CurrencyConverterComponent"> </reference> - <reference name="trip" target="TripComponent"> - </reference> <property name="quoteCurrencyCode">GBP</property> </component> - <component name="TripComponent"> - <implementation.java class="scatours.trip.TripImpl"/> - <service name="Trip"> - </service> + <component name="TripBookingComponent"> + <implementation.java class="scatours.tripbooking.TripBookingImpl"/> + <service name="TripBooking"/> </component> <component name="HotelComponent"> @@ -114,5 +110,17 @@ <service name="CurrencyConverter"> </service> </component> + + <!-- component name="ShoppingCartComponent"> + <implementation.java class="scatours.shoppingcart.ShoppingCartImpl"/> + <service name="CurrencyConverter"> + </service> + </component> + + <component name="PaymentComponent"> + <implementation.java class="scatours.payment.PaymentImpl"/> + <service name="CurrencyConverter"> + </service> + </component--> </composite> diff --git a/sandbox/travelsample/ui-contribution/scatours.html b/sandbox/travelsample/ui-contribution/scatours.html index 54ee0c6b3d..d2a6baf669 100644 --- a/sandbox/travelsample/ui-contribution/scatours.html +++ b/sandbox/travelsample/ui-contribution/scatours.html @@ -24,27 +24,19 @@ <script type="text/javascript" src="scatours.js"></script> -<script language="JavaScript"> - - //@Reference - var hotel = new Reference("hotel"); - - //@Reference - var flight = new Reference("flight"); - - //@Reference - var car = new Reference("car"); +<script language="JavaScript"> //@Reference - var travelSearch = new Reference("travelSearch"); + var scaToursSearch = new Reference("scaToursSearch"); //@Reference - var travelBooking = new Reference("travelBooking"); + var scaToursBooking = new Reference("scaToursBooking"); //local state var currentTripId; - var searchResponseItems; - + var searchItems; + var cartItems; + //the constructor for trip leg beans function TripLegType(id, fromLocation, @@ -77,21 +69,9 @@ alert(e); } } - - function searchHotels() { - hotel.searchSynch(getTripLeg(), search_response); - } - - function searchFlights() { - flight.searchSynch(getTripLeg(), search_response); - } - - function searchCars() { - car.searchSynch(getTripLeg(), search_response); - } - - function searchPackages() { - travelSearch.search(getTripLeg(), search_response); + + function searchTravelCatalog() { + scaToursSearch.search(getTripLeg(), search_response); } function search_response(items, exception) { @@ -119,21 +99,27 @@ document.getElementById('searchResponse').innerHTML = responseHTML; - searchResponseItems = items; + searchItems = items; } - function processSelection() { + function processSelection() { + // do nothing at the moment + } + + function addItemsToCart() { var items = document.tripForm.items; - var j = 0; + for (var i=0; i<items.length; i++) { + + // notify the server of the change if (items[i].checked == true) { - travelBooking.addTripItem(currentTripId, items[i].value); + scaToursBooking.addTripItem(currentTripId, items[i].value); } else { - travelBooking.removeTripItem(currentTripId, items[i].value); + scaToursBooking.removeTripItem(currentTripId, items[i].value); } } - travelBooking.getTripItems(currentTripId,getTripItems_response); + scaToursBooking.getTripItems(currentTripId,getTripItems_response); } function getTripItems_response(items, exception) { @@ -160,7 +146,7 @@ document.getElementById('tripItems').innerHTML = itemsHTML; - travelBooking.getTotalPrice(currentTripId, getTotalPrice_response); + scaToursBooking.getTotalPrice(currentTripId, getTotalPrice_response); } function getTotalPrice_response(totalPrice, exception) { @@ -172,7 +158,7 @@ } function newTrip() { - travelBooking.newTrip(newTrip_response); + scaToursBooking.newTrip(newTrip_response); document.getElementById('searchResponse').innerHTML = ""; document.getElementById('tripItems').innerHTML = ""; @@ -185,18 +171,21 @@ return; } currentTripId = tripId - document.getElementById('tripId').innerHTML = "Trip: " + tripId; + document.getElementById('tripId').innerHTML = "Trip Reference: " + tripId; } - function purchaseTrip() { - travelBooking.purchaseTrip(currentTripId); + function bookTrip() { + travelBooking.bookTrip(currentTripId); document.getElementById('searchResponse').innerHTML = ""; document.getElementById('tripItems').innerHTML = "Thank you for shopping with SCA Tours"; document.getElementById('totalPrice').innerHTML = ""; searchResponseItems = null; tripItems = null; - } + } + + function purchase() { + } </script> @@ -234,22 +223,22 @@ </tr> </table> <br/> - <input type="button" onClick="searchPackages()" value="SearchPackages"> - <input type="button" onClick="searchHotels()" value="Search Hotels"> - <input type="button" onClick="searchFlights()" value="Search Flights"> - <input type="button" onClick="searchCars()" value="Search Cars"> + <input type="button" onClick="searchTravelCatalog()" value="Search"> </form> <form name="tripForm"> <h3>Search Results</h3> <div id="searchResponse"></div> - <br> + <br/> + <input type="button" onClick="addItemsToCart()" value="Add Items"> + <br/> + <h3>Shopping Cart</h3> <h3><div id="tripId"></h3> <div id="tripItems"></div> - <br> + <br/> <div id="totalPrice"></div> - <br> + <br/> + <input type="button" onClick="bookTrip()" value="Book"> <input type="button" onClick="newTrip()" value="Create New Trip"> - <input type="button" onClick="purchaseTrip()" value="Purchase Trip"> </form> </div> |