cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1304080 - in /cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first: README.txt src/main/java/demo/hw/server/JavascriptExampleImpl.java src/main/java/demo/hw/server/data/Category.java staticContent/Beverages.html
Date Thu, 22 Mar 2012 21:37:11 GMT
Author: gmazza
Date: Thu Mar 22 21:37:10 2012
New Revision: 1304080

URL: http://svn.apache.org/viewvc?rev=1304080&view=rev
Log:
Clarified sample, made beverages somewhat less gross.

Modified:
    cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/README.txt
    cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/main/java/demo/hw/server/JavascriptExampleImpl.java
    cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/main/java/demo/hw/server/data/Category.java
    cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/staticContent/Beverages.html

Modified: cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/README.txt
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/README.txt?rev=1304080&r1=1304079&r2=1304080&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/README.txt
(original)
+++ cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/README.txt
Thu Mar 22 21:37:10 2012
@@ -15,16 +15,17 @@ Using either UNIX or Windows:
   mvn install
   mvn -Pserver
 
-
 Running the client in a browser
 -------------------------------
 
-Once the server is running, browse to:
+Once the server is running, you can view its WSDL at:
+   http://localhost:9000/beverages?wsdl
+
+Also, browse to:
 
-  http://HOSTNAME:9000/Beverages.html
+  http://localhost:9000/Beverages.html
 
-(Substitute your hostname for HOSTNAME.)
+On the web page you see, choose a beverage ingredient category
+and select the invoke button to see a list of beverages 
+containing that ingredients of that category.
 
-On the web page you see, click on the 'invoke' button to invoke the
-very simple sayHi service, which takes no input and returns a single
-string.

Modified: cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/main/java/demo/hw/server/JavascriptExampleImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/main/java/demo/hw/server/JavascriptExampleImpl.java?rev=1304080&r1=1304079&r2=1304080&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/main/java/demo/hw/server/JavascriptExampleImpl.java
(original)
+++ cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/main/java/demo/hw/server/JavascriptExampleImpl.java
Thu Mar 22 21:37:10 2012
@@ -35,41 +35,44 @@ public class JavascriptExampleImpl imple
     
     public JavascriptExampleImpl() {
         beverages = new ArrayList<Beverage>();
-        Ingredient chalk = new Ingredient();
-        chalk.setName("chalk");
-        chalk.setCategory(Category.Mineral);
+        Ingredient calcium = new Ingredient();
+        calcium.setName("calcium");
+        calcium.setCategory(Category.Mineral);
+        Ingredient zinc = new Ingredient();
+        zinc.setName("zinc");
+        zinc.setCategory(Category.Mineral);
         Ingredient broccoli = new Ingredient();
         broccoli.setName("broccoli");
         broccoli.setCategory(Category.Vegetable);
-        Ingredient locust = new Ingredient();
-        locust.setName("locust");
-        locust.setCategory(Category.Animal);
+        Ingredient apple = new Ingredient();
+        apple.setName("apple");
+        apple.setCategory(Category.Fruit);
         
         Beverage b = new Beverage();
-        b.setName("broccoli shake");
+        b.setName("zinc-fortified broccoli shake");
         b.setProof(20);
         Ingredient[] ingredients;
         ingredients = new Ingredient[2];
-        ingredients[0] = chalk;
+        ingredients[0] = zinc;
         ingredients[1] = broccoli;
         b.setIngredients(ingredients);
         beverages.add(b);
         
         b = new Beverage();
-        b.setName("green locust");
+        b.setName("apple broccoli shake");
         b.setProof(50);
         ingredients = new Ingredient[2];
-        ingredients[0] = locust;
+        ingredients[0] = apple;
         ingredients[1] = broccoli;
         b.setIngredients(ingredients);
         beverages.add(b);
         
         b = new Beverage();
-        b.setName("bug shake");
+        b.setName("calcium-fortified apple juice");
         b.setProof(13);
         ingredients = new Ingredient[2];
-        ingredients[0] = locust;
-        ingredients[1] = chalk;
+        ingredients[0] = apple;
+        ingredients[1] = calcium;
         b.setIngredients(ingredients);
         beverages.add(b);
         

Modified: cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/main/java/demo/hw/server/data/Category.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/main/java/demo/hw/server/data/Category.java?rev=1304080&r1=1304079&r2=1304080&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/main/java/demo/hw/server/data/Category.java
(original)
+++ cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/main/java/demo/hw/server/data/Category.java
Thu Mar 22 21:37:10 2012
@@ -20,7 +20,7 @@
 package demo.hw.server.data;
 
 public enum Category {
-    Animal,
+    Fruit,
     Vegetable,
     Mineral;
 }

Modified: cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/staticContent/Beverages.html
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/staticContent/Beverages.html?rev=1304080&r1=1304079&r2=1304080&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/staticContent/Beverages.html
(original)
+++ cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/staticContent/Beverages.html
Thu Mar 22 21:37:10 2012
@@ -35,9 +35,13 @@ function beverageListResponse(response)
     responseSpan = document.getElementById('beverages');
     var beverages = response.getItem();
     var str = '';
+    var first = new Boolean(true);
     for(b in beverages) {
+        if (first == false) {
+           str = str + ', ';
+        }
     	str = str + beverages[b].getName();
-    	str = str + ' ';
+    	first=false;
     }
     responseSpan.firstChild.nodeValue = str;
 }
@@ -67,12 +71,12 @@ Hello World Sample
 <div>
 	<table>
 	<tr>
-	<td>Category
+	<td>Ingredient
 	</td>
 	<td>
 	<select id='category'>
-	<option value="">Choose a Category...</option>
-    <option value="Animal">Animal</option>
+	<option value="">Choose an Ingredient...</option>
+	<option value="Fruit">Fruit</option>
 	<option value="Vegetable">Vegetable</option>
 	<option value="Mineral">Mineral</option>
     </select>
@@ -92,4 +96,5 @@ Hello World Sample
 </div>
 </form>
 </body>
-</html>
\ No newline at end of file
+</html>
+



Mime
View raw message