Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 5933 invoked from network); 31 Jul 2010 22:34:45 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 31 Jul 2010 22:34:45 -0000 Received: (qmail 789 invoked by uid 500); 31 Jul 2010 22:34:45 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 687 invoked by uid 500); 31 Jul 2010 22:34:44 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 680 invoked by uid 99); 31 Jul 2010 22:34:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 Jul 2010 22:34:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 Jul 2010 22:34:39 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BB00523889B9; Sat, 31 Jul 2010 22:33:21 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r981097 - in /commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src: javascript/scxml/cgf/util/external_communications/ xslt/ir-compiler/external_communications/ Date: Sat, 31 Jul 2010 22:33:21 -0000 To: commits@commons.apache.org From: jbeard@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100731223321.BB00523889B9@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jbeard Date: Sat Jul 31 22:33:21 2010 New Revision: 981097 URL: http://svn.apache.org/viewvc?rev=981097&view=rev Log: Initial commit of code for external communications module. This code is untested, but should generate message templates. Added: commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/javascript/scxml/cgf/util/external_communications/ commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/javascript/scxml/cgf/util/external_communications/jquery.js (with props) commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/javascript/scxml/cgf/util/external_communications/rhino.js (with props) commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/ commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/filterParams.xsl (with props) commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/genMessageTemplates.xsl (with props) commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/sendToMessageTemplate.xsl (with props) commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/splitNamelist.xsl (with props) Added: commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/javascript/scxml/cgf/util/external_communications/jquery.js URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/javascript/scxml/cgf/util/external_communications/jquery.js?rev=981097&view=auto ============================================================================== --- commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/javascript/scxml/cgf/util/external_communications/jquery.js (added) +++ commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/javascript/scxml/cgf/util/external_communications/jquery.js Sat Jul 31 22:33:21 2010 @@ -0,0 +1,32 @@ +require.def("src/javascript/scxml/cgf/util/external_communications/jquery", +["lib/js/jquery.js"], +function(){ + //fixme: json or xml? how do we handle the difference for get? for post? + return { + get : function(url){ + var toReturn; + $.ajax({ + url:url, + success: function(result) { + toReturn = result; + }, + async:false + }); + return toReturn; + }, + post : function(url,data){ + var toReturn; + $.ajax({ + type:'POST', + url:url, + success: function(result) { + toReturn = result; + }, + data:data, + async:false + }); + return toReturn; + } + } +}) + Propchange: commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/javascript/scxml/cgf/util/external_communications/jquery.js ------------------------------------------------------------------------------ svn:eol-style = native Added: commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/javascript/scxml/cgf/util/external_communications/rhino.js URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/javascript/scxml/cgf/util/external_communications/rhino.js?rev=981097&view=auto ============================================================================== --- commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/javascript/scxml/cgf/util/external_communications/rhino.js (added) +++ commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/javascript/scxml/cgf/util/external_communications/rhino.js Sat Jul 31 22:33:21 2010 @@ -0,0 +1,53 @@ +require.def("src/javascript/scxml/cgf/util/external_communications/rhino", +function(){ + //fixme: json or xml? how do we handle the difference for get? for post? + + importClass(Packages.org.apache.http.NameValuePair); + importClass(Packages.org.apache.http.HttpResponse); + importClass(Packages.org.apache.http.protocol.BasicHttpContext); + importClass(Packages.org.apache.http.protocol.HttpContext); + importClass(Packages.org.apache.http.client.methods.HttpGet); + importClass(Packages.org.apache.http.client.methods.HttpPost); + importClass(Packages.org.apache.http.client.entity.UrlEncodedFormEntity); + importClass(Packages.org.apache.http.util.EntityUtils); + importClass(Packages.org.apache.http.impl.client.DefaultHttpClient); + importClass(Packages.org.apache.http.message.BasicNameValuePair); + + return { + get : function(url){ + var toReturn = ""; + + var httpget = new HttpGet(url); + + httpclient = new DefaultHttpClient(); + localContext = new BasicHttpContext(); + + response = httpclient.execute(httpget, localContext); + + entity = response.getEntity(); + if (entity != null) { + toReturn = String(EntityUtils.toString(entity)); + } + + return toReturn; + }, + post : function(url,data){ + + var httpPost = new HttpPost(url); + + var httpclient = new DefaultHttpClient(); + var localContext = new BasicHttpContext(); + + /* + List formparams = new ArrayList(); + formparams.add(new BasicNameValuePair("x", "200")); + UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formparams, "UTF-8"); + + httpPost.setEntity(entity); + */ + + HttpResponse response = httpclient.execute(httpPost, localContext); + } + } +}) + Propchange: commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/javascript/scxml/cgf/util/external_communications/rhino.js ------------------------------------------------------------------------------ svn:eol-style = native Added: commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/filterParams.xsl URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/filterParams.xsl?rev=981097&view=auto ============================================================================== --- commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/filterParams.xsl (added) +++ commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/filterParams.xsl Sat Jul 31 22:33:21 2010 @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Propchange: commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/filterParams.xsl ------------------------------------------------------------------------------ svn:eol-style = native Added: commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/genMessageTemplates.xsl URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/genMessageTemplates.xsl?rev=981097&view=auto ============================================================================== --- commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/genMessageTemplates.xsl (added) +++ commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/genMessageTemplates.xsl Sat Jul 31 22:33:21 2010 @@ -0,0 +1,85 @@ + + + + + + + + function( + + + + , + + + ){ + return ' + ' + } + + + + + + < + + + + + xmlns + + : + + + =' + + + + ' + + + + + + + =' + + + + ' + + + + > + + + + + + </ + + > + + + + Propchange: commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/genMessageTemplates.xsl ------------------------------------------------------------------------------ svn:eol-style = native Added: commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/sendToMessageTemplate.xsl URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/sendToMessageTemplate.xsl?rev=981097&view=auto ============================================================================== --- commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/sendToMessageTemplate.xsl (added) +++ commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/sendToMessageTemplate.xsl Sat Jul 31 22:33:21 2010 @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Propchange: commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/sendToMessageTemplate.xsl ------------------------------------------------------------------------------ svn:eol-style = native Added: commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/splitNamelist.xsl URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/splitNamelist.xsl?rev=981097&view=auto ============================================================================== --- commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/splitNamelist.xsl (added) +++ commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/splitNamelist.xsl Sat Jul 31 22:33:21 2010 @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Propchange: commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-143_external-communications-module/src/xslt/ir-compiler/external_communications/splitNamelist.xsl ------------------------------------------------------------------------------ svn:eol-style = native