summaryrefslogtreecommitdiffstats
path: root/sandbox/travelsample/ui-contribution
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2008-08-10 15:15:28 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2008-08-10 15:15:28 +0000
commit569c99b45bb0b3e6408c3af066110f4212da0688 (patch)
tree3a9479e87ab058ccbecdf8b5a2e5e0417404a1df /sandbox/travelsample/ui-contribution
parentf21ed5242ed195c2bfc082765c9a5ec95a26348c (diff)
Separate the search into a travel component so that it is independent of the trip booking
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@684518 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sandbox/travelsample/ui-contribution')
-rw-r--r--sandbox/travelsample/ui-contribution/META-INF/sca-contribution.xml1
-rw-r--r--sandbox/travelsample/ui-contribution/build.xml1
-rw-r--r--sandbox/travelsample/ui-contribution/scatours.composite21
-rw-r--r--sandbox/travelsample/ui-contribution/scatours.html50
4 files changed, 48 insertions, 25 deletions
diff --git a/sandbox/travelsample/ui-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/ui-contribution/META-INF/sca-contribution.xml
index 51f91e071e..debc0e2ea5 100644
--- a/sandbox/travelsample/ui-contribution/META-INF/sca-contribution.xml
+++ b/sandbox/travelsample/ui-contribution/META-INF/sca-contribution.xml
@@ -25,5 +25,6 @@
<import.java package="scatours.flight"/>
<import.java package="scatours.car"/>
<import.java package="scatours.trip"/>
+ <import.java package="scatours.travel"/>
<deployable composite="scatours: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 8d5b4a8dfa..5444c953ff 100644
--- a/sandbox/travelsample/ui-contribution/build.xml
+++ b/sandbox/travelsample/ui-contribution/build.xml
@@ -100,7 +100,6 @@
<include name="jsr250-api-1.0.jar"/>
<include name="stax-api-1.0-2.jar"/>
<include name="wstx-asl-3.2.1.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 76fdc2c0d6..fc28b0a884 100644
--- a/sandbox/travelsample/ui-contribution/scatours.composite
+++ b/sandbox/travelsample/ui-contribution/scatours.composite
@@ -37,23 +37,23 @@
<reference name="car" target="CarComponent">
<tuscany:binding.jsonrpc/>
</reference>
- <reference name="tripSearch" target="TripComponent/TripSearch">
+ <reference name="travelSearch" target="TravelComponent/TravelSearch">
<tuscany:binding.jsonrpc/>
</reference>
- <reference name="tripContents" target="TripComponent/TripContents">
+ <reference name="travelBooking" target="TravelComponent/TravelBooking">
<tuscany:binding.jsonrpc/>
</reference>
</component>
- <component name="TripComponent">
- <implementation.java class="scatours.trip.TripImpl"/>
- <service name="TripSearch">
+ <component name="TravelComponent">
+ <implementation.java class="scatours.travel.TravelImpl"/>
+ <service name="TravelSearch">
<tuscany:binding.jsonrpc/>
</service>
- <service name="TripContents">
+ <service name="TravelBooking">
<tuscany:binding.jsonrpc/>
</service>
- <reference name="hotelSearch" target="HotelComponent">
+ <reference name="hotelSearch" target="HotelComponent/Search">
<binding.sca/>
</reference>
<reference name="flightSearch" target="FlightComponent">
@@ -64,8 +64,15 @@
</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>
<component name="HotelComponent">
<implementation.java class="scatours.hotel.HotelImpl"/>
diff --git a/sandbox/travelsample/ui-contribution/scatours.html b/sandbox/travelsample/ui-contribution/scatours.html
index c699ddb046..7b1a0b60d8 100644
--- a/sandbox/travelsample/ui-contribution/scatours.html
+++ b/sandbox/travelsample/ui-contribution/scatours.html
@@ -36,10 +36,10 @@
var car = new Reference("car");
//@Reference
- var tripSearch = new Reference("tripSearch");
+ var travelSearch = new Reference("travelSearch");
//@Reference
- var tripContents = new Reference("tripContents");
+ var travelBooking = new Reference("travelBooking");
//local state
var searchResponseItems;
@@ -62,11 +62,11 @@
function getTripLeg(){
return new TripLegType("X",
- document.searchForm.fromLocation.value,
- document.searchForm.toLocation.value,
- document.searchForm.fromDate.value,
- document.searchForm.toDate.value,
- document.searchForm.noOfPeople.value);
+ document.travelForm.fromLocation.value,
+ document.travelForm.toLocation.value,
+ document.travelForm.fromDate.value,
+ document.travelForm.toDate.value,
+ document.travelForm.noOfPeople.value);
}
function init() {
@@ -90,8 +90,8 @@
car.searchSynch(getTripLeg(), search_response);
}
- function searchTrip() {
- tripSearch.search(getTripLeg(), search_response);
+ function searchPackages() {
+ travelSearch.search(getTripLeg(), search_response);
}
function search_response(items, exception) {
@@ -127,13 +127,13 @@
var j = 0;
for (var i=0; i<items.length; i++) {
if (items[i].checked == true) {
- tripContents.addTripItem(items[i].value);
+ travelBooking.addTripItem(items[i].value);
} else {
- tripContents.removeTripItem(items[i].value);
+ travelBooking.removeTripItem(items[i].value);
}
}
- tripContents.getTotalPrice(totalPrice_response);
+ travelBooking.getTotalPrice(totalPrice_response);
}
function totalPrice_response(totalPrice, exception) {
@@ -143,6 +143,19 @@
}
document.getElementById('totalPrice').innerHTML = totalPrice;
}
+
+ function newTrip() {
+
+ }
+
+ function purchaseTrip() {
+ travelBooking.purchaseTrip();
+
+ document.getElementById('tripItems').innerHTML = "Thank you for shopping with SCA Tours";
+ document.getElementById('totalPrice').innerHTML = "";
+ searchResponseItems = null;
+ tripItems = null;
+ }
</script>
@@ -152,7 +165,7 @@
<img src="scatours.png" border="0" />
<div id="scatours">
<br>
- <form name="searchForm">
+ <form name="travelForm">
<table border="0">
<tr>
<td>From Location:</td>
@@ -178,18 +191,21 @@
<td/>
</tr>
</table>
+ <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="searchHotels()" value="Search Cars">
- <br/>
- <input type="button" onClick="searchTrip()" value="SearchTrip">
</form>
<form name="tripForm">
<div id="searchResponse"></div>
- <br>
+ <br>
+ <input type="button" onClick="newTrip()" value="Create New Trip">
+ <br>
<div id="totalPrice"></div>
<br>
- <input type="button" onClick="bookTrip()" value="Book Trip">
+ <div id="tripItems"></div>
+ <br>
+ <input type="button" onClick="purchaseTrip()" value="Purchase Trip">
</form>