[google-appengine] Re: Gae and visualization api
Hi Nick/All - sorry for the later reply on this - swamped recently. Ive tried urls like the following w/o success.: gv/file.csv http://appid.appspot.com/gv/file.csv Should I be uploading into/referencing something like Blobstore for my source data instead? Let me know what you think - thanks John On Oct 16, 5:37 pm, Nick Johnson nickjohn...@google.com wrote: On Fri, Oct 14, 2011 at 1:04 AM, uover82 uove...@gmail.com wrote: Hi Nick - thanks for the help! I believe I'm using a relative url, off of localhost. Here's a representative page: Yes, you're embedding the hostname - 'localhost' - in your page. That's an absolute URL, not a relative one, and will break when you're no longer running off localhost. -Nick Johnson !DOCTYPE html html head titleESE Pct./title !--Load the AJAX API-- script type=text/javascript src=http://www.google.com/jsapi;/ script script type=text/javascript // Load the Visualization API and the ready-made Google table visualization. google.load(visualization, 1, {packages: ['corechart,table,annotatedtimeline']}); // Set a callback to run when the API is loaded. google.setOnLoadCallback(init); // Send the queries to the data sources. function init() { query1 = new google.visualization.Query('ese?url=http://localhost: 8080/gv/11032010_trends_daily_p.csvpivot=1dtx=0tr=0'); query1.send(handleCsvDsResponse1); } // Handle the csv data source query response1 function handleCsvDsResponse1(response) { if (response.isError()) { alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage()); return; } var data = response.getDataTable(); var formatter_short = new google.visualization.DateFormat({formatType: 'short'}); formatter_short.format(data, 0); var chart = new google.visualization.LineChart(document.getElementById('chart_div')); chart.draw(data,{pointSize: 0, title: 'Event/Subevent (ESE) Analysis - Percentages', hAxis: {slantedTextAngle: 70}}); } /script /head body div id='chart_div' style='width: 1650px; height: 490px;'/div div id=csv_div style='width: 1650px; height: 400px;'/div /body /html The problem seems to be in the Query. Is there another url entry I should be using other than localhost? Also, I'm interested in GAE hosting the datasource rather than my host. Let me know what you think - thanks John On Oct 12, 5:33 pm, Nick Johnson nickjohn...@google.com wrote: Hi, It sounds like you've embedded the URL of your development environment into your code somewhere. Naturally, when deployed, your browser (or the Visualization API) can't access files stored on your local machine. Instead of hard-coding URLs, you should determine the host header from the current request - exactly how to do so depends on your framework - and use that. Alternately, you can use relative URLs if the Visualization API supports that. -Nick Johnson On Thu, Oct 13, 2011 at 5:39 AM, uover82 uove...@gmail.com wrote: Hi All, I'm developing an application using app engine and the google visualization api using java. It currently uses a static file (csv) located in war as a datasource. My app works fine in my local development server but fails with errors like the following after uploading: java.io.IOException: Could not fetch URL:http://localhost:8080/... csv path/filename Any ideas/thoughts on this? Let me know - thanks John -- You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to google-appengine@googlegroups.com . To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en. -- Nick Johnson, Developer Programs Engineer, App Engine -- You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to google-appengine@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en. -- Nick Johnson, Developer Programs Engineer, App Engine -- You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to google-appengine@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
[appengine-java] GAE and Visualization API
Hi All, I'm developing an app using GAE and the google visualization api in Java. I've deployed a csv underneath war to act as a datasource. The app runs on my local development server but fails with errors like the following after uploading: ESEDataSourceServlet generateDataTable: Couldn't read from url: http://localhost:8080/gv/11032010_trends_daily_p.csv java.io.IOException: Could not fetch URL: http://localhost:8080/gv/11032010_trends_daily_p.csv at com.google.appengine.api.urlfetch.URLFetchServiceImpl.convertApplicationException(URLFetchServiceImpl.java: 115) at com.google.appengine.api.urlfetch.URLFetchServiceImpl.fetch(URLFetchServiceImpl.java: 42) at com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler $Connection.fetchResponse(URLFetchServiceStreamHandler.java:418) at com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler $Connection.getInputStream(URLFetchServiceStreamHandler.java:297) at java.net.URL.openStream(URL.java:1029) at ESEDataSourceServlet.generateDataTable(ESEDataSourceServlet.java: 110) at com.google.visualization.datasource.DataSourceHelper.executeDataSourceServletFlow(Unknown Source) at com.google.visualization.datasource.DataSourceServlet.doGet(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java: 511) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1166) at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java: 97) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1157) at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java: 35) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1157) at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java: 43) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1157) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: 388) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: 216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java: 182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java: 765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: 418) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java: 249) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: 152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java: 542) at org.mortbay.jetty.HttpConnection $RequestHandler.headerComplete(HttpConnection.java:923) at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java: 76) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java: 135) at com.google.apphosting.runtime.JavaRuntime $RequestRunnable.run(JavaRuntime.java:393) at com.google.tracing.TraceContext $TraceContextRunnable.runInContext(TraceContext.java:449) at com.google.tracing.TraceContext$TraceContextRunnable $1.run(TraceContext.java:455) at com.google.tracing.TraceContext.runInContext(TraceContext.java: 695) at com.google.tracing.TraceContext $AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java: 333) at com.google.tracing.TraceContext $AbstractTraceContextCallback.runInInheritedContext(TraceContext.java: 325) at com.google.tracing.TraceContext $TraceContextRunnable.run(TraceContext.java:453) at com.google.apphosting.runtime.ThreadGroupPool $PoolEntry.run(ThreadGroupPool.java:160) at java.lang.Thread.run(Thread.java:679) I'm building/accessing pages like the following: !DOCTYPE html html head titleESE Pct./title !--Load the AJAX API-- script type=text/javascript src=http://www.google.com/jsapi;/ script script type=text/javascript // Load the Visualization API and the ready-made Google table visualization. //google.load('visualization', '1', {'packages': ['table,annotatedtimeline']}); google.load(visualization, 1, {packages: ['corechart,table,annotatedtimeline']}); // Set a callback to run when the API is loaded. google.setOnLoadCallback(init); // Send the queries to the data sources. function init() { query1 = new google.visualization.Query('ese?url=http://localhost:
[google-appengine] Re: Gae and visualization api
Hi Nick - thanks for the help! I believe I'm using a relative url, off of localhost. Here's a representative page: !DOCTYPE html html head titleESE Pct./title !--Load the AJAX API-- script type=text/javascript src=http://www.google.com/jsapi;/ script script type=text/javascript // Load the Visualization API and the ready-made Google table visualization. google.load(visualization, 1, {packages: ['corechart,table,annotatedtimeline']}); // Set a callback to run when the API is loaded. google.setOnLoadCallback(init); // Send the queries to the data sources. function init() { query1 = new google.visualization.Query('ese?url=http://localhost: 8080/gv/11032010_trends_daily_p.csvpivot=1dtx=0tr=0'); query1.send(handleCsvDsResponse1); } // Handle the csv data source query response1 function handleCsvDsResponse1(response) { if (response.isError()) { alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage()); return; } var data = response.getDataTable(); var formatter_short = new google.visualization.DateFormat({formatType: 'short'}); formatter_short.format(data, 0); var chart = new google.visualization.LineChart(document.getElementById('chart_div')); chart.draw(data,{pointSize: 0, title: 'Event/Subevent (ESE) Analysis - Percentages', hAxis: {slantedTextAngle: 70}}); } /script /head body div id='chart_div' style='width: 1650px; height: 490px;'/div div id=csv_div style='width: 1650px; height: 400px;'/div /body /html The problem seems to be in the Query. Is there another url entry I should be using other than localhost? Also, I'm interested in GAE hosting the datasource rather than my host. Let me know what you think - thanks John On Oct 12, 5:33 pm, Nick Johnson nickjohn...@google.com wrote: Hi, It sounds like you've embedded the URL of your development environment into your code somewhere. Naturally, when deployed, your browser (or the Visualization API) can't access files stored on your local machine. Instead of hard-coding URLs, you should determine the host header from the current request - exactly how to do so depends on your framework - and use that. Alternately, you can use relative URLs if the Visualization API supports that. -Nick Johnson On Thu, Oct 13, 2011 at 5:39 AM, uover82 uove...@gmail.com wrote: Hi All, I'm developing an application using app engine and the google visualization api using java. It currently uses a static file (csv) located in war as a datasource. My app works fine in my local development server but fails with errors like the following after uploading: java.io.IOException: Could not fetch URL:http://localhost:8080/... csv path/filename Any ideas/thoughts on this? Let me know - thanks John -- You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to google-appengine@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en. -- Nick Johnson, Developer Programs Engineer, App Engine -- You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to google-appengine@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
[google-appengine] Gae and visualization api
Hi All, I'm developing an application using app engine and the google visualization api using java. It currently uses a static file (csv) located in war as a datasource. My app works fine in my local development server but fails with errors like the following after uploading: java.io.IOException: Could not fetch URL: http://localhost:8080/ ... csv path/filename Any ideas/thoughts on this? Let me know - thanks John -- You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to google-appengine@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.