Author: slaws
Date: Sun Jan 11 12:13:32 2009
New Revision: 733506

URL: http://svn.apache.org/viewvc?rev=733506&view=rev
Log:
Starting adding in ability to book pre-packaged trips

Added:
    tuscany/sandbox/travelsample/trip-contribution/   (with props)
    tuscany/sandbox/travelsample/trip-contribution/META-INF/
    
tuscany/sandbox/travelsample/trip-contribution/META-INF/sca-contribution.xml   
(with props)
    tuscany/sandbox/travelsample/trip-contribution/pom.xml   (with props)
    tuscany/sandbox/travelsample/trip-contribution/src/
    tuscany/sandbox/travelsample/trip-contribution/src/scatours/
    tuscany/sandbox/travelsample/trip-contribution/src/scatours/trip/
    
tuscany/sandbox/travelsample/trip-contribution/src/scatours/trip/TripImpl.java  
 (with props)
    
tuscany/sandbox/travelsample/trip-contribution/src/scatours/trip/TripInfo.java  
 (with props)

Propchange: tuscany/sandbox/travelsample/trip-contribution/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Jan 11 12:13:32 2009
@@ -0,0 +1,4 @@
+.classpath
+.project
+.settings
+target

Added: 
tuscany/sandbox/travelsample/trip-contribution/META-INF/sca-contribution.xml
URL: 
http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/trip-contribution/META-INF/sca-contribution.xml?rev=733506&view=auto
==============================================================================
--- 
tuscany/sandbox/travelsample/trip-contribution/META-INF/sca-contribution.xml 
(added)
+++ 
tuscany/sandbox/travelsample/trip-contribution/META-INF/sca-contribution.xml 
Sun Jan 11 12:13:32 2009
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    * 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.    
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0";>
+   <import.java package="scatours.common"/>
+   <export.java package="scatours.trip"/>
+</contribution>
\ No newline at end of file

Propchange: 
tuscany/sandbox/travelsample/trip-contribution/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
tuscany/sandbox/travelsample/trip-contribution/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: 
tuscany/sandbox/travelsample/trip-contribution/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: tuscany/sandbox/travelsample/trip-contribution/pom.xml
URL: 
http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/trip-contribution/pom.xml?rev=733506&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/trip-contribution/pom.xml (added)
+++ tuscany/sandbox/travelsample/trip-contribution/pom.xml Sun Jan 11 12:13:32 
2009
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    * 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.    
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-sca</artifactId>
+        <version>1.5-SNAPSHOT</version>
+        <!--relativePath>../../pom.xml</relativePath-->
+    </parent>
+    <artifactId>scatours-trip-contribution</artifactId>
+    <name>Apache Tuscany SCA Tours Prepackaged Trip Contribution</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-sca-api</artifactId>
+            <version>1.5-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-data-api</artifactId>
+            <version>1.5-SNAPSHOT</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>scatours-common-contribution</artifactId>
+            <version>1.5-SNAPSHOT</version>
+        </dependency> 
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.5</version>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+       <finalName>${artifactId}</finalName>
+       <sourceDirectory>${basedir}/src</sourceDirectory>
+       <resources>
+          <resource>
+              <directory>${basedir}</directory>
+              <excludes>
+                  <exclude>**/*.java</exclude>
+                  <exclude>**/.*/**</exclude>
+                  <exclude>pom.xml</exclude>
+                  <exclude>build.xml</exclude>
+                  <exclude>target/**</exclude>
+                  <exclude>src/**</exclude>
+              </excludes>
+          </resource>
+       </resources>
+    </build>
+</project>

Propchange: tuscany/sandbox/travelsample/trip-contribution/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/travelsample/trip-contribution/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: tuscany/sandbox/travelsample/trip-contribution/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: 
tuscany/sandbox/travelsample/trip-contribution/src/scatours/trip/TripImpl.java
URL: 
http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/trip-contribution/src/scatours/trip/TripImpl.java?rev=733506&view=auto
==============================================================================
--- 
tuscany/sandbox/travelsample/trip-contribution/src/scatours/trip/TripImpl.java 
(added)
+++ 
tuscany/sandbox/travelsample/trip-contribution/src/scatours/trip/TripImpl.java 
Sun Jan 11 12:13:32 2009
@@ -0,0 +1,91 @@
+/*
+ * 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.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})
+public class TripImpl implements Search {
+    
+    private List<TripInfo> trips = new ArrayList<TripInfo>();
+    
+    @Callback
+    protected SearchCallback searchCallback; 
+
+    @Init
+    public void init() {
+        trips.add(new TripInfo("FS1APR4", 
+                               "Florence and Siena pre-packaged tour",
+                               "LGW",
+                               "FLR",
+                               "04/04/09",
+                               "11/04/09",
+                               "27",
+                               450,
+                               "EUR",
+                               "http://localhost:8085/tbd"; ));
+    }
+    
+    public TripItem[] searchSynch(TripLeg tripLeg) {
+        List<TripItem> items = new ArrayList<TripItem>();
+        
+        // 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("",
+                                             "",
+                                             "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));  
+    }
+}

Propchange: 
tuscany/sandbox/travelsample/trip-contribution/src/scatours/trip/TripImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
tuscany/sandbox/travelsample/trip-contribution/src/scatours/trip/TripImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
tuscany/sandbox/travelsample/trip-contribution/src/scatours/trip/TripInfo.java
URL: 
http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/trip-contribution/src/scatours/trip/TripInfo.java?rev=733506&view=auto
==============================================================================
--- 
tuscany/sandbox/travelsample/trip-contribution/src/scatours/trip/TripInfo.java 
(added)
+++ 
tuscany/sandbox/travelsample/trip-contribution/src/scatours/trip/TripInfo.java 
Sun Jan 11 12:13:32 2009
@@ -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

Propchange: 
tuscany/sandbox/travelsample/trip-contribution/src/scatours/trip/TripInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
tuscany/sandbox/travelsample/trip-contribution/src/scatours/trip/TripInfo.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date


Reply via email to