[appengine-java] Re: open source pdf engine for GAE
Hi Vik, This should be possible with appengine and Google Docs, but it may not be easy. For any Google account you have 1GB of Google Docs usage free and additional storage is $0.25 per GB, so you could be creative with storing files (securely) and or moving them to other backup. Here's how it could be done: For 'creating a PDF' you would actually create or edit a Google Docs document on the fly and keep that stored in Google Docs. (Google Documents List API... Creating a permanent generic version of the document and making a copy and editing the copy on the fly would be easiest.) In the email to the donor, you would give them a url that they will use to download the file as a pdf. That url for the pdf would not be the Google Docs url, but would be a url to your appengine application. That specific delivery url would have to not use Google authentication (though the rest of your urls would continue to). For that delivery url, you would have to implement your own programatic authentication and authorization for that delivery url and supply donor specific auth/ auth to the donor in an easy to use manner. Behind the scenes in your app: Since your application is already authenticated with Google and authorized to access your Google Docs, you would read the PDF export stream directly into the response stream to the donor. A brief look at the Google Documents List API suggests that that's possible, but I haven't tried it. Cheers, Nichole On May 29, 9:07 pm, Vik vik@gmail.com wrote: Hie Nichole My use case is different. We are a non profit and our systems wants to implement a automatic appreciation certification mailing facility to the blood donor after blood donation. So, I need to create the pdf certificate on the fly and email it to the blood donor. So the google docs approach wont help us. Thankx and Regards Vik Founderhttp://www.sakshum.orghttp://blog.sakshum.org On Mon, May 30, 2011 at 9:20 AM, Nichole nichole.k...@gmail.com wrote: I haven't tried this programmatically, but you can export a Google Docs document in pdf format. If it's useful to store your files or a generic version of the file which you can copy and specialize as a Google Doc, then export as pdf might be a good way to create a PDF file. I'd be interested in hearing how well that works for you if you do implement it. On May 20, 10:42 am, Vik vik@gmail.com wrote: any further advise on this please? Thankx and Regards Vik Founderhttp://www.sakshum.orghttp://blog.sakshum.org On Wed, May 18, 2011 at 12:03 PM, Vik vik@gmail.com wrote: Hie Even below code fails for the same exception ByteArrayOutputStream out = new ByteArrayOutputStream(); PDF pdf; try { pdf = new PDF(out); log.info(#1); pdf.setTitle(Using TextColumn and Paragraph classes); pdf.setSubject(Examples); pdf.setAuthor(Innovatics Inc.); log.info(#2); Page page = new Page(pdf, Letter.PORTRAIT); pdf.flush(); Multipart mp = new MimeMultipart(); MimeBodyPart htmlPart = new MimeBodyPart(); htmlPart.setFileName(whatever.pdf); log.info(#7); htmlPart.setContent(out.toByteArray(), application/pdf); mp.addBodyPart(htmlPart); log.info(#8); Properties props = new Properties(); Session session = Session.getDefaultInstance(props, null); Message msg = new MimeMessage(session); msg.setContent(mp); msg.setFrom(new InternetAddress(vik@gmail.com)); msg.addRecipient(Message.RecipientType.TO, new InternetAddress(vik@gmail.com)); msg.setSubject(testing PDF system); Transport.send(msg); Thankx and Regards Vik Founder http://www.sakshum.org http://blog.sakshum.org On Wed, May 18, 2011 at 10:25 AM, Stephen Johnson onepagewo...@gmail.comwrote: Try not adding the image or the font. Just try to get as simple a PDF working as possible. On Tue, May 17, 2011 at 9:47 PM, Vik vik@gmail.com wrote: Hie I am doing exact same. Here is the code: log.info(start of PDFTest:); //OutputStream out = resp.getOutputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream(); PDF pdf; try { pdf = new PDF(out); log.info(#1); pdf.setTitle(Using TextColumn and Paragraph classes); pdf.setSubject(Examples); pdf.setAuthor(Innovatics Inc.); log.info(#2); String fileName = images/share_facebook.png; Image image1 = new Image(pdf, new BufferedInputStream( getClass().getResourceAsStream(fileName)), ImageType.PNG); log.info(#3);
[appengine-java] Gmail IMAP and SMTP using OAuth
Hi Guys, Anyone knows about integrating Gmail IMAP and SMTP using OAuth on GAE. Both of them using sockets. Also if I use GAE Mail java API to send mails, from address(sender) becoming an issue as only the app developers email address can be added. Basically my app is integrated to Google APPS and I am looking to send mails on behalf of the logged in user. Any thoughts on this? Thanks in advance George Simon -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] [mapreduce] Global limitation on concurrent mapper jobs performance
We are testing the mass creation of a very large number of entities in the datastore (several billions). We use csv files (approx. 100 Mb each), uploaded into the blobstore, and run mapper jobs on them. Our goal : minimize the overall execution time (whatever the cost). There seems to be an overall performance limitation we can not overcome, even when playing with different parameters : . Set a high value to mapreduce.mapper.inputprocessingrate (for instance 1,000,000) . Set a high value to mapreduce.mapper.shardcount (for instance 20, or 50) . Launch concurrent mapper jobs in parallel (for instance 20 jobs, 1 job per file) The overall performance sticks around 500 entities/second. Is there a specific limitation related to the blobstore reads we should be aware of? Or has someone any tips about improving this perf? -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Is Google planning to offer HR datastore migration feature
I would like to switch from M/S datastore to HR datastore, buut how should I do this? Is Google planning to offer HR datastore migration feature? -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: FileWriteChannel writeChannel throwing java.io.IOException?
The error: 1. E2011-05-27 07:41:59.139 org.gonevertical.core.server.jdo.data.base64.WriteBase64 writeToBlob: writeToBlob(): Error 5: java.io.IOException 2. E2011-05-27 07:41:59.149 org.gonevertical.core.server.jdo.data.base64.WriteBase64 decode: com.google.appengine.api.datastore.DatastoreTimeoutException: The datastore operation timed out, or the data was temporarily unavailable. at com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java:46) at com.google.appengine.api.datastore.DatastoreApiHelper$1.convertException(DatastoreApiHelper.java:98) at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:69) at com.google.appengine.api.datastore.FutureHelper.getInternal(FutureHelper.java:71) at com.google.appengine.api.datastore.FutureHelper.quietGet(FutureHelper.java:32) at com.google.appengine.api.datastore.QueryResultsSourceImpl.loadMoreEntities(QueryResultsSourceImpl.java:69) at com.google.appengine.api.datastore.QueryResultsSourceImpl.loadMoreEntities(QueryResultsSourceImpl.java:56) at com.google.appengine.api.datastore.QueryResultIteratorImpl.ensureLoaded(QueryResultIteratorImpl.java:156) at com.google.appengine.api.datastore.QueryResultIteratorImpl.hasNext(QueryResultIteratorImpl.java:65) at org.gonevertical.core.server.jdo.data.base64.WriteBase64.decode(WriteBase64.java:219) at org.gonevertical.core.server.jdo.data.base64.WriteBase64.decodeToBlob(WriteBase64.java:87) at org.gonevertical.core.server.jdo.data.BlobTmpJdo.writeTmpBlob(BlobTmpJdo.java:335) at org.gonevertical.core.server.jdo.data.BlobTmpJdo.writeTmpBlob(BlobTmpJdo.java:321) at org.gonevertical.core.server.servlet.Servlet_Task.startWriteToBlob(Servlet_Task.java:106) at org.gonevertical.core.server.servlet.Servlet_Task.doGet(Servlet_Task.java:92) 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:238) 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.handleRequest(JavaRuntime.java:260) at com.google.apphosting.base.RuntimePb$EvaluationRuntime$2.handleRequest(RuntimePb.java:9669) at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:439) at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:573) at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:448) at com.google.tracing.TraceContext.runInContext(TraceContext.java:688) at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:326) at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:318) at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:446) at
[appengine-java] Channel API (Java) doesn't work locally, but in production mode.
Hey folks. I know that I'm not the first one who is facing this problem. There is a similar thread, but I don't think it's exactly the same problem. I'm working on a project including GAE + GWT. We are using gwt-gae-channel (http://code.google.com/p/gwt-gae- channel/) to send different messages from the server to the client (basically we are implementing a real life game for mobile devices.) I have read and understood the Channel API documentation and we are implementing the channel creation in the same way as proposed. Also gwt-gae-channel has been introduced on the client side like described in gwt-gae-channel wiki. The interesting part: In production mode (app is deployed to GAE) everything works just fine (Users are able to chat, server sends notifications, etc.) However the channel doesn't work locally. We use Maven and start our App locally with the maven command gwt:run Here is the first exception which occurs after creating the channel on the server side: [ERROR] 2011-05-28 11:00:48.523:WARN::/_ah/channel/dev [ERROR] com.google.appengine.api.channel.dev.LocalChannelFailureException: Channel for application key null not found. [ERROR] at com.google.appengine.api.channel.dev.ChannelManager.getChannel(ChannelManager.java: 58) However on server side the channel seems to be created. When sending messages to a client there is no warning or exception. The exception above occurs after creating the channel by some other thread (I think it's the long-polling thread which works in the background!?!?!?) So this exception is not thrown by any of our code lines, but by some other thread of the local test environment. Here is what we do on server side when creating the channel (just the important lines): String clientId = getChannelIdFromUserKey(userKey); //userKey = the datastore key which is then hashed to get a short client id used to create the channel String channelToken = channelService.createChannel(clientId); //the token is then passed to the client return channelToken; The client receives this token (a gwt-dispatch command triggers the channel creation and returns the token): ChannelFactory.createChannel(channelToken, new ChannelCreatedCallback() { @Override public void onChannelCreated(Channel channel) { . } } Which leads to: [INFO] Socket error. [INFO] Channel for application key null not found. I really hope somebody out there can help me/us. It is really, really important that we fix this bug soon, as we have just few weeks left to finish the project (well, it's an university thing ;) ) Kind regards, Z -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Problem With JPA and Google Engine
Hello, i have a problem With JPA and Google Engine, i have one trial web application http://jocual.appspot.com/index.jsp and it works good with JDO but when i use JPA it report the next error: Caused by: java.lang.NoClassDefFoundError: javax/persistence/spi/ ProviderUtil at com.google.appengine.runtime.Request.process-2e0607ad3b5a947f(Request.java) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:132) at javax.persistence.Persistence.createFactory(Persistence.java:160) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java: 112) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java: 66) at com.presentacion.EMF.clinit(EMF.java:6) at com.presentacion.PersistenceActionJPA.execute(PersistenceActionJPA.java: 38) And i have a persistence.xml and all the anotations and all the jar´s incluyed in the proyect, i dont know what is happen? -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Ghost entities. I can see entities in the 'Datastore Viewer' but they doesn't appear with a query
Hi, I have a very strange problem. In my database I have Entities I can see in the Datastore Viewer but do not appear in queries. It only happens with certain entities, but I have no way of knowing which. The solution to appear is very simple yet very strange. I edit the entity from the datastore viewer, and without any modifications, I click 'Save Entity'. Now automatically appear in the queries. This seems a index problem, but I have deleted all the index and have been recreated. The problem persists. It seems a serious problem in the datastore. The data is there, but I can not find them. This seems to occur sporadically and randomly in a block of entities that have been recorded at the same time. Example of entity 'Fichaje' author value: myem...@gmail.com type: string date -MM-DD HH:MM:SS value: 2011-05-19 20:01:00 type: gd:when With the query SELECT * FROM Fichaje WHERE author='myem...@gmail.com' the entity doesn't appear. But I edit the entity from datastore viewer and with no changes click in 'Save Entity'. Now automatically appear in the query. any ideas? Thank you very much Sorry for my bad English. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Getting STREAMED error whne trying to read InputStream
I am getting a STREAMED error when trying to read the InputStream from a POSTed HttpServletRequest. It worked perfectly in 1.3, but it is not working in 1.5. The following is the code: public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { String posted_data = ; //read all the contents of the posted data into a string final char[] buffer = new char[0x1]; StringBuilder posted_data_builder = new StringBuilder(); BufferedReader in=request.getReader(); int d; while((d=in.read()) != -1){ posted_data_builder.append((char)d); } posted_data = posted_data_builder.toString(); } Am I doing something wrong, or is this a bug? Thank you -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Problems uploading to app engine
I'm a developer on the application ridersofgilead, but when I try to use the toolbar inside eclipse to deploy the application I get this error Unable to update: java.io.IOException: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=ridersofgileadversion=3; 404 Not Found This application does not exist (app_id=u'ridersofgilead'). But when I run appcfg.sh update war and provide my email address and password at the script prompts it uploads correctly. If it matters the application is registered under a google apps domain and my email address is under a seperate google apps domain. Ryan -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Checking if I understand transactions correctly
I am writing some code that needs to do a rollback on a secondary object/table should the transaction fail, I believe this can be done via entity groups, however I am not sure if this is how it would be implemented. I have written some sample code to check if what I would be doing is correct? Would the following code ensure the Account object is never updated if the insert of the TransactionRecord object fails. public void addTransaction(String account, Double value, String description, Date date) throws EntityNotFoundException { DatastoreService datastore = DatastoreServiceFactory.getDatastoreService(); int retries = 3; while (true) { Transaction txn = datastore.beginTransaction(); try { // Update the bank balance Key key = KeyFactory.createKey(Account, account); Entity e = datastore.get(key); Double balance = (Double) e.getProperty(balance); balance += value; e.setProperty(balance, value); datastore.put(e); // Record transaction details Entity d = new Entity(TransactionRecord, key); d.setProperty(account_key, key); d.setProperty(date, date); d.setProperty(value, value); d.setProperty(description, description); txn.commit(); break; } catch (ConcurrentModificationException e) { if (retries == 0) throw e; --retries; } finally { if (txn.isActive()) txn.rollback(); } } } Thanks for any feedback! -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Would the following create problems for me in Google app engine?
I have a Java application that has approximately 100 users. In this application there is a table that would have the equivalent of 100,000 entities added per day, ie 100 users each doing 1000 inserts per day. From time to time I will need to output a CSV file that shows one months worth of entries for a particular user, ie would result in a file with 30,000 entries. If I understand correctly, The entities would be given an anscestor record to allow querying the transactions by user, and then filter them by month. Am I going to have timeout issues with querying by user+month, and for in the case where I need to export a month's worth of data? Any feedback much appreciated! -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Unable to find the webapp directory Files\GoogleAppEngine\appengine- java-sdk-1.3.0\demos\guestbook\war
hi i have just installed the java sdk. after extracting the files from the appengine-java-sdk-1.3.0 jar, I am trying to start the server with at the command line with the following: C:\Program Files\GoogleAppEngine\appengine-java- sdk-1.3.0\bindev_appserver.cmd C:\Program Files\GoogleAppEngine \appengine-java-sdk-1.3.0\demos\guestbook\war I get the following error message: Unable to find the webapp directory Files\GoogleAppEngine\appengine- java-sdk-1.3.0\demos\guestbook\war can anyone help? Thx -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Unable to find the webapp directory
hi i have just installed the java sdk. after extracting the files from the appengine-java-sdk-1.3.0 jar, I am trying to start the server with at the command line with the following: C:\Program Files\GoogleAppEngine\appengine-java- sdk-1.3.0\bindev_appserver.cmd C:\Program Files\GoogleAppEngine \appengine-java-sdk-1.3.0\demos\guestbook\war I get the following error message: Unable to find the webapp directory Files\GoogleAppEngine\appengine- java-sdk-1.3.0\demos\guestbook\war can anyone help? Thx -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Simple data model
Hi there, I can not get my head around the datastore. Just want to have a list of users Entity: Users - name - Address - Read books // how to link to Books in low-level api Entiry: Books - History - Sports - Religion Should Books be in the Entity group, or by itself and then select from the Category list and add a property on user with a category. Entity = Object Ahh, I dont get it... help :-) Thanks -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.