diff options
author | fmoga <fmoga@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-14 08:36:12 +0000 |
---|---|---|
committer | fmoga <fmoga@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-14 08:36:12 +0000 |
commit | a35869937e31242eb77543db1dc1a320c2046544 (patch) | |
tree | 32991a84b6f8bea21f7d8694df56203039dd3391 /sca-java-2.x/contrib/samples/comet-webapp/src/main/webapp/js/org.apache.tuscany.sca.cometComponentContext.js | |
parent | f76d1a0e59602bb2c6d513a909c67c012ff95091 (diff) |
Updated sample to use tuscany javascript servlet.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@985446 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sca-java-2.x/contrib/samples/comet-webapp/src/main/webapp/js/org.apache.tuscany.sca.cometComponentContext.js | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/sca-java-2.x/contrib/samples/comet-webapp/src/main/webapp/js/org.apache.tuscany.sca.cometComponentContext.js b/sca-java-2.x/contrib/samples/comet-webapp/src/main/webapp/js/org.apache.tuscany.sca.cometComponentContext.js deleted file mode 100644 index c8dc19d15a..0000000000 --- a/sca-java-2.x/contrib/samples/comet-webapp/src/main/webapp/js/org.apache.tuscany.sca.cometComponentContext.js +++ /dev/null @@ -1,55 +0,0 @@ -// TODO: Try isolating functional code one piece at a time by using it like in the inital version -var tuscanyComet = { - connectedEndpoint : null, - connect : function(transport) { - $.atmosphere.subscribe(document.location.toString() + 'tuscany-comet', - this.callback, - $.atmosphere.request = { - transport : transport - }); - this.connectedEndpoint = $.atmosphere.response; - }, - callAsync : function(url, callbackMethod) { - this.connectedEndpoint.push(document.location.toString() - + 'tuscany-comet/' + url, - null, - $.atmosphere.request = { - method : 'POST', - data : 'callback=' + callbackMethod.name - }); - }, - callback : function(response) { - var data = response.responseBody; - if (data.indexOf('#') != -1) { - var callbackMethod = data.substring(0, data.indexOf('#')); - data = data.substring(data.indexOf('#') + 1); - eval(callbackMethod + '("' + data + '");'); - } - } -}; - -// To be generated -var cometComponentContext = { - c1 : { - TemperatureService : { - getTemperatureCelsius : function(callbackMethod) { - tuscanyComet.callAsync('c1/TemperatureService/getTemperatureCelsius', callbackMethod); - }, - getTemperatureFahrenheit : function(callbackMethod) { - tuscanyComet.callAsync('c1/TemperatureService/getTemperatureFahrenheit', callbackMethod); - } - }, - HumidityService : { - getHumidity : function(callbackMethod) { - tuscanyComet.callAsync('c1/HumidityService/getHumidity', callbackMethod); - } - } - }, - c2 : { - PrecipitationService : { - getPrecipitation : function(callbackMethod) { - tuscanyComet.callAsync('c2/PrecipitationService/getPrecipitation', callbackMethod); - } - } - } -}
\ No newline at end of file |