Grails App-Engine deployment

When deploying a new version of my application (actually I started an entire project from scratch) I continuously bounced my head against this  “You don’t have the permission…” exception.

I finally added the following lines to my Configuration/config.groovy file:

google.appengine.application=”myproject”
google.appengine.email=”myname@gmail.com”
google.appengine.password=”XXX”

where myproject is the part that appears in the url, like myproject.appspot.com.

Google App-Engine, Grails and Security

Here are the directions for a patch in a great Screencast by Tomás Lin that makes authentication work  in a Grails Application on Google’s App-Engine:

google.appengine.sessionEnabled = true // default true
google.appengine.enableSsl = true // default true
google.appengine.security.useHttps = ["/secure", "/shoppingcart/*", "/admin"]
google.appengine.security.requireAdmin = ["/admin", "/notsecuredadmin"]
google.appengine.security.requireLogin = ["/admin", "/", "/yabbadabbadoo"]

Don’t forget to apply the securePatch.diff patch to the plugin directory of your project – that is in <home>.grails/1.1.1/projects/myproject/plugins/app-engine-0.8.1 in order for these properties effectively written to the web.xml file.

Google App-Engine and Grails Dynamic Methods

A blog entry about running grails on Google’s App Engine. Among other things the methods that are provided by the App-Engine plugin are listed.

The added domain class MetaClass methods are:

  • save
  • get
  • delete
  • findAll
  • withTransaction
  • withPersistenceManager (to execute code with access to the PersistenceManager)
  • isJdoPersistent, isJdoDeleted, isJdoDetached, isJdoDirty, isJdoNew, isJdoTransactional, getJdoTransactionalObjectId, getJdoVersion, getJdoObjectId, and jdoMakeDirty corresponding to the JDOHelper methods isPersistent, isDeleted, isDetached, isDirty, isNew, isTransactional, getTransactionalObjectId, getVersion, getObjectId, and makeDirty

Controllers have these attributes added to their MetaClass:

  • params (with Request attributes like in Grails)
  • session
  • request
  • response
  • servletContext