geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r942644 [2/2] - in /geronimo/samples/trunk/samples/javaee6: ./ restfulorder-javaee6/ restfulorder-javaee6/restfulorder-javaee6-jetty/ restfulorder-javaee6/restfulorder-javaee6-jetty/src/ restfulorder-javaee6/restfulorder-javaee6-jetty/src/m...
Date Mon, 10 May 2010 02:10:10 GMT
Added: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/resources/META-INF/persistence_openjpa.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/resources/META-INF/persistence_openjpa.xml?rev=942644&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/resources/META-INF/persistence_openjpa.xml (added)
+++ geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/resources/META-INF/persistence_openjpa.xml Mon May 10 02:10:08 2010
@@ -0,0 +1,35 @@
+<?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 impWlied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
+  <persistence-unit name="RestfulProduct2PU" transaction-type="JTA">
+    <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>    
+    <class>org.apache.geronimo.samples.javaee6.restfulorder.entities.Restfulorder</class>
+    <exclude-unlisted-classes>true</exclude-unlisted-classes>
+    <properties>
+      <property name="openjpa.jdbc.DBDictionary " value="derby"/>
+      <property name="openjpa.ConnectionURL" value="jdbc:derby://localhost:1527/restfuldemodb"/>
+      <property name="openjpa.ConnectionDriverName" value="org.apache.derby.jdbc.ClientDriver"/>
+      <property name="openjpa.ConnectionUserName" value="APP"/>
+      <property name="openjpa.ConnectionPassword" value="APP"/>      
+      <property name="openjpa.Sequence" value="table(Table=OPENJPASEQ, Increment=1)"/>      
+      <property name="openjpa.jdbc.SynchronizeMappings" value="bWWuildSchema(ForeignKeys=true)"/>
+      <property name="openjpa.Log" value="DefaultLevel=WARN, Tool=INFO"/>      
+    </properties>
+  </persistence-unit>
+</persistence>

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/resources/META-INF/persistence_openjpa.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/resources/META-INF/persistence_openjpa.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/resources/META-INF/persistence_openjpa.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/WEB-INF/geronimo-web.xml?rev=942644&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/WEB-INF/geronimo-web.xml (added)
+++ geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/WEB-INF/geronimo-web.xml Mon May 10 02:10:08 2010
@@ -0,0 +1,39 @@
+<?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.
+-->
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"
+         xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
+         xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
+         xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
+
+  <sys:environment>
+    <sys:moduleId>
+      <sys:groupId>${pom.groupId}</sys:groupId>
+      <sys:artifactId>restfulorder-javaee6</sys:artifactId>
+      <sys:version>${version}</sys:version>
+      <sys:type>car</sys:type>
+    </sys:moduleId>
+    <sys:dependencies/>
+    <sys:hidden-classes/>
+    <sys:non-overridable-classes/>
+  </sys:environment>
+
+  <context-root>/restfulorder-javaee6</context-root>
+
+</web-app>

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/WEB-INF/web.xml?rev=942644&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/WEB-INF/web.xml (added)
+++ geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/WEB-INF/web.xml Mon May 10 02:10:08 2010
@@ -0,0 +1,30 @@
+<?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.
+-->
+
+<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee " title="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">" class="link">http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
+    <session-config>
+        <session-timeout>
+            30
+        </session-timeout>
+    </session-config>
+    <welcome-file-list>
+        <welcome-file>index.html</welcome-file>
+    </welcome-file-list>
+</web-app>
\ No newline at end of file

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/header.html
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/header.html?rev=942644&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/header.html (added)
+++ geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/header.html Mon May 10 02:10:08 2010
@@ -0,0 +1,54 @@
+<!--
+   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>
+        <link type="text/css" rel="stylesheet" href="http://geronimo.apache.org/style/default.css">
+        <link rel="SHORTCUT ICON" href="http://geronimo.apache.org/images/favicon.ico">
+        <script src="http://geronimo.apache.org/functions.js" type="text/javascript"></script><title>Apache Geronimo Sample Applications</title>
+        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    </head>
+
+    <body onload="init()">
+
+        <table valign="top" background="http://geronimo.apache.org/images/header_bg_1x86.gif" border="0" cellpadding="0" cellspacing="0" width="100%">
+            <tbody>
+                <tr>
+                    <td valing="top" align="left">
+                        <a href="http://geronimo.apache.org/"><img src="http://geronimo.apache.org/images/topleft_logo_437x64.gif" border="0"></a>
+                    </td>
+                    <td width="100%">
+                        &nbsp;
+                    </td>
+                </tr>
+            </tbody>
+        </table>
+
+        <table border="0" cellpadding="2" cellspacing="0" width="100%">
+            <tbody>
+                <tr class="topBar">
+                    <td class="topBarDiv" align="left" nowrap="true" valign="middle" width="100%">
+                        &nbsp;<a href="http://geronimo.apache.org/" title="Apache Geronimo Home" target="_blank">Apache Geronimo Home</a> | <a href="http://cwiki.apache.org/geronimo/" title="Geronimo Documentation"target="_blank">Documentation</a> | <a href="http://cwiki.apache.org/GMOxSAMPLES/" title="Sample Applications"target="_blank">Sample Applications</a>
+                    </td>
+                    <td class="topBarDiv" align="left" nowrap="true" valign="middle">
+                        <a href="xref/index.html" target="source_window">Source Code</a> | <a href="apidocs/index.html" target="source_window">Java Docs</a>&nbsp;&nbsp;
+                    </td>
+                </tr>
+            </tbody>
+        </table>
+    </body>
+</html>
\ No newline at end of file

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/header.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/header.html
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/header.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/index.html
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/index.html?rev=942644&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/index.html (added)
+++ geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/index.html Mon May 10 02:10:08 2010
@@ -0,0 +1,29 @@
+<!--
+   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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd class="cell"">
+<html>
+<head>
+  <title>Apache Geronimo Sample Application</title>
+  <meta content="text/html; CHARSET=UTF-8" http-equiv="Content-Type">
+</head>
+
+<FRAMESET rows="86px,*" frameborder="0">
+    <FRAME src="./header.html" name="headerFrame" title="Header" frameborder="0" marginheight="0" marginwidth="0" noresize scrolling="no">
+    <FRAME src="rest/showAll.html" name="sampleDocumentFrame" title="Sample Document Description" frameborder="0" marginheight="0" marginwidth="0" noresize scrolling="no">
+</FRAMESET>
+
+</html>
\ No newline at end of file

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/index.html
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/index.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/Support.js
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/Support.js?rev=942644&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/Support.js (added)
+++ geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/Support.js Mon May 10 02:10:08 2010
@@ -0,0 +1,261 @@
+/**
+ * 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.
+ */
+
+
+var rjsSupport = {
+
+    proxy : "",
+    
+    getHttpProxy: function() {
+        return this.proxy;
+    },
+    
+    setHttpProxy: function(proxy_) {
+        this.proxy = proxy_;
+    },
+    
+    isSetHttpProxy: function() {
+        return this.getHttpProxy().length > 0;
+    },
+
+    getHttpRequest: function() {
+        var xmlHttpReq;
+        try
+        {    // Firefox, Opera 8.0+, Safari, IE7.0+
+            xmlHttpReq=new XMLHttpRequest();
+        }
+        catch (e)
+        {    // Internet Explorer 6.0+, 5.0+
+            try
+            {
+                xmlHttpReq=new ActiveXObject("Msxml2.XMLHTTP");
+            }
+            catch (e)
+            {
+                try
+                {
+                    xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP");
+                }
+                catch (e)
+                {
+                    this.debug("Your browser does not support AJAX!");
+                }
+            }
+        }
+        return xmlHttpReq;
+    },
+    
+    findUrl : function(url, method) {
+        var url2 = url;
+        if(this.isSetHttpProxy())
+            url2 = this.getHttpProxy()+"?method="+method+"&url="+url2;
+        return url2;
+    },
+
+    findMethod : function(method) {
+        var method2 = method;
+        if(method != "GET" && this.isSetHttpProxy())
+            method2 = "POST";
+        return method2;
+    },
+
+    open : function(method2, url2, mimeType, paramLen, async) {
+
+        //Change url and method if using http proxy
+        var url = this.findUrl(url2, method2);
+        var method = this.findMethod(method2);
+
+        //add timestamp to make url unique in case of IE7
+        var timestamp = new Date().getTime();
+        if(url.indexOf("?") != -1)
+            url = url+"&timestamp="+timestamp;
+        else
+            url = url+"?timestamp="+timestamp;
+
+        var xmlHttpReq = this.getHttpRequest();
+        if(xmlHttpReq == null) {
+            this.debug('Error: Cannot create XMLHttpRequest');
+            return null;
+        }
+        try {
+            netscape.security.PrivilegeManager.enablePrivilege ("UniversalBrowserRead");
+        } catch (e) {
+        //this.debug("Permission UniversalBrowserRead denied.");
+        }
+        try {
+            xmlHttpReq.open(method, url, async);
+        } catch( e ) {
+            this.debug('Error: XMLHttpRequest.open failed for: '+url+' Error name: '+e.name+' Error message: '+e.message);
+            return null;
+        }
+        if (mimeType != null) {
+            if(method == 'GET') {
+                //this.debug("setting GET accept: "+mimeType);
+                xmlHttpReq.setRequestHeader('Accept', mimeType);
+            } else if(method == 'POST' || method == 'PUT'){
+                //this.debug("setting content-type: "+mimeType);
+                //Send the proper header information along with the request
+                xmlHttpReq.setRequestHeader("Content-Type", mimeType);
+                xmlHttpReq.setRequestHeader("Content-Length", paramLen);
+                xmlHttpReq.setRequestHeader("Connection", "close");
+            }
+        }
+        //For cache control on IE7
+        xmlHttpReq.setRequestHeader("Cache-Control", "no-cache");
+        xmlHttpReq.setRequestHeader("Pragma", "no-cache");
+        xmlHttpReq.setRequestHeader("Expires", "-1");
+
+        return xmlHttpReq;
+    },
+
+    loadXml : function(xmlStr) {
+        var doc2;
+        // code for IE
+        if (window.ActiveXObject)
+        {
+            doc2=new ActiveXObject("Microsoft.XMLDOM");
+            doc2.async="false";
+            doc2.loadXML(xmlStr);
+        }
+        // code for Mozilla, Firefox, Opera, etc.
+        else
+        {
+            var parser=new DOMParser();
+            doc2=parser.parseFromString(xmlStr,getDefaultMime());
+        }
+        return doc2;
+    },
+
+    findIdFromUrl : function(u) {
+        var li = u.lastIndexOf('/');
+        if(li != -1) {
+            var u2 = u.substring(0, li);      
+            var li2 = u2.lastIndexOf('/');
+            u2 = u.substring(0, li2);
+            return u.substring(li2+1, li);
+        }
+        return -1;
+    },
+
+    get : function(url, mime) {
+        var xmlHttpReq = this.open('GET', url, mime, 0, false);
+        try {
+            xmlHttpReq.send(null);
+            if (xmlHttpReq.readyState == 4) {
+                var rtext = xmlHttpReq.responseText;
+                if(rtext == undefined || rtext == '' || rtext.indexOf('HTTP Status') != -1) {
+                    if(rtext != undefined)
+                        this.debug('Failed XHR(GET, '+url+'): Server returned --> ' + rtext);
+                    return '-1';
+                }
+                return rtext;
+            }
+        } catch( e ) {
+            this.debug('Caught Exception; name: [' + e.name + '] message: [' + e.message+']');
+        }
+        return '-1';
+    },
+
+    post : function(url, mime, content) {
+        var xmlHttpReq = this.open('POST', url, mime, content.length, false);
+
+        try {
+            xmlHttpReq.send(content);
+            if (xmlHttpReq.readyState == 4) {
+                var status = xmlHttpReq.status;
+                if(status == 201) {
+                    return true;
+                } else {
+                    this.debug('Failed XHR(POST, '+url+'): Server returned --> ' + status);
+                }
+            }
+        } catch( e ) {
+            this.debug('Caught Exception; name: [' + e.name + '] message: [' + e.message+']');
+        }
+        return false;
+    },
+
+    put : function(url, mime, content) {
+        var xmlHttpReq = this.open('PUT', url, mime, content.length, false);
+        try {
+            xmlHttpReq.send(content);
+            if (xmlHttpReq.readyState == 4) {
+                var status = xmlHttpReq.status;
+                if(status == 204) {
+                    return true;
+                } else {
+                    this.debug('Failed XHR(PUT, '+url+'): Server returned --> ' + status);
+                }
+            }
+        } catch( e ) {
+            this.debug('Caught Exception; name: [' + e.name + '] message: [' + e.message+']');
+        }
+        return false;
+    },
+
+    delete_ : function(url) {
+        var xmlHttpReq = this.open('DELETE', url, 'application/xml', 0, false);
+        try {
+            xmlHttpReq.send(null);
+            if (xmlHttpReq.readyState == 4) {
+                var status = xmlHttpReq.status;
+                if(status == 204) {
+                    return true;
+                } else {
+                    this.debug('Failed XHR(DELETE, '+url+'): Server returned --> ' + status);
+                }
+            }
+        } catch( e ) {
+            this.debug('Caught Exception; name: [' + e.name + '] message: [' + e.message+']');
+        }
+        return false;
+    },
+
+    debug : function(message) {
+        var dbgComp = document.getElementById("dbgComp");
+        if(dbgComp == null) {
+            dbgComp = document.createElement("div");
+            dbgComp.setAttribute("id", "dbgComp");
+            dbgComp.style.border = "#2574B7 1px solid";
+            dbgComp.style.font = "12pt/14pt sans-serif";
+            var br = document.createElement("div");
+            document.getElementsByTagName("body")[0].appendChild(br);
+            br.innerHTML = '<br/><br/><br/>';
+            document.getElementsByTagName("body")[0].appendChild(dbgComp);
+            if((typeof rjsConfig!="undefined") && rjsConfig.isDebug) {
+                dbgComp.style.display = "";
+            } else {
+                dbgComp.style.display = "none";
+            }
+            var tab = 'width: 20px; border-right: #2574B7 1px solid; border-top: #2574B7 1px solid; border-left: #2574B7 1px solid; border-bottom: #2574B7 1px solid; color: #000000; text-align: center;';
+            var addActionStr = '<div style="'+tab+'"><a style="text-decoration: none" href="javascript:rjsSupport.closeDebug()"><span style="color: red">X</span></a></div>';        
+            dbgComp.innerHTML = '<table><tr><td><span style="color: blue">Rest Debug Window</span></td><td>'+addActionStr + '</td></tr></table><br/>';
+        }
+        var s = dbgComp.innerHTML;
+        var now = new Date();
+        var dateStr = now.getHours()+':'+now.getMinutes()+':'+now.getSeconds();
+        dbgComp.innerHTML = s + '<span style="color: red">rest debug('+dateStr+'): </span>' + message + "<br/>";
+    },
+    
+    closeDebug : function() {
+        var dbgComp = document.getElementById("dbgComp");
+        if(dbgComp != null) {
+            dbgComp.style.display = "none";
+            dbgComp.innerHTML = '';
+        }
+    }
+}

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/Support.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/Support.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/Support.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/addOrder.html
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/addOrder.html?rev=942644&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/addOrder.html (added)
+++ geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/addOrder.html Mon May 10 02:10:08 2010
@@ -0,0 +1,94 @@
+<!--
+   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.
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+    <head>
+        <title></title>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <script type="text/javascript" src="./Support.js"></script>
+        <script type='text/javascript' src='./restfulorder/RestfulOrderControl.js'></script>
+        <script type='text/javascript' src='./restfulorder/Restfulorders.js'></script>
+        <script type='text/javascript' src='./restfulorder/Restfulorder.js'></script>
+        <script language='Javascript'>
+            function addOrder(){
+                var currentLocation=window.location.toString();
+                var indexB=currentLocation.indexOf("rest/addOrder.html");
+                var app = new RestfulProduct2(currentLocation.substring(0, indexB)+'resources');
+                var resources = app.getResources();           
+                var productURI=resources[0].getUri();
+                var item=new Restfulorder(productURI);
+                if(validate(document.getElementById("ID").value)){
+                    item.setId(document.getElementById("ID").value);
+                }     
+                else {
+                    alert("Please input an integer for ID attribute");
+                    document.getElementById("ID").value="";
+                    document.getElementById("ID").focus();
+                    return false;
+                }
+                item.setCustomer(document.getElementById("Customer").value);
+                item.setSeller(document.getElementById("Seller").value);
+                item.setProductname(document.getElementById("ProductName").value);
+                if(validate(document.getElementById("Price").value)){
+                    item.setPrice(document.getElementById("Price").value);
+                }
+                else {
+                    alert("Please input an integer for Price attribute");
+                    document.getElementById("Price").value="";
+                    document.getElementById("Price").focus();
+                    return false;
+                }
+                if(validate(document.getElementById("Quantity").value)){
+                    item.setQuantity(document.getElementById("Quantity").value);
+                }
+                else {
+                    alert("Please input an integer for Quantity attribute");
+                    document.getElementById("Quantity").value="";
+                    document.getElementById("Quantity").focus();
+                    return false;
+                }
+                
+                resources[0].addItem(item);
+                window.location.href="showAll.html";
+            }
+            function validate(inputnumber){
+                if(isNaN(parseInt(inputnumber))){
+                    return false;
+                }
+                else{
+                    return true;
+                }
+                
+            }
+        </script>
+    </head>
+    <body>
+        <h2>Add a new order and post this resource.</h2>
+        <hr>
+        <table>
+            <tr><td align="right">ID:</td><td><input type="text" name="ID" id="ID"></td></tr>
+            <tr><td align="right">Customer:</td><td><input type="text" name="Customer" id="Customer"></td></tr>
+            <tr><td align="right">Seller:</td><td><input type="text" name="Seller" id="Seller"></td></tr>
+            <tr><td align="right">ProductName:</td><td><input type="text" name="ProductName" id="ProductName"></td></tr>
+            <tr><td align="right">Price:</td><td><input type="text" name="Price" id="Price"></td></tr>
+            <tr><td align="right">Quantity:</td><td><input type="text" name="Quantity" id="Quantity"></td></tr>
+            <tr><td></td><td  align="center"><input type="button" onclick="addOrder()" value="Save"/></td></tr>
+            <tr><td></td ><td align="center"><a href="showAll.html">Show All Orders</a></td></tr>
+        </table>
+
+    </body>
+</html>

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/addOrder.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/addOrder.html
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/addOrder.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/editOrder.jsp
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/editOrder.jsp?rev=942644&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/editOrder.jsp (added)
+++ geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/editOrder.jsp Mon May 10 02:10:08 2010
@@ -0,0 +1,95 @@
+<!--
+   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.
+-->
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+    "" title="http://www.w3.org/TR/html4/loose.dtd">"
+
+<html>
+    <head>
+        <script type="text/javascript" src="./Support.js"></script>
+        <script type='text/javascript' src='./restfulorder/RestfulOrderControl.js'></script>
+        <script type='text/javascript' src='./restfulorder/Restfulorders.js'></script>
+        <script type='text/javascript' src='./restfulorder/Restfulorder.js'></script>
+
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <title>Restful Service Demo</title>
+        <script language="javascript">
+            function deleteOrder()
+            {             
+                item.delete_();
+                window.location.href="showAll.html";
+            }
+            function editOrder(){
+                item.setCustomer(document.getElementById("customer").value);
+                item.setSeller(document.getElementById("seller").value);
+                item.setProductname(document.getElementById("productname").value);
+                if(validate(document.getElementById("price").value)){
+                    item.setPrice(document.getElementById("price").value);
+                }
+                else {
+                    alert("Please input an integer for Price attribute");
+                    document.getElementById("price").value="";
+                    document.getElementById("price").focus();
+                    return false;
+                }
+                if(validate(document.getElementById("quantity").value)){
+                    item.setQuantity(document.getElementById("quantity").value);
+                }
+                else {
+                    alert("Please input an integer for Quantity attribute");
+                    document.getElementById("quantity").value="";
+                    document.getElementById("quantity").focus();
+                    return false;
+                }
+                item.flush();
+                window.location.href="showAll.html";
+            }
+             function validate(inputnumber){
+                if(isNaN(parseInt(inputnumber))){
+                    return false;
+                }
+                else{
+                    return true;
+                }
+            }
+        </script>
+    </head>
+    <body>
+        <h2>The resource you are accessing is from</h2><label id="orderUri"><%=request.getParameter("uri")%></label>
+        <hr/>
+        <div id="containerContent"><h2>Demonstrate edit and delete a restful resource.</h2></div>
+        <script language="javascript">
+            var item=new Restfulorder(document.getElementById("orderUri").innerHTML);
+            var str='';
+            str+='<table>';
+            str+='<tr><td align="right">ID:</td><td>'+item.getId()+'</td></tr>';
+            str+='<tr><td align="right">Customer:</td><td><input id="customer" type="txet" value="'+item.getCustomer()+'"></td></tr>';
+            str+='<tr><td align="right">Seller:</td><td><input id="seller" type="txet" value="'+item.getSeller()+'"></td></tr>';
+            str+=' <tr><td align="right">ProductName:</td><td><input id="productname" type="txet" value="'+item.getProductname()+'"></td></tr>';
+            str+=' <tr><td align="right">Price:</td><td><input id="price" type="txet" value="'+item.getPrice()+'"></td></tr>';
+            str+='<tr><td align="right">Quantity:</td><td><input id="quantity" type="txet" value="'+item.getQuantity()+'"></td></tr>';
+            str+='</table>';
+            var n = document.getElementById("containerContent");
+            n.innerHTML = n.innerHTML + str;
+        </script>
+        <input type="button" onclick="editOrder()"  value="Submit Changes"/>
+        <input type="button" onclick="deleteOrder()" value="Delete this"/>
+        <input type="button" onclick="javascript:history.go(-1)" value="Go Back"/>
+
+
+    </body>
+</html>

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/editOrder.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/editOrder.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/editOrder.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/restfulorder/RestfulOrderControl.js
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/restfulorder/RestfulOrderControl.js?rev=942644&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/restfulorder/RestfulOrderControl.js (added)
+++ geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/restfulorder/RestfulOrderControl.js Mon May 10 02:10:08 2010
@@ -0,0 +1,81 @@
+/**
+ * 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 RestfulProduct2() {}
+
+function RestfulProduct2(uri_) {
+    this.uri = uri_;
+}
+
+RestfulProduct2.prototype = {
+
+    uri : 'http://localhost:8080/RestfulProduct2/resources',
+
+    resources : new Array(),
+   
+    initialized : false,
+
+    getUri : function() {
+        return this.uri;
+    },
+
+    getResources : function() {
+        if(!this.initialized)
+            this.init();
+        return this.resources;
+    },
+
+    init : function() {
+        this.resources[0] = new Restfulorders(this.uri+'/restfulorders/');
+
+        this.initialized = true;
+    },
+
+    flush : function(resources_) {
+        for(j=0;j<resources_.length;j++) {
+            var r = resources_[j];
+            r.flush();
+        }
+    },
+   
+    getProxy : function() {
+        return rjsSupport.getHttpProxy();
+    },
+   
+    setProxy : function(proxy_) {
+        rjsSupport.setHttpProxy(proxy_);
+    },
+
+    toString : function() {
+        var s = '';
+        for(j=0;j<this.resources.length;j++) {
+            var c = this.resources[j];
+            if(j<this.resources.length-1)
+                s = s + '{"@uri":"'+c.getUri()+'"},';
+            else
+                s = s + '{"@uri":"'+c.getUri()+'"}';
+        }
+        var myObj =
+        '{"resources":'+
+        '{'+
+        s+
+        '}'+
+        '}';
+        return myObj;
+    }
+  
+}

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/restfulorder/RestfulOrderControl.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/restfulorder/RestfulOrderControl.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/restfulorder/RestfulOrderControl.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/restfulorder/Restfulorder.js
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/restfulorder/Restfulorder.js?rev=942644&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/restfulorder/Restfulorder.js (added)
+++ geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/restfulorder/Restfulorder.js Mon May 10 02:10:08 2010
@@ -0,0 +1,223 @@
+/**
+ * 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.
+ */
+
+var useWrapRestfulorder = true;
+
+function Restfulorder(uri_) {
+    this.Restfulorder(uri_, false);
+}
+
+function Restfulorder(uri_, initialized_) {
+    this.uri = uri_;
+    this.id = '';
+    this.customer = '';
+    this.seller = '';
+    this.productname = '';
+    this.price = '';
+    this.quantity = '';
+
+    this.initialized = initialized_;
+}
+
+Restfulorder.prototype = {
+
+    getUri : function() {
+        return this.uri;
+    },
+
+    getId : function() {
+        if(!this.initialized)
+            this.init();
+        return this.id;
+    },
+
+    setId : function(id_) {
+        this.id = id_;
+    },
+
+    getCustomer : function() {
+        if(!this.initialized)
+            this.init();
+        return this.customer;
+    },
+
+    setCustomer : function(customer_) {
+        this.customer = customer_ ;
+    },
+
+    getSeller : function() {
+        if(!this.initialized)
+            this.init();
+        return this.seller;
+    },
+
+    setSeller : function(seller_) {
+        this.seller = seller_;
+    },
+
+    getProductname : function() {
+        if(!this.initialized)
+            this.init();
+        return this.productname;
+    },
+
+    setProductname : function(productname_) {
+        this.productname = productname_;
+    },
+
+    getPrice : function() {
+        if(!this.initialized)
+            this.init();
+        return this.price;
+    },
+
+    setPrice : function(price_) {
+        this.price = price_;
+    },
+
+    getQuantity : function() {
+        if(!this.initialized)
+            this.init();
+        return this.quantity;
+    },
+
+    setQuantity : function(quantity_) {
+        this.quantity = quantity_;
+    },
+
+
+
+    init : function() {
+        var remote = new RestfulorderRemote(this.uri);
+        var c = remote.getJson_();
+    
+        if(c != -1) {
+            var myObj = eval('(' +c+')');
+            var restfulorder = myObj.restfulorder;
+            if(restfulorder == null || restfulorder == undefined || restfulorder['@uri'] == undefined) {
+                restfulorder = myObj;
+                useWrapRestfulorder = false;
+            }
+            this.uri = restfulorder['@uri'];
+            this.id = this.findValue(this.id, restfulorder['id']);
+            this.customer = this.findValue(this.customer, restfulorder['customer']);
+            this.seller = this.findValue(this.seller, restfulorder['seller']);
+            this.productname = this.findValue(this.productname, restfulorder['productname']);
+            this.price = this.findValue(this.price, restfulorder['price']);
+            this.quantity = this.findValue(this.quantity, restfulorder['quantity']);
+
+            this.initialized = true;
+        }
+    },
+
+    findValue : function(field, value) {
+        if(value == undefined)
+            return field;
+        else
+            return value;
+    },
+
+    flush : function() {
+        var remote = new RestfulorderRemote(this.uri);
+        if(useWrapRestfulorder)
+            return remote.putJson_('{'+this.toString()+'}');
+        else
+            return remote.putJson_(this.toString());
+    },
+
+    delete_ : function() {
+        var remote = new RestfulorderRemote(this.uri);
+        return remote.deleteJson_();
+    },
+
+    toString : function() {
+        if(!this.initialized)
+            this.init();
+        var myObj =
+        '{'+
+        '"@uri":"'+this.uri+'"'+
+        ', "id":"'+this.id+'"'+
+        ', "customer":"'+this.customer+'"'+
+        ', "seller":"'+this.seller+'"'+
+        ', "productname":"'+this.productname+'"'+
+        ', "price":"'+this.price+'"'+
+        ', "quantity":"'+this.quantity+'"'+
+
+        '}';
+        if(useWrapRestfulorder) {
+            myObj = '"restfulorder":'+myObj;
+        }
+        return myObj;
+    },
+
+    getFields : function() {
+        var fields = [];
+        fields.push('id');
+        fields.push('customer');
+        fields.push('seller');
+        fields.push('productname');
+        fields.push('price');
+        fields.push('quantity');
+
+        return fields;
+    }
+
+}
+function getItem(uri_){
+
+
+}
+
+function RestfulorderRemote(uri_) {
+    this.uri = uri_+'?expandLevel=1';
+}
+
+RestfulorderRemote.prototype = {
+
+    /* Default getJson_() method used by init() method. Do not remove. */
+    getJson_ : function() {
+        return rjsSupport.get(this.uri, 'application/json');
+    },
+    /* Default putJson_() method used by flush() method. Do not remove. */
+    putJson_ : function(content) {
+        return rjsSupport.put(this.uri, 'application/json', content);
+    },
+    /* Default deleteJson_() method used by delete_() method. Do not remove. */
+    deleteJson_ : function() {
+        return rjsSupport.delete_(this.uri);
+    }
+    ,
+    getXml : function() {
+        return rjsSupport.get(this.uri, 'application/xml');
+    },
+
+    getJson : function() {
+        return rjsSupport.get(this.uri, 'application/json');
+    },
+
+    putXml : function(content) {
+        return rjsSupport.put(this.uri, 'application/xml', content);
+    },
+
+    putJson : function(content) {
+        return rjsSupport.put(this.uri, 'application/json', content);
+    },
+
+    delete_ : function() {
+        return rjsSupport.delete_(this.uri);
+    }
+}

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/restfulorder/Restfulorder.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/restfulorder/Restfulorder.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/restfulorder/Restfulorder.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/restfulorder/Restfulorders.js
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/restfulorder/Restfulorders.js?rev=942644&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/restfulorder/Restfulorders.js (added)
+++ geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/restfulorder/Restfulorders.js Mon May 10 02:10:08 2010
@@ -0,0 +1,168 @@
+/**
+ * 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.
+ */
+
+var useWrapRestfulorders = true;
+
+function Restfulorders(uri_) {
+    this.uri = uri_;
+    this.items = new Array();
+    this.initialized = false;
+}
+
+Restfulorders.prototype = {
+
+    getUri : function() {
+        return this.uri;
+    },
+
+    getItems : function() {
+        if(!this.initialized)
+            this.init();
+        return this.items;
+    },
+
+    addItem : function(item) {
+        var remote = new RestfulordersRemote(this.uri);
+        remote.postJson_(item.toString());
+        this.items.push(item);
+    },
+
+    removeItem : function(item) {
+        var status = item.delete_();
+        if(status)
+            this.init(); //re-read items
+        return status;
+    },
+
+    init : function() {
+        var remote = new RestfulordersRemote(this.uri);
+        var c = remote.getJson_();
+        if(c != -1) {
+            var myObj = eval('('+c+')');
+            var restfulorders = myObj.restfulorders;
+            if(restfulorders == null || restfulorders == undefined || restfulorders['@uri'] == undefined) {
+                restfulorders = myObj;
+                useWrapRestfulorders = false;
+            }
+            this.items = new Array();
+            var refs = restfulorders.restfulorder;
+         
+            if(refs != undefined) {
+                if(refs.length == undefined) {
+                    this.initChild(refs, 0);
+                } else {
+                    var j = 0;
+                    for(j=0;j<refs.length;j++) {
+                        var ref = refs[j];
+                        this.initChild(ref, j);
+                    }
+                }
+            } else {
+                rjsSupport.debug('restfulorder is undefined, so skipping initChild for Restfulorders');
+            }
+            this.initialized = true;
+        }
+    },
+
+    initChild : function(ref, j) {
+        var uri2 = ref['@uri'];
+        this.items[j] = new Restfulorder(uri2);
+    },
+
+    flush : function() {
+        var remote = new RestfulordersRemote(this.uri);
+        if(useWrapRestfulorders)
+            remote.postJson_('{'+this.toString()+'}');
+        else
+            return remote.postJson_(this.toString());
+    },
+
+    flush : function(restfulorder) {
+        var remote = new RestfulordersRemote(this.uri);
+        if(useWrapRestfulorders)
+            return remote.postJson_('{'+restfulorder.toString()+'}');
+        else
+            return remote.postJson_(restfulorder.toString());
+    },
+
+    toString : function() {
+        if(!this.initialized)
+            this.init();
+        var s = '';
+        var j = 0;
+        if(this.items.length > 1)
+            s = s + '[';
+        for(j=0;j<this.items.length;j++) {
+            var c = this.items[j];
+            if(j<this.items.length-1)
+                s = s + '{"@uri":"'+c.getUri()+'", "restfulorderId":"'+rjsSupport.findIdFromUrl(c.getUri())+'"},';
+            else
+                s = s + '{"@uri":"'+c.getUri()+'", "restfulorderId":"'+rjsSupport.findIdFromUrl(c.getUri())+'"}';
+        }
+        if(this.items.length > 1)
+            s = s + ']';
+        var myObj = '';
+        if(s == '') {
+            myObj = '{"@uri":"'+this.getUri()+'"}';
+        } else {
+            myObj =
+            '{'+'"@uri":"'+this.getUri()+'",'+'"restfulorder":'+s+''+'}';
+        }
+        if(useWrapRestfulorders) {
+            myObj = '"restfulorders":'+myObj;
+        }
+        return myObj;
+    }
+
+}
+
+function RestfulordersRemote(uri_) {
+    this.uri = uri_+'?expandLevel=0&start=0&max=50';
+}
+
+RestfulordersRemote.prototype = {
+
+    /* Default getJson_() method used by init() method. Do not remove. */
+    getJson_ : function() {
+        return rjsSupport.get(this.uri, 'application/json');
+    },
+    /* Default postJson_() method used by flush() methods. Do not remove. */
+    postJson_ : function(content) {
+        return rjsSupport.post(this.uri, 'application/json', content);
+    }
+    ,
+    getXml : function() {
+        return rjsSupport.get(this.uri, 'application/xml');
+    },
+
+    getJson : function() {
+        return rjsSupport.get(this.uri, 'application/json');
+    },
+
+    postXml : function(content) {
+        return rjsSupport.post(this.uri, 'application/xml', content);
+    },
+
+    postJson : function(content) {
+        return rjsSupport.post(this.uri, 'application/json', content);
+    },
+
+    getRestfulorderResource : function(id) {
+        var link = new Restfulorder(this.uri+'/'+id);
+        return link;
+    }
+}

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/restfulorder/Restfulorders.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/restfulorder/Restfulorders.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/restfulorder/Restfulorders.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/showAll.html
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/showAll.html?rev=942644&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/showAll.html (added)
+++ geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/showAll.html Mon May 10 02:10:08 2010
@@ -0,0 +1,81 @@
+<!--
+   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.
+-->
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+    <head>
+        <title>Javascript client stub for RESTful Web Services - Test</title>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+        <link rel="stylesheet" href="./css/css_master-all.css" type="text/css"/>
+        <script type="text/javascript" src="./Support.js"></script>
+        <script type='text/javascript' src='./restfulorder/RestfulOrderControl.js'></script>
+        <script type='text/javascript' src='./restfulorder/Restfulorders.js'></script>
+        <script type='text/javascript' src='./restfulorder/Restfulorder.js'></script>
+
+    </head>
+    <body>
+        <div class="outerBorder">
+
+            <div id="main" class="main">
+                <h2>Demonstrate get/delete/edit resources using resful service.</h2>
+                <hr></hr>
+                <div id="containerContent"> </div>
+                <script language='Javascript'>
+                    
+                    var str = '';
+                    var currentLocation=window.location.toString();
+                    var indexB=currentLocation.indexOf("rest/showAll.html");
+                    str = '<h2>Resources for Restful Order:</h2><br><table border="1">';
+                    str+='<th>ID</th><th>customer</th><th>seller</th><th>productName</th><th>price</th><th>quantity</th><th>URI</th><th>Actions</th>';
+                    var app = new RestfulProduct2(currentLocation.substring(0, indexB)+'resources');
+                    var resources = app.getResources();
+                    for(i=0;i<resources.length;i++) {
+                        var resource = resources[i];
+                        var uri = resource.getUri();
+                        var items  = resource.getItems();
+                        if(items != undefined && items.length > 0) {
+                            for(j=0;j<items.length;j++) {
+                                var item = items[j];
+                                str+='<tr>';
+                                str+='<td>'+item.getId()+'</td>';
+                                str+='<td>'+item. getCustomer()+'</td>';
+                                str+='<td>'+item.getSeller()+'</td>';
+                                str+='<td>'+item.getProductname()+'</td>';
+                                str+='<td>'+item.getPrice()+'</td>';
+                                str+='<td>'+item.getQuantity()+'</td>';
+                                var uri2 = item.getUri();
+                                str+= '<td><a href="'+uri2+'" target="_blank">'+uri2+'</a></td>';
+                                //str+='<td><form id="'+item.getId()+'"><input type="button" value="Delete" onclick="deleteProduct('+item+')"/></form></td>';
+                                //str+='<td><form id=\"'+item.getId()+'\"><input type=\"button\" value=\"Delete\" onclick=\"deleteProduct('+item+')\"/></form></td>';
+                                str+='<td><a href="editOrder.jsp?uri='+item.getUri()+'">Edit</a></td>';
+                                str+='</tr>';
+                            }
+                        } else {
+                            str += 'No items, please check the url: <a href="'+uri+'" target="_blank">'+uri+'</a>.<br/>Set proxy if RESTful web service is not running on the same domain as this application.';
+                        }
+                    }
+                    str += '</table><br>';
+                    str+="<a href=\"addOrder.html\">Add a new order</a>";
+                    var n = document.getElementById('containerContent');
+                    n.innerHTML = n.innerHTML + str;
+                </script>
+            </div>
+        </div> 
+    </body>
+</html>

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/showAll.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/showAll.html
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/trunk/samples/javaee6/restfulorder-javaee6/restfulorder-javaee6-war/src/main/webapp/rest/showAll.html
------------------------------------------------------------------------------
    svn:mime-type = text/html



Mime
View raw message