You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by lr...@apache.org on 2010/01/26 23:10:12 UTC

svn commit: r903450 - in /tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs: ./ src/ src/main/ src/main/java/ src/main/java/services/ src/main/resources/ src/main/webapp/ src/main/webapp/META-INF/ src/main/webapp/WEB-INF/

Author: lresende
Date: Tue Jan 26 22:10:11 2010
New Revision: 903450

URL: http://svn.apache.org/viewvc?rev=903450&view=rev
Log:
Store scenario using JAX-RS from Apache Wink

Added:
    tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/   (with props)
    tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/.project
    tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/pom.xml   (with props)
    tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/
    tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/
    tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/
    tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/
    tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/Catalog.java   (with props)
    tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/CurrencyConverter.java   (with props)
    tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/CurrencyConverterImpl.java   (with props)
    tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/FruitsCatalogImpl.java   (with props)
    tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/Item.java   (with props)
    tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/resources/
    tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/
    tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/META-INF/
    tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/META-INF/MANIFEST.MF
    tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/WEB-INF/
    tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/WEB-INF/application
    tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/WEB-INF/web.xml   (with props)
    tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/binding-http.js   (with props)
    tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/store.html   (with props)

Propchange: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Jan 26 22:10:11 2010
@@ -0,0 +1,20 @@
+target
+work
+dojo
+*.iws
+*.ipr
+*.iml
+derby.log
+maven.log
+maven-eclipse.xml
+build.xml
+build-dependency.xml
+velocity.log*
+junit*.properties
+surefire*.properties
+.project
+.classpath
+.settings
+.deployables
+.wtpmodules
+.externalToolBuilders

Added: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/.project
URL: http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/.project?rev=903450&view=auto
==============================================================================
--- tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/.project (added)
+++ tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/.project Tue Jan 26 22:10:11 2010
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>sample-store-jaxrs-webapp</name>
+	<comment>The Apache Software Foundation provides support for the Apache community of open-source software projects.
+    The Apache projects are characterized by a collaborative, consensus based development process, an open and
+    pragmatic software license, and a desire to create high quality software that leads the way in its field.
+    We consider ourselves not simply a group of projects sharing a server, but rather a community of developers
+    and users.</comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.wst.common.project.facet.core.builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.wst.validation.validationbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+		<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+	</natures>
+</projectDescription>

Added: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/pom.xml?rev=903450&view=auto
==============================================================================
--- tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/pom.xml (added)
+++ tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/pom.xml Tue Jan 26 22:10:11 2010
@@ -0,0 +1,74 @@
+<?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>2.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>sample-store-jaxrs-webapp</artifactId>
+    <packaging>war</packaging>
+    <name>Apache Tuscany SCA Sample Getting Started Online Store as WebApp</name>
+
+	<repositories>
+		<repository>
+			<id>Codehaus</id>
+			<name>Codehaus Repository</name>
+			<releases>
+				<enabled>true</enabled>
+			</releases>
+			<snapshots>
+				<enabled>false</enabled>
+			</snapshots>
+			<url>http://repository.codehaus.org/</url>
+		</repository>
+	</repositories>
+            
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.wink</groupId>
+			<artifactId>wink-common</artifactId>
+			<version>1.0-incubating</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.wink</groupId>
+			<artifactId>wink-server</artifactId>
+			<version>1.0-incubating</version>
+		</dependency>
+		<dependency>
+			<groupId>org.codehaus.jackson</groupId>
+			<artifactId>jackson-jaxrs</artifactId>
+			<version>1.4.1</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.8.1</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+    
+    <build>
+       <finalName>store-jaxrs</finalName>
+    </build>
+
+</project>

Propchange: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/Catalog.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/Catalog.java?rev=903450&view=auto
==============================================================================
--- tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/Catalog.java (added)
+++ tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/Catalog.java Tue Jan 26 22:10:11 2010
@@ -0,0 +1,40 @@
+/*
+ * 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 services;
+
+import java.util.List;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+@Produces(MediaType.APPLICATION_JSON)
+public interface Catalog {
+    @GET
+    @Produces(MediaType.APPLICATION_JSON)
+    List<Item> get();
+    
+    @GET
+    @Path("{id}")
+    @Produces(MediaType.APPLICATION_JSON)
+    Item get(@PathParam("id") String id);
+}

Propchange: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/Catalog.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/Catalog.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/CurrencyConverter.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/CurrencyConverter.java?rev=903450&view=auto
==============================================================================
--- tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/CurrencyConverter.java (added)
+++ tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/CurrencyConverter.java Tue Jan 26 22:10:11 2010
@@ -0,0 +1,27 @@
+/*
+ * 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 services;
+
+public interface CurrencyConverter {
+	
+    public double getConversion(String fromCurrenycCode, String toCurrencyCode, double amount);
+
+    public String getCurrencySymbol(String currencyCode);
+}

Propchange: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/CurrencyConverter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/CurrencyConverter.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/CurrencyConverterImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/CurrencyConverterImpl.java?rev=903450&view=auto
==============================================================================
--- tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/CurrencyConverterImpl.java (added)
+++ tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/CurrencyConverterImpl.java Tue Jan 26 22:10:11 2010
@@ -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 services;
+
+public class CurrencyConverterImpl implements CurrencyConverter {
+	
+    public double getConversion(String fromCurrencyCode, String toCurrencyCode, double amount) {
+        if (toCurrencyCode.equals("USD"))
+            return amount;
+        else if (toCurrencyCode.equals("EUR"))
+            return ((double)Math.round(amount * 0.7256 * 100)) /100;
+        return 0;
+    }
+
+    public String getCurrencySymbol(String currencyCode) {
+        if (currencyCode.equals("USD"))
+            return "$";
+        else if (currencyCode.equals("EUR"))
+            return "E"; //"€";
+        return "?";
+    }
+}

Propchange: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/CurrencyConverterImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/CurrencyConverterImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/FruitsCatalogImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/FruitsCatalogImpl.java?rev=903450&view=auto
==============================================================================
--- tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/FruitsCatalogImpl.java (added)
+++ tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/FruitsCatalogImpl.java Tue Jan 26 22:10:11 2010
@@ -0,0 +1,53 @@
+/*
+ * 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 services;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.ws.rs.Path;
+
+@Path("catalog")
+public class FruitsCatalogImpl implements Catalog {
+    public String currencyCode = "USD";
+    
+    public CurrencyConverter currencyConverter = new CurrencyConverterImpl();
+    
+    private List<Item> catalog = new ArrayList<Item>();
+
+    public FruitsCatalogImpl() {
+    	init();
+    }
+    
+    public void init() {
+        String currencySymbol = currencyConverter.getCurrencySymbol(currencyCode);
+        catalog.add(new Item("Apple",  currencySymbol + currencyConverter.getConversion("USD", currencyCode, 2.99)));
+        catalog.add(new Item("Orange", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 3.55)));
+        catalog.add(new Item("Pear", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 1.55)));
+    }
+
+    public List<Item> get() {
+    	return catalog;
+    }
+    
+    public Item get(String id) {
+    	throw new UnsupportedOperationException("Not yet implemented.");
+    }
+}

Propchange: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/FruitsCatalogImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/FruitsCatalogImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/Item.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/Item.java?rev=903450&view=auto
==============================================================================
--- tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/Item.java (added)
+++ tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/Item.java Tue Jan 26 22:10:11 2010
@@ -0,0 +1,50 @@
+/*
+ * 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 services;
+
+public class Item {
+    private String name;
+    private String price;
+    
+    public Item() {
+    }
+    
+    public Item(String name, String price) {
+        this.name = name;
+        this.price = price;
+    }
+    
+    public String getName() {
+        return name;
+    }
+    
+    public void setName(String name) {
+        this.name = name;
+    }
+    
+    public String getPrice() {
+        return price;
+    }
+    
+    public void setPrice(String price) {
+        this.price = price;
+    }
+
+}

Propchange: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/Item.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/java/services/Item.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/META-INF/MANIFEST.MF?rev=903450&view=auto
==============================================================================
--- tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/META-INF/MANIFEST.MF (added)
+++ tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/META-INF/MANIFEST.MF Tue Jan 26 22:10:11 2010
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+

Added: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/WEB-INF/application
URL: http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/WEB-INF/application?rev=903450&view=auto
==============================================================================
--- tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/WEB-INF/application (added)
+++ tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/WEB-INF/application Tue Jan 26 22:10:11 2010
@@ -0,0 +1,2 @@
+services.FruitsCatalogImpl
+org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider
\ No newline at end of file

Added: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/WEB-INF/web.xml?rev=903450&view=auto
==============================================================================
--- tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/WEB-INF/web.xml (added)
+++ tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/WEB-INF/web.xml Tue Jan 26 22:10:11 2010
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
+  <display-name>store-jaxrs</display-name>
+  
+    <!--
+		Wink SDK servlet configuration. This servlet handles HTTP requests
+		of SDK web service on application server.
+	-->
+	<servlet>
+		<servlet-name>restSdkService</servlet-name>
+		<servlet-class>org.apache.wink.server.internal.servlet.RestServlet</servlet-class>
+		<init-param>
+			<param-name>applicationConfigLocation</param-name>
+			<param-value>/WEB-INF/application</param-value>
+		</init-param>
+	</servlet>
+
+	<servlet-mapping>
+		<servlet-name>restSdkService</servlet-name>
+		<url-pattern>/services/*</url-pattern>
+	</servlet-mapping>
+	  
+  <welcome-file-list>
+    <welcome-file>store.html</welcome-file>
+  </welcome-file-list>
+</web-app>
\ No newline at end of file

Propchange: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/binding-http.js
URL: http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/binding-http.js?rev=903450&view=auto
==============================================================================
--- tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/binding-http.js (added)
+++ tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/binding-http.js Tue Jan 26 22:10:11 2010
@@ -0,0 +1,105 @@
+/*
+ * 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.    
+ */
+	
+function HTTPClient(uri) {
+
+	this.msxmlNames = [ "MSXML2.XMLHTTP.5.0",
+                        "MSXML2.XMLHTTP.4.0",
+                        "MSXML2.XMLHTTP.3.0",
+                        "MSXML2.XMLHTTP",
+                        "Microsoft.XMLHTTP" ];
+			            
+	this.uri=uri;
+	
+	this.get = function(id, responseFunction) {
+		var xhr = this.createXMLHttpRequest();
+		xhr.onreadystatechange = function() {
+			if (xhr.readyState == 4) {
+				if (xhr.status == 200) {
+				    var strDocument = xhr.responseText;
+                    if (responseFunction != null) responseFunction(strDocument);
+				} else {
+                    alert("get - Error getting data from the server");
+				}
+			}
+		}
+		xhr.open("GET", uri + '/' + id, true);
+		xhr.send(null);
+	}	
+
+	this.post = function (entry, responseFunction) {
+		var xhr = this.createXMLHttpRequest();
+		xhr.onreadystatechange = function() {
+			if (xhr.readyState == 4) {
+				if (xhr.status == 201) {
+				    var strDocument = xhr.responseText;
+					if (responseFunction != null) responseFunction(strDocument);
+				} else {
+					alert("post - Error getting data from the server");
+				}
+			}
+		}
+		xhr.open("POST", uri, true);
+		xhr.setRequestHeader("Content-Type", "text/xml");
+		xhr.send(entry);
+	}	
+
+	this.put = function (id, entry, responseFunction) {
+		var xhr = this.createXMLHttpRequest();
+		xhr.onreadystatechange = function() {
+			if (xhr.readyState == 4) {
+				if (xhr.status == 200) {
+				    var strDocument = xhr.responseText;
+					if (responseFunction != null) responseFunction(strDocument);
+				} else {
+					alert("put - Error getting data from the server");
+				}
+			}
+		}
+		xhr.open("PUT", uri + '/' + id, true);
+		xhr.setRequestHeader("Content-Type", "text/xml");
+		xhr.send(entry);
+	}	
+
+	this.del = function (id, responseFunction) {       
+		var xhr = this.createXMLHttpRequest();
+		xhr.onreadystatechange = function() {
+			if (xhr.readyState == 4) {
+				if (xhr.status == 200) {
+					if (responseFunction != null) responseFunction();
+				} else {
+					alert("delete - Error getting data from the server");
+				}
+			}
+		}
+		xhr.open("DELETE", uri + '/' + id, true);		
+		xhr.send(null);
+	}
+	this.createXMLHttpRequest = function () {
+        /* Mozilla XMLHttpRequest */
+        try {return new XMLHttpRequest();} catch(e) {}      
+		
+        /* Microsoft MSXML ActiveX */
+        for (var i=0;i < this.msxmlNames.length; i++) {
+            try {return new ActiveXObject(this.msxmlNames[i]);} catch (e) {}
+        }
+        alert("XML http request not supported");
+        return null;
+	}
+}
\ No newline at end of file

Propchange: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/binding-http.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/store.html
URL: http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/store.html?rev=903450&view=auto
==============================================================================
--- tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/store.html (added)
+++ tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/store.html Tue Jan 26 22:10:11 2010
@@ -0,0 +1,86 @@
+<!--
+    * 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.    
+-->
+<html>
+<head>
+<title>Store</title>
+
+<script type="text/javascript" src="binding-http.js"></script>
+
+<script language="JavaScript">
+
+	var catalog = new HTTPClient('http://localhost:8080/store-jaxrs/services/catalog');
+
+	var catalogItems;
+
+	function catalog_getResponse(items,exception) {
+		if(exception){
+			alert(exception.message);
+			return;
+		}
+		var catalog = "";
+		items = eval(items);
+		
+		for (var i=0; i<items.length; i++) {
+			var item = items[i].name + ' - ' + items[i].price;
+			catalog += '<input name="items" type="checkbox" value="' + 
+						item + '">' + item + ' <br>';
+		}
+		document.getElementById('catalog').innerHTML=catalog;
+		catalogItems = items;
+	}
+	
+
+	function init() {
+		try	{
+			catalog.get('',catalog_getResponse);
+		}
+		catch(e){
+			alert(e);
+		}
+	}
+	
+</script>
+
+</head>
+
+<body onload="init()">
+<h1>Store</h1>
+  <div id="store">
+   	<h2>Catalog</h2>
+   	<form name="catalogForm">
+		<div id="catalog" ></div>
+		<br>
+		<input type="button" onClick="addToCart()"  value="Add to Cart">
+   	</form>
+ 
+ 	<br>
+  
+   	<h2>Your Shopping Cart</h2>
+   	<form name="shoppingCartForm">
+		<div id="shoppingCart"></div>
+		<br>
+		<div id="total"></div>
+		<br>		
+		<input type="button" onClick="checkoutCart()" value="Checkout"> 
+		<input type="button" onClick="deleteCart()" value="Empty">     
+	   	<a href="../ShoppingCart/Cart/">(feed)</a>
+	</form>    
+  </div>
+</body>
+</html>

Propchange: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/store.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/store.html
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: tuscany/sandbox/lresende/sca-2.x/samples/store-jaxrs/src/main/webapp/store.html
------------------------------------------------------------------------------
    svn:mime-type = text/html