GWT uploading a photo - google-app-engine

I m using Google App Engine (1.7) to store my entities on Datastore and GWT 2.4 to build the interface. Some entities have an image field, so a user when submits a new Entity (a "Product" for example) can upload her one image (of the product).
So my question is how I can create an upload field where the browsing window will appear when the user clicks in an element and after the upload process a thumbnail of that image will appear in this element!!
Any suggestions???

Check out GWT FileUpload component.

Take a look at this tutorial. I think it does exactly what you need:
GWT, Blobstore, the new high performance image serving API

"GWT Upload" is the best choice i have found. I have used it outside GAE (in my own application server) but i think it has GAE support as well. Basically to make it work you need to put the "GWT Upload control" onto your page, write the server side uploader (extending one provided) add some lines to web.xml, and that's it.

Related

Best approach to use a CDN service

I am a mobile developer trying to do backend development. It is going more or less well but still having doubts about some subjects. Currently I want to add a Google app engine service to upload and resizing images on Google Storage. Now I am trying to define the best way to upload it because image is just a part of the object form data.
Option 1: I know I can use Javascript to send two different forms (one for the data to my own controller and the other one for image to the app engine service) pointing to different processing URIs and create a random string to use as a link between image and data (because after uploading successfully on Google Storage I need to write the URL on my object data.
Option 2: Upload everything in one form just with my service and store temporally the image locally and send it on background calling app engine from my controller.
Option 3: Storing everything like now and use a background task to send image to app engine and the replacing the image by the returned URI.
No one of this options convinces me, please if some of you faced this before, enlighten me.
Regards,

Google Cloud Datastore and reports/administration

I'm quite new to Google App Engine and it's cloud Datastore which is used for storing the backend's data by default. As far as I realized you can only view it's content within the developer console and you can create or edit entities there.
But is there any external tool from which you can connect to your datastore to create reports or administer the data? What is your experience?
In fact yes it's true you can only see data's from the admin console.
If you wish to see your data's in Google Drive Table and make a report you can, but for that you need to create a connector to your sheet (I already made one). It's exactly the same if you need update or import data's to your datastore.
I use this Technic to upload or refresh products on my e-shop GAE app.
In general if I need to see a report, I design a specific web page for that and I protect theme via a login / password. To see a well formatted report you can use jquery library or use Google Charts

How to start a WinRT app from a web application?

Suppose I have a video hosting site, like youtube. When user clicks on a link on the site, I want to open a WinRT application for a better viewing experience, how would I do that?
How do I pass parameters into the WinRT application, to let it know what video it should stream? I need to be able to go back and forth, so I assume I can introduce a hyperlink to go back to the site from the app.
The other possibility is to embed the application on the site itself. How would that work? Can you still inline an applet style application on the site itself (eg. flash/silverlight)?
It is possible to launch a Windows Store app, given that you know the URI scheme associated with that application. For example, the Games app has the xboxgames: associated with it. If you insert a link with that URI scheme, the shell will pick it up as an internal reference. Read more details here.
You might also be interested in reading more on how to connect your website to a Windows Store app here.
Edit: It is possible to have an associated url: see accepted answer from Den Delimarsky.
Alternatively, a Windows Store app can declare file type associations. So you could make the user download a file (for example "video.customExtension"), which could contain informations, such as the video the app should play. In the same way as it works for Office Live Meeting when you download a meeting file to start a meeting.
If the user download that kind of file from your website, and that he doesn't have the corresponding app installed, he will be prompted to look for an app that can open that file in the store, and he will find your app.
And finally, no you can't embbed an Windows 8 Store app in a webpage.

Store Images in datastore from local drive in Google App Engine

I couldn't find articles match to my requirements.
Basically, what I want is that:
User uploads picture to the application from their local drive.
Application stores the picture uploaded to datastore.
Application retrieves images from datastore.
Any suggestions? Urgent.
That's exactly what is discussed in the documentation for the BlobStore API.
You can do this in much the same way as you would in any other framework or platform: Create an HTML form with a 'file' input and the mimetype set to 'multipart/form-data'. On the server side, extract the file data from the form field (using self.request.POST['fieldname'].value in webapp) and store the contents in a datastore model, in a db.BlobProperty field.

gwt and dynamic server processing. Do they belong together?

I am eager to build an application with Gwt and App Engine. I'm more familiar with App Engine: creating dynamic html pages with servlets and jsp's. I'm wondering however, if this type of application technology belongs with GWT?
The two examples I can foresee being a problem are login and database retrieval.
For user log-in, my current approach is simple: at the beginning of a servlet, check if the user object exists. If it does, show the page. If it doesn't, redirect to Google's login service. How does this model fit in with GWT? It seems to me that GWT compiles into static html/javascript/css files you place on your server. With this approach, it doesn't seem possible to do any server processing to check for a vlid user before serving the static page (because any user could just bypass the servlet and type the static page url directly).
The other example would be show data from the app engine datastore. If i wanted to create a table which each row being an entry from the data store, I would dynamiclly create the html in a servlet, and do my datastore access there etc, etc. It seems with GWT I would have to serve a container html page, then use ajax to load the database content after the fact?
Maybe GWT isn't right for my type of application, or maybe I'm just thing about web application development the wrong way. Some clarification would be appreciated.
In a over simplified sense, a typical GWT app will work like this:
User navigates to your web page. Their browser uses a static url(s) to download all the javascript, css, and images necessary to run your app.
From now on, every time a user presses a button or otherwise interacts with the page, data is retrieved via an AJAX call. So yes, they might download your app before logging in, but all your security sensitive data would only be returned via an ajax call, giving you the chance to validate their identity however you wish (cookie, user/pass, etc)
This is basically what you describe in your second example about loading data from the datastore. It sounds like you think this is bad for some reason, but you don't say why.

Resources