[appengine-java] Re: GAE or EC2
Just to reply to the point about persistence: > 1, GAE > The benefits are obvious. However, it is also locking you inyou > don't have much control over it. If you are unhappy later, you will > have to redo the persistence layer and migrate data etc. If you are careful, and set it as a design objective from the start then you can create a portable persistence layer. We do this using JDO and develope and test on GAE and Tomcat/MySql, which I think will also allow us to cover EC2/S3 when we can get around to it. -- 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-j...@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.
Re: [appengine-java] Re: GAE or EC2
do you have specific point to be careful in schema design? or pointers to any read? thanks. On Sun, Nov 14, 2010 at 11:56 AM, andrew wrote: > Just to reply to the point about persistence: > > > 1, GAE > > The benefits are obvious. However, it is also locking you inyou > > don't have much control over it. If you are unhappy later, you will > > have to redo the persistence layer and migrate data etc. > > If you are careful, and set it as a design objective from the start > then you can create a portable persistence layer. > > We do this using JDO and develope and test on GAE and Tomcat/MySql, > which I think will also allow us to cover EC2/S3 when we can get > around to it. > > -- > 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-j...@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. > > -- 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-j...@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] How to send spreadsheet as an attachment on Google App Engine?
I have an application which is deployed on the Google App Engine. This application also works with the Google spreadsheet API to update a couple of spreadsheets. Once the user is done with changing the spreadsheet data, I want to email the resultant spreadsheet (not the link) to the manager. Is there a way to attach the spreadsheet as an attachment ? Since the app engine supports multi-part for attachment, http://code.google.com/appengine/docs/java/mail/usingjavamail.html#Multi_Part_Messages I guess I would need to get the content of the spreadsheet back as a byte []. How can I do that? Is there any other way to approach this problem? Regards | Vikas www.inphina.com -- 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-j...@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.
Re: [appengine-java] How to send spreadsheet as an attachment on Google App Engine?
Vikas, I have a servlet that uses JXL to build an Excel spreadsheet and send it via email. Below is the code. However, I do not export any of the data from Google Spreadsheets. If the Google Spreadsheets API doesn't let you get the byte[], you'd probably need a JXL <-> Google Spreadsheets adapter that cycles through all sheets and all cells and duplicates them to the other format. Hope this helps, MG import java.io.ByteArrayOutputStream; import java.io.IOException; import java.net.URLEncoder; import java.util.Properties; import javax.activation.DataHandler; import javax.activation.DataSource; import javax.mail.Address; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Multipart; import javax.mail.Part; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeBodyPart; import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeMultipart; import javax.mail.util.ByteArrayDataSource; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import jxl.Workbook; import jxl.write.Label; import jxl.write.WritableSheet; import jxl.write.WritableWorkbook; import jxl.write.WriteException; import jxl.write.biff.RowsExceededException; import com.google.appengine.api.utils.SystemProperty; <.. snip...> public class SendMailTask extends HttpServlet { private static final long serialVersionUID = 1L; public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String requestId = request.getParameter("requestId"); EmailTrackingRequest req = dao.getRequest(Long.valueOf(requestId)); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); WritableWorkbook workbookOut = Workbook.createWorkbook(outputStream); WritableSheet sheetOut = workbookOut.createSheet("First Sheet", 0); Label salesOrderIdLabel = new Label (0,0,"Sales Order ID"); Label shipDateLabel = new Label (1,0,"Ship Date"); Label trackingNumLabel = new Label (2,0, "Tracking Number"); Label scanDateLabel = new Label(3,0, "Scan Date"); Label scanTimeLabel = new Label(4,0, "Scan Time"); Label scanOffsetLabel = new Label(5,0, "GMT Offset"); Label scanStatusLabel = new Label(6,0, "Scan Status"); Label scanLocLabel = new Label(7,0, "Location"); Label scanCommentsLabel = new Label(8,0, "Comments"); try { sheetOut.addCell(salesOrderIdLabel); sheetOut.addCell(shipDateLabel); sheetOut.addCell(trackingNumLabel); sheetOut.addCell(scanDateLabel); sheetOut.addCell(scanTimeLabel); sheetOut.addCell(scanOffsetLabel); sheetOut.addCell(scanStatusLabel); sheetOut.addCell(scanLocLabel); sheetOut.addCell(scanCommentsLabel); int currentRow = 1; for (Shipment s : req.getShipments()) { sheetOut.addCell(new Label (0, currentRow, s.getSalesOrderId())); sheetOut.addCell(new Label (1, currentRow, s.getShipDate().toString())); sheetOut.addCell(new Label (2, currentRow, s.getTrackingNumber())); for (Scan scan : s.getScans()) { //_log.warning ("scan status: " + scan.getStatus()); Label scanDate = new Label(3, currentRow, scan.getScanDate()); Label scanTime = new Label(4, currentRow, scan.getScanTime()); Label scanOffset = new Label(5, currentRow, scan.getOffset()); Label scanStatus = new Label(6, currentRow, scan.getScanStatus()); Label scanLoc = new Label(7, currentRow, scan.getLoc()); Label scanComments = new Label(8, currentRow, scan.getComments()); sheetOut.addCell(scanDate); sheetOut.addCell(scanTime); sheetOut.addCell(scanOffset); sheetOut.addCell(scanStatus);
[appengine-java] Re: How to write a JPA unit test for GAE?
hi vikas nice blog u have there. However i cant reproduce your results the unit test with spring. can u post your spring config to see what i have done wrong. thanks -lp On Nov 13, 3:58 pm, Vikas Hazrati wrote: > You could get more information on the way we set up our testing infra > here > > http://thoughts.inphina.com/2010/06/28/unit-testing-maven-based-jpa-a... > > Regards | Vikaswww.inphina.com -- 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-j...@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] Bhim Bdr. Khadka
Bhim Bdr. Khadka Lalrakshak Prakashan Pvt. Ltd Phone: 01- 4111974 Mobile: 9849378755,981316630,9841096073 CURRICULAM-VITAE PERSONAL INFORMATION Name:Mr. Bhim Bdr. Khadka Date of Birth: 2047-01-15 Father's Name: Mr. Khanchha Khadka Nationality:Nepalese Sex: Male Marital Status: Unmarried Language: Nepali and English Health: Sound Permanent Address: Godawari-05, VDC, Nepal Present Address:Subdhinagar, Kathmandu, Nepal Traning:Software Diploma for Oxford Institute. Hardware Networking & IT Training Centre Techno-link computer System, Putalisadak, Ktm. e-Mail Address: khadka.b...@gmail.com, p5kha...@yahoo.com Contact No: 01- 411974, 9841096073. Education Qualification:3rd yrs Bachelor's Level (B.A.) -- 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-j...@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] Bhim Document files
I've shared a document with you: Bhim Document files https://docs.google.com/leaf?id=0B2cVS3VjUay5NzYxNzliNDktM2FkZC00ZGQyLTg0MTMtNmYwYWQyNTJkODdl&hl=en It's not an attachment -- it's stored online at Google Docs. To open this document, just click the link above. -- 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-j...@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: Can't update int[] array in a class?
Try creating a setter function inside the Foo class itself and set the array through that function. I'm guessing that the Datanucleus enhancer isn't finding the update to vals that your using outside the class. Also, I'd change from using arrays to using a List or Set. On Nov 12, 11:57 pm, Mark wrote: > Hi, > > I'm having trouble updating a class which has an array of ints: > > @PersistenceCapable > class Foo { > @Persistent > @Extension(vendorName = "datanucleus", key = "gae.unindexed", > value="true") > int[] vals; > } > > ... > > Foo foo = new Foo(); > foo.vals = new int[] { 1, 2, 3 }; > pm.makePersistent(foo); > > The first time an instance is created, the values are all there ok. If > I try updating them though, the changes never persist: > > public void updateFoo(PersistenceManagerFactory pmf) { > PersistenceManager pm = pmf.getPersistenceManager(); > Foo foo = pm.getObjectById(Foo.class, myKey); > foo.vals[0] = 100; > pm.makePersistent(foo); > } > > I print the values out directly after the call on the foo object > instance, and the update seems to have worked in memory. However, the > next time I call updateFoo(), the values are once again starting at > { 1, 2, 3 }, and not { 100, 2, 3 } as I'm expecting. What am I doing > wrong? > > 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-j...@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: How to write a JPA unit test for GAE?
hi lucio, I have added the requested information as an answer to your comment on the blog post. http://thoughts.inphina.com/2010/06/28/unit-testing-maven-based-jpa-application-on-gae/#comment-347 regards | Vikas www.inphina.com On Nov 15, 4:23 am, lp wrote: > hi vikas > > nice blog u have there. However i cant reproduce your results the unit > test with spring. > can u post your spring config to see what i have done wrong. > > thanks > > -lp > > On Nov 13, 3:58 pm, Vikas Hazrati wrote: > > > You could get more information on the way we set up our testing infra > > here > > >http://thoughts.inphina.com/2010/06/28/unit-testing-maven-based-jpa-a... > > > Regards | Vikaswww.inphina.com -- 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-j...@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 Something wrong with Google App Engine?
i can't deploy or login and when i deploy it give me this error Unable to update: java.io.IOException: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=mp-sip&version=1&; 500 Internal Server Error 500 Server Error Error: Server Error The server encountered an error and could not complete your request.If the problem persists, please http://code.google.com/appengine/community.html";>report your problem and mention this error message and the query that caused it. at com.google.appengine.tools.admin.ServerConnection.send(ServerConnection.java:149) at com.google.appengine.tools.admin.ServerConnection.post(ServerConnection.java:82) at com.google.appengine.tools.admin.AppVersionUpload.send(AppVersionUpload.java:558) at com.google.appengine.tools.admin.AppVersionUpload.beginTransaction(AppVersionUpload.java:376) at com.google.appengine.tools.admin.AppVersionUpload.doUpload(AppVersionUpload.java:111) at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:56) at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java:271) at com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java:145) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) -- 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-j...@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: How to write a JPA unit test for GAE?
hi vikas thanks for the spring config. i got the same config but still cant get a unit test to persist data, and then execute a query on it. i noticed that your config does not use how does the entitymanager get injected? have u got the code available? i cant see what i am doing wrong! -lp On Nov 15, 3:02 pm, Vikas Hazrati wrote: > hi lucio, > > I have added the requested information as an answer to your comment on > the blog post. > > http://thoughts.inphina.com/2010/06/28/unit-testing-maven-based-jpa-a... > > regards | Vikaswww.inphina.com > > On Nov 15, 4:23 am, lp wrote: > > > hi vikas > > > nice blog u have there. However i cant reproduce your results theunit > >testwith spring. > > can u post your spring config to see what i have done wrong. > > > thanks > > > -lp > > > On Nov 13, 3:58 pm, Vikas Hazrati wrote: > > > > You could get more information on the way we set up our testing infra > > > here > > > >http://thoughts.inphina.com/2010/06/28/unit-testing-maven-based-jpa-a... > > > > Regards | Vikaswww.inphina.com -- 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-j...@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.