Skip to main content

Home/ Google AppEngine/ Contents contributed and discussions participated by Esfand S

Contents contributed and discussions participated by Esfand S

Esfand S

Episode 13: Using the Blobstore Java API « Google App Engine Java Experiments - 0 views

  • The Blobstore API provides two types of functions:   An ability to upload and save the blob automaticallyThe BlobstoreService which is provided by the com.google.appengine.api.blobstore.BlobstoreService allows us to specify a URL where users can upload their large files. You can think of this url as the action element in the HTML form. The implementation at this URL is internal to the BlobstoreService. But what it does is significant. It will extract out the file contents that you uploaded and store it as a Blob in the database. Each blob that is stored in the database is associated with the a Blob Key. This Blob key is then provided to your url and you can then use the Blob Key to do anything within your application. In our case, we form a url that is tweeted to the users who can then view the picture that we uploaded. An ability to serve or retrieve the blob.The BlobstoreService also provides an ability to serve or retrieve the blob that was saved successfully. It will provide the blob as a response that could then use as a source in an <img> element for example. All you need to do is provide it the Blob Key and the response stream and in return, it will provide the content properly encoded as per its type that you could then use.
Esfand S

Feed your site with RSS and Atom - 0 views

  • This article studies the proxy technique first and then turns to the Google AJAX Feed API method, giving you a chance to intermix Java™and JavaScript coding.
  • You need a service that, when given a feed URL, connects to that site, downloads its contents, and sends them back to the caller. (For a shell-line parallel, consider the wget or curl command.) You can do this many ways, and Listing 2 shows a simple way to accomplish the task. Because I decided to call my remote proxy RemoteProxy, the server-side class had to be called RemoteProxyImpl; Impl stands for "Implementation."
  • The SOP won't let your code get data from another site, but there's an exception: You can download and execute JavaScript code using the <script ... /> tag. If the code you download happens to include data and calls a function of yours that puts the data to good use, then you have managed to bypass the SOP. Here's the idea behind the Google AJAX Feed API: It uses the <script ... /> tag to call a Google site that works as a proxy. The remote site gets the feed data and returns it in the form of JavaScript code. The downloaded JavaScript code calls your function so you can process the incoming XML
  • ...1 more annotation...
  • Because the Google AJAX Feed API is written in JavaScript code, you have to use GWT's JavaScript Native Interface (JSNI).
Esfand S

Using HTMLPanel with UiBinder - Google Web Toolkit | Google Groups - 0 views

  • Just so you know, because it isn't documented, you can choose the tag name of the root element with UiBinder (the HTMLPanel(String,String) constructor), just use a tag="" attribute, e.g. <g:HTMLPanel>This will use a div element</g:HTMLPanel> <g:HTMLPanel tag='p'>While this will use a p element</g:HTMLPanel> You can then use an HTMLPanel as the root of your UiBinder and build your widget as a Composite, passing the HTMLPanel built by UiBinder to the initWidget method.
Esfand S

Exploring the new mapper API - Nick's Blog - 0 views

  • The mapper API isn't just limited to mapping over datastore entities, either. You can map over lines in a text file in the blobstore, or over the contents of a zip file in the blobstore. It's even possible to write your own data sources
Esfand S

Unified OAuth and Users service - Google App Engine | Google Groups - 0 views

  • I was very pleased to see that the new OAuth API provides the same interface as the Users API, but I see a missed opportunity here:
  • my problem is that there are two versions of the method: google.appengine.api.oauth.get_current_user() google.appengine.api.users.get_current_user() one works with OAuth and one with sign-in (or am I wrong?).
Esfand S

false and JSESSIONID - Google App Engine for Java | Google Groups - 0 views

  • disabling session id in code will not stop the cookie from saving session id. When you enable session in app engine xml file than you are telling the framework that you don't want to save sessions in cookies (client side), instead you want to save them on server i.e. using _ah_session. Cookies JSession id is default behavior of Java session mgmt. And it is nothing to do with APP engine framework.*
Esfand S

Issue 4438 - google-web-toolkit - GWT Compiler includes unneeded classes in RPC code - ... - 0 views

  • You don't have to add each class individually to the black list. They are all regex patterns, so just do this: <extend-configuration-property name="rpc.blacklist" value="com.google.gwt.user.client.ui.*Collection"/> In my case I wanted even finer grained control over which collections get included, so I did this: <extend-configuration-property name="rpc.blacklist" value="-.*List"/> <extend-configuration-property name="rpc.blacklist" value="-.*Map"/> <extend-configuration-property name="rpc.blacklist" value="-.*Collection"/> <extend-configuration-property name="rpc.blacklist" value="+java.util.HashMap"/> <extend-configuration-property name="rpc.blacklist" value="+java.util.LinkedHashMap"/> <extend-configuration-property name="rpc.blacklist" value="+java.util.ArrayList"/>
Esfand S

Hitch Hiker's Guide to Java: Accessing Google UserService from GWT client through RPC - 0 views

  • This tutorial concerns using Google Accounts to maintain the existence of your users in a Google App Engine application. Google App Engine provides the class UserServiceFactory to facilitate that. UserServiceFactory is then used to generate UserService object, which in turn provides the following features createLoginURL createLogoutURL getCurrentUser isUserAdmin isUserLoggedIn You would use UserService object to generate the login URL for the browser. The browser would be directed/redirected to this URL. On reaching this URL, the Google log-in prompt would be displayed by Google's server.
Esfand S

Example of using new GAE libs - gwtupload | Google Groups - 0 views

  • public class DatastoreUploadAction extends AppEngineUploadAction {         @Override         public String executeAction(HttpServletRequest request, List<FileItem> sessionFiles) throws UploadActionException {                 String out = super.executeAction(request, sessionFiles);                 for(FileItem imgItem : sessionFiles) {                         PersistenceManager pm = ContentServiceImpl.getPersistenceManager();                         Transaction tx = pm.currentTransaction();                         try {                             // Start the transaction                             tx.begin();                             InputStream imgStream = imgItem.getInputStream();                                 Blob blob = new Blob(IOUtils.toByteArray(imgStream));                                 ImageBlob imageBlob = new ImageBlob(imgItem.getName(), blob);                             pm.makePersistent(imageBlob);                             // Commit the transaction, flushing the object to the datastore                             tx.commit();                         }                         catch(Exception e) {                                 e.printStackTrace();                         }                         finally {                             if(tx.isActive()) {                                 tx.rollback();                             }                             pm.close();                         }                 }             return out;         } }
« First ‹ Previous 401 - 420 of 592 Next › Last »
Showing 20 items per page