I want to create an application deployed into the google app engine and I want to use the docx4j library. My application will read in a preexisting docx file (perhaps from a database) and then parse the docx document and replace some content, before outputting the final version as a PDF (also stored in a database)
I know app enine has a quite a few restrictions on what can and cannot run, and I will be using Java to do this. I know it does not allow writing to the filesystem, hence my comment about needing to get the input file and generating the output file into a database.
Does anyone know if the docx4j library, and it's dependencies, will be allowed to run in the app engine environment?
Thanks!
Java is one of the languages that is supported in both of the Google App Engine environments: standard and flexible. Go to these GCP docs to check the differences between those and choose the environment suitable for you. You can use Maven to handle your dependencies (the Docx4J library is available in Maven Repository).
When it comes to storing your files, you have a few options that can be used with Google App Engine app: Google Cloud Datastore, Google Cloud SQL and Google Cloud Storage. Their comparison can be found in GCP docs here.
Related
I'm trying to create a spreadsheet on google drive using DRIVE API in Java, the documentation on google site is very confusing, can somebody please help me by pointing to a sample example that demonstrate the creation of documents on google drive in Java using the latest DRIVE API?
Based from this SO question, using Drive API seems to only let you create new empty files with the spreadsheet MIME type. The Drive API is only concerned with operations at the whole file level. It is only possible in Google Drive to upload the created spreadsheet.
You can use Google Sheets API (formerly called the Google Spreadsheets API) which lets you develop client applications that create, read and modify worksheets and data in Google Sheets. This API can manage the worksheets in a Google Sheets file. You should strongly consider using a GData client library to interact with the API. Follow the following steps here to setup a development environment for working with the Sheets API.
You can create a spreadsheet via Drive API by calling files.create() with mimeType=application/vnd.google-apps.spreadsheet and uploading a CSV file. See Importing to Google Docs Types where there's a Java sample.
So I have a Java project that gets a content through an API request. Then, it saves the content in a file, which it uploads using another API. Now I want to use the Google App Engine, which doesn't support the fileoutputstream. I know you can use the datastore, but it can't really save a file.
Is there an alternative for this problem?
I am looking for java alternative for python library. Here is the question
how to read an excel file on google app engine
Take a look at the blog posting 'How to generate excel files on GAE?'. It discusses using the JExcelAPI library in GAE. JExcelAPI supports both writing and read of Excel documents, and doesn't seem to have a dependency on the JRE classes that cause issues with the use of Apache POI.
Is it possible to download files of any type from Google Docs using the Google Docs API? (jpg, zip, txt)
I can figure out how to download word, powerpoint, and excel files but want to be able to upload and download any type of file to Google Docs. I know it is possible to do this with the online uploader but can't seem to get the downloading part to work with the API.
I'm using the Java wrapper to the API. Is it possible to use the Java version of the API to download all file types?
Since the last answer was written, that API is deprecated. There's sample Java code on the Google Dev page for the (newer) Google Drive API for managing downloads from Google Docs.
This handles a large variety of MIME types.
See this page http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html
and this for specifically downloading documents and files
http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#DownloadingDocsAndFiles
The document listing XML returned by google has file type and the URL to download the file in the node. You can use the URL to download the file contents.
A question that seems to have quite a few options for Python, but none for Java after googling for two days. Really really could use some help all I have found so far is a recommendation to use gaeVFS to build an excel file from the xml components and then zip it all together which sounds like a slap in the face. Oh yes and if you were wondering I am questioning my use of Java rather than python but at 5,000 lines of code it would be insane to turn back now...
Other things you might find useful
Client: GWT
Server: Servlets running
on google app engine storing data
into the google data store
Excel file: mandatory, CSV isn't good
enough, no need to save the file just
to be able to "serve" it to the
client i.e. open a "Save As" box.
Have you checked out this api already: Java Excel API ?
You could also take a look at the Apache POI project. You can read and write MS Excel documents with this library.
Take a look at this post.
It's a step by step tutorial on how to generate excel files on google app engine.
Try this :
http://code.google.com/p/gwt-table-to-excel/
google app engine do not support input/output stream classes, you need to use google app engine virtual file system.