You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
(39) |
May
(165) |
Jun
(164) |
Jul
(127) |
Aug
(81) |
Sep
(146) |
Oct
(375) |
Nov
(241) |
Dec
(77) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(42) |
Feb
(38) |
Mar
(30) |
Apr
(6) |
May
(17) |
Jun
|
Jul
(15) |
Aug
(59) |
Sep
(31) |
Oct
(44) |
Nov
(30) |
Dec
(12) |
| 2008 |
Jan
(9) |
Feb
(63) |
Mar
(18) |
Apr
(43) |
May
(28) |
Jun
(32) |
Jul
(61) |
Aug
(5) |
Sep
(72) |
Oct
(48) |
Nov
(6) |
Dec
|
|
From: <fug...@us...> - 2007-11-02 02:12:27
|
Revision: 1818
http://cogkit.svn.sourceforge.net/cogkit/?rev=1818&view=rev
Author: fugangwang
Date: 2007-11-01 19:12:26 -0700 (Thu, 01 Nov 2007)
Log Message:
-----------
delete the unused example
Removed Paths:
-------------
trunk/cyberaide/src/jaxws/hello/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fug...@us...> - 2007-11-02 02:05:49
|
Revision: 1817
http://cogkit.svn.sourceforge.net/cogkit/?rev=1817&view=rev
Author: fugangwang
Date: 2007-11-01 19:05:47 -0700 (Thu, 01 Nov 2007)
Log Message:
-----------
add a usable test example, which deployed a web service and invoke the service using a java client
Added Paths:
-----------
trunk/cyberaide/src/jaxws/testCircleService/
trunk/cyberaide/src/jaxws/testCircleService/CircleFunctions.java
trunk/cyberaide/src/jaxws/testCircleService/Makefile
trunk/cyberaide/src/jaxws/testCircleService/TestCircleFunctions.java
trunk/cyberaide/src/jaxws/testCircleService/stop.sh
Added: trunk/cyberaide/src/jaxws/testCircleService/CircleFunctions.java
===================================================================
--- trunk/cyberaide/src/jaxws/testCircleService/CircleFunctions.java (rev 0)
+++ trunk/cyberaide/src/jaxws/testCircleService/CircleFunctions.java 2007-11-02 02:05:47 UTC (rev 1817)
@@ -0,0 +1,46 @@
+/*
+ * CircleFunctions.java
+ *
+ * @version:
+ * $Id v1.0$
+ *
+ * @author:
+ * Fugang Wang
+ *
+ * Revisions:
+ * 10/28/2007 Initial version
+ * 11/01/2007 modify package name
+ *
+ */
+package testjaxws.service;
+
+import javax.jws.WebService;
+import javax.xml.ws.Endpoint;
+
+@WebService
+public class CircleFunctions {
+
+ /*
+ * return area of a circle
+ */
+ public double getArea(double r) {
+ return java.lang.Math.PI * (r * r);
+ }
+
+ /*
+ * return circumference of a circle
+ */
+ public double getCircumference(double r) {
+ return 2 * java.lang.Math.PI * r;
+ }
+
+ /*
+ * publish the service
+ */
+ public static void main(String[] args) {
+
+ Endpoint.publish(
+ "http://localhost:8080/jaxws/circlefunctions",
+ new CircleFunctions());
+ }
+}
Added: trunk/cyberaide/src/jaxws/testCircleService/Makefile
===================================================================
--- trunk/cyberaide/src/jaxws/testCircleService/Makefile (rev 0)
+++ trunk/cyberaide/src/jaxws/testCircleService/Makefile 2007-11-02 02:05:47 UTC (rev 1817)
@@ -0,0 +1,27 @@
+all: compile service client stop
+ @echo done
+
+init:
+ mkdir -p testjaxws
+
+compile: init
+ javac -d . CircleFunctions.java
+
+service:
+ @echo "Starting service..."
+ wsgen -cp . -r testjaxws -wsdl testjaxws.service.CircleFunctions
+ java testjaxws.service.CircleFunctions &
+ sleep 2
+
+client:
+ @echo "Generating and running client..."
+ wsimport -keep -p testjaxws.clientstub http://localhost:8080/jaxws/circlefunctions?WSDL
+ javac -d . TestCircleFunctions.java
+ java testjaxws.client.TestCircleFunctions
+
+stop:
+ @echo "Stopping service..."
+ sh stop.sh
+
+clean:
+ rm -fr testjaxws
Added: trunk/cyberaide/src/jaxws/testCircleService/TestCircleFunctions.java
===================================================================
--- trunk/cyberaide/src/jaxws/testCircleService/TestCircleFunctions.java (rev 0)
+++ trunk/cyberaide/src/jaxws/testCircleService/TestCircleFunctions.java 2007-11-02 02:05:47 UTC (rev 1817)
@@ -0,0 +1,68 @@
+/*
+ * TestCircleFunctions.java
+ *
+ * @version:
+ * $Id v1.0$
+ *
+ * @author:
+ * Fugang Wang
+ *
+ * Revisions:
+ * 10/28/2007 Initial version
+ * 11/01/2007 modify package name
+ *
+ */
+package testjaxws.client;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceRef;
+//import javax.jws.WebService;
+import testjaxws.clientstub.CircleFunctionsService;
+
+//@WebServiceRef(wsdlLocation = "http://localhost:8080/jaxws/circlefunctions?WSDL")
+
+public class TestCircleFunctions {
+ static CircleFunctionsService service = new CircleFunctionsService();
+
+ public static void main(String[] args) {
+ try {
+ TestCircleFunctions client = new TestCircleFunctions();
+ client.doTest(args);
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void doTest(String[] args) {
+ try {
+ System.out.println("----------from Client running----------");
+ System.out.println("Retrieving the port from the following service:\n\t " + service);
+ testjaxws.clientstub.CircleFunctions port = service.getCircleFunctionsPort();
+ double radius,area,circumference;
+
+ System.out.println("Invoking the getCircumference operation on the port...");
+ System.out.print("Response from server:\n\tThe circumference of a circle with radius 5:");
+ radius = 5;
+ circumference = port.getCircumference(radius);
+ System.out.println( circumference );
+
+ System.out.println("Invoking the getArea operation on the port...");
+ System.out.print("Response from server:\n\tThe area of a circle with radius 10:");
+ radius = 10;
+ area = port.getArea(radius);
+ System.out.println( area );
+
+ System.out.println("Invoking the getCircumference operation on the port...");
+ System.out.print("Response from server:\n\tThe circumference of a circle with radius 10:");
+ circumference = port.getCircumference(radius);
+ System.out.println( circumference );
+
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
Added: trunk/cyberaide/src/jaxws/testCircleService/stop.sh
===================================================================
--- trunk/cyberaide/src/jaxws/testCircleService/stop.sh (rev 0)
+++ trunk/cyberaide/src/jaxws/testCircleService/stop.sh 2007-11-02 02:05:47 UTC (rev 1817)
@@ -0,0 +1 @@
+kill -9 `ps -a|grep java|awk '{print $1}'`
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ha...@us...> - 2007-10-30 20:19:30
|
Revision: 1816
http://cogkit.svn.sourceforge.net/cogkit/?rev=1816&view=rev
Author: hategan
Date: 2007-10-30 13:19:29 -0700 (Tue, 30 Oct 2007)
Log Message:
-----------
changes
Modified Paths:
--------------
trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
Modified: trunk/current/src/cog/modules/provider-gt2/CHANGES.txt
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/CHANGES.txt 2007-10-30 20:17:50 UTC (rev 1815)
+++ trunk/current/src/cog/modules/provider-gt2/CHANGES.txt 2007-10-30 20:19:29 UTC (rev 1816)
@@ -1,3 +1,9 @@
+(10/30/2007)
+
+*** Added totalSize implementation to data sources such that
+ the JGlobus GridFTP client sends the ALLO command before
+ a transfer.
+
(10/03/2007)
*** Fixed some issues with the credentials used for the callback
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ha...@us...> - 2007-10-30 20:17:53
|
Revision: 1815
http://cogkit.svn.sourceforge.net/cogkit/?rev=1815&view=rev
Author: hategan
Date: 2007-10-30 13:17:50 -0700 (Tue, 30 Oct 2007)
Log Message:
-----------
added totalSize implementation for data sources
Modified Paths:
--------------
trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java
Modified: trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java 2007-10-30 20:17:02 UTC (rev 1814)
+++ trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/file/gridftp/old/FileResourceImpl.java 2007-10-30 20:17:50 UTC (rev 1815)
@@ -351,7 +351,7 @@
public void putFile(String localFileName, String remoteFileName,
final ProgressMonitor progressMonitor) throws FileResourceException {
- File localFile = new File(localFileName);
+ final File localFile = new File(localFileName);
try {
gridFTPClient.setPassiveMode(true);
final long size = localFile.length();
@@ -362,10 +362,18 @@
progressMonitor.progress(totalRead, size);
return super.read();
}
+
+ public long totalSize() {
+ return localFile.length();
+ }
};
}
else {
- source = new DataSourceStream(new FileInputStream(localFile));
+ source = new DataSourceStream(new FileInputStream(localFile)) {
+ public long totalSize() {
+ return localFile.length();
+ }
+ };
}
gridFTPClient.put(remoteFileName, source, null, false);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ha...@us...> - 2007-10-30 20:17:05
|
Revision: 1814
http://cogkit.svn.sourceforge.net/cogkit/?rev=1814&view=rev
Author: hategan
Date: 2007-10-30 13:17:02 -0700 (Tue, 30 Oct 2007)
Log Message:
-----------
updated jglobus
Added Paths:
-----------
trunk/current/src/cog/modules/jglobus/lib/cog-jglobus-1.4-dev-071030.jar
trunk/current/src/cog/modules/jglobus/lib/cog-jobmanager-1.4-dev-071030.jar
Removed Paths:
-------------
trunk/current/src/cog/modules/jglobus/lib/cog-jglobus-1.2-060802.jar
trunk/current/src/cog/modules/jglobus/lib/cog-jobmanager-060802.jar
Deleted: trunk/current/src/cog/modules/jglobus/lib/cog-jglobus-1.2-060802.jar
===================================================================
(Binary files differ)
Added: trunk/current/src/cog/modules/jglobus/lib/cog-jglobus-1.4-dev-071030.jar
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/jglobus/lib/cog-jglobus-1.4-dev-071030.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: trunk/current/src/cog/modules/jglobus/lib/cog-jobmanager-060802.jar
===================================================================
(Binary files differ)
Added: trunk/current/src/cog/modules/jglobus/lib/cog-jobmanager-1.4-dev-071030.jar
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/jglobus/lib/cog-jobmanager-1.4-dev-071030.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <las...@us...> - 2007-10-28 17:04:01
|
Revision: 1813
http://cogkit.svn.sourceforge.net/cogkit/?rev=1813&view=rev
Author: laszewsk
Date: 2007-10-28 10:04:00 -0700 (Sun, 28 Oct 2007)
Log Message:
-----------
more code restructuring
Modified Paths:
--------------
trunk/cyberaide/src/js/java/CoGHandler/SimpleHandler.java
Modified: trunk/cyberaide/src/js/java/CoGHandler/SimpleHandler.java
===================================================================
--- trunk/cyberaide/src/js/java/CoGHandler/SimpleHandler.java 2007-10-28 16:54:21 UTC (rev 1812)
+++ trunk/cyberaide/src/js/java/CoGHandler/SimpleHandler.java 2007-10-28 17:04:00 UTC (rev 1813)
@@ -1,37 +1,51 @@
-package zhguo.test;
+package org.cogkit.cyberaide.???.CoGHandler.test;
import java.io.*;
-import zhguo.test.SimpleHandlerStub.Echo;
-import zhguo.test.SimpleHandlerStub.EchoResponse;
-import zhguo.test.SimpleHandlerStub.CmdCOGExecute;
-import zhguo.test.SimpleHandlerStub.CmdCOGExecuteResponse;
+import org.cogkit.cyberaide.???.CoGHandler.test.SimpleHandlerStub.Echo;
+import org.cogkit.cyberaide.???.CoGHandler.test.SimpleHandlerStub.EchoResponse;
+import org.cogkit.cyberaide.???.CoGHandler.test.SimpleHandlerStub.CmdCOGExecute;
+import org.cogkit.cyberaide.???.CoGHandler.test.SimpleHandlerStub.CmdCOGExecuteResponse;
/*
* It is to be used to XML-RPC framework.
*/
+
+
+/*
+ String apache_home = E:\\Prog ...
+ String service_home = http:/loca ....
+ String WEBINF_home = ....
+ String cog_workflow_exe = .....
+
+ long timeout = ....
+*/
+
public class SimpleHandler{
// private
- public SimpleHandler(){}
- public String echo( String input ){
- try{//write input into a file for logging
- File recordfile = new File("E:\\Program Files\\Apache Software Foundation\\Tomcat 6.0\\webapps\\sample\\WEB-INF\\parameters.txt");
- BufferedWriter br = new BufferedWriter(new FileWriter( recordfile ));
- br.write( input );
- br.close();
- }catch (Exception e ){
- System.exit( 1 );
- }
-
- SimpleHandlerStub stub = new SimpleHandlerStub("http://localhost:8080/axis2/services/SimpleHandler");
- Echo req = new Echo();
- req.setInput( input );
- EchoResponse resp = new EchoResponse();
-
- //call the corresponding web service
- return "Your input is:\n" + input;
+ public SimpleHandler (){}
+
+ public String echo (String input){
+ try{
+ //write input into a file for logging
+ File recordfile = new File("E:\\Program Files\\Apache Software Foundation\\Tomcat 6.0\\webapps\\sample\\WEB-INF\\parameters.txt");
+ BufferedWriter br = new BufferedWriter(new FileWriter( recordfile ));
+ br.write (input);
+ br.close();
+ }catch (Exception e ){
+ System.exit (1);
}
- public static int add(OperationInterfaceStub stub) {
+
+ SimpleHandlerStub stub
+ = new SimpleHandlerStub("http://localhost:8080/axis2/services/SimpleHandler");
+ Echo req = new Echo();
+ req.setInput (input);
+ EchoResponse resp = new EchoResponse();
+
+ //call the corresponding web service
+ return "Your input is:\n" + input;
+ }
+ public static int add (OperationInterfaceStub stub) {
try {
Add req = new Add();
req.setParam0(op1);
@@ -48,33 +62,33 @@
return 0;
}
- public String cmdCOGExecute( String workflow ){
- Process wfproc = null;
- int exit = -1;
- try {
- String filename = "E:\\Program Files\\Apache Software Foundation\\Tomcat 6.0\\webapps\\sample\\WEB-INF\\workflow.xml";
- File recordfile = new File(filename);
- BufferedWriter br = new BufferedWriter(new FileWriter(recordfile));
- br.write(workflow);
- br.close();
-
- String cmd = "E:\\my_program\\cog-4_1_5\\bin\\cog-workflow.bat " + filename;
- long timeout = 1000 * 5;
- wfproc = Runtime.getRuntime().exec(cmd);
- synchronized(wfproc) {
- wfproc.wait(timeout);
- }
- exit = wfproc.exitValue();
- } catch (IllegalThreadStateException e) {
- //if the thread
- wfproc.destroy();
- return e.toString();
- } catch (Exception e){
- return e.toString();
- }
- return "exit value " + String.valueOf(exit);
+ public String cmdCOGExecute( String workflow ){
+ Process wfproc = null;
+ int exit = -1;
+ try {
+ String filename = "E:\\Program Files\\Apache Software Foundation\\Tomcat 6.0\\webapps\\sample\\WEB-INF\\workflow.xml";
+ File recordfile = new File(filename);
+ BufferedWriter br = new BufferedWriter(new FileWriter(recordfile));
+ br.write(workflow);
+ br.close();
+
+ String cmd = "E:\\my_program\\cog-4_1_5\\bin\\cog-workflow.bat " + filename;
+ long timeout = 1000 * 5;
+ wfproc = Runtime.getRuntime().exec(cmd);
+ synchronized(wfproc) {
+ wfproc.wait(timeout);
+ }
+ exit = wfproc.exitValue();
+ } catch (IllegalThreadStateException e) {
+ //if the thread
+ wfproc.destroy();
+ return e.toString();
+ } catch (Exception e){
+ return e.toString();
}
- public static void main( String []args ){
- SimpleHandler hd = new SimpleHandler();
- }
+ return "exit value " + String.valueOf(exit);
+ }
+ public static void main( String []args ){
+ SimpleHandler hd = new SimpleHandler();
+ }
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <las...@us...> - 2007-10-28 16:54:22
|
Revision: 1812
http://cogkit.svn.sourceforge.net/cogkit/?rev=1812&view=rev
Author: laszewsk
Date: 2007-10-28 09:54:21 -0700 (Sun, 28 Oct 2007)
Log Message:
-----------
more code restructuring
Added Paths:
-----------
trunk/cyberaide/src/js/java/CoGHandler/
Removed Paths:
-------------
trunk/cyberaide/src/js/java/a/
Copied: trunk/cyberaide/src/js/java/CoGHandler (from rev 1811, trunk/cyberaide/src/js/java/a)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <las...@us...> - 2007-10-28 16:54:03
|
Revision: 1811
http://cogkit.svn.sourceforge.net/cogkit/?rev=1811&view=rev
Author: laszewsk
Date: 2007-10-28 09:53:59 -0700 (Sun, 28 Oct 2007)
Log Message:
-----------
more code restructuring
Added Paths:
-----------
trunk/cyberaide/src/js/java/a/
Removed Paths:
-------------
trunk/cyberaide/src/js/java/COGHandler/
Copied: trunk/cyberaide/src/js/java/a (from rev 1810, trunk/cyberaide/src/js/java/COGHandler)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <las...@us...> - 2007-10-28 16:52:59
|
Revision: 1810
http://cogkit.svn.sourceforge.net/cogkit/?rev=1810&view=rev
Author: laszewsk
Date: 2007-10-28 09:52:56 -0700 (Sun, 28 Oct 2007)
Log Message:
-----------
more code restructuring
Added Paths:
-----------
trunk/cyberaide/src/js/java/
Removed Paths:
-------------
trunk/cyberaide/src/js/src/
Copied: trunk/cyberaide/src/js/java (from rev 1808, trunk/cyberaide/src/js/src)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <las...@us...> - 2007-10-28 16:49:56
|
Revision: 1809
http://cogkit.svn.sourceforge.net/cogkit/?rev=1809&view=rev
Author: laszewsk
Date: 2007-10-28 09:49:52 -0700 (Sun, 28 Oct 2007)
Log Message:
-----------
more code restructuring
Added Paths:
-----------
trunk/cyberaide/lib/js/json2xml.js
trunk/cyberaide/lib/js/xml2json.js
trunk/cyberaide/src/js/securelogin/cogkit/CoGHandler.js
Removed Paths:
-------------
trunk/cyberaide/src/js/securelogin/cogkit/json2xml.js
trunk/cyberaide/src/js/securelogin/cogkit/response.jsp
trunk/cyberaide/src/js/securelogin/cogkit/sample.js
trunk/cyberaide/src/js/securelogin/cogkit/xml2json.js
Copied: trunk/cyberaide/lib/js/json2xml.js (from rev 1808, trunk/cyberaide/src/js/securelogin/cogkit/json2xml.js)
===================================================================
--- trunk/cyberaide/lib/js/json2xml.js (rev 0)
+++ trunk/cyberaide/lib/js/json2xml.js 2007-10-28 16:49:52 UTC (rev 1809)
@@ -0,0 +1,45 @@
+/* This work is licensed under Creative Commons GNU LGPL License.
+
+ License: http://creativecommons.org/licenses/LGPL/2.1/
+ Version: 0.9
+ Author: Stefan Goessner/2006
+ Web: http://goessner.net/
+*/
+function json2xml(o, tab) {
+ var toXml = function(v, name, ind) {
+ var xml = "";
+ if (v instanceof Array) {
+ for (var i=0, n=v.length; i<n; i++)
+ xml += ind + toXml(v[i], name, ind+"\t") + "\n";
+ }
+ else if (typeof(v) == "object") {
+ var hasChild = false;
+ xml += ind + "<" + name;
+ for (var m in v) {
+ if (m.charAt(0) == "@")
+ xml += " " + m.substr(1) + "=\"" + v[m].toString() + "\"";
+ else
+ hasChild = true;
+ }
+ xml += hasChild ? ">" : "/>";
+ if (hasChild) {
+ for (var m in v) {
+ if (m == "#text")
+ xml += v[m];
+ else if (m == "#cdata")
+ xml += "<![CDATA[" + v[m] + "]]>";
+ else if (m.charAt(0) != "@")
+ xml += toXml(v[m], m, ind+"\t");
+ }
+ xml += (xml.charAt(xml.length-1)=="\n"?ind:"") + "</" + name + ">";
+ }
+ }
+ else {
+ xml += ind + "<" + name + ">" + v.toString() + "</" + name + ">";
+ }
+ return xml;
+ }, xml="";
+ for (var m in o)
+ xml += toXml(o[m], m, "");
+ return tab ? xml.replace(/\t/g, tab) : xml.replace(/\t|\n/g, "");
+}
Copied: trunk/cyberaide/lib/js/xml2json.js (from rev 1808, trunk/cyberaide/src/js/securelogin/cogkit/xml2json.js)
===================================================================
--- trunk/cyberaide/lib/js/xml2json.js (rev 0)
+++ trunk/cyberaide/lib/js/xml2json.js 2007-10-28 16:49:52 UTC (rev 1809)
@@ -0,0 +1,155 @@
+/* This work is licensed under Creative Commons GNU LGPL License.
+
+ License: http://creativecommons.org/licenses/LGPL/2.1/
+ Version: 0.9
+ Author: Stefan Goessner/2006
+ Web: http://goessner.net/
+*/
+function xml2json(xml, tab) {
+ var X = {
+ toObj: function(xml) {
+ var o = {};
+ if (xml.nodeType==1) { // element node ..
+ if (xml.attributes.length) // element with attributes ..
+ for (var i=0; i<xml.attributes.length; i++)
+ o["@"+xml.attributes[i].nodeName] = (xml.attributes[i].nodeValue||"").toString();
+ if (xml.firstChild) { // element has child nodes ..
+ var textChild=0, cdataChild=0, hasElementChild=false;
+ for (var n=xml.firstChild; n; n=n.nextSibling) {
+ if (n.nodeType==1) hasElementChild = true;
+ else if (n.nodeType==3 && n.nodeValue.match(/[^ \f\n\r\t\v]/)) textChild++; // non-whitespace text
+ else if (n.nodeType==4) cdataChild++; // cdata section node
+ }
+ if (hasElementChild) {
+ if (textChild < 2 && cdataChild < 2) { // structured element with evtl. a single text or/and cdata node ..
+ X.removeWhite(xml);
+ for (var n=xml.firstChild; n; n=n.nextSibling) {
+ if (n.nodeType == 3) // text node
+ o["#text"] = X.escape(n.nodeValue);
+ else if (n.nodeType == 4) // cdata node
+ o["#cdata"] = X.escape(n.nodeValue);
+ else if (o[n.nodeName]) { // multiple occurence of element ..
+ if (o[n.nodeName] instanceof Array)
+ o[n.nodeName][o[n.nodeName].length] = X.toObj(n);
+ else
+ o[n.nodeName] = [o[n.nodeName], X.toObj(n)];
+ }
+ else // first occurence of element..
+ o[n.nodeName] = X.toObj(n);
+ }
+ }
+ else { // mixed content
+ if (!xml.attributes.length)
+ o = X.escape(X.innerXml(xml));
+ else
+ o["#text"] = X.escape(X.innerXml(xml));
+ }
+ }
+ else if (textChild) { // pure text
+ if (!xml.attributes.length)
+ o = X.escape(X.innerXml(xml));
+ else
+ o["#text"] = X.escape(X.innerXml(xml));
+ }
+ else if (cdataChild) { // cdata
+ if (cdataChild > 1)
+ o = X.escape(X.innerXml(xml));
+ else
+ for (var n=xml.firstChild; n; n=n.nextSibling)
+ o["#cdata"] = X.escape(n.nodeValue);
+ }
+ }
+ if (!xml.attributes.length && !xml.firstChild) o = null;
+ }
+ else if (xml.nodeType==9) { // document.node
+ o = X.toObj(xml.documentElement);
+ }
+ else
+ alert("unhandled node type: " + xml.nodeType);
+ return o;
+ },
+ toJson: function(o, name, ind) {
+ var json = name ? ("\""+name+"\"") : "";
+ if (o instanceof Array) {
+ for (var i=0,n=o.length; i<n; i++)
+ o[i] = X.toJson(o[i], "", ind+"\t");
+ json += (name?":[":"[") + (o.length > 1 ? ("\n"+ind+"\t"+o.join(",\n"+ind+"\t")+"\n"+ind) : o.join("")) + "]";
+ }
+ else if (o == null)
+ json += (name&&":") + "null";
+ else if (typeof(o) == "object") {
+ var arr = [];
+ for (var m in o)
+ arr[arr.length] = X.toJson(o[m], m, ind+"\t");
+ json += (name?":{":"{") + (arr.length > 1 ? ("\n"+ind+"\t"+arr.join(",\n"+ind+"\t")+"\n"+ind) : arr.join("")) + "}";
+ }
+ else if (typeof(o) == "string")
+ json += (name&&":") + "\"" + o.toString() + "\"";
+ else
+ json += (name&&":") + o.toString();
+ return json;
+ },
+ innerXml: function(node) {
+ var s = ""
+ if ("innerHTML" in node)
+ s = node.innerHTML;
+ else {
+ var asXml = function(n) {
+ var s = "";
+ if (n.nodeType == 1) {
+ s += "<" + n.nodeName;
+ for (var i=0; i<n.attributes.length;i++)
+ s += " " + n.attributes[i].nodeName + "=\"" + (n.attributes[i].nodeValue||"").toString() + "\"";
+ if (n.firstChild) {
+ s += ">";
+ for (var c=n.firstChild; c; c=c.nextSibling)
+ s += asXml(c);
+ s += "</"+n.nodeName+">";
+ }
+ else
+ s += "/>";
+ }
+ else if (n.nodeType == 3)
+ s += n.nodeValue;
+ else if (n.nodeType == 4)
+ s += "<![CDATA[" + n.nodeValue + "]]>";
+ return s;
+ };
+ for (var c=node.firstChild; c; c=c.nextSibling)
+ s += asXml(c);
+ }
+ return s;
+ },
+ escape: function(txt) {
+ return txt.replace(/[\\]/g, "\\\\")
+ .replace(/[\"]/g, '\\"')
+ .replace(/[\n]/g, '\\n')
+ .replace(/[\r]/g, '\\r');
+ },
+ removeWhite: function(e) {
+ e.normalize();
+ for (var n = e.firstChild; n; ) {
+ if (n.nodeType == 3) { // text node
+ if (!n.nodeValue.match(/[^ \f\n\r\t\v]/)) { // pure whitespace text node
+ var nxt = n.nextSibling;
+ e.removeChild(n);
+ n = nxt;
+ }
+ else
+ n = n.nextSibling;
+ }
+ else if (n.nodeType == 1) { // element node
+ X.removeWhite(n);
+ n = n.nextSibling;
+ }
+ else // any other node
+ n = n.nextSibling;
+ }
+ return e;
+ }
+ };
+ if (xml.nodeType == 9) // document node
+ xml = xml.documentElement;
+ var json = X.toJson(X.toObj(X.removeWhite(xml)), xml.nodeName, "\t");
+ return "{\n" + tab + (tab ? json.replace(/\t/g, tab) : json.replace(/\t|\n/g, "")) + "\n}";
+}
Copied: trunk/cyberaide/src/js/securelogin/cogkit/CoGHandler.js (from rev 1808, trunk/cyberaide/src/js/securelogin/cogkit/sample.js)
===================================================================
--- trunk/cyberaide/src/js/securelogin/cogkit/CoGHandler.js (rev 0)
+++ trunk/cyberaide/src/js/securelogin/cogkit/CoGHandler.js 2007-10-28 16:49:52 UTC (rev 1809)
@@ -0,0 +1,95 @@
+PlainCOGHandler = new Handler("http://localhost:8080/sample/COGJS/xmlrpc");
+SecureCOGHandler = new Handler("https://localhost:8443/sample/COGJS/xmlrpc");
+COGHandler = null;
+
+if( window.location.protocol.indexOf("https") != -1 )//this is a https link
+ COGHandler = SecureCOGHandler;
+else
+ COGHandler = PlainCOGHandler;
+
+function Handler( serviceurl ){
+ try{
+ this.url = serviceurl;
+ this.xmlrpc = imprt("xmlrpc");
+ }catch(e){
+ alert(e);
+ throw "importing of xmlrpc module failed.";
+ }
+
+ this.executeMethods = function(methodname, args, cbname){
+ try{
+ var methods = [];
+ var cbfunc = null;
+ methods.push( methodname );
+ var service = new this.xmlrpc.ServiceProxy( this.url, methods );
+ var nargs = arguments.length - 1; //number of arguments for the method specified by methodname parameter
+ if( typeof arguments[arguments.length - 1] == "function" ){
+ //the user does not specify callback function
+ cbfunc = arguments[ arguments.length - 1 ];
+ nargs = arguments.length - 2;
+ }
+ var callstr = "service."+methodname+"(";
+
+ for( var i = 0; i < nargs; i++ ){//get and escape the arguments
+ if( i > 0 ) callstr += ",";
+ if( typeof arguments[i+1] == "string" ){
+ var str = arguments[i+1];
+ str = str.replace( /[\n|\r]/g, '\\n' ); //escape \n \r
+ str = str.replace( /\"/g, '\\\"'); //escape "
+ callstr += "\"" + str +"\"";
+ }else{
+ callstr += arguments[i+1];
+ }
+ }
+
+ if( cbfunc == null ){
+ callstr += ")";
+ }else
+ callstr += ", " + cbfunc + ");";
+
+ var rslt = eval( callstr );
+ }catch(e){
+ alert( e );
+ }
+ if( typeof rslt == "string" ) return rslt;
+ }
+}
+/*
+function old_wfhandle( wfdes ){
+ if( arguments.length == 0 ){
+ alert("You must input the workflow description");
+ return;
+ }
+ if( typeof arguments[0] != 'string' ){
+ alert("workflow description must be a string");
+ return;
+ }
+
+ try {
+ if (netscape.security.PrivilegeManager.enablePrivilege) {
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
+ }
+ } catch (ex) { // eat it
+ }
+ var url = "http://127.0.0.1:8080/sample/xmlrpc";
+ var methods = ["zhguo.handler.inBound"];
+
+ var xmlrpc=null;
+ try{
+ xmlrpc = imprt("xmlrpc");
+ }catch(e){
+ alert(e);
+ throw "importing of xmlrpc module failed.";
+ }
+
+ var workflow = wfdes;
+ try{
+ var service = new xmlrpc.ServiceProxy( url, methods );
+ var from = "\"home\"", to = "\"rpc\"";
+ var rslt = service.zhguo.handler.inBound(workflow, to);
+ }catch(e){
+ alert( e );
+ }
+ return rslt;
+}
+*/
\ No newline at end of file
Deleted: trunk/cyberaide/src/js/securelogin/cogkit/json2xml.js
===================================================================
--- trunk/cyberaide/src/js/securelogin/cogkit/json2xml.js 2007-10-28 16:43:47 UTC (rev 1808)
+++ trunk/cyberaide/src/js/securelogin/cogkit/json2xml.js 2007-10-28 16:49:52 UTC (rev 1809)
@@ -1,45 +0,0 @@
-/* This work is licensed under Creative Commons GNU LGPL License.
-
- License: http://creativecommons.org/licenses/LGPL/2.1/
- Version: 0.9
- Author: Stefan Goessner/2006
- Web: http://goessner.net/
-*/
-function json2xml(o, tab) {
- var toXml = function(v, name, ind) {
- var xml = "";
- if (v instanceof Array) {
- for (var i=0, n=v.length; i<n; i++)
- xml += ind + toXml(v[i], name, ind+"\t") + "\n";
- }
- else if (typeof(v) == "object") {
- var hasChild = false;
- xml += ind + "<" + name;
- for (var m in v) {
- if (m.charAt(0) == "@")
- xml += " " + m.substr(1) + "=\"" + v[m].toString() + "\"";
- else
- hasChild = true;
- }
- xml += hasChild ? ">" : "/>";
- if (hasChild) {
- for (var m in v) {
- if (m == "#text")
- xml += v[m];
- else if (m == "#cdata")
- xml += "<![CDATA[" + v[m] + "]]>";
- else if (m.charAt(0) != "@")
- xml += toXml(v[m], m, ind+"\t");
- }
- xml += (xml.charAt(xml.length-1)=="\n"?ind:"") + "</" + name + ">";
- }
- }
- else {
- xml += ind + "<" + name + ">" + v.toString() + "</" + name + ">";
- }
- return xml;
- }, xml="";
- for (var m in o)
- xml += toXml(o[m], m, "");
- return tab ? xml.replace(/\t/g, tab) : xml.replace(/\t|\n/g, "");
-}
Deleted: trunk/cyberaide/src/js/securelogin/cogkit/response.jsp
===================================================================
--- trunk/cyberaide/src/js/securelogin/cogkit/response.jsp 2007-10-28 16:43:47 UTC (rev 1808)
+++ trunk/cyberaide/src/js/securelogin/cogkit/response.jsp 2007-10-28 16:49:52 UTC (rev 1809)
@@ -1,11 +0,0 @@
-<% response.setContentType("text/xml");
-String str = "<?xml version=\"1.0\"?>";
-str += "<methodResponse>";
-str += "<params>";
-str += "<param><value><string>South</string></value></param>";
-str += "</params></methodResponse>";
-out.print( str );
- %>
-
-
-
Deleted: trunk/cyberaide/src/js/securelogin/cogkit/sample.js
===================================================================
--- trunk/cyberaide/src/js/securelogin/cogkit/sample.js 2007-10-28 16:43:47 UTC (rev 1808)
+++ trunk/cyberaide/src/js/securelogin/cogkit/sample.js 2007-10-28 16:49:52 UTC (rev 1809)
@@ -1,95 +0,0 @@
-PlainCOGHandler = new Handler("http://localhost:8080/sample/COGJS/xmlrpc");
-SecureCOGHandler = new Handler("https://localhost:8443/sample/COGJS/xmlrpc");
-COGHandler = null;
-
-if( window.location.protocol.indexOf("https") != -1 )//this is a https link
- COGHandler = SecureCOGHandler;
-else
- COGHandler = PlainCOGHandler;
-
-function Handler( serviceurl ){
- try{
- this.url = serviceurl;
- this.xmlrpc = imprt("xmlrpc");
- }catch(e){
- alert(e);
- throw "importing of xmlrpc module failed.";
- }
-
- this.executeMethods = function(methodname, args, cbname){
- try{
- var methods = [];
- var cbfunc = null;
- methods.push( methodname );
- var service = new this.xmlrpc.ServiceProxy( this.url, methods );
- var nargs = arguments.length - 1; //number of arguments for the method specified by methodname parameter
- if( typeof arguments[arguments.length - 1] == "function" ){
- //the user does not specify callback function
- cbfunc = arguments[ arguments.length - 1 ];
- nargs = arguments.length - 2;
- }
- var callstr = "service."+methodname+"(";
-
- for( var i = 0; i < nargs; i++ ){//get and escape the arguments
- if( i > 0 ) callstr += ",";
- if( typeof arguments[i+1] == "string" ){
- var str = arguments[i+1];
- str = str.replace( /[\n|\r]/g, '\\n' ); //escape \n \r
- str = str.replace( /\"/g, '\\\"'); //escape "
- callstr += "\"" + str +"\"";
- }else{
- callstr += arguments[i+1];
- }
- }
-
- if( cbfunc == null ){
- callstr += ")";
- }else
- callstr += ", " + cbfunc + ");";
-
- var rslt = eval( callstr );
- }catch(e){
- alert( e );
- }
- if( typeof rslt == "string" ) return rslt;
- }
-}
-/*
-function old_wfhandle( wfdes ){
- if( arguments.length == 0 ){
- alert("You must input the workflow description");
- return;
- }
- if( typeof arguments[0] != 'string' ){
- alert("workflow description must be a string");
- return;
- }
-
- try {
- if (netscape.security.PrivilegeManager.enablePrivilege) {
- netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
- }
- } catch (ex) { // eat it
- }
- var url = "http://127.0.0.1:8080/sample/xmlrpc";
- var methods = ["zhguo.handler.inBound"];
-
- var xmlrpc=null;
- try{
- xmlrpc = imprt("xmlrpc");
- }catch(e){
- alert(e);
- throw "importing of xmlrpc module failed.";
- }
-
- var workflow = wfdes;
- try{
- var service = new xmlrpc.ServiceProxy( url, methods );
- var from = "\"home\"", to = "\"rpc\"";
- var rslt = service.zhguo.handler.inBound(workflow, to);
- }catch(e){
- alert( e );
- }
- return rslt;
-}
-*/
\ No newline at end of file
Deleted: trunk/cyberaide/src/js/securelogin/cogkit/xml2json.js
===================================================================
--- trunk/cyberaide/src/js/securelogin/cogkit/xml2json.js 2007-10-28 16:43:47 UTC (rev 1808)
+++ trunk/cyberaide/src/js/securelogin/cogkit/xml2json.js 2007-10-28 16:49:52 UTC (rev 1809)
@@ -1,155 +0,0 @@
-/* This work is licensed under Creative Commons GNU LGPL License.
-
- License: http://creativecommons.org/licenses/LGPL/2.1/
- Version: 0.9
- Author: Stefan Goessner/2006
- Web: http://goessner.net/
-*/
-function xml2json(xml, tab) {
- var X = {
- toObj: function(xml) {
- var o = {};
- if (xml.nodeType==1) { // element node ..
- if (xml.attributes.length) // element with attributes ..
- for (var i=0; i<xml.attributes.length; i++)
- o["@"+xml.attributes[i].nodeName] = (xml.attributes[i].nodeValue||"").toString();
- if (xml.firstChild) { // element has child nodes ..
- var textChild=0, cdataChild=0, hasElementChild=false;
- for (var n=xml.firstChild; n; n=n.nextSibling) {
- if (n.nodeType==1) hasElementChild = true;
- else if (n.nodeType==3 && n.nodeValue.match(/[^ \f\n\r\t\v]/)) textChild++; // non-whitespace text
- else if (n.nodeType==4) cdataChild++; // cdata section node
- }
- if (hasElementChild) {
- if (textChild < 2 && cdataChild < 2) { // structured element with evtl. a single text or/and cdata node ..
- X.removeWhite(xml);
- for (var n=xml.firstChild; n; n=n.nextSibling) {
- if (n.nodeType == 3) // text node
- o["#text"] = X.escape(n.nodeValue);
- else if (n.nodeType == 4) // cdata node
- o["#cdata"] = X.escape(n.nodeValue);
- else if (o[n.nodeName]) { // multiple occurence of element ..
- if (o[n.nodeName] instanceof Array)
- o[n.nodeName][o[n.nodeName].length] = X.toObj(n);
- else
- o[n.nodeName] = [o[n.nodeName], X.toObj(n)];
- }
- else // first occurence of element..
- o[n.nodeName] = X.toObj(n);
- }
- }
- else { // mixed content
- if (!xml.attributes.length)
- o = X.escape(X.innerXml(xml));
- else
- o["#text"] = X.escape(X.innerXml(xml));
- }
- }
- else if (textChild) { // pure text
- if (!xml.attributes.length)
- o = X.escape(X.innerXml(xml));
- else
- o["#text"] = X.escape(X.innerXml(xml));
- }
- else if (cdataChild) { // cdata
- if (cdataChild > 1)
- o = X.escape(X.innerXml(xml));
- else
- for (var n=xml.firstChild; n; n=n.nextSibling)
- o["#cdata"] = X.escape(n.nodeValue);
- }
- }
- if (!xml.attributes.length && !xml.firstChild) o = null;
- }
- else if (xml.nodeType==9) { // document.node
- o = X.toObj(xml.documentElement);
- }
- else
- alert("unhandled node type: " + xml.nodeType);
- return o;
- },
- toJson: function(o, name, ind) {
- var json = name ? ("\""+name+"\"") : "";
- if (o instanceof Array) {
- for (var i=0,n=o.length; i<n; i++)
- o[i] = X.toJson(o[i], "", ind+"\t");
- json += (name?":[":"[") + (o.length > 1 ? ("\n"+ind+"\t"+o.join(",\n"+ind+"\t")+"\n"+ind) : o.join("")) + "]";
- }
- else if (o == null)
- json += (name&&":") + "null";
- else if (typeof(o) == "object") {
- var arr = [];
- for (var m in o)
- arr[arr.length] = X.toJson(o[m], m, ind+"\t");
- json += (name?":{":"{") + (arr.length > 1 ? ("\n"+ind+"\t"+arr.join(",\n"+ind+"\t")+"\n"+ind) : arr.join("")) + "}";
- }
- else if (typeof(o) == "string")
- json += (name&&":") + "\"" + o.toString() + "\"";
- else
- json += (name&&":") + o.toString();
- return json;
- },
- innerXml: function(node) {
- var s = ""
- if ("innerHTML" in node)
- s = node.innerHTML;
- else {
- var asXml = function(n) {
- var s = "";
- if (n.nodeType == 1) {
- s += "<" + n.nodeName;
- for (var i=0; i<n.attributes.length;i++)
- s += " " + n.attributes[i].nodeName + "=\"" + (n.attributes[i].nodeValue||"").toString() + "\"";
- if (n.firstChild) {
- s += ">";
- for (var c=n.firstChild; c; c=c.nextSibling)
- s += asXml(c);
- s += "</"+n.nodeName+">";
- }
- else
- s += "/>";
- }
- else if (n.nodeType == 3)
- s += n.nodeValue;
- else if (n.nodeType == 4)
- s += "<![CDATA[" + n.nodeValue + "]]>";
- return s;
- };
- for (var c=node.firstChild; c; c=c.nextSibling)
- s += asXml(c);
- }
- return s;
- },
- escape: function(txt) {
- return txt.replace(/[\\]/g, "\\\\")
- .replace(/[\"]/g, '\\"')
- .replace(/[\n]/g, '\\n')
- .replace(/[\r]/g, '\\r');
- },
- removeWhite: function(e) {
- e.normalize();
- for (var n = e.firstChild; n; ) {
- if (n.nodeType == 3) { // text node
- if (!n.nodeValue.match(/[^ \f\n\r\t\v]/)) { // pure whitespace text node
- var nxt = n.nextSibling;
- e.removeChild(n);
- n = nxt;
- }
- else
- n = n.nextSibling;
- }
- else if (n.nodeType == 1) { // element node
- X.removeWhite(n);
- n = n.nextSibling;
- }
- else // any other node
- n = n.nextSibling;
- }
- return e;
- }
- };
- if (xml.nodeType == 9) // document node
- xml = xml.documentElement;
- var json = X.toJson(X.toObj(X.removeWhite(xml)), xml.nodeName, "\t");
- return "{\n" + tab + (tab ? json.replace(/\t/g, tab) : json.replace(/\t|\n/g, "")) + "\n}";
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <las...@us...> - 2007-10-28 16:43:49
|
Revision: 1808
http://cogkit.svn.sourceforge.net/cogkit/?rev=1808&view=rev
Author: laszewsk
Date: 2007-10-28 09:43:47 -0700 (Sun, 28 Oct 2007)
Log Message:
-----------
reorganizing source
Added Paths:
-----------
trunk/cyberaide/src/js/
trunk/cyberaide/src/js/README.txt
trunk/cyberaide/src/js/securelogin/
trunk/cyberaide/src/js/src/
Removed Paths:
-------------
trunk/cyberaide/src/javascript/
trunk/cyberaide/src/js/README.txt
trunk/cyberaide/src/js/sample/
trunk/cyberaide/src/js/src/
Copied: trunk/cyberaide/src/js (from rev 1804, trunk/cyberaide/src/javascript)
Deleted: trunk/cyberaide/src/js/README.txt
===================================================================
--- trunk/cyberaide/src/javascript/README.txt 2007-10-28 16:34:33 UTC (rev 1804)
+++ trunk/cyberaide/src/js/README.txt 2007-10-28 16:43:47 UTC (rev 1808)
@@ -1 +0,0 @@
-see ../../README.txt
Copied: trunk/cyberaide/src/js/README.txt (from rev 1807, trunk/cyberaide/src/javascript/README.txt)
===================================================================
--- trunk/cyberaide/src/js/README.txt (rev 0)
+++ trunk/cyberaide/src/js/README.txt 2007-10-28 16:43:47 UTC (rev 1808)
@@ -0,0 +1 @@
+see ../../README.txt
Copied: trunk/cyberaide/src/js/securelogin (from rev 1807, trunk/cyberaide/src/javascript/securelogin)
Copied: trunk/cyberaide/src/js/src (from rev 1807, trunk/cyberaide/src/javascript/src)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <las...@us...> - 2007-10-28 16:43:14
|
Revision: 1807
http://cogkit.svn.sourceforge.net/cogkit/?rev=1807&view=rev
Author: laszewsk
Date: 2007-10-28 09:43:10 -0700 (Sun, 28 Oct 2007)
Log Message:
-----------
reorganizing source
Added Paths:
-----------
trunk/cyberaide/src/javascript/securelogin/cogkit/
trunk/cyberaide/src/javascript/securelogin/cogkit/json2xml.js
trunk/cyberaide/src/javascript/securelogin/cogkit/response.jsp
trunk/cyberaide/src/javascript/securelogin/cogkit/sample.js
trunk/cyberaide/src/javascript/securelogin/cogkit/xml2json.js
Removed Paths:
-------------
trunk/cyberaide/src/javascript/securelogin/COGJS/
trunk/cyberaide/src/javascript/securelogin/cogkit/index.html
trunk/cyberaide/src/javascript/securelogin/cogkit/json2xml.js
trunk/cyberaide/src/javascript/securelogin/cogkit/response.jsp
trunk/cyberaide/src/javascript/securelogin/cogkit/sample.js
trunk/cyberaide/src/javascript/securelogin/cogkit/xml2json.js
Copied: trunk/cyberaide/src/javascript/securelogin/cogkit (from rev 1805, trunk/cyberaide/src/javascript/securelogin/COGJS)
Deleted: trunk/cyberaide/src/javascript/securelogin/cogkit/index.html
===================================================================
--- trunk/cyberaide/src/javascript/securelogin/COGJS/index.html 2007-10-28 16:38:23 UTC (rev 1805)
+++ trunk/cyberaide/src/javascript/securelogin/cogkit/index.html 2007-10-28 16:43:10 UTC (rev 1807)
@@ -1,119 +0,0 @@
-<html>
- <head>
- <!---->
- <script type='text/javascript' src='jsolait/jsolait.js'></script>
- <script type='text/javascript' src='sample.js'></script>
- <script type='text/javascript' src='xml2json.js'></script>
- <script type='text/javascript' src='json2xml.js'></script>
-
- <script type='text/javascript'>
- function callback( response ){
- output('resp', response);
- }
-
- function getInput( eleid ){
- var workflow = document.getElementById( eleid );
- if( workflow == null ){
- alert( 'Please input workflow description' );
- return;
- }
- return workflow.value;
- }
- function output( eleid, result ){
- var res = document.getElementById( eleid );
- if( res == null ){
- alert( 'please specify an output element' );
- return;
- }
- res.value = result;
- }
- function echo(){
- var str = getInput("workflow");
- var result = COGHandler.executeMethods( "Handler.echo", str , callback );
- if( result != undefined ){
- //display output to user
- output('resp', result);
- }
- }
- function wfhandle(){
- var str = getInput("workflow");
- var result = COGHandler.executeMethods( "Handler.cmdCOGExecute", str, callback );
- if( result != undefined ){
- //display output to user
- output('resp', result);
- }
- }
- function clearoutput(){
- var output = document.getElementById( 'resp' );
- output.value = "";
- }
- function zhguoj2x(){
- var str = getInput("workflow");
- //str = "a:{\"b\":\"bbb\"}}";
- //alert( str );
- eval( "var json="+str );
- //for(var prop in obj) alert(obj);
- var xml = json2xml( json, " ");
- output( 'resp', xml );
- }
- function zhguox2j(){
- var str = getInput("workflow");
- var dom = parseXml( str );
- var json = xml2json( dom, " " );
- output( 'resp', json );
- }
- function parseXml(xml) {
- var dom = null;
- if (window.DOMParser) {
- try {
- dom = (new DOMParser()).parseFromString(xml, "text/xml");
- }
- catch (e) { dom = null; }
- }
- else if (window.ActiveXObject) {
- try {
- dom = new ActiveXObject('Microsoft.XMLDOM');
- dom.async = false;
- if (!dom.loadXML(xml)) // parse error ..
-
- window.alert(dom.parseError.reason + dom.parseError.srcText);
- }
- catch (e) { dom = null; }
- }
- else
- alert("cannot parse xml string!");
- return dom;
- }
- </script>
- </head>
- <body>
- <div>
- <div style='font-size:large; padding-top:0.3em; padding-bottom:0.3em; color:blue;'>Workflow description:</div>
- <table>
- <tr><td>
- <textarea id='workflow' wrap='off' cols=100 rows=15 ></textarea>
- <td><td valign=top>
- <div style='padding-top:10px;padding-bottom:10px'>
- <input type='button' value='echo' onclick='javascript:echo();'></input>
- </div>
- <div style='padding-top:10px;padding-bottom:10px'>
- <input type='button' value='Workflow Handle' onclick='javascript:wfhandle();'></input></div>
- <div style='padding-top:10px;padding-bottom:10px'>
- <input type='button' value='JSON2XML' onclick='javascript:zhguoj2x();'></input></div>
- <div style='padding-top:10px;padding-bottom:10px'>
- <input type='button' value='XML2JSON' onclick='javascript:zhguox2j();'></input></div>
- </td></tr>
- </table>
- </div>
- <br>
- <div style='font-size:large; padding-top:0.3em; padding-bottom:0.3em; color:blue;'>Response from server:</div>
- <table>
- <tr><td>
- <textarea WRAP='off' id='resp' cols=100 rows=15 readOnly='true'></textarea>
- <td><td valign=top>
- <input type='button' value='clear' onclick='javascript:clearoutput();'></input>
- </td></tr>
- </table>
- </div>
- </body>
-</html>
\ No newline at end of file
Deleted: trunk/cyberaide/src/javascript/securelogin/cogkit/json2xml.js
===================================================================
--- trunk/cyberaide/src/javascript/securelogin/COGJS/json2xml.js 2007-10-28 16:38:23 UTC (rev 1805)
+++ trunk/cyberaide/src/javascript/securelogin/cogkit/json2xml.js 2007-10-28 16:43:10 UTC (rev 1807)
@@ -1,45 +0,0 @@
-/* This work is licensed under Creative Commons GNU LGPL License.
-
- License: http://creativecommons.org/licenses/LGPL/2.1/
- Version: 0.9
- Author: Stefan Goessner/2006
- Web: http://goessner.net/
-*/
-function json2xml(o, tab) {
- var toXml = function(v, name, ind) {
- var xml = "";
- if (v instanceof Array) {
- for (var i=0, n=v.length; i<n; i++)
- xml += ind + toXml(v[i], name, ind+"\t") + "\n";
- }
- else if (typeof(v) == "object") {
- var hasChild = false;
- xml += ind + "<" + name;
- for (var m in v) {
- if (m.charAt(0) == "@")
- xml += " " + m.substr(1) + "=\"" + v[m].toString() + "\"";
- else
- hasChild = true;
- }
- xml += hasChild ? ">" : "/>";
- if (hasChild) {
- for (var m in v) {
- if (m == "#text")
- xml += v[m];
- else if (m == "#cdata")
- xml += "<![CDATA[" + v[m] + "]]>";
- else if (m.charAt(0) != "@")
- xml += toXml(v[m], m, ind+"\t");
- }
- xml += (xml.charAt(xml.length-1)=="\n"?ind:"") + "</" + name + ">";
- }
- }
- else {
- xml += ind + "<" + name + ">" + v.toString() + "</" + name + ">";
- }
- return xml;
- }, xml="";
- for (var m in o)
- xml += toXml(o[m], m, "");
- return tab ? xml.replace(/\t/g, tab) : xml.replace(/\t|\n/g, "");
-}
Copied: trunk/cyberaide/src/javascript/securelogin/cogkit/json2xml.js (from rev 1806, trunk/cyberaide/src/javascript/securelogin/COGJS/json2xml.js)
===================================================================
--- trunk/cyberaide/src/javascript/securelogin/cogkit/json2xml.js (rev 0)
+++ trunk/cyberaide/src/javascript/securelogin/cogkit/json2xml.js 2007-10-28 16:43:10 UTC (rev 1807)
@@ -0,0 +1,45 @@
+/* This work is licensed under Creative Commons GNU LGPL License.
+
+ License: http://creativecommons.org/licenses/LGPL/2.1/
+ Version: 0.9
+ Author: Stefan Goessner/2006
+ Web: http://goessner.net/
+*/
+function json2xml(o, tab) {
+ var toXml = function(v, name, ind) {
+ var xml = "";
+ if (v instanceof Array) {
+ for (var i=0, n=v.length; i<n; i++)
+ xml += ind + toXml(v[i], name, ind+"\t") + "\n";
+ }
+ else if (typeof(v) == "object") {
+ var hasChild = false;
+ xml += ind + "<" + name;
+ for (var m in v) {
+ if (m.charAt(0) == "@")
+ xml += " " + m.substr(1) + "=\"" + v[m].toString() + "\"";
+ else
+ hasChild = true;
+ }
+ xml += hasChild ? ">" : "/>";
+ if (hasChild) {
+ for (var m in v) {
+ if (m == "#text")
+ xml += v[m];
+ else if (m == "#cdata")
+ xml += "<![CDATA[" + v[m] + "]]>";
+ else if (m.charAt(0) != "@")
+ xml += toXml(v[m], m, ind+"\t");
+ }
+ xml += (xml.charAt(xml.length-1)=="\n"?ind:"") + "</" + name + ">";
+ }
+ }
+ else {
+ xml += ind + "<" + name + ">" + v.toString() + "</" + name + ">";
+ }
+ return xml;
+ }, xml="";
+ for (var m in o)
+ xml += toXml(o[m], m, "");
+ return tab ? xml.replace(/\t/g, tab) : xml.replace(/\t|\n/g, "");
+}
Deleted: trunk/cyberaide/src/javascript/securelogin/cogkit/response.jsp
===================================================================
--- trunk/cyberaide/src/javascript/securelogin/COGJS/response.jsp 2007-10-28 16:38:23 UTC (rev 1805)
+++ trunk/cyberaide/src/javascript/securelogin/cogkit/response.jsp 2007-10-28 16:43:10 UTC (rev 1807)
@@ -1,11 +0,0 @@
-<% response.setContentType("text/xml");
-String str = "<?xml version=\"1.0\"?>";
-str += "<methodResponse>";
-str += "<params>";
-str += "<param><value><string>South</string></value></param>";
-str += "</params></methodResponse>";
-out.print( str );
- %>
-
-
-
Copied: trunk/cyberaide/src/javascript/securelogin/cogkit/response.jsp (from rev 1806, trunk/cyberaide/src/javascript/securelogin/COGJS/response.jsp)
===================================================================
--- trunk/cyberaide/src/javascript/securelogin/cogkit/response.jsp (rev 0)
+++ trunk/cyberaide/src/javascript/securelogin/cogkit/response.jsp 2007-10-28 16:43:10 UTC (rev 1807)
@@ -0,0 +1,11 @@
+<% response.setContentType("text/xml");
+String str = "<?xml version=\"1.0\"?>";
+str += "<methodResponse>";
+str += "<params>";
+str += "<param><value><string>South</string></value></param>";
+str += "</params></methodResponse>";
+out.print( str );
+ %>
+
+
+
Deleted: trunk/cyberaide/src/javascript/securelogin/cogkit/sample.js
===================================================================
--- trunk/cyberaide/src/javascript/securelogin/COGJS/sample.js 2007-10-28 16:38:23 UTC (rev 1805)
+++ trunk/cyberaide/src/javascript/securelogin/cogkit/sample.js 2007-10-28 16:43:10 UTC (rev 1807)
@@ -1,95 +0,0 @@
-PlainCOGHandler = new Handler("http://localhost:8080/sample/COGJS/xmlrpc");
-SecureCOGHandler = new Handler("https://localhost:8443/sample/COGJS/xmlrpc");
-COGHandler = null;
-
-if( window.location.protocol.indexOf("https") != -1 )//this is a https link
- COGHandler = SecureCOGHandler;
-else
- COGHandler = PlainCOGHandler;
-
-function Handler( serviceurl ){
- try{
- this.url = serviceurl;
- this.xmlrpc = imprt("xmlrpc");
- }catch(e){
- alert(e);
- throw "importing of xmlrpc module failed.";
- }
-
- this.executeMethods = function(methodname, args, cbname){
- try{
- var methods = [];
- var cbfunc = null;
- methods.push( methodname );
- var service = new this.xmlrpc.ServiceProxy( this.url, methods );
- var nargs = arguments.length - 1; //number of arguments for the method specified by methodname parameter
- if( typeof arguments[arguments.length - 1] == "function" ){
- //the user does not specify callback function
- cbfunc = arguments[ arguments.length - 1 ];
- nargs = arguments.length - 2;
- }
- var callstr = "service."+methodname+"(";
-
- for( var i = 0; i < nargs; i++ ){//get and escape the arguments
- if( i > 0 ) callstr += ",";
- if( typeof arguments[i+1] == "string" ){
- var str = arguments[i+1];
- str = str.replace( /[\n|\r]/g, '\\n' ); //escape \n \r
- str = str.replace( /\"/g, '\\\"'); //escape "
- callstr += "\"" + str +"\"";
- }else{
- callstr += arguments[i+1];
- }
- }
-
- if( cbfunc == null ){
- callstr += ")";
- }else
- callstr += ", " + cbfunc + ");";
-
- var rslt = eval( callstr );
- }catch(e){
- alert( e );
- }
- if( typeof rslt == "string" ) return rslt;
- }
-}
-/*
-function old_wfhandle( wfdes ){
- if( arguments.length == 0 ){
- alert("You must input the workflow description");
- return;
- }
- if( typeof arguments[0] != 'string' ){
- alert("workflow description must be a string");
- return;
- }
-
- try {
- if (netscape.security.PrivilegeManager.enablePrivilege) {
- netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
- }
- } catch (ex) { // eat it
- }
- var url = "http://127.0.0.1:8080/sample/xmlrpc";
- var methods = ["zhguo.handler.inBound"];
-
- var xmlrpc=null;
- try{
- xmlrpc = imprt("xmlrpc");
- }catch(e){
- alert(e);
- throw "importing of xmlrpc module failed.";
- }
-
- var workflow = wfdes;
- try{
- var service = new xmlrpc.ServiceProxy( url, methods );
- var from = "\"home\"", to = "\"rpc\"";
- var rslt = service.zhguo.handler.inBound(workflow, to);
- }catch(e){
- alert( e );
- }
- return rslt;
-}
-*/
\ No newline at end of file
Copied: trunk/cyberaide/src/javascript/securelogin/cogkit/sample.js (from rev 1806, trunk/cyberaide/src/javascript/securelogin/COGJS/sample.js)
===================================================================
--- trunk/cyberaide/src/javascript/securelogin/cogkit/sample.js (rev 0)
+++ trunk/cyberaide/src/javascript/securelogin/cogkit/sample.js 2007-10-28 16:43:10 UTC (rev 1807)
@@ -0,0 +1,95 @@
+PlainCOGHandler = new Handler("http://localhost:8080/sample/COGJS/xmlrpc");
+SecureCOGHandler = new Handler("https://localhost:8443/sample/COGJS/xmlrpc");
+COGHandler = null;
+
+if( window.location.protocol.indexOf("https") != -1 )//this is a https link
+ COGHandler = SecureCOGHandler;
+else
+ COGHandler = PlainCOGHandler;
+
+function Handler( serviceurl ){
+ try{
+ this.url = serviceurl;
+ this.xmlrpc = imprt("xmlrpc");
+ }catch(e){
+ alert(e);
+ throw "importing of xmlrpc module failed.";
+ }
+
+ this.executeMethods = function(methodname, args, cbname){
+ try{
+ var methods = [];
+ var cbfunc = null;
+ methods.push( methodname );
+ var service = new this.xmlrpc.ServiceProxy( this.url, methods );
+ var nargs = arguments.length - 1; //number of arguments for the method specified by methodname parameter
+ if( typeof arguments[arguments.length - 1] == "function" ){
+ //the user does not specify callback function
+ cbfunc = arguments[ arguments.length - 1 ];
+ nargs = arguments.length - 2;
+ }
+ var callstr = "service."+methodname+"(";
+
+ for( var i = 0; i < nargs; i++ ){//get and escape the arguments
+ if( i > 0 ) callstr += ",";
+ if( typeof arguments[i+1] == "string" ){
+ var str = arguments[i+1];
+ str = str.replace( /[\n|\r]/g, '\\n' ); //escape \n \r
+ str = str.replace( /\"/g, '\\\"'); //escape "
+ callstr += "\"" + str +"\"";
+ }else{
+ callstr += arguments[i+1];
+ }
+ }
+
+ if( cbfunc == null ){
+ callstr += ")";
+ }else
+ callstr += ", " + cbfunc + ");";
+
+ var rslt = eval( callstr );
+ }catch(e){
+ alert( e );
+ }
+ if( typeof rslt == "string" ) return rslt;
+ }
+}
+/*
+function old_wfhandle( wfdes ){
+ if( arguments.length == 0 ){
+ alert("You must input the workflow description");
+ return;
+ }
+ if( typeof arguments[0] != 'string' ){
+ alert("workflow description must be a string");
+ return;
+ }
+
+ try {
+ if (netscape.security.PrivilegeManager.enablePrivilege) {
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
+ }
+ } catch (ex) { // eat it
+ }
+ var url = "http://127.0.0.1:8080/sample/xmlrpc";
+ var methods = ["zhguo.handler.inBound"];
+
+ var xmlrpc=null;
+ try{
+ xmlrpc = imprt("xmlrpc");
+ }catch(e){
+ alert(e);
+ throw "importing of xmlrpc module failed.";
+ }
+
+ var workflow = wfdes;
+ try{
+ var service = new xmlrpc.ServiceProxy( url, methods );
+ var from = "\"home\"", to = "\"rpc\"";
+ var rslt = service.zhguo.handler.inBound(workflow, to);
+ }catch(e){
+ alert( e );
+ }
+ return rslt;
+}
+*/
\ No newline at end of file
Deleted: trunk/cyberaide/src/javascript/securelogin/cogkit/xml2json.js
===================================================================
--- trunk/cyberaide/src/javascript/securelogin/COGJS/xml2json.js 2007-10-28 16:38:23 UTC (rev 1805)
+++ trunk/cyberaide/src/javascript/securelogin/cogkit/xml2json.js 2007-10-28 16:43:10 UTC (rev 1807)
@@ -1,155 +0,0 @@
-/* This work is licensed under Creative Commons GNU LGPL License.
-
- License: http://creativecommons.org/licenses/LGPL/2.1/
- Version: 0.9
- Author: Stefan Goessner/2006
- Web: http://goessner.net/
-*/
-function xml2json(xml, tab) {
- var X = {
- toObj: function(xml) {
- var o = {};
- if (xml.nodeType==1) { // element node ..
- if (xml.attributes.length) // element with attributes ..
- for (var i=0; i<xml.attributes.length; i++)
- o["@"+xml.attributes[i].nodeName] = (xml.attributes[i].nodeValue||"").toString();
- if (xml.firstChild) { // element has child nodes ..
- var textChild=0, cdataChild=0, hasElementChild=false;
- for (var n=xml.firstChild; n; n=n.nextSibling) {
- if (n.nodeType==1) hasElementChild = true;
- else if (n.nodeType==3 && n.nodeValue.match(/[^ \f\n\r\t\v]/)) textChild++; // non-whitespace text
- else if (n.nodeType==4) cdataChild++; // cdata section node
- }
- if (hasElementChild) {
- if (textChild < 2 && cdataChild < 2) { // structured element with evtl. a single text or/and cdata node ..
- X.removeWhite(xml);
- for (var n=xml.firstChild; n; n=n.nextSibling) {
- if (n.nodeType == 3) // text node
- o["#text"] = X.escape(n.nodeValue);
- else if (n.nodeType == 4) // cdata node
- o["#cdata"] = X.escape(n.nodeValue);
- else if (o[n.nodeName]) { // multiple occurence of element ..
- if (o[n.nodeName] instanceof Array)
- o[n.nodeName][o[n.nodeName].length] = X.toObj(n);
- else
- o[n.nodeName] = [o[n.nodeName], X.toObj(n)];
- }
- else // first occurence of element..
- o[n.nodeName] = X.toObj(n);
- }
- }
- else { // mixed content
- if (!xml.attributes.length)
- o = X.escape(X.innerXml(xml));
- else
- o["#text"] = X.escape(X.innerXml(xml));
- }
- }
- else if (textChild) { // pure text
- if (!xml.attributes.length)
- o = X.escape(X.innerXml(xml));
- else
- o["#text"] = X.escape(X.innerXml(xml));
- }
- else if (cdataChild) { // cdata
- if (cdataChild > 1)
- o = X.escape(X.innerXml(xml));
- else
- for (var n=xml.firstChild; n; n=n.nextSibling)
- o["#cdata"] = X.escape(n.nodeValue);
- }
- }
- if (!xml.attributes.length && !xml.firstChild) o = null;
- }
- else if (xml.nodeType==9) { // document.node
- o = X.toObj(xml.documentElement);
- }
- else
- alert("unhandled node type: " + xml.nodeType);
- return o;
- },
- toJson: function(o, name, ind) {
- var json = name ? ("\""+name+"\"") : "";
- if (o instanceof Array) {
- for (var i=0,n=o.length; i<n; i++)
- o[i] = X.toJson(o[i], "", ind+"\t");
- json += (name?":[":"[") + (o.length > 1 ? ("\n"+ind+"\t"+o.join(",\n"+ind+"\t")+"\n"+ind) : o.join("")) + "]";
- }
- else if (o == null)
- json += (name&&":") + "null";
- else if (typeof(o) == "object") {
- var arr = [];
- for (var m in o)
- arr[arr.length] = X.toJson(o[m], m, ind+"\t");
- json += (name?":{":"{") + (arr.length > 1 ? ("\n"+ind+"\t"+arr.join(",\n"+ind+"\t")+"\n"+ind) : arr.join("")) + "}";
- }
- else if (typeof(o) == "string")
- json += (name&&":") + "\"" + o.toString() + "\"";
- else
- json += (name&&":") + o.toString();
- return json;
- },
- innerXml: function(node) {
- var s = ""
- if ("innerHTML" in node)
- s = node.innerHTML;
- else {
- var asXml = function(n) {
- var s = "";
- if (n.nodeType == 1) {
- s += "<" + n.nodeName;
- for (var i=0; i<n.attributes.length;i++)
- s += " " + n.attributes[i].nodeName + "=\"" + (n.attributes[i].nodeValue||"").toString() + "\"";
- if (n.firstChild) {
- s += ">";
- for (var c=n.firstChild; c; c=c.nextSibling)
- s += asXml(c);
- s += "</"+n.nodeName+">";
- }
- else
- s += "/>";
- }
- else if (n.nodeType == 3)
- s += n.nodeValue;
- else if (n.nodeType == 4)
- s += "<![CDATA[" + n.nodeValue + "]]>";
- return s;
- };
- for (var c=node.firstChild; c; c=c.nextSibling)
- s += asXml(c);
- }
- return s;
- },
- escape: function(txt) {
- return txt.replace(/[\\]/g, "\\\\")
- .replace(/[\"]/g, '\\"')
- .replace(/[\n]/g, '\\n')
- .replace(/[\r]/g, '\\r');
- },
- removeWhite: function(e) {
- e.normalize();
- for (var n = e.firstChild; n; ) {
- if (n.nodeType == 3) { // text node
- if (!n.nodeValue.match(/[^ \f\n\r\t\v]/)) { // pure whitespace text node
- var nxt = n.nextSibling;
- e.removeChild(n);
- n = nxt;
- }
- else
- n = n.nextSibling;
- }
- else if (n.nodeType == 1) { // element node
- X.removeWhite(n);
- n = n.nextSibling;
- }
- else // any other node
- n = n.nextSibling;
- }
- return e;
- }
- };
- if (xml.nodeType == 9) // document node
- xml = xml.documentElement;
- var json = X.toJson(X.toObj(X.removeWhite(xml)), xml.nodeName, "\t");
- return "{\n" + tab + (tab ? json.replace(/\t/g, tab) : json.replace(/\t|\n/g, "")) + "\n}";
-}
Copied: trunk/cyberaide/src/javascript/securelogin/cogkit/xml2json.js (from rev 1806, trunk/cyberaide/src/javascript/securelogin/COGJS/xml2json.js)
===================================================================
--- trunk/cyberaide/src/javascript/securelogin/cogkit/xml2json.js (rev 0)
+++ trunk/cyberaide/src/javascript/securelogin/cogkit/xml2json.js 2007-10-28 16:43:10 UTC (rev 1807)
@@ -0,0 +1,155 @@
+/* This work is licensed under Creative Commons GNU LGPL License.
+
+ License: http://creativecommons.org/licenses/LGPL/2.1/
+ Version: 0.9
+ Author: Stefan Goessner/2006
+ Web: http://goessner.net/
+*/
+function xml2json(xml, tab) {
+ var X = {
+ toObj: function(xml) {
+ var o = {};
+ if (xml.nodeType==1) { // element node ..
+ if (xml.attributes.length) // element with attributes ..
+ for (var i=0; i<xml.attributes.length; i++)
+ o["@"+xml.attributes[i].nodeName] = (xml.attributes[i].nodeValue||"").toString();
+ if (xml.firstChild) { // element has child nodes ..
+ var textChild=0, cdataChild=0, hasElementChild=false;
+ for (var n=xml.firstChild; n; n=n.nextSibling) {
+ if (n.nodeType==1) hasElementChild = true;
+ else if (n.nodeType==3 && n.nodeValue.match(/[^ \f\n\r\t\v]/)) textChild++; // non-whitespace text
+ else if (n.nodeType==4) cdataChild++; // cdata section node
+ }
+ if (hasElementChild) {
+ if (textChild < 2 && cdataChild < 2) { // structured element with evtl. a single text or/and cdata node ..
+ X.removeWhite(xml);
+ for (var n=xml.firstChild; n; n=n.nextSibling) {
+ if (n.nodeType == 3) // text node
+ o["#text"] = X.escape(n.nodeValue);
+ else if (n.nodeType == 4) // cdata node
+ o["#cdata"] = X.escape(n.nodeValue);
+ else if (o[n.nodeName]) { // multiple occurence of element ..
+ if (o[n.nodeName] instanceof Array)
+ o[n.nodeName][o[n.nodeName].length] = X.toObj(n);
+ else
+ o[n.nodeName] = [o[n.nodeName], X.toObj(n)];
+ }
+ else // first occurence of element..
+ o[n.nodeName] = X.toObj(n);
+ }
+ }
+ else { // mixed content
+ if (!xml.attributes.length)
+ o = X.escape(X.innerXml(xml));
+ else
+ o["#text"] = X.escape(X.innerXml(xml));
+ }
+ }
+ else if (textChild) { // pure text
+ if (!xml.attributes.length)
+ o = X.escape(X.innerXml(xml));
+ else
+ o["#text"] = X.escape(X.innerXml(xml));
+ }
+ else if (cdataChild) { // cdata
+ if (cdataChild > 1)
+ o = X.escape(X.innerXml(xml));
+ else
+ for (var n=xml.firstChild; n; n=n.nextSibling)
+ o["#cdata"] = X.escape(n.nodeValue);
+ }
+ }
+ if (!xml.attributes.length && !xml.firstChild) o = null;
+ }
+ else if (xml.nodeType==9) { // document.node
+ o = X.toObj(xml.documentElement);
+ }
+ else
+ alert("unhandled node type: " + xml.nodeType);
+ return o;
+ },
+ toJson: function(o, name, ind) {
+ var json = name ? ("\""+name+"\"") : "";
+ if (o instanceof Array) {
+ for (var i=0,n=o.length; i<n; i++)
+ o[i] = X.toJson(o[i], "", ind+"\t");
+ json += (name?":[":"[") + (o.length > 1 ? ("\n"+ind+"\t"+o.join(",\n"+ind+"\t")+"\n"+ind) : o.join("")) + "]";
+ }
+ else if (o == null)
+ json += (name&&":") + "null";
+ else if (typeof(o) == "object") {
+ var arr = [];
+ for (var m in o)
+ arr[arr.length] = X.toJson(o[m], m, ind+"\t");
+ json += (name?":{":"{") + (arr.length > 1 ? ("\n"+ind+"\t"+arr.join(",\n"+ind+"\t")+"\n"+ind) : arr.join("")) + "}";
+ }
+ else if (typeof(o) == "string")
+ json += (name&&":") + "\"" + o.toString() + "\"";
+ else
+ json += (name&&":") + o.toString();
+ return json;
+ },
+ innerXml: function(node) {
+ var s = ""
+ if ("innerHTML" in node)
+ s = node.innerHTML;
+ else {
+ var asXml = function(n) {
+ var s = "";
+ if (n.nodeType == 1) {
+ s += "<" + n.nodeName;
+ for (var i=0; i<n.attributes.length;i++)
+ s += " " + n.attributes[i].nodeName + "=\"" + (n.attributes[i].nodeValue||"").toString() + "\"";
+ if (n.firstChild) {
+ s += ">";
+ for (var c=n.firstChild; c; c=c.nextSibling)
+ s += asXml(c);
+ s += "</"+n.nodeName+">";
+ }
+ else
+ s += "/>";
+ }
+ else if (n.nodeType == 3)
+ s += n.nodeValue;
+ else if (n.nodeType == 4)
+ s += "<![CDATA[" + n.nodeValue + "]]>";
+ return s;
+ };
+ for (var c=node.firstChild; c; c=c.nextSibling)
+ s += asXml(c);
+ }
+ return s;
+ },
+ escape: function(txt) {
+ return txt.replace(/[\\]/g, "\\\\")
+ .replace(/[\"]/g, '\\"')
+ .replace(/[\n]/g, '\\n')
+ .replace(/[\r]/g, '\\r');
+ },
+ removeWhite: function(e) {
+ e.normalize();
+ for (var n = e.firstChild; n; ) {
+ if (n.nodeType == 3) { // text node
+ if (!n.nodeValue.match(/[^ \f\n\r\t\v]/)) { // pure whitespace text node
+ var nxt = n.nextSibling;
+ e.removeChild(n);
+ n = nxt;
+ }
+ else
+ n = n.nextSibling;
+ }
+ else if (n.nodeType == 1) { // element node
+ X.removeWhite(n);
+ n = n.nextSibling;
+ }
+ else // any other node
+ n = n.nextSibling;
+ }
+ return e;
+ }
+ };
+ if (xml.nodeType == 9) // document node
+ xml = xml.documentElement;
+ var json = X.toJson(X.toObj(X.removeWhite(xml)), xml.nodeName, "\t");
+ return "{\n" + tab + (tab ? json.replace(/\t/g, tab) : json.replace(/\t|\n/g, "")) + "\n}";
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <las...@us...> - 2007-10-28 16:42:29
|
Revision: 1806
http://cogkit.svn.sourceforge.net/cogkit/?rev=1806&view=rev
Author: laszewsk
Date: 2007-10-28 09:42:28 -0700 (Sun, 28 Oct 2007)
Log Message:
-----------
reorganizing source
Added Paths:
-----------
trunk/cyberaide/src/javascript/securelogin/www/
trunk/cyberaide/src/javascript/securelogin/www/error.html
trunk/cyberaide/src/javascript/securelogin/www/index.html
trunk/cyberaide/src/javascript/securelogin/www/login.html
Removed Paths:
-------------
trunk/cyberaide/src/javascript/securelogin/COGJS/index.html
trunk/cyberaide/src/javascript/securelogin/error.html
trunk/cyberaide/src/javascript/securelogin/login.html
Deleted: trunk/cyberaide/src/javascript/securelogin/COGJS/index.html
===================================================================
--- trunk/cyberaide/src/javascript/securelogin/COGJS/index.html 2007-10-28 16:38:23 UTC (rev 1805)
+++ trunk/cyberaide/src/javascript/securelogin/COGJS/index.html 2007-10-28 16:42:28 UTC (rev 1806)
@@ -1,119 +0,0 @@
-<html>
- <head>
- <!---->
- <script type='text/javascript' src='jsolait/jsolait.js'></script>
- <script type='text/javascript' src='sample.js'></script>
- <script type='text/javascript' src='xml2json.js'></script>
- <script type='text/javascript' src='json2xml.js'></script>
-
- <script type='text/javascript'>
- function callback( response ){
- output('resp', response);
- }
-
- function getInput( eleid ){
- var workflow = document.getElementById( eleid );
- if( workflow == null ){
- alert( 'Please input workflow description' );
- return;
- }
- return workflow.value;
- }
- function output( eleid, result ){
- var res = document.getElementById( eleid );
- if( res == null ){
- alert( 'please specify an output element' );
- return;
- }
- res.value = result;
- }
- function echo(){
- var str = getInput("workflow");
- var result = COGHandler.executeMethods( "Handler.echo", str , callback );
- if( result != undefined ){
- //display output to user
- output('resp', result);
- }
- }
- function wfhandle(){
- var str = getInput("workflow");
- var result = COGHandler.executeMethods( "Handler.cmdCOGExecute", str, callback );
- if( result != undefined ){
- //display output to user
- output('resp', result);
- }
- }
- function clearoutput(){
- var output = document.getElementById( 'resp' );
- output.value = "";
- }
- function zhguoj2x(){
- var str = getInput("workflow");
- //str = "a:{\"b\":\"bbb\"}}";
- //alert( str );
- eval( "var json="+str );
- //for(var prop in obj) alert(obj);
- var xml = json2xml( json, " ");
- output( 'resp', xml );
- }
- function zhguox2j(){
- var str = getInput("workflow");
- var dom = parseXml( str );
- var json = xml2json( dom, " " );
- output( 'resp', json );
- }
- function parseXml(xml) {
- var dom = null;
- if (window.DOMParser) {
- try {
- dom = (new DOMParser()).parseFromString(xml, "text/xml");
- }
- catch (e) { dom = null; }
- }
- else if (window.ActiveXObject) {
- try {
- dom = new ActiveXObject('Microsoft.XMLDOM');
- dom.async = false;
- if (!dom.loadXML(xml)) // parse error ..
-
- window.alert(dom.parseError.reason + dom.parseError.srcText);
- }
- catch (e) { dom = null; }
- }
- else
- alert("cannot parse xml string!");
- return dom;
- }
- </script>
- </head>
- <body>
- <div>
- <div style='font-size:large; padding-top:0.3em; padding-bottom:0.3em; color:blue;'>Workflow description:</div>
- <table>
- <tr><td>
- <textarea id='workflow' wrap='off' cols=100 rows=15 ></textarea>
- <td><td valign=top>
- <div style='padding-top:10px;padding-bottom:10px'>
- <input type='button' value='echo' onclick='javascript:echo();'></input>
- </div>
- <div style='padding-top:10px;padding-bottom:10px'>
- <input type='button' value='Workflow Handle' onclick='javascript:wfhandle();'></input></div>
- <div style='padding-top:10px;padding-bottom:10px'>
- <input type='button' value='JSON2XML' onclick='javascript:zhguoj2x();'></input></div>
- <div style='padding-top:10px;padding-bottom:10px'>
- <input type='button' value='XML2JSON' onclick='javascript:zhguox2j();'></input></div>
- </td></tr>
- </table>
- </div>
- <br>
- <div style='font-size:large; padding-top:0.3em; padding-bottom:0.3em; color:blue;'>Response from server:</div>
- <table>
- <tr><td>
- <textarea WRAP='off' id='resp' cols=100 rows=15 readOnly='true'></textarea>
- <td><td valign=top>
- <input type='button' value='clear' onclick='javascript:clearoutput();'></input>
- </td></tr>
- </table>
- </div>
- </body>
-</html>
\ No newline at end of file
Deleted: trunk/cyberaide/src/javascript/securelogin/error.html
===================================================================
--- trunk/cyberaide/src/javascript/securelogin/error.html 2007-10-28 16:38:23 UTC (rev 1805)
+++ trunk/cyberaide/src/javascript/securelogin/error.html 2007-10-28 16:42:28 UTC (rev 1806)
@@ -1,4 +0,0 @@
-
-<b> Authentication Failed </b>
-
-Unfortunatly, you have either used a wrong Username or Password.
Deleted: trunk/cyberaide/src/javascript/securelogin/login.html
===================================================================
--- trunk/cyberaide/src/javascript/securelogin/login.html 2007-10-28 16:38:23 UTC (rev 1805)
+++ trunk/cyberaide/src/javascript/securelogin/login.html 2007-10-28 16:42:28 UTC (rev 1806)
@@ -1,11 +0,0 @@
-<html>
- <head>Login</head>
- <body>
- <b> Login</b><br>
- <form method="POST" action="j_security_check">
- <input type="text" name="j_username">
- <input type="text" name="j_password">
- <input type="submit" value="Log in">
- </form>
- </body>
-</html>
Copied: trunk/cyberaide/src/javascript/securelogin/www/error.html (from rev 1805, trunk/cyberaide/src/javascript/securelogin/error.html)
===================================================================
--- trunk/cyberaide/src/javascript/securelogin/www/error.html (rev 0)
+++ trunk/cyberaide/src/javascript/securelogin/www/error.html 2007-10-28 16:42:28 UTC (rev 1806)
@@ -0,0 +1,4 @@
+
+<b> Authentication Failed </b>
+
+Unfortunatly, you have either used a wrong Username or Password.
Copied: trunk/cyberaide/src/javascript/securelogin/www/index.html (from rev 1805, trunk/cyberaide/src/javascript/securelogin/COGJS/index.html)
===================================================================
--- trunk/cyberaide/src/javascript/securelogin/www/index.html (rev 0)
+++ trunk/cyberaide/src/javascript/securelogin/www/index.html 2007-10-28 16:42:28 UTC (rev 1806)
@@ -0,0 +1,119 @@
+<html>
+ <head>
+ <!---->
+ <script type='text/javascript' src='jsolait/jsolait.js'></script>
+ <script type='text/javascript' src='sample.js'></script>
+ <script type='text/javascript' src='xml2json.js'></script>
+ <script type='text/javascript' src='json2xml.js'></script>
+
+ <script type='text/javascript'>
+ function callback( response ){
+ output('resp', response);
+ }
+
+ function getInput( eleid ){
+ var workflow = document.getElementById( eleid );
+ if( workflow == null ){
+ alert( 'Please input workflow description' );
+ return;
+ }
+ return workflow.value;
+ }
+ function output( eleid, result ){
+ var res = document.getElementById( eleid );
+ if( res == null ){
+ alert( 'please specify an output element' );
+ return;
+ }
+ res.value = result;
+ }
+ function echo(){
+ var str = getInput("workflow");
+ var result = COGHandler.executeMethods( "Handler.echo", str , callback );
+ if( result != undefined ){
+ //display output to user
+ output('resp', result);
+ }
+ }
+ function wfhandle(){
+ var str = getInput("workflow");
+ var result = COGHandler.executeMethods( "Handler.cmdCOGExecute", str, callback );
+ if( result != undefined ){
+ //display output to user
+ output('resp', result);
+ }
+ }
+ function clearoutput(){
+ var output = document.getElementById( 'resp' );
+ output.value = "";
+ }
+ function zhguoj2x(){
+ var str = getInput("workflow");
+ //str = "a:{\"b\":\"bbb\"}}";
+ //alert( str );
+ eval( "var json="+str );
+ //for(var prop in obj) alert(obj);
+ var xml = json2xml( json, " ");
+ output( 'resp', xml );
+ }
+ function zhguox2j(){
+ var str = getInput("workflow");
+ var dom = parseXml( str );
+ var json = xml2json( dom, " " );
+ output( 'resp', json );
+ }
+ function parseXml(xml) {
+ var dom = null;
+ if (window.DOMParser) {
+ try {
+ dom = (new DOMParser()).parseFromString(xml, "text/xml");
+ }
+ catch (e) { dom = null; }
+ }
+ else if (window.ActiveXObject) {
+ try {
+ dom = new ActiveXObject('Microsoft.XMLDOM');
+ dom.async = false;
+ if (!dom.loadXML(xml)) // parse error ..
+
+ window.alert(dom.parseError.reason + dom.parseError.srcText);
+ }
+ catch (e) { dom = null; }
+ }
+ else
+ alert("cannot parse xml string!");
+ return dom;
+ }
+ </script>
+ </head>
+ <body>
+ <div>
+ <div style='font-size:large; padding-top:0.3em; padding-bottom:0.3em; color:blue;'>Workflow description:</div>
+ <table>
+ <tr><td>
+ <textarea id='workflow' wrap='off' cols=100 rows=15 ></textarea>
+ <td><td valign=top>
+ <div style='padding-top:10px;padding-bottom:10px'>
+ <input type='button' value='echo' onclick='javascript:echo();'></input>
+ </div>
+ <div style='padding-top:10px;padding-bottom:10px'>
+ <input type='button' value='Workflow Handle' onclick='javascript:wfhandle();'></input></div>
+ <div style='padding-top:10px;padding-bottom:10px'>
+ <input type='button' value='JSON2XML' onclick='javascript:zhguoj2x();'></input></div>
+ <div style='padding-top:10px;padding-bottom:10px'>
+ <input type='button' value='XML2JSON' onclick='javascript:zhguox2j();'></input></div>
+ </td></tr>
+ </table>
+ </div>
+ <br>
+ <div style='font-size:large; padding-top:0.3em; padding-bottom:0.3em; color:blue;'>Response from server:</div>
+ <table>
+ <tr><td>
+ <textarea WRAP='off' id='resp' cols=100 rows=15 readOnly='true'></textarea>
+ <td><td valign=top>
+ <input type='button' value='clear' onclick='javascript:clearoutput();'></input>
+ </td></tr>
+ </table>
+ </div>
+ </body>
+</html>
\ No newline at end of file
Copied: trunk/cyberaide/src/javascript/securelogin/www/login.html (from rev 1805, trunk/cyberaide/src/javascript/securelogin/login.html)
===================================================================
--- trunk/cyberaide/src/javascript/securelogin/www/login.html (rev 0)
+++ trunk/cyberaide/src/javascript/securelogin/www/login.html 2007-10-28 16:42:28 UTC (rev 1806)
@@ -0,0 +1,11 @@
+<html>
+ <head>Login</head>
+ <body>
+ <b> Login</b><br>
+ <form method="POST" action="j_security_check">
+ <input type="text" name="j_username">
+ <input type="text" name="j_password">
+ <input type="submit" value="Log in">
+ </form>
+ </body>
+</html>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <las...@us...> - 2007-10-28 16:38:27
|
Revision: 1805
http://cogkit.svn.sourceforge.net/cogkit/?rev=1805&view=rev
Author: laszewsk
Date: 2007-10-28 09:38:23 -0700 (Sun, 28 Oct 2007)
Log Message:
-----------
renamed sample to a more useful directory name
Added Paths:
-----------
trunk/cyberaide/src/javascript/securelogin/
trunk/cyberaide/src/javascript/securelogin/COGJS/
trunk/cyberaide/src/javascript/securelogin/WEB-INF/
trunk/cyberaide/src/javascript/securelogin/error.html
trunk/cyberaide/src/javascript/securelogin/login.html
Removed Paths:
-------------
trunk/cyberaide/src/javascript/sample/
trunk/cyberaide/src/javascript/securelogin/COGJS/
trunk/cyberaide/src/javascript/securelogin/WEB-INF/
trunk/cyberaide/src/javascript/securelogin/error.html
trunk/cyberaide/src/javascript/securelogin/login.html
Copied: trunk/cyberaide/src/javascript/securelogin (from rev 1799, trunk/cyberaide/src/javascript/sample)
Copied: trunk/cyberaide/src/javascript/securelogin/COGJS (from rev 1804, trunk/cyberaide/src/javascript/sample/COGJS)
Copied: trunk/cyberaide/src/javascript/securelogin/WEB-INF (from rev 1804, trunk/cyberaide/src/javascript/sample/WEB-INF)
Deleted: trunk/cyberaide/src/javascript/securelogin/error.html
===================================================================
--- trunk/cyberaide/src/javascript/sample/error.html 2007-10-28 16:08:45 UTC (rev 1799)
+++ trunk/cyberaide/src/javascript/securelogin/error.html 2007-10-28 16:38:23 UTC (rev 1805)
@@ -1 +0,0 @@
-Username/Password wrong!!!
\ No newline at end of file
Copied: trunk/cyberaide/src/javascript/securelogin/error.html (from rev 1804, trunk/cyberaide/src/javascript/sample/error.html)
===================================================================
--- trunk/cyberaide/src/javascript/securelogin/error.html (rev 0)
+++ trunk/cyberaide/src/javascript/securelogin/error.html 2007-10-28 16:38:23 UTC (rev 1805)
@@ -0,0 +1,4 @@
+
+<b> Authentication Failed </b>
+
+Unfortunatly, you have either used a wrong Username or Password.
Deleted: trunk/cyberaide/src/javascript/securelogin/login.html
===================================================================
--- trunk/cyberaide/src/javascript/sample/login.html 2007-10-28 16:08:45 UTC (rev 1799)
+++ trunk/cyberaide/src/javascript/securelogin/login.html 2007-10-28 16:38:23 UTC (rev 1805)
@@ -1,10 +0,0 @@
-<html>
- <head></head>
- <body>
- <form method="POST" action="j_security_check">
- <input type="text" name="j_username">
- <input type="text" name="j_password">
- <input type="submit" value="Log in">
- </form>
- </body>
-</html>
\ No newline at end of file
Copied: trunk/cyberaide/src/javascript/securelogin/login.html (from rev 1804, trunk/cyberaide/src/javascript/sample/login.html)
===================================================================
--- trunk/cyberaide/src/javascript/securelogin/login.html (rev 0)
+++ trunk/cyberaide/src/javascript/securelogin/login.html 2007-10-28 16:38:23 UTC (rev 1805)
@@ -0,0 +1,11 @@
+<html>
+ <head>Login</head>
+ <body>
+ <b> Login</b><br>
+ <form method="POST" action="j_security_check">
+ <input type="text" name="j_username">
+ <input type="text" name="j_password">
+ <input type="submit" value="Log in">
+ </form>
+ </body>
+</html>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <las...@us...> - 2007-10-28 16:34:34
|
Revision: 1804
http://cogkit.svn.sourceforge.net/cogkit/?rev=1804&view=rev
Author: laszewsk
Date: 2007-10-28 09:34:33 -0700 (Sun, 28 Oct 2007)
Log Message:
-----------
simplified the directory structure
Added Paths:
-----------
trunk/cyberaide/src/javascript/src/COGHandler/SimpleHandler.java
trunk/cyberaide/src/javascript/src/COGHandler/SimpleHandlerStub.java
Removed Paths:
-------------
trunk/cyberaide/src/javascript/src/COGHandler/src/
Copied: trunk/cyberaide/src/javascript/src/COGHandler/SimpleHandler.java (from rev 1799, trunk/cyberaide/src/javascript/src/COGHandler/src/zhguo/test/SimpleHandler.java)
===================================================================
--- trunk/cyberaide/src/javascript/src/COGHandler/SimpleHandler.java (rev 0)
+++ trunk/cyberaide/src/javascript/src/COGHandler/SimpleHandler.java 2007-10-28 16:34:33 UTC (rev 1804)
@@ -0,0 +1,80 @@
+package zhguo.test;
+
+import java.io.*;
+
+import zhguo.test.SimpleHandlerStub.Echo;
+import zhguo.test.SimpleHandlerStub.EchoResponse;
+import zhguo.test.SimpleHandlerStub.CmdCOGExecute;
+import zhguo.test.SimpleHandlerStub.CmdCOGExecuteResponse;
+
+/*
+ * It is to be used to XML-RPC framework.
+ */
+public class SimpleHandler{
+// private
+ public SimpleHandler(){}
+ public String echo( String input ){
+ try{//write input into a file for logging
+ File recordfile = new File("E:\\Program Files\\Apache Software Foundation\\Tomcat 6.0\\webapps\\sample\\WEB-INF\\parameters.txt");
+ BufferedWriter br = new BufferedWriter(new FileWriter( recordfile ));
+ br.write( input );
+ br.close();
+ }catch (Exception e ){
+ System.exit( 1 );
+ }
+
+ SimpleHandlerStub stub = new SimpleHandlerStub("http://localhost:8080/axis2/services/SimpleHandler");
+ Echo req = new Echo();
+ req.setInput( input );
+ EchoResponse resp = new EchoResponse();
+
+ //call the corresponding web service
+ return "Your input is:\n" + input;
+ }
+ public static int add(OperationInterfaceStub stub) {
+ try {
+ Add req = new Add();
+ req.setParam0(op1);
+ req.setParam1(op2);
+ AddResponse resp = new AddResponse();
+ resp = stub.add(req);
+ System.out.println("done");
+ System.out.println(op1 + "+"+ op2 + " is " + resp.get_return());
+ return resp.get_return();
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.out.println("\n\n\n");
+ }
+ return 0;
+ }
+
+ public String cmdCOGExecute( String workflow ){
+ Process wfproc = null;
+ int exit = -1;
+ try {
+ String filename = "E:\\Program Files\\Apache Software Foundation\\Tomcat 6.0\\webapps\\sample\\WEB-INF\\workflow.xml";
+ File recordfile = new File(filename);
+ BufferedWriter br = new BufferedWriter(new FileWriter(recordfile));
+ br.write(workflow);
+ br.close();
+
+ String cmd = "E:\\my_program\\cog-4_1_5\\bin\\cog-workflow.bat " + filename;
+ long timeout = 1000 * 5;
+ wfproc = Runtime.getRuntime().exec(cmd);
+ synchronized(wfproc) {
+ wfproc.wait(timeout);
+ }
+ exit = wfproc.exitValue();
+ } catch (IllegalThreadStateException e) {
+ //if the thread
+ wfproc.destroy();
+ return e.toString();
+ } catch (Exception e){
+ return e.toString();
+ }
+ return "exit value " + String.valueOf(exit);
+ }
+ public static void main( String []args ){
+ SimpleHandler hd = new SimpleHandler();
+ }
+}
\ No newline at end of file
Copied: trunk/cyberaide/src/javascript/src/COGHandler/SimpleHandlerStub.java (from rev 1799, trunk/cyberaide/src/javascript/src/COGHandler/src/zhguo/test/SimpleHandlerStub.java)
===================================================================
--- trunk/cyberaide/src/javascript/src/COGHandler/SimpleHandlerStub.java (rev 0)
+++ trunk/cyberaide/src/javascript/src/COGHandler/SimpleHandlerStub.java 2007-10-28 16:34:33 UTC (rev 1804)
@@ -0,0 +1,2882 @@
+/**
+ * SimpleHandlerStub.java
+ *
+ * This file was auto-generated from WSDL
+ * by the Apache Axis2 version: 1.3 Built on : Aug 10, 2007 (04:45:47 LKT)
+ */
+package zhguo.test;
+
+
+/*
+ * SimpleHandlerStub java implementation
+ */
+public class SimpleHandlerStub extends org.apache.axis2.client.Stub {
+ protected org.apache.axis2.description.AxisOperation[] _operations;
+
+ //hashmaps to keep the fault mapping
+ private java.util.HashMap faultExceptionNameMap = new java.util.HashMap();
+ private java.util.HashMap faultExceptionClassNameMap = new java.util.HashMap();
+ private java.util.HashMap faultMessageMap = new java.util.HashMap();
+ private javax.xml.namespace.QName[] opNameArray = null;
+
+ /**
+ *Constructor that takes in a configContext
+ */
+ public SimpleHandlerStub(
+ org.apache.axis2.context.ConfigurationContext configurationContext,
+ java.lang.String targetEndpoint) throws org.apache.axis2.AxisFault {
+ this(configurationContext, targetEndpoint, false);
+ }
+
+ /**
+ * Constructor that takes in a configContext and useseperate listner
+ */
+ public SimpleHandlerStub(
+ org.apache.axis2.context.ConfigurationContext configurationContext,
+ java.lang.String targetEndpoint, boolean useSeparateListener)
+ throws org.apache.axis2.AxisFault {
+ //To populate AxisService
+ populateAxisService();
+ populateFaults();
+
+ _serviceClient = new org.apache.axis2.client.ServiceClient(configurationContext,
+ _service);
+
+ configurationContext = _serviceClient.getServiceContext()
+ .getConfigurationContext();
+
+ _serviceClient.getOptions()
+ .setTo(new org.apache.axis2.addressing.EndpointReference(
+ targetEndpoint));
+ _serviceClient.getOptions().setUseSeparateListener(useSeparateListener);
+
+ //Set the soap version
+ _serviceClient.getOptions()
+ .setSoapVersionURI(org.apache.axiom.soap.SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+ }
+
+ /**
+ * Default Constructor
+ */
+ public SimpleHandlerStub(
+ org.apache.axis2.context.ConfigurationContext configurationContext)
+ throws org.apache.axis2.AxisFault {
+ this(configurationContext,
+ "http://localhost:8080/axis2/services/SimpleHandler");
+ }
+
+ /**
+ * Default Constructor
+ */
+ public SimpleHandlerStub() throws org.apache.axis2.AxisFault {
+ this("http://localhost:8080/axis2/services/SimpleHandler");
+ }
+
+ /**
+ * Constructor taking the target endpoint
+ */
+ public SimpleHandlerStub(java.lang.String targetEndpoint)
+ throws org.apache.axis2.AxisFault {
+ this(null, targetEndpoint);
+ }
+
+ private void populateAxisService() throws org.apache.axis2.AxisFault {
+ //creating the Service with a unique name
+ _service = new org.apache.axis2.description.AxisService("SimpleHandler" +
+ this.hashCode());
+
+ //creating the operations
+ org.apache.axis2.description.AxisOperation __operation;
+
+ _operations = new org.apache.axis2.description.AxisOperation[3];
+
+ __operation = new org.apache.axis2.description.OutOnlyAxisOperation();
+
+ __operation.setName(new javax.xml.namespace.QName("http://test.zhguo",
+ "main"));
+ _service.addOperation(__operation);
+
+ _operations[0] = __operation;
+
+ __operation = new org.apache.axis2.description.OutInAxisOperation();
+
+ __operation.setName(new javax.xml.namespace.QName("http://test.zhguo",
+ "cmdCOGExecute"));
+ _service.addOperation(__operation);
+
+ _operations[1] = __operation;
+
+ __operation = new org.apache.axis2.description.OutInAxisOperation();
+
+ __operation.setName(new javax.xml.namespace.QName("http://test.zhguo",
+ "echo"));
+ _service.addOperation(__operation);
+
+ _operations[2] = __operation;
+ }
+
+ //populates the faults
+ private void populateFaults() {
+ }
+
+ public void main(zhguo.test.SimpleHandlerStub.Main main)
+ throws java.rmi.RemoteException {
+ org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[0].getName());
+ _operationClient.getOptions().setAction("urn:main");
+ _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);
+
+ addPropertyToOperationClient(_operationClient,
+ org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,
+ "&");
+
+ org.apache.axiom.soap.SOAPEnvelope env = null;
+ org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext();
+
+ //Style is Doc.
+ env = toEnvelope(getFactory(_operationClient.getOptions()
+ .getSoapVersionURI()),
+ main,
+ optimizeContent(
+ new javax.xml.namespace.QName("http://test.zhguo", "main")));
+
+ //adding SOAP soap_headers
+ _serviceClient.addHeadersToEnvelope(env);
+ // create message context with that soap envelope
+ _messageContext.setEnvelope(env);
+
+ // add the message contxt to the operation client
+ _operationClient.addMessageContext(_messageContext);
+
+ _operationClient.execute(true);
+
+ return;
+ }
+
+ /**
+ * Auto generated method signature
+ * @see zhguo.test.SimpleHandler#cmdCOGExecute
+ * @param cmdCOGExecute
+ */
+ public zhguo.test.SimpleHandlerStub.CmdCOGExecuteResponse cmdCOGExecute(
+ zhguo.test.SimpleHandlerStub.CmdCOGExecute cmdCOGExecute)
+ throws java.rmi.RemoteException {
+ try {
+ org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[1].getName());
+ _operationClient.getOptions().setAction("urn:cmdCOGExecute");
+ _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);
+
+ addPropertyToOperationClient(_operationClient,
+ org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,
+ "&");
+
+ // create a message context
+ org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext();
+
+ // create SOAP envelope with that payload
+ org.apache.axiom.soap.SOAPEnvelope env = null;
+
+ env = toEnvelope(getFactory(_operationClient.getOptions()
+ .getSoapVersionURI()),
+ cmdCOGExecute,
+ optimizeContent(
+ new javax.xml.namespace.QName("http://test.zhguo",
+ "cmdCOGExecute")));
+
+ //adding SOAP soap_headers
+ _serviceClient.addHeadersToEnvelope(env);
+ // set the message context with that soap envelope
+ _messageContext.setEnvelope(env);
+
+ // add the message contxt to the operation client
+ _operationClient.addMessageContext(_messageContext);
+
+ //execute the operation client
+ _operationClient.execute(true);
+
+ org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+ org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();
+
+ java.lang.Object object = fromOM(_returnEnv.getBody()
+ .getFirstElement(),
+ zhguo.test.SimpleHandlerStub.CmdCOGExecuteResponse.class,
+ getEnvelopeNamespaces(_returnEnv));
+ _messageContext.getTransportOut().getSender()
+ .cleanup(_messageContext);
+
+ return (zhguo.test.SimpleHandlerStub.CmdCOGExecuteResponse) object;
+ } catch (org.apache.axis2.AxisFault f) {
+ org.apache.axiom.om.OMElement faultElt = f.getDetail();
+
+ if (faultElt != null) {
+ if (faultExceptionNameMap.containsKey(faultElt.getQName())) {
+ //make the fault by reflection
+ try {
+ java.lang.String exceptionClassName = (java.lang.String) faultExceptionClassNameMap.get(faultElt.getQName());
+ java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);
+ java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance();
+
+ //message class
+ java.lang.String messageClassName = (java.lang.String) faultMessageMap.get(faultElt.getQName());
+ java.lang.Class messageClass = java.lang.Class.forName(messageClassName);
+ java.lang.Object messageObject = fromOM(faultElt,
+ messageClass, null);
+ java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage",
+ new java.lang.Class[] { messageClass });
+ m.invoke(ex, new java.lang.Object[] { messageObject });
+
+ throw new java.rmi.RemoteException(ex.getMessage(), ex);
+ } catch (java.lang.ClassCastException e) {
+ // we cannot intantiate the class - throw the original Axis fault
+ throw f;
+ } catch (java.lang.ClassNotFoundException e) {
+ // we cannot intantiate the class - throw the original Axis fault
+ throw f;
+ } catch (java.lang.NoSuchMethodException e) {
+ // we cannot intantiate the class - throw the original Axis fault
+ throw f;
+ } catch (java.lang.reflect.InvocationTargetException e) {
+ // we cannot intantiate the class - throw the original Axis fault
+ throw f;
+ } catch (java.lang.IllegalAccessException e) {
+ // we cannot intantiate the class - throw the original Axis fault
+ throw f;
+ } catch (java.lang.InstantiationException e) {
+ // we cannot intantiate the class - throw the original Axis fault
+ throw f;
+ }
+ } else {
+ throw f;
+ }
+ } else {
+ throw f;
+ }
+ }
+ }
+
+ /**
+ * Auto generated method signature
+ * @see zhguo.test.SimpleHandler#echo
+ * @param echo
+ */
+ public zhguo.test.SimpleHandlerStub.EchoResponse echo(
+ zhguo.test.SimpleHandlerStub.Echo echo) throws java.rmi.RemoteException {
+ try {
+ org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[2].getName());
+ _operationClient.getOptions().setAction("urn:echo");
+ _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);
+
+ addPropertyToOperationClient(_operationClient,
+ org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,
+ "&");
+
+ // create a message context
+ org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext();
+
+ // create SOAP envelope with that payload
+ org.apache.axiom.soap.SOAPEnvelope env = null;
+
+ env = toEnvelope(getFactory(_operationClient.getOptions()
+ .getSoapVersionURI()),
+ echo,
+ optimizeContent(
+ new javax.xml.namespace.QName("http://test.zhguo",
+ "echo")));
+
+ //adding SOAP soap_headers
+ _serviceClient.addHeadersToEnvelope(env);
+ // set the message context with that soap envelope
+ _messageContext.setEnvelope(env);
+
+ // add the message contxt to the operation client
+ _operationClient.addMessageContext(_messageContext);
+
+ //execute the operation client
+ _operationClient.execute(true);
+
+ org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+ org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();
+
+ java.lang.Object object = fromOM(_returnEnv.getBody()
+ .getFirstElement(),
+ zhguo.test.SimpleHandlerStub.EchoResponse.class,
+ getEnvelopeNamespaces(_returnEnv));
+ _messageContext.getTransportOut().getSender()
+ .cleanup(_messageContext);
+
+ return (zhguo.test.SimpleHandlerStub.EchoResponse) object;
+ } catch (org.apache.axis2.AxisFault f) {
+ org.apache.axiom.om.OMElement faultElt = f.getDetail();
+
+ if (faultElt != null) {
+ if (faultExceptionNameMap.containsKey(faultElt.getQName())) {
+ //make the fault by reflection
+ try {
+ java.lang.String exceptionClassName = (java.lang.String) faultExceptionClassNameMap.get(faultElt.getQName());
+ java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);
+ java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance();
+
+ //message class
+ java.lang.String messageClassName = (java.lang.String) faultMessageMap.get(faultElt.getQName());
+ java.lang.Class messageClass = java.lang.Class.forName(messageClassName);
+ java.lang.Object messageObject = fromOM(faultElt,
+ messageClass, null);
+ java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage",
+ new java.lang.Class[] { messageClass });
+ m.invoke(ex, new java.lang.Object[] { messageObject });
+
+ throw new java.rmi.RemoteException(ex.getMessage(), ex);
+ } catch (java.lang.ClassCastException e) {
+ // we cannot intantiate the class - throw the original Axis fault
+ throw f;
+ } catch (java.lang.ClassNotFoundException e) {
+ // we cannot intantiate the class - throw the original Axis fault
+ throw f;
+ } catch (java.lang.NoSuchMethodException e) {
+ // we cannot intantiate the class - throw the original Axis fault
+ throw f;
+ } catch (java.lang.reflect.InvocationTargetException e) {
+ // we cannot intantiate the class - throw the original Axis fault
+ throw f;
+ } catch (java.lang.IllegalAccessException e) {
+ // we cannot intantiate the class - throw the original Axis fault
+ throw f;
+ } catch (java.lang.InstantiationException e) {
+ // we cannot intantiate the class - throw the original Axis fault
+ throw f;
+ }
+ } else {
+ throw f;
+ }
+ } else {
+ throw f;
+ }
+ }
+ }
+
+ /**
+ * A utility method that copies the namepaces from the SOAPEnvelope
+ */
+ private java.util.Map getEnvelopeNamespaces(
+ org.apache.axiom.soap.SOAPEnvelope env) {
+ java.util.Map returnMap = new java.util.HashMap();
+ java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces();
+
+ while (namespaceIterator.hasNext()) {
+ org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next();
+ returnMap.put(ns.getPrefix(), ns.getNamespaceURI());
+ }
+
+ return returnMap;
+ }
+
+ private boolean optimizeContent(javax.xml.namespace.QName opName) {
+ if (opNameArray == null) {
+ return false;
+ }
+
+ for (int i = 0; i < opNameArray.length; i++) {
+ if (opName.equals(opNameArray[i])) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private org.apache.axiom.om.OMElement toOM(
+ zhguo.test.SimpleHandlerStub.CmdCOGExecute param,
+ boolean optimizeContent) throws org.apache.axis2.AxisFault {
+ try {
+ return param.getOMElement(zhguo.test.SimpleHandlerStub.CmdCOGExecute.MY_QNAME,
+ org.apache.axiom.om.OMAbstractFactory.getOMFactory());
+ } catch (org.apache.axis2.databinding.ADBException e) {
+ throw org.apache.axis2.AxisFault.makeFault(e);
+ }
+ }
+
+ private org.apache.axiom.om.OMElement toOM(
+ zhguo.test.SimpleHandlerStub.CmdCOGExecuteResponse param,
+ boolean optimizeContent) throws org.apache.axis2.AxisFault {
+ try {
+ return param.getOMElement(zhguo.test.SimpleHandlerStub.CmdCOGExecuteResponse.MY_QNAME,
+ org.apache.axiom.om.OMAbstractFactory.getOMFactory());
+ } catch (org.apache.axis2.databinding.ADBException e) {
+ throw org.apache.axis2.AxisFault.makeFault(e);
+ }
+ }
+
+ private org.apache.axiom.om.OMElement toOM(
+ zhguo.test.SimpleHandlerStub.Echo param, boolean optimizeContent)
+ throws org.apache.axis2.AxisFault {
+ try {
+ return param.getOMElement(zhguo.test.SimpleHandlerStub.Echo.MY_QNAME,
+ org.apache.axiom.om.OMAbstractFactory.getOMFactory());
+ } catch (org.apache.axis2.databinding.ADBException e) {
+ throw org.apache.axis2.AxisFault.makeFault(e);
+ }
+ }
+
+ private org.apache.axiom.om.OMElement toOM(
+ zhguo.test.SimpleHandlerStub.EchoResponse param, boolean optimizeContent)
+ throws org.apache.axis2.AxisFault {
+ try {
+ return param.getOMElement(zhguo.test.SimpleHandlerStub.EchoResponse.MY_QNAME,
+ org.apache.axiom.om.OMAbstractFactory.getOMFactory());
+ } catch (org.apache.axis2.databinding.ADBException e) {
+ throw org.apache.axis2.AxisFault.makeFault(e);
+ }
+ }
+
+ private org.apache.axiom.om.OMElement toOM(
+ zhguo.test.SimpleHandlerStub.Main param, boolean optimizeContent)
+ throws org.apache.axis2.AxisFault {
+ try {
+ return param.getOMElement(zhguo.test.SimpleHandlerStub.Main.MY_QNAME,
+ org.apache.axiom.om.OMAbstractFactory.getOMFactory());
+ } catch (org.apache.axis2.databinding.ADBException e) {
+ throw org.apache.axis2.AxisFault.makeFault(e);
+ }
+ }
+
+ private org.apache.axiom.soap.SOAPEnvelope toEnvelope(
+ org.apache.axiom.soap.SOAPFactory factory,
+ zhguo.test.SimpleHandlerStub.CmdCOGExecute param,
+ boolean optimizeContent) throws org.apache.axis2.AxisFault {
+ try {
+ org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope();
+ emptyEnvelope.getBody()
+ .addChild(param.getOMElement(
+ zhguo.test.SimpleHandlerStub.CmdCOGExecute.MY_QNAME, factory));
+
+ return emptyEnvelope;
+ } catch (org.apache.axis2.databinding.ADBException e) {
+ throw org.apache.axis2.AxisFault.makeFault(e);
+ }
+ }
+
+ /* methods to provide back word compatibility */
+ private org.apache.axiom.soap.SOAPEnvelope toEnvelope(
+ org.apache.axiom.soap.SOAPFactory factory,
+ zhguo.test.SimpleHandlerStub.Echo param, boolean optimizeContent)
+ throws org.apache.axis2.AxisFault {
+ try {
+ org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope();
+ emptyEnvelope.getBody()
+ .addChild(param.getOMElement(
+ zhguo.test.SimpleHandlerStub.Echo.MY_QNAME, factory));
+
+ return emptyEnvelope;
+ } catch (org.apache.axis2.databinding.ADBException e) {
+ throw org.apache.axis2.AxisFault.makeFault(e);
+ }
+ }
+
+ /* methods to provide back word compatibility */
+ private org.apache.axiom.soap.SOAPEnvelope toEnvelope(
+ org.apache.axiom.soap.SOAPFactory factory,
+ zhguo.test.SimpleHandlerStub.Main param, boolean optimizeContent)
+ throws org.apache.axis2.AxisFault {
+ try {
+ org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope();
+ emptyEnvelope.getBody()
+ .addChild(param.getOMElement(
+ zhguo.test.SimpleHandlerStub.Main.MY_QNAME, factory));
+
+ return emptyEnvelope;
+ } catch (org.apache.axis2.databinding.ADBException e) {
+ throw org.apache.axis2.AxisFault.makeFault(e);
+ }
+ }
+
+ /* methods to provide back word compatibility */
+
+ /**
+ * get the default envelope
+ */
+ private org.apache.axiom.soap.SOAPEnvelope toEnvelope(
+ org.apache.axiom.soap.SOAPFactory factory) {
+ return factory.getDefaultEnvelope();
+ }
+
+ private java.lang.Object fromOM(org.apache.axiom.om.OMElement param,
+ java.lang.Class type, java.util.Map extraNamespaces)
+ throws org.apache.axis2.AxisFault {
+ try {
+ if (zhguo.test.SimpleHandlerStub.CmdCOGExecute.class.equals(type)) {
+ return zhguo.test.SimpleHandlerStub.CmdCOGExecute.Factory.parse(param.getXMLStreamReaderWithoutCaching());
+ }
+
+ if (zhguo.test.SimpleHandlerStub.CmdCOGExecuteResponse.class.equals(
+ type)) {
+ return zhguo.test.SimpleHandlerStub.CmdCOGExecuteResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching());
+ }
+
+ if (zhguo.test.SimpleHandlerStub.Echo.class.equals(type)) {
+ return zhguo.test.SimpleHandlerStub.Echo.Factory.parse(param.getXMLStreamReaderWithoutCaching());
+ }
+
+ if (zhguo.test.SimpleHandlerStub.EchoResponse.class.equals(type)) {
+ return zhguo.test.SimpleHandlerStub.EchoResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching());
+ }
+
+ if (zhguo.test.SimpleHandlerStub.Main.class.equals(type)) {
+ return zhguo.test.SimpleHandlerStub.Main.Factory.parse(param.getXMLStreamReaderWithoutCaching());
+ }
+ } catch (java.lang.Exception e) {
+ throw org.apache.axis2.AxisFault.makeFault(e);
+ }
+
+ return null;
+ }
+
+ //http://localhost:8080/axis2/services/SimpleHandler
+ public static class ExtensionMapper {
+ public static java.lang.Object getTypeObject(
+ java.lang.String namespaceURI, java.lang.String typeName,
+ javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception {
+ throw new org.apache.axis2.databinding.ADBException(
+ "Unsupported type " + namespaceURI + " " + typeName);
+ }
+ }
+
+ public static class CmdCOGExecuteResponse implements org.apache.axis2.databinding.ADBBean {
+ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://test.zhguo/xsd",
+ "cmdCOGExecuteResponse", "ns1");
+
+ /**
+ * field for _return
+ */
+ protected java.lang.String local_return;
+
+ /* This tracker boolean wil be used to detect whether the user called the set method
+ * for this attribute. It will be used to determine whether to include this field
+ * in the serialized XML
+ */
+ protected boolean local_returnTracker = false;
+
+ private static java.lang.String generatePrefix(
+ java.lang.String namespace) {
+ if (namespace.equals("http://test.zhguo/xsd")) {
+ return "ns1";
+ }
+
+ return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
+ }
+
+ /**
+ * Auto generated getter method
+ * @return java.lang.String
+ */
+ public java.lang.String get_return() {
+ return local_return;
+ }
+
+ /**
+ * Auto generated setter method
+ * @param param _return
+ */
+ public void set_return(java.lang.String param) {
+ if (param != null) {
+ //update the setting tracker
+ local_returnTracker = true;
+ } else {
+ local_returnTracker = true;
+ }
+
+ this.local_return = param;
+ }
+
+ /**
+ * isReaderMTOMAware
+ * @return true if the reader supports MTOM
+ */
+ public static boolean isReaderMTOMAware(
+ javax.xml.stream.XMLStreamReader reader) {
+ boolean isReaderMTOMAware = false;
+
+ try {
+ isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(
+ org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE));
+ } catch (java.lang.IllegalArgumentException e) {
+ isReaderMTOMAware = false;
+ }
+
+ return isReaderMTOMAware;
+ }
+
+ /**
+ *
+ * @param parentQName
+ * @param factory
+ * @return org.apache.axiom.om.OMElement
+ */
+ public org.apache.axiom.om.OMElement getOMElement(
+ final javax.xml.namespace.QName parentQName,
+ final org.apache.axiom.om.OMFactory factory)
+ throws org.apache.axis2.databinding.ADBException {
+ org.apache.axiom.om.OMDataSource dataSource = new org.apache.axis2.databinding.ADBDataSource(this,
+ MY_QNAME) {
+ public void serialize(
+ org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter)
+ throws javax.xml.stream.XMLStreamException {
+ CmdCOGExecuteResponse.this.serialize(MY_QNAME, factory,
+ xmlWriter);
+ }
+ };
+
+ return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME,
+ factory, dataSource);
+ }
+
+ public void serialize(final javax.xml.namespace.QName parentQName,
+ final org.apache.axiom.om.OMFactory factory,
+ org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter)
+ throws javax.xml.stream.XMLStreamException,
+ org.apache.axis2.databinding.ADBException {
+ java.lang.String prefix = null;
+ java.lang.String namespace = null;
+
+ prefix = parentQName.getPrefix();
+ namespace = parentQName.getNamespaceURI();
+
+ if (namespace != null) {
+ java.lang.String writerPrefix = xmlWriter.getPrefix(namespace);
+
+ if (writerPrefix != null) {
+ xmlWriter.writeStartElement(namespace,
+ parentQName.getLocalPart());
+ } else {
+ if (prefix == null) {
+ prefix = generatePrefix(namespace);
+ }
+
+ xmlWriter.writeStartElement(prefix,
+ parentQName.getLocalPart(), namespace);
+ xmlWriter.writeNamespace(prefix, namespace);
+ xmlWriter.setPrefix(prefix, namespace);
+ }
+ } else {
+ xmlWriter.writeStartElement(parentQName.getLocalPart());
+ }
+
+ if (local_returnTracker) {
+ namespace = "http://test.zhguo/xsd";
+
+ if (!namespace.equals("")) {
+ prefix = xmlWriter.getPrefix(namespace);
+
+ if (prefix == null) {
+ prefix = generatePrefix(namespace);
+
+ xmlWriter.writeStartElement(prefix, "return", namespace);
+ xmlWriter.writeNamespace(prefix, namespace);
+ xmlWriter.setPrefix(prefix, namespace);
+ } else {
+ xmlWriter.writeStartElement(namespace, "return");
+ }
+ } else {
+ xmlWriter.writeStartElement("return");
+ }
+
+ if (local_return == null) {
+ // write the nil attribute
+ writeAttribute("xsi",
+ "http://www.w3.org/2001/XMLSchema-instance", "nil",
+ "1", xmlWriter);
+ } else {
+ xmlWriter.writeCharacters(local_return);
+ }
+
+ xmlWriter.writeEndElement();
+ }
+
+ xmlWriter.writeEndElement();
+ }
+
+ /**
+ * Util method to write an attribute with the ns prefix
+ */
+ private void writeAttribute(java.lang.String prefix,
+ java.lang.String namespace, java.lang.String attName,
+ java.lang.String attValue,
+ javax.xml.stream.XMLStreamWriter xmlWriter)
+ throws javax.xml.stream.XMLStreamException {
+ if (xmlWriter.getPrefix(namespace) == null) {
+ xmlWriter.writeNamespace(prefix, namespace);
+ xmlWriter.setPrefix(prefix, namespace);
+ }
+
+ xmlWriter.writeAttribute(namespace, attName, attValue);
+ }
+
+ /**
+ * Util method to write an attribute without the ns prefix
+ */
+ private void writeAttribute(java.lang.String namespace,
+ java.lang.String attName, java.lang.String attValue,
+ javax.xml.stream.XMLStreamWriter xmlWriter)
+ throws javax.xml.stream.XMLStreamException {
+ if (namespace.equals("")) {
+ xmlWriter.writeAttribute(attName, attValue);
+ } else {
+ registerPrefix(xmlWriter, namespace);
+ xmlWriter.writeAttribute(namespace, attName, attValue);
+ }
+ }
+
+ /**
+ * Util method to write an attribute without the ns prefix
+ */
+ private void writeQNameAttribute(java.lang.String namespace,
+ java.lang.String attName, javax.xml.namespace.QName qname,
+ javax.xml.stream.XMLStreamWriter xmlWriter)
+ throws javax.xml.stream.XMLStreamException {
+ java.lang.String attributeNamespace = qname.getNamespaceURI();
+ java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace);
+
+ if (attributePrefix == null) {
+ attributePrefix = registerPrefix(xmlWriter, attributeNamespace);
+ }
+
+ java.lang.String attributeValue;
+
+ if (attributePrefix.trim().length() > 0) {
+ attributeValue = attributePrefix + ":" + qname.getLocalPart();
+ } else {
+ attributeValue = qname.getLocalPart();
+ }
+
+ if (namespace.equals("")) {
+ xmlWriter.writeAttribute(attName, attributeValue);
+ } else {
+ registerPrefix(xmlWriter, namespace);
+ xmlWriter.writeAttribute(namespace, attName, attributeValue);
+ }
+ }
+
+ /**
+ * method to handle Qnames
+ */
+ private void writeQName(javax.xml.namespace.QName qname,
+ javax.xml.stream.XMLStreamWriter xmlWriter)
+ throws javax.xml.stream.XMLStreamException {
+ java.lang.String namespaceURI = qname.getNamespaceURI();
+
+ if (namespaceURI != null) {
+ java.lang.String prefix = xmlWriter.getPrefix(namespaceURI);
+
+ if (prefix == null) {
+ prefix = generatePrefix(namespaceURI);
+ xmlWriter.writeNamespace(prefix, namespaceURI);
+ xmlWriter.setPrefix(prefix, namespaceURI);
+ }
+
+ if (prefix.trim().length() > 0) {
+ xmlWriter.writeCharacters(prefix + ":" +
+ org.apache.axis2.databinding.utils.ConverterUtil.convertToString(
+ qname));
+ } else {
+ // i.e this is the default namespace
+ xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(
+ qname));
+ }
+ } else {
+ xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(
+ qname));
+ }
+ }
+
+ private void writeQNames(javax.xml.namespace.QName[] qnames,
+ javax.xml.stream.XMLStreamWriter xmlWriter)
+ throws javax.xml.stream.XMLStreamException {
+ if (qnames != null) {
+ // we have to store this data until last moment since it is not possible to write any
+ // namespace data after writing the charactor data
+ java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer();
+ java.lang.String namespaceURI = null;
+ java.lang.String prefix = null;
+
+ for (int i = 0; i < qnames.length; i++) {
+ if (i > 0) {
+ stringToWrite.append(" ");
+ }
+
+ namespaceURI = qnames[i].getNamespaceURI();
+
+ if (namespaceURI != null) {
+ prefix = xmlWriter.getPrefix(namespaceURI);
+
+ if ((prefix == null) || (prefix.length() == 0)) {
+ prefix = generatePrefix(namespaceURI);
+ xmlWriter.writeNamespace(prefix, namespaceURI);
+ xmlWriter.setPrefix(prefix, namespaceURI);
+ }
+
+ if (prefix.trim().length() > 0) {
+ stringToWrite.append(prefix).append(":")
+ .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(
+ qnames[i]));
+ } else {
+ stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(
+ qnames[i]));
+ }
+ } else {
+ stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(
+ qnames[i]));
+ }
+ }
+
+ xmlWriter.writeCharacters(stringToWrite.toString());
+ }
+ }
+
+ /**
+ * Register a namespace prefix
+ */
+ private java.lang.String registerPrefix(
+ javax.xml.stream.XMLStreamWriter xmlWriter,
+ java.lang.String namespace)
+ throws javax.xml.stream.XMLStreamException {
+ java.lang.String prefix = xmlWriter.getPrefix(namespace);
+
+ if (prefix == null) {
+ prefix = generatePrefix(namespace);
+
+ while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) {
+ prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
+ }
+
+ xmlWriter.writeNamespace(prefix, namespace);
+ xmlWriter.setPrefix(prefix, namespace);
+ }
+
+ return prefix;
+ }
+
+ /**
+ * databinding method to get an XML representation of this object
+ *
+ */
+ public javax.xml.stream.XMLStreamReader getPullParser(
+ javax.xml.namespace.QName qName)
+ throws org.apache.axis2.databinding.ADBException {
+ java.util.ArrayList elementList = new java.util.ArrayList();
+ java.util.ArrayList attribList = new java.util.ArrayList();
+
+ if (local_returnTracker) {
+ elementList.add(new javax.xml.namespace.QName(
+ "http://test.zhguo/xsd", "return"));
+
+ elementList.add((local_return == null) ? null
+ : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(
+ local_return));
+ }
+
+ return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName,
+ elementList.toArray(), attribList.toArray());
+ }
+
+ /**
+ * Factory class that keeps the parse method
+ */
+ public static class Factory {
+ /**
+ * static method to create the object
+ * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable
+ * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element
+ * Postcondition: If this object is an element, the reader is positioned at its end element
+ * If this object is a complex type, the reader is positioned at the end element of its outer element
+ */
+ public static CmdCOGExecuteResponse parse(
+ javax.xml.stream.XMLStreamReader reader)
+ throws java.lang.Exception {
+ CmdCOGExecuteResponse object = new CmdCOGExecuteResponse();
+
+ int event;
+ java.lang.String nillableValue = null;
+ java.lang.String prefix = "";
+ java.lang.String namespaceuri = "";
+
+ try {
+ while (!reader.isStartElement() && !reader.isEndElement())
+ reader.next();
+
+ if (reader.getAttributeValue(
+ "http://www.w3.org/2001/XMLSchema-instance",
+ "type") != null) {
+ java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance",
+ "type");
+
+ if (fullTypeName != null) {
+ java.lang.String nsPrefix = null;
+
+ if (fullTypeName.indexOf(":") > -1) {
+ nsPrefix = fullTypeName.substring(0,
+ fullTypeName.indexOf(":"));
+ }
+
+ nsPrefix = (nsPrefix == null) ? "" : nsPrefix;
+
+ java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(
+ ":") + 1);
+
+ if (!"cmdCOGExecuteResponse".equals(type)) {
+ //find namespace for the prefix
+ java.lang.String nsUri = reader.getNamespaceContext()
+ .getNamespaceURI(nsPrefix);
+
+ return (CmdCOGExecuteResponse) ExtensionMapper.getTypeObject(nsUri,
+ type, reader);
+ }
+ }
+ }
+
+ // Note all attributes that were handled. Used to differ normal attributes
+ // from anyAttributes.
+ java.util.Vector handledAttributes = new java.util.Vector();
+
+ reader.next();
+
+ while (!reader.isStartElement() && !reader.isEndElement())
+ reader.next();
+
+ if (reader.isStartElement() &&
+ new javax.xml.namespace.QName(
+ "http://test.zhguo/xsd", "return").equals(
+ reader.getName())) {
+ nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance",
+ "nil");
+
+ if (!"true".equals(nillableValue) &&
+ !"1".equals(nillableValue)) {
+ java.lang.String content = reader.getElementText();
+
+ object.set_return(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(
+ content));
+ } else {
+ reader.getElementText(); // throw away text nodes if any.
+ }
+
+ reader.next();
+ } // End of if for expected property start element
+
+ else {
+ }
+
+ while (!reader.isStartElement() && !reader.isEndElement())
+ reader.next();
+
+ if (reader.isStartElement()) {
+ // A start element we are not expecting indicates a trailing invalid property
+ throw new org.apache.axis2.databinding.ADBException(
+ "Unexpected subelement " + reader.getLocalName());
+ }
+ } catch (javax.xml.stream.XMLStreamException e) {
+ throw new java.lang.Exception(e);
+ }
+
+ return object;
+ }
+ } //end of factory class
+ }
+
+ public static class CmdCOGExecute implements org.apache.axis2.databinding.ADBBean {
+ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://test.zhguo/xsd",
+ "cmdCOGExecute", "ns1");
+
+ /**
+ * field for Workflow
+ */
+ protected java.lang.String localWorkflow;
+
+ /* This tracker boolean wil be used to detect whether the user called the set method
+ * for this attribute. It will be used to determine whether to include this field
+ * in the serialized XML
+ */
+ protected boolean localWorkflowTracker = false;
+
+ private static java.lang.String generatePrefix(
+ java.lang.String namespace) {
+ if (namespace.equals("http://test.zhguo/xsd")) {
+ return "ns1";
+ }
+
+ return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
+ }
+
+ /**
+ * Auto generated getter method
+ * @return java.lang.String
+ */
+ public java.lang.String getWorkflow() {
+ return localWorkflow;
+ }
+
+ /**
+ * Auto generated setter method
+ * @param param Workflow
+ */
+ public void setWorkflow(java.lang.String param) {
+ if (param != null) {
+ //update the setting tracker
+ localWorkflowTracker = true;
+ } else {
+ localWorkflowTracker = true;
+ }
+
+ this.localWorkflow = param;
+ }
+
+ /**
+ * isReaderMTOMAware
+ * @return true if the reader supports MTOM
+ */
+ public static boolean isReaderMTOMAware(
+ javax.xml.stream.XMLStreamReader reader) {
+ boolean isReaderMTOMAware = false;
+
+ try {
+ isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(
+ org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE));
+ } catch (java.lang.IllegalArgumentException e) {
+ isReaderMTOMAware = false;
+ }
+
+ return isReaderMTOMAware;
+ }
+
+ /**
+ *
+ * @param parentQName
+ * @param factory
+ * @return org.apache.axiom.om.OMElement
+ */
+ public org.apache.axiom.om.OMElement getOMElement(
+ final javax.xml.namespace.QName parentQName,
+ final org.apache.axiom.om.OMFactory factory)
+ throws org.apache.axis2.databinding.ADBException {
+ org.apache.axiom.om.OMDataSource dataSource = new org.apache.axis2.databinding.ADBDataSource(this,
+ MY_QNAME) {
+ public void serialize(
+ org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter)
+ throws javax.xml.stream.XMLStreamException {
+ CmdCOGExecute.this.serialize(MY_QNAME, factory,
+ xmlWriter);
+ }
+ };
+
+ return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME,
+ factory, dataSource);
+ }
+
+ public void serialize(final javax.xml.namespace.QName parentQName,
+ final org.apache.axiom.om.OMFactory factory,
+ org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter)
+ throws javax.xml.stream.XMLStreamException,
+ org.apache.axis2.databinding.ADBException {
+ java.lang.String prefix = null;
+ java.lang.String namespace = null;
+
+ prefix = parentQName.getPrefix();
+ namespace = parentQName.getNamespaceURI();
+
+ if (namespace != null) {
+ java.lang.String writerPrefix = xmlWriter.getPrefix(namespace);
+
+ if (writerPrefix != null) {
+ xmlWriter.writeStartElement(namespace,
+ parentQName.getLocalPart());
+ } else {
+ if (prefix == null) {
+ prefix = generatePrefix(namespace);
+ }
+
+ xmlWriter.writeStartElement(prefix,
+ parentQName.getLocalPart(), namespace);
+ xmlWriter.writeNamespace(prefix, namespace);
+ xmlWriter.setPrefix(prefix, namespace);
+ }
+ } else {
+ xmlWriter.writeStartElement(parentQName.getLocalPart());
+ }
+
+ if (localWorkflowTracker) {
+ namespace = "http://test.zhguo/xsd";
+
+ if (!namespace.equals("")) {
+ prefix = xmlWriter.getPrefix(namespace);
+
+ if (prefix == null) {
+ prefix = generatePrefix(namespace);
+
+ xmlWriter.writeStartElement(prefix, "workflow",
+ namespace);
+ xmlWriter.writeNamespace(prefix, namespace);
+ xmlWriter.setPrefix(prefix, namespace);
+ } else {
+ xmlWriter.writeStartElement(namespace, "workflow");
+ }
+ } else {
+ xmlWriter.writeStartElement("workflow");
+ }
+
+ if (localWorkflow == null) {
+ // write the nil attribute
+ writeAttribute("xsi",
+ "http://www.w3.org/2001/XMLSchema-instance", "nil",
+ "1", xmlWriter);
+ } else {
+ xmlWriter.writeCharacters(localWorkflow);
+ }
+
+ xmlWriter.writeEndElement();
+ }
+
+ xmlWriter.writeEndElement();
+ }
+
+ /**
+ * Util method to write an attribute with the ns prefix
+ */
+ private void writeAttribute(java.lang.String prefix,
+ java.lang.String namespace, java.lang.String attName,
+ java.lang.String attValue,
+ javax.xml.stream.XMLStreamWriter xmlWriter)
+ throws javax.xml.stream.XMLStreamException {
+ if (xmlWriter.getPrefix(namespace) == null) {
+ xmlWriter.writeNamespace(prefix, namespace);
+ xmlWriter.setPrefix(prefix, namespace);
+ }
+
+ xmlWriter.writeAttribute(namespace, attName, attValue);
+ }
+
+ /**
+ * Util method to write an attribute without the ns prefix
+ */
+ private void writeAttribute(java.lang.String namespace,
+ java.lang.String attName, java.lang.String attValue,
+ javax.xml.stream.XMLStreamWriter xmlWriter)
+ throws javax.xml.stream.XMLStreamException {
+ if (namespace.equals("")) {
+ xmlWriter.writeAttribute(attName, attValue);
+ } else {
+ registerPrefix(xmlWriter, namespace);
+ xmlWriter.writeAttribute(namespace, attName, attValue);
+ }
+ }
+
+ /**
+ * Util method to write an attribute without the ns prefix
+ */
+ private void writeQNameAttribute(java.lang.String namespace,
+ java.lang.String attName, javax.xml.namespace.QName qname,
+ javax.xml.stream.XMLStreamWriter xmlWriter)
+ throws javax.xml.stream.XMLStreamException {
+ java.lang.String attributeNamespace = qname.getNamespaceURI();
+ java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace);
+
+ if (attributePrefix == null) {
+ attributePrefix = registerPrefix(xmlWriter, attributeNamespace);
+ }
+
+ java.lang.String attributeValue;
+
+ if (attributePrefix.trim().length() > 0) {
+ attributeValue = attributePrefix + ":" + qname.getLocalPart();
+ } else {
+ attributeValue = qname.getLocalPart();
+ }
+
+ if (namespace.equals("")) {
+ xmlWriter.writeAttribute(attName, attributeValue);
+ } else {
+ registerPrefix(xmlWriter, namespace);
+ xmlWriter.writeAttribute(namespace, attName, attributeValue);
+ }
+ }
+
+ /**
+ * method to handle Qnames
+ */
+ private void writeQName(javax.xml.namespace.QName qname,
+ javax.xml.stream.XMLStreamWriter xmlWriter)
+ throws javax.xml.stream.XMLStreamException {
+ java.lang.String namespaceURI = qname.getNamespaceURI();
+
+ if (namespaceURI != null) {
+ java.lang.String prefix = xmlWriter.getPrefix(namespaceURI);
+
+ if (prefix == null) {
+ prefix = generatePrefix(namespaceURI);
+ xmlWriter.writeNamespace(prefix, namespaceURI);
+ xmlWriter.setPrefix(prefix, namespaceURI);
+ }
+
+ if (prefix.trim().length() > 0) {
+ xmlWriter.writeCharacters(prefix + ":" +
+ org.apache.axis2.databinding.utils.ConverterUtil.convertToString(
+ qname));
+ } else {
+ // i.e this is the default namespace
+ xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(
+ qname));
+ }
+ } else {
+ xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(
+ qname));
+ }
+ }
+
+ private void writeQNames(javax.xml.namespace.QName[] qnames,
+ javax.xml.stream.XMLStreamWriter xmlWriter)
+ throws javax.xml.stream.XMLStreamException {
+ if (qnames != null) {
+ // we have to store this data until last moment since it is not possible to write any
+ // namespace data after writing the charactor data
+ java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer();
+ java.lang.String namespaceURI = null;
+ java.lang.String prefix = null;
+
+ for (int i = 0; i < qnames.length; i++) {
+ if (i > 0) {
+ stringToWrite.append(" ");
+ }
+
+ namespaceURI = qnames[i].getNamespaceURI();
+
+ if (namespaceURI != null) {
+ prefix = xmlWriter.getPrefix(namespaceURI);
+
+ if ((prefix == null) || (prefix.length() == 0)) {
+ prefix = generatePrefix(namespaceURI);
+ xmlWriter.writeNamespace(prefix, namespaceURI);
+ xmlWriter.setPrefix(prefix, namespaceURI);
+ }
+
+ if (prefix.trim().length() > 0) {
+ stringToWrite.append(prefix).append(":")
+ .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(
+ qnames[i]));
+ } else {
+ stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(
+ qnames[i]));
+ }
+ } else {
+ stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(
+ qnames[i]));
+ }
+ }
+
+ xmlWriter.writeCharacters(stringToWrite.toString());
+ }
+ }
+
+ /**
+ * Register a namespace prefix
+ */
+ private java.lang.String registerPrefix(
+ javax.xml.stream.XMLStreamWriter xmlWriter,
+ java.lang.String namespace)
+ throws javax.xml.stream.XMLStreamException {
+ java.lang.String prefix = xmlWriter.getPrefix(namespace);
+
+ if (prefix == null) {
+ prefix = generatePrefix(namespace);
+
+ while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) {
+ prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
+ }
+
+ xmlWriter.writeNamespace(prefix, namespace);
+ xmlWriter.setPrefix(prefix, namespace);
+ }
+
+ return prefix;
+ }
+
+ /**
+ * databinding method to get an XML representation of this object
+ *
+ */
+ public javax.xml.stream.XMLStreamReader getPullParser(
+ javax.xml.namespace.QName qName)
+ throws org.apache.axis2.databinding.ADBException {
+ java.util.ArrayList elementList = new java.util.ArrayList();
+ java.util.ArrayList attribList = new java.util.ArrayList();
+
+ if (localWorkflowTracker) {
+ elementList.add(new javax.xml.namespace.QName(
+ "http://test.zhguo/xsd", "workflow"));
+
+ elementList.add((localWorkflow == null) ? null
+ : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(
+ localWorkflow));
+ }
+
+ return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName,
+ elementList.toArray(), attribList.toArray());
+ }
+
+ /**
+ * Factory class that keeps the parse method
+ */
+ public static class Factory {
+ /**
+ * static method to create the object
+...
[truncated message content] |
|
From: <las...@us...> - 2007-10-28 16:30:32
|
Revision: 1803
http://cogkit.svn.sourceforge.net/cogkit/?rev=1803&view=rev
Author: laszewsk
Date: 2007-10-28 09:30:23 -0700 (Sun, 28 Oct 2007)
Log Message:
-----------
moved jsolait to the lib
Modified Paths:
--------------
trunk/cyberaide/README.txt
Modified: trunk/cyberaide/README.txt
===================================================================
--- trunk/cyberaide/README.txt 2007-10-28 16:28:53 UTC (rev 1802)
+++ trunk/cyberaide/README.txt 2007-10-28 16:30:23 UTC (rev 1803)
@@ -16,6 +16,7 @@
========
doc - directory containing some documentation to this project
+lib/js - contains useful js libraries
src - directory containing the source code
src/jax-ws - directory containing the jax-ws test cases
src/axis2 - directory containing the axis2 code
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <las...@us...> - 2007-10-28 16:28:55
|
Revision: 1802
http://cogkit.svn.sourceforge.net/cogkit/?rev=1802&view=rev
Author: laszewsk
Date: 2007-10-28 09:28:53 -0700 (Sun, 28 Oct 2007)
Log Message:
-----------
moved jsolait to the lib
Added Paths:
-----------
trunk/cyberaide/lib/js/jsolait/
Removed Paths:
-------------
trunk/cyberaide/src/javascript/sample/COGJS/jsolait/
Copied: trunk/cyberaide/lib/js/jsolait (from rev 1799, trunk/cyberaide/src/javascript/sample/COGJS/jsolait)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <las...@us...> - 2007-10-28 16:26:22
|
Revision: 1801
http://cogkit.svn.sourceforge.net/cogkit/?rev=1801&view=rev
Author: laszewsk
Date: 2007-10-28 09:26:20 -0700 (Sun, 28 Oct 2007)
Log Message:
-----------
added Javascript lib
Added Paths:
-----------
trunk/cyberaide/lib/
trunk/cyberaide/lib/js/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <las...@us...> - 2007-10-28 16:19:01
|
Revision: 1800
http://cogkit.svn.sourceforge.net/cogkit/?rev=1800&view=rev
Author: laszewsk
Date: 2007-10-28 09:18:59 -0700 (Sun, 28 Oct 2007)
Log Message:
-----------
made the html pages better looking
Modified Paths:
--------------
trunk/cyberaide/src/javascript/sample/error.html
trunk/cyberaide/src/javascript/sample/login.html
Modified: trunk/cyberaide/src/javascript/sample/error.html
===================================================================
--- trunk/cyberaide/src/javascript/sample/error.html 2007-10-28 16:08:45 UTC (rev 1799)
+++ trunk/cyberaide/src/javascript/sample/error.html 2007-10-28 16:18:59 UTC (rev 1800)
@@ -1 +1,4 @@
-Username/Password wrong!!!
\ No newline at end of file
+
+<b> Authentication Failed </b>
+
+Unfortunatly, you have either used a wrong Username or Password.
Modified: trunk/cyberaide/src/javascript/sample/login.html
===================================================================
--- trunk/cyberaide/src/javascript/sample/login.html 2007-10-28 16:08:45 UTC (rev 1799)
+++ trunk/cyberaide/src/javascript/sample/login.html 2007-10-28 16:18:59 UTC (rev 1800)
@@ -1,10 +1,11 @@
<html>
- <head></head>
+ <head>Login</head>
<body>
+ <b> Login</b><br>
<form method="POST" action="j_security_check">
<input type="text" name="j_username">
<input type="text" name="j_password">
<input type="submit" value="Log in">
</form>
</body>
-</html>
\ No newline at end of file
+</html>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <las...@us...> - 2007-10-28 15:58:04
|
Revision: 1797
http://cogkit.svn.sourceforge.net/cogkit/?rev=1797&view=rev
Author: laszewsk
Date: 2007-10-28 08:57:56 -0700 (Sun, 28 Oct 2007)
Log Message:
-----------
added help
Modified Paths:
--------------
trunk/cyberaide/src/jaxws/Makefile
Modified: trunk/cyberaide/src/jaxws/Makefile
===================================================================
--- trunk/cyberaide/src/jaxws/Makefile 2007-10-28 15:47:14 UTC (rev 1796)
+++ trunk/cyberaide/src/jaxws/Makefile 2007-10-28 15:57:56 UTC (rev 1797)
@@ -1,3 +1,17 @@
+help:
+
+ @echo
+ @echo "Ussage"
+ @echo
+ @echo " make compile - compiles all the source code"
+ @echo " make service - generates the web service"
+ @echo " make start - starts the Web Service"
+ @echo
+ @echo "NOT YET IMPLEMENTED:"
+ @echo " make stop - stops the Web Service"
+ @echo " make stopall - stops all java processes"
+ @echo " make run - runs a client process"
+
all: compile service run
echo done
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <las...@us...> - 2007-10-28 14:58:51
|
Revision: 1788
http://cogkit.svn.sourceforge.net/cogkit/?rev=1788&view=rev
Author: laszewsk
Date: 2007-10-28 07:58:49 -0700 (Sun, 28 Oct 2007)
Log Message:
-----------
added dir structure
Added Paths:
-----------
trunk/cyberaide/doc/
trunk/cyberaide/doc/README.txt
trunk/cyberaide/src/
trunk/cyberaide/src/README.txt
trunk/cyberaide/src/axis2/
trunk/cyberaide/src/axis2/README.txt
trunk/cyberaide/src/javascript/
trunk/cyberaide/src/javascript/README.txt
trunk/cyberaide/src/jaxws/
trunk/cyberaide/src/jaxws/README.txt
Added: trunk/cyberaide/doc/README.txt
===================================================================
--- trunk/cyberaide/doc/README.txt (rev 0)
+++ trunk/cyberaide/doc/README.txt 2007-10-28 14:58:49 UTC (rev 1788)
@@ -0,0 +1 @@
+see ../README.txt
Added: trunk/cyberaide/src/README.txt
===================================================================
--- trunk/cyberaide/src/README.txt (rev 0)
+++ trunk/cyberaide/src/README.txt 2007-10-28 14:58:49 UTC (rev 1788)
@@ -0,0 +1 @@
+see ../README.txt
Added: trunk/cyberaide/src/axis2/README.txt
===================================================================
--- trunk/cyberaide/src/axis2/README.txt (rev 0)
+++ trunk/cyberaide/src/axis2/README.txt 2007-10-28 14:58:49 UTC (rev 1788)
@@ -0,0 +1 @@
+see ../../README.txt
Added: trunk/cyberaide/src/javascript/README.txt
===================================================================
--- trunk/cyberaide/src/javascript/README.txt (rev 0)
+++ trunk/cyberaide/src/javascript/README.txt 2007-10-28 14:58:49 UTC (rev 1788)
@@ -0,0 +1 @@
+see ../../README.txt
Added: trunk/cyberaide/src/jaxws/README.txt
===================================================================
--- trunk/cyberaide/src/jaxws/README.txt (rev 0)
+++ trunk/cyberaide/src/jaxws/README.txt 2007-10-28 14:58:49 UTC (rev 1788)
@@ -0,0 +1 @@
+see ../../README.txt
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <las...@us...> - 2007-10-28 14:58:16
|
Revision: 1787
http://cogkit.svn.sourceforge.net/cogkit/?rev=1787&view=rev
Author: laszewsk
Date: 2007-10-28 07:58:14 -0700 (Sun, 28 Oct 2007)
Log Message:
-----------
added dir structure
Modified Paths:
--------------
trunk/cyberaide/README.txt
Modified: trunk/cyberaide/README.txt
===================================================================
--- trunk/cyberaide/README.txt 2007-10-28 14:49:43 UTC (rev 1786)
+++ trunk/cyberaide/README.txt 2007-10-28 14:58:14 UTC (rev 1787)
@@ -1,2 +1,23 @@
-To check this code, using the following command:
-svn co http://cogkit.svn.sourceforge.net/svnroot/cogkit/trunk/cyberaide/
+REPOSITORY
+==========
+
+The code to this project is maintained in SVN. To check out this code
+please use an svn client and specify the following address
+
+ http://cogkit.svn.sourceforge.net/svnroot/cogkit/trunk/cyberaide/
+
+However if you are fortunate enough to have a commandline client, you
+can just say
+
+ svn co http://cogkit.svn.sourceforge.net/svnroot/cogkit/trunk/cyberaide/
+
+
+CONTENTS
+========
+
+doc - directory containing some documentation to this project
+src - directory containing the source code
+src/jax-ws - directory containing the jax-ws test cases
+src/axis2 - directory containing the axis2 code
+src/javascript dirctory containing the java script code
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <las...@us...> - 2007-10-28 14:39:19
|
Revision: 1785
http://cogkit.svn.sourceforge.net/cogkit/?rev=1785&view=rev
Author: laszewsk
Date: 2007-10-28 07:39:17 -0700 (Sun, 28 Oct 2007)
Log Message:
-----------
added cyberaide
Added Paths:
-----------
trunk/cyberaide/
trunk/cyberaide/README.txt
Added: trunk/cyberaide/README.txt
===================================================================
--- trunk/cyberaide/README.txt (rev 0)
+++ trunk/cyberaide/README.txt 2007-10-28 14:39:17 UTC (rev 1785)
@@ -0,0 +1 @@
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ha...@us...> - 2007-10-27 17:51:40
|
Revision: 1784
http://cogkit.svn.sourceforge.net/cogkit/?rev=1784&view=rev
Author: hategan
Date: 2007-10-27 10:51:36 -0700 (Sat, 27 Oct 2007)
Log Message:
-----------
added more descriptive information about where jglobus sources can be found
Modified Paths:
--------------
trunk/current/src/cog/modules/jglobus/src/README.txt
Modified: trunk/current/src/cog/modules/jglobus/src/README.txt
===================================================================
--- trunk/current/src/cog/modules/jglobus/src/README.txt 2007-10-19 20:49:30 UTC (rev 1783)
+++ trunk/current/src/cog/modules/jglobus/src/README.txt 2007-10-27 17:51:36 UTC (rev 1784)
@@ -1 +1,7 @@
-the sourec is in the jglobus tag
+The JGlobus sources can be found in the Globus CVS repository:
+
+cvs -d:pserver:ano...@cv...:/home/dsl/cog/CVS login
+cvs -d:pserver:ano...@cv...:/home/dsl/cog/CVS checkout jglobus
+
+For details see http://dev.globus.org/wiki/CoG_jglobus
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ha...@us...> - 2007-10-19 20:49:51
|
Revision: 1783
http://cogkit.svn.sourceforge.net/cogkit/?rev=1783&view=rev
Author: hategan
Date: 2007-10-19 13:49:30 -0700 (Fri, 19 Oct 2007)
Log Message:
-----------
better quoting and escaping
Modified Paths:
--------------
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/pbs/PBSExecutor.java
Modified: trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/pbs/PBSExecutor.java
===================================================================
--- trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/pbs/PBSExecutor.java 2007-10-19 20:26:38 UTC (rev 1782)
+++ trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/pbs/PBSExecutor.java 2007-10-19 20:49:30 UTC (rev 1783)
@@ -195,15 +195,35 @@
wr.write("/bin/echo $? >" + exitcodefile + '\n');
wr.close();
}
+
+ private static final boolean[] TRIGGERS;
+
+ static {
+ TRIGGERS = new boolean[128];
+ TRIGGERS[' '] = true;
+ TRIGGERS['\n'] = true;
+ TRIGGERS['\t'] = true;
+ TRIGGERS['|'] = true;
+ TRIGGERS['\\'] = true;
+ TRIGGERS['>'] = true;
+ TRIGGERS['<'] = true;
+ }
protected String quote(String s) {
if ("".equals(s)) {
return "\"\"";
}
boolean quotes = false;
- if (s.indexOf(' ') != -1) {
- quotes = true;
+ for (int i = 0; i < s.length(); i++) {
+ char c = s.charAt(i);
+ if (c < 128 && TRIGGERS[c]) {
+ quotes = true;
+ break;
+ }
}
+ if (!quotes) {
+ return s;
+ }
StringBuffer sb = new StringBuffer();
if (quotes) {
sb.append('"');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|