[jboss-cvs] jboss-seam/examples/seambay/view ...
Shane Bryzak
sbryzak at redhat.com
Wed Apr 11 03:16:12 EDT 2007
User: sbryzak2
Date: 07/04/11 03:16:12
Modified: examples/seambay/view home.xhtml test.js test.xhtml
Log:
split web services into separate groups
Revision Changes Path
1.4 +3 -2 jboss-seam/examples/seambay/view/home.xhtml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: home.xhtml
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/seambay/view/home.xhtml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- home.xhtml 29 Mar 2007 13:55:07 -0000 1.3
+++ home.xhtml 11 Apr 2007 07:16:12 -0000 1.4
@@ -30,8 +30,9 @@
<div id="content">
<p>
- Welcome to <img src="img/seambay_inline.png" border="0"/>, an example Seam application that parodies a popular online auction site.
- This example demonstrates how Seam integrates with JBossWS.
+ Welcome to <img src="img/seambay_inline.png" border="0"/>, an example Seam application that parodies a popular
+ online auction site. This example demonstrates how Seam integrates with JBossWS to provide web services that
+ take advantage of Seam's contextual framework.
</p>
<p>
1.4 +48 -6 jboss-seam/examples/seambay/view/test.js
(In the diff below, changes in quantity of whitespace are not shown.)
Index: test.js
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/seambay/view/test.js,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- test.js 10 Apr 2007 01:42:38 -0000 1.3
+++ test.js 11 Apr 2007 07:16:12 -0000 1.4
@@ -1,4 +1,5 @@
var webServices = new Object();
+var groups = new Object();
ServiceParam = function(name, key)
{
@@ -7,9 +8,10 @@
this.value = "#{" + key + "}";
}
-ServiceMetadata = function(name)
+ServiceMetadata = function(name, group)
{
this.name = name;
+ this.group = group;
this.parameters = new Array();
webServices[name] = this;
@@ -21,16 +23,18 @@
ServiceMetadata.prototype.getRequest = function() { return this.request; };
}
-var svc = new ServiceMetadata("listCategories");
+// start of web service definitions
+
+var svc = new ServiceMetadata("listCategories", "General");
svc.setDescription("List Categories");
svc.setRequest("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" " +
"\n xmlns:seam=\"http://seambay.example.seam.jboss.org/\">\n <soapenv:Header/>" +
"\n <soapenv:Body>\n <seam:listCategories/>\n </soapenv:Body>\n</soapenv:Envelope>");
-svc = new ServiceMetadata("listAuctions");
+svc = new ServiceMetadata("listAuctions", "General");
svc.setDescription("List Auctions");
-svc = new ServiceMetadata("login");
+svc = new ServiceMetadata("login", "Security");
svc.setDescription("Login");
svc.setRequest("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" " +
"\n xmlns:seam=\"http://seambay.example.seam.jboss.org/\">\n <soapenv:Header/>" +
@@ -44,6 +48,34 @@
svc.addParameter(new ServiceParam("Username", "username"));
svc.addParameter(new ServiceParam("Password", "password"));
+svc = new ServiceMetadata("logout", "Security");
+svc.setDescription("Logout");
+svc.setRequest("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" " +
+ "\n xmlns:seam=\"http://seambay.example.seam.jboss.org/\">\n <soapenv:Header/>" +
+ "\n <soapenv:Body>" +
+ "\n <seam:logout/>" +
+ "\n </soapenv:Body>" +
+ "</soapenv:Envelope>");
+
+svc = new ServiceMetadata("createAuction", "Create/Update Auction");
+svc.setDescription("Create new auction");
+svc.setRequest("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" " +
+ "\n xmlns:seam=\"http://seambay.example.seam.jboss.org/\">\n <soapenv:Header/>" +
+ "\n <soapenv:Body>" +
+ "\n <seam:createAuction>" +
+ "\n <arg0>#{title}</arg0>" +
+ "\n <arg1>#{description}</arg1>" +
+ "\n <arg2>#{categoryId}</arg2>" +
+ "\n </seam:createAuction>" +
+ "\n </soapenv:Body>" +
+ "\n</soapenv:Envelope>");
+svc.addParameter(new ServiceParam("Auction title", "title"));
+svc.addParameter(new ServiceParam("Description", "description"));
+svc.addParameter(new ServiceParam("Category ID", "categoryId"));
+
+// end of web service definitions
+
+
var selectedService = null;
function setAllParams()
@@ -181,7 +213,17 @@
var anchor = document.createElement("a");
anchor.href = "javascript:selectService('" + ws.name + "')";
anchor.appendChild(document.createTextNode(ws.getDescription()));
- document.getElementById("services").appendChild(anchor);
+
+ if (!groups[ws.group])
+ {
+ groups[ws.group] = document.createElement("div");
+ var groupTitle = document.createElement("span");
+ groupTitle.appendChild(document.createTextNode(ws.group));
+ groups[ws.group].appendChild(groupTitle);
+ document.getElementById("services").appendChild(groups[ws.group]);
+ }
+
+ groups[ws.group].appendChild(anchor);
}
}
1.3 +1 -1 jboss-seam/examples/seambay/view/test.xhtml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: test.xhtml
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/seambay/view/test.xhtml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- test.xhtml 10 Apr 2007 01:42:38 -0000 1.2
+++ test.xhtml 11 Apr 2007 07:16:12 -0000 1.3
@@ -14,7 +14,7 @@
<h1>SeamBay Web Services - Test Page</h1>
<div id="services">
- <span>Select a service to test</span>
+
</div>
<div id="detail">
More information about the jboss-cvs-commits
mailing list