diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-05 20:14:21 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-05 20:14:21 +0000 |
commit | 26a2e18d46a5e8e6a6457e12afa6f191befcddfd (patch) | |
tree | 9eeb2bab043114ac4e18f7305a3dc21010306378 /sandbox/travelsample/scatours-android-ui | |
parent | 18d8aa3401326d927bbb0665e25dd0f2cdce92fd (diff) |
Move scatours-android-ui into contrib
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@833154 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sandbox/travelsample/scatours-android-ui')
16 files changed, 0 insertions, 931 deletions
diff --git a/sandbox/travelsample/scatours-android-ui/.classpath b/sandbox/travelsample/scatours-android-ui/.classpath deleted file mode 100644 index 609aa00ebc..0000000000 --- a/sandbox/travelsample/scatours-android-ui/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src"/> - <classpathentry kind="src" path="gen"/> - <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/sandbox/travelsample/scatours-android-ui/.project b/sandbox/travelsample/scatours-android-ui/.project deleted file mode 100644 index e4a44c86de..0000000000 --- a/sandbox/travelsample/scatours-android-ui/.project +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>scatours-android-ui</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>com.android.ide.eclipse.adt.ApkBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>com.android.ide.eclipse.adt.AndroidNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/sandbox/travelsample/scatours-android-ui/AndroidManifest.xml b/sandbox/travelsample/scatours-android-ui/AndroidManifest.xml deleted file mode 100644 index 7bda31e187..0000000000 --- a/sandbox/travelsample/scatours-android-ui/AndroidManifest.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="scatours.android" - android:versionCode="1" - android:versionName="1.0"> - <application android:icon="@drawable/icon" android:label="@string/app_name"> - <activity android:name=".TripSearch" - android:label="@string/app_name"> - <intent-filter> - <action android:name="android.intent.action.MAIN" /> - <category android:name="android.intent.category.LAUNCHER" /> - </intent-filter> - </activity> - </application> - <uses-permission android:name="android.permission.INTERNET"></uses-permission> - <uses-sdk android:minSdkVersion="3" /> -</manifest>
\ No newline at end of file diff --git a/sandbox/travelsample/scatours-android-ui/default.properties b/sandbox/travelsample/scatours-android-ui/default.properties deleted file mode 100644 index 6b8ae52b90..0000000000 --- a/sandbox/travelsample/scatours-android-ui/default.properties +++ /dev/null @@ -1,22 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "build.properties", and override values to adapt the script to your -# project structure. - -# apk configurations. This property allows creation of APK files with limited -# resources. For example, if your application contains many locales and -# you wish to release multiple smaller apks instead of a large one, you can -# define configuration to create apks with limited language sets. -# Format is a comma separated list of configuration names. For each -# configuration, a property will declare the resource configurations to -# include. Example: -# apk-configurations=european,northamerica -# apk-config-european=en,fr,it,de,es -# apk-config-northamerica=en,es -apk-configurations= -# Project target. -target=android-3 diff --git a/sandbox/travelsample/scatours-android-ui/gen/scatours/android/R.java b/sandbox/travelsample/scatours-android-ui/gen/scatours/android/R.java deleted file mode 100644 index 777832aa4c..0000000000 --- a/sandbox/travelsample/scatours-android-ui/gen/scatours/android/R.java +++ /dev/null @@ -1,35 +0,0 @@ -/* AUTO-GENERATED FILE. DO NOT MODIFY. - * - * This class was automatically generated by the - * aapt tool from the resource data it found. It - * should not be modified by hand. - */ - -package scatours.android; - -public final class R { - public static final class attr { - } - public static final class drawable { - public static final int icon=0x7f020000; - } - public static final class id { - public static final int btnSearch=0x7f050005; - public static final int edit_NumberOfPeople=0x7f050004; - public static final int edit_date_end=0x7f050003; - public static final int edit_date_start=0x7f050002; - public static final int edit_fromLocation=0x7f050000; - public static final int edit_toLocation=0x7f050001; - public static final int listPackages=0x7f050006; - } - public static final class layout { - public static final int search=0x7f030000; - public static final int search_results=0x7f030001; - } - public static final class string { - public static final int alert_cancel=0x7f040003; - public static final int alert_yes=0x7f040002; - public static final int app_name=0x7f040000; - public static final int title_search=0x7f040001; - } -} diff --git a/sandbox/travelsample/scatours-android-ui/res/drawable/icon.png b/sandbox/travelsample/scatours-android-ui/res/drawable/icon.png Binary files differdeleted file mode 100644 index 75024841d3..0000000000 --- a/sandbox/travelsample/scatours-android-ui/res/drawable/icon.png +++ /dev/null diff --git a/sandbox/travelsample/scatours-android-ui/res/layout/search.xml b/sandbox/travelsample/scatours-android-ui/res/layout/search.xml deleted file mode 100644 index cb7ae6acb6..0000000000 --- a/sandbox/travelsample/scatours-android-ui/res/layout/search.xml +++ /dev/null @@ -1,65 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:layout_width="fill_parent" - android:layout_height="wrap_content"> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="From:" /> - - <AutoCompleteTextView android:id="@+id/edit_fromLocation" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:text="LGW"/> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="To:"/> - - <AutoCompleteTextView android:id="@+id/edit_toLocation" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:text="FLR"/> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="Start Date:" /> - - <AutoCompleteTextView android:id="@+id/edit_date_start" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:text="06/12/09"/> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="End Date:" /> - - <AutoCompleteTextView android:id="@+id/edit_date_end" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:text="13/12/09"/> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="Number of People:" /> - - <AutoCompleteTextView android:id="@+id/edit_NumberOfPeople" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:text="2"/> - - - <Button android:id="@+id/btnSearch" - android:layout_width="100px" - android:layout_height="40px" - android:text="@string/title_search"/> - -</LinearLayout> - - diff --git a/sandbox/travelsample/scatours-android-ui/res/layout/search_results.xml b/sandbox/travelsample/scatours-android-ui/res/layout/search_results.xml deleted file mode 100644 index 1af13900a3..0000000000 --- a/sandbox/travelsample/scatours-android-ui/res/layout/search_results.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="wrap_content" - android:layout_height="wrap_content"> - - <TextView android:text="Available Packages" - android:layout_width="wrap_content" - android:layout_height="wrap_content"/> - - <ListView android:id="@+id/listPackages" - android:layout_width="wrap_content" - android:layout_height="wrap_content"/> -</LinearLayout> diff --git a/sandbox/travelsample/scatours-android-ui/res/values/strings.xml b/sandbox/travelsample/scatours-android-ui/res/values/strings.xml deleted file mode 100644 index 8f1b67bcf0..0000000000 --- a/sandbox/travelsample/scatours-android-ui/res/values/strings.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <string name="app_name">SCA Tours - Search Trip</string> - <string name="title_search">Search</string> - <string name="alert_yes">Yes</string> - <string name="alert_cancel">Cancel</string> -</resources> diff --git a/sandbox/travelsample/scatours-android-ui/src/scatours/SCAToursSearch.java b/sandbox/travelsample/scatours-android-ui/src/scatours/SCAToursSearch.java deleted file mode 100644 index 36a514b0b8..0000000000 --- a/sandbox/travelsample/scatours-android-ui/src/scatours/SCAToursSearch.java +++ /dev/null @@ -1,29 +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 scatours.common.TripItem; -import scatours.common.TripLeg; - -/** - * The Trip service interface - */ -public interface SCAToursSearch { - TripItem[] search(TripLeg tripLeg); -} diff --git a/sandbox/travelsample/scatours-android-ui/src/scatours/SCAToursSearchProxy.java b/sandbox/travelsample/scatours-android-ui/src/scatours/SCAToursSearchProxy.java deleted file mode 100644 index cfd6b98bcf..0000000000 --- a/sandbox/travelsample/scatours-android-ui/src/scatours/SCAToursSearchProxy.java +++ /dev/null @@ -1,81 +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.List; - -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import scatours.common.TripItem; -import scatours.common.TripLeg; -import scatours.jsonrpc.JSONRpc; - -public class SCAToursSearchProxy implements SCAToursSearch { - // see http://developer.android.com/guide/developing/tools/emulator.html - private static final String jsonRPCServiceURI = "http://10.0.2.2:8080/SCAToursComponent/SCAToursSearch"; - private static final String jsonRPCRequest = "{\"id\": 5, \"method\": \"Service.search\", \"params\": [{\"id\": \"5f9a10f2-527f-4d91-a13c-b1aa2baaedd8\", \"fromLocation\": \"LGW\", \"toLocation\": \"FLR\", \"fromDate\": \"06/12/09\", \"toDate\": \"13/12/09\", \"noOfPeople\": \"2\"}]}"; - - private List<TripItem> tripCatalog = new ArrayList<TripItem>(); - - public SCAToursSearchProxy() { - initialize(); - } - - public void initialize() { - JSONObject json = null; - - try { - json = JSONRpc.invoke(jsonRPCServiceURI, jsonRPCRequest); - - if(json == null) { - return; - } - - JSONArray result = json.getJSONArray("result"); - for(int i = 0; i < result.length(); i++) { - TripItem item = new TripItem(); - - item.setType(result.getJSONObject(i).getString("type")); - item.setName(result.getJSONObject(i).getString("name")); - item.setDescription(result.getJSONObject(i).getString("description")); - item.setLocation(result.getJSONObject(i).getString("location")); - item.setFromDate(result.getJSONObject(i).getString("fromDate")); - item.setToDate(result.getJSONObject(i).getString("toDate")); - item.setPrice(result.getJSONObject(i).getDouble("price")); - item.setCurrency(result.getJSONObject(i).getString("currency")); - - tripCatalog.add(item); - } - - } catch (JSONException e) { - e.printStackTrace(); - } - } - - - public TripItem[] search(TripLeg tripLeg) { - TripItem[] catalogArray = new TripItem[tripCatalog.size()]; - tripCatalog.toArray(catalogArray); - return catalogArray; - } -} diff --git a/sandbox/travelsample/scatours-android-ui/src/scatours/android/TripSearch.java b/sandbox/travelsample/scatours-android-ui/src/scatours/android/TripSearch.java deleted file mode 100644 index b64c14a583..0000000000 --- a/sandbox/travelsample/scatours-android-ui/src/scatours/android/TripSearch.java +++ /dev/null @@ -1,186 +0,0 @@ -package scatours.android; - -import scatours.SCAToursSearch; -import scatours.SCAToursSearchProxy; -import scatours.common.TripItem; -import scatours.common.TripLeg; -import android.app.Activity; -import android.app.AlertDialog; -import android.content.DialogInterface; -import android.content.Intent; -import android.os.Bundle; -import android.util.Log; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.AdapterView; -import android.widget.ArrayAdapter; -import android.widget.AutoCompleteTextView; -import android.widget.Button; -import android.widget.AdapterView.OnItemClickListener; -import android.widget.AdapterView.OnItemSelectedListener; - -public class TripSearch extends Activity { - - static final String[] AIRPORT_CODES = new String[] { - "LGW - London Gatwick Airport", - "FLR - Luigi Ridolfi Airport", - "SFO - San Francisco Airport", - "GRU - Sao Paulo Airport", - "GIG - Rio de Janeiro Airport" - }; - - - private AutoCompleteTextView txtFromLocation, - txtToLocation, - txtDateStart, - txtDateEnd, - txtNumberOfPeople; - private Button btnSearch; - - - /** Called when the activity is first created. */ - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.search); - - - ArrayAdapter adapter = new ArrayAdapter(this,android.R.layout.simple_dropdown_item_1line, AIRPORT_CODES); - - txtFromLocation = (AutoCompleteTextView) findViewById(R.id.edit_fromLocation); - //ArrayAdapter adapterFrom = new ArrayAdapter(this,android.R.layout.simple_dropdown_item_1line, AIRPORT_CODES); - txtFromLocation.setAdapter(adapter); - - txtToLocation = (AutoCompleteTextView) findViewById(R.id.edit_toLocation); - //ArrayAdapter adapterTo = new ArrayAdapter(this,android.R.layout.simple_dropdown_item_1line, AIRPORT_CODES); - txtToLocation.setAdapter(adapter); - - txtDateStart = (AutoCompleteTextView) findViewById(R.id.edit_date_start); - txtDateEnd = (AutoCompleteTextView) findViewById(R.id.edit_date_end); - txtNumberOfPeople = (AutoCompleteTextView) findViewById(R.id.edit_NumberOfPeople); - - btnSearch = (Button) this.findViewById(R.id.btnSearch); - - doListen(); - } - - private void doListen() { - - txtFromLocation.setOnItemClickListener(new OnItemClickListener() { - public void onItemClick(AdapterView<?> parent, View view, int position, long id) { - Log.i(getString(R.string.app_name),">>Item Clicked: " +AIRPORT_CODES[position]); - } - - }); - - txtFromLocation.setOnItemSelectedListener(new OnItemSelectedListener() { - - public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { - Log.i(getString(R.string.app_name),">>Item Selected: " +AIRPORT_CODES[position]); - } - - public void onNothingSelected(AdapterView<?> parent) { - Log.i(getString(R.string.app_name),">>Selection cleared"); - } - - }); - - - //closeButton - btnSearch.setOnClickListener( new OnClickListener() { - public void onClick(View v) { - - doTripSearch(v); - /* - //Search trips here - new AlertDialog.Builder(TripSearch.this) - .setTitle("SCATour") - .setMessage("You're about to search for trips !") - .setIcon(R.drawable.icon) - .setPositiveButton(R.string.alert_yes, new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int whichButton) { - - }}) - .setNegativeButton(R.string.alert_cancel, new DialogInterface.OnClickListener(){ - public void onClick(DialogInterface dialog, int which) { - - } - }) - .show();*/ - } - }); - - } - - - private void doTripSearch(View view) { - SCAToursSearch searchProxy = new SCAToursSearchProxy(); - TripLeg tripLeg = new TripLeg(); - - Log.i(getString(R.string.app_name),"From : " + txtFromLocation.getText().toString() ); - Log.i(getString(R.string.app_name),"To : " + txtToLocation.getText().toString() ); - Log.i(getString(R.string.app_name),"Start Date : " + txtDateStart.getText().toString() ); - Log.i(getString(R.string.app_name),"End Date : " + txtDateEnd.getText().toString() ); - Log.i(getString(R.string.app_name),"NumberOfPeople : " + txtNumberOfPeople.getText().toString() ); - - tripLeg.setFromLocation("LGW"); - tripLeg.setToLocation("FLR"); - tripLeg.setFromDate("06/12/09"); - tripLeg.setToDate("13/12/09"); - tripLeg.setNoOfPeople("2"); - - TripItem[] tripsAvailable = searchProxy.search(tripLeg); - Log.i(getString(R.string.app_name),"Found " + tripsAvailable.length + " trips"); - - Log.i(getString(R.string.app_name),"Calling Results view..."); - - displayTripSearchResults(tripsAvailable); - - /* - try { - Intent resultView = new Intent(this, TripSearchResults.class); - resultView.putExtra("results", tripsAvailable); - startActivity(resultView); - } catch(Exception e) { - Log.e(getString(R.string.app_name), e.getMessage()); - } - */ - - //TripSearchResults searchResults = new TripSearchResults(tripsAvailable); - //searchResults.setContentView(R.layout.search_results); - - Log.i(getString(R.string.app_name),"Called..."); - - } - - private void displayTripSearchResults(TripItem[] tripsAvailable) { - - String result = ""; - for(TripItem item : tripsAvailable) { - Log.i(getString(R.string.app_name), "Item type:" + item.getType()); - if (item.getType().equals(TripItem.TRIP)) { - result += item.getDescription() + " (" + item.getCurrency() + " " + item.getPrice() + ")\n"; - } - } - - - //Search trips here - new AlertDialog.Builder(TripSearch.this) - .setTitle("SCATour") - .setMessage("Found:\n" + result) - .setIcon(R.drawable.icon) - .setCancelable(false) - .setPositiveButton(R.string.alert_yes, new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int whichButton) { - - }}) - .setNegativeButton(R.string.alert_cancel, new DialogInterface.OnClickListener(){ - public void onClick(DialogInterface dialog, int which) { - - } - }) - .show(); - - } - -}
\ No newline at end of file diff --git a/sandbox/travelsample/scatours-android-ui/src/scatours/android/TripSearchResults.java b/sandbox/travelsample/scatours-android-ui/src/scatours/android/TripSearchResults.java deleted file mode 100644 index 002ef8def1..0000000000 --- a/sandbox/travelsample/scatours-android-ui/src/scatours/android/TripSearchResults.java +++ /dev/null @@ -1,57 +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.android; - -import scatours.common.TripItem; -import android.app.Activity; -import android.os.Bundle; -import android.util.Log; -import android.widget.ArrayAdapter; -import android.widget.ListView; - -public class TripSearchResults extends Activity { - private TripItem[] results; - - private ListView listResults; - - public TripSearchResults( ) { - super(); - } - - public void setResults(TripItem[] results) { - Log.i(getString(R.string.app_name),"Setting results : " + results.length); - this.results = results; - } - - /** Called when the activity is first created. */ - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.search_results); - - Log.i(getString(R.string.app_name),"Displaying " + results.length + " trips"); - - listResults = (ListView) findViewById(R.id.listPackages); - //listResults.setAdapter(new ArrayAdapter<TripItem>(this, R.id.listPackages, results)); - - - } - -} diff --git a/sandbox/travelsample/scatours-android-ui/src/scatours/common/TripItem.java b/sandbox/travelsample/scatours-android-ui/src/scatours/common/TripItem.java deleted file mode 100644 index 1fd78c8dd5..0000000000 --- a/sandbox/travelsample/scatours-android-ui/src/scatours/common/TripItem.java +++ /dev/null @@ -1,219 +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 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/scatours-android-ui/src/scatours/common/TripLeg.java b/sandbox/travelsample/scatours-android-ui/src/scatours/common/TripLeg.java deleted file mode 100644 index 1af33aa6f9..0000000000 --- a/sandbox/travelsample/scatours-android-ui/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/scatours-android-ui/src/scatours/jsonrpc/JSONRpc.java b/sandbox/travelsample/scatours-android-ui/src/scatours/jsonrpc/JSONRpc.java deleted file mode 100644 index c6a9cd8702..0000000000 --- a/sandbox/travelsample/scatours-android-ui/src/scatours/jsonrpc/JSONRpc.java +++ /dev/null @@ -1,63 +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.jsonrpc; - -import java.io.IOException; - -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.util.EntityUtils; -import org.json.JSONException; -import org.json.JSONObject; - -public class JSONRpc { - - protected JSONRpc() { - - } - - public static JSONObject invoke(String serviceURI, String rpcRequest) throws JSONException{ - HttpClient httpClient = new DefaultHttpClient(); - HttpPost httpPost = new HttpPost(serviceURI); - - JSONObject result = null; - try { - httpPost.setHeader("Content-Type", "text/xml"); - httpPost.setEntity(new StringEntity(rpcRequest)); - - HttpResponse httpResponse = httpClient.execute(httpPost); - if (httpResponse.getStatusLine().getStatusCode() == 200) { - String jsonResult = EntityUtils.toString(httpResponse.getEntity()); - result = new JSONObject(jsonResult); - } else { - String errorMessage = httpResponse.getStatusLine() - .getReasonPhrase(); - System.out.println(errorMessage); - } - } catch (IOException e) { - e.printStackTrace(); - } - - return result; - } -} |