SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Google App Engine
  with Gaelyk
 Easy cloud development. Or why using
   Gaelyk is like cheating the cloud
          development game.
About me
#java #groovy #grails
#android #iphone-dev
#clojure #lisp
#agile
#ruby #jruby #macruby
#favoriteMedium #software_architect
#cloud #gae
Cloud computing?
Teach Yourself Gaelyk
          in 30 minutes


• Introduction to Google App Engine
• Overview of Gaelyk
• Getting Started
• Future of GAE and Gaelyk
http://gaelyk.appspot.com
Guillaume Laforge
  Head of Groovy
  Development at SpringSource


http://www.slideshare.net/glaforge
Software as a Service
       Gmail, SalesForce




Platform as a Service
      Google App Engine




Infrastructure as a Service
      Amazon EC2, Azure
Platform as a Service
     Google App Engine
Gaelyk Services
• Template pages
• Datastore (similar to NoSQL)
• Email
• XMPP (Jabber e.g., Gtalk)
• Multi-tenant(namespace)
• Caching (Memcache)
• Download “gaelyk-template-project”
• Create groovy class
• Create gtpl template pages
• dev_appserver.sh war
• http://localhost:8080/
Gaelyk Directory Structure
URL Routing


/ Simple URL routings config in routes.groovy
 /

get "/about", redirect: "/general/about.html"
URL Routing

/ Advance URL routings config in routes.groovy
 /
get “/project/@id”, forward: “/project.groovy?id=@id”
get “/delete/@id”, forward: “/delete.groovy?id=@id”
get “/more/*”, forward: ”/more.groovy”

/ More involved example
 /
get “/edit/@project/@id”, forward: “/edit.groovy?id=@id&project=@project”
Controller

/ Simple Groovlet controller
 /
def name = params.name
def now = new Date()

request.now = now
request.name = name

forward “hello.gtpl”
Views/Templates

<body>

  <%
       def name = params.name
       def message = "Hi ${name} Hello World!"
  %>

  <p> ${message} </p>

</body>
Views/Templates (2)

<%
     def user = session.user
%>
<html>
   <body>
      <% if (user) { %>
        <p>You are currently logged in.</p>
      <% } else { %>
        <p>You're not logged in.</p>
      <% } %>
   </body>
</html>
Datastore (1)

/ Create and save entity data
 /
def project = new Entity(“project”)
project.name = “Kickass Web Application”
project.owner = bob.key.id
project.createdDate = new Date()
project.save()
Datastore (2)

def project = new Entity(“project”)
project.name = “Kickass Web Application”
project.owner = bob.key.id
project.createdDate = new Date()
project.save()
//...sometime to delete data
project.delete()
Datastore (3)

/ Querying data
 /
def query = new Query(“project”)

query.addSort(“createdDate”, SortDirection.DESCENDING)
query.addFilter(“name”, FilterOperator.EQUAL, “Kickass Project”)

def preparedQuery = datastore.prepare(query)
def results = preparedQuery.adList( withLimit(20) )
Datastore (4)

/ Querying data with more Groovy meta-programming
 /
def query = new Query(“project”)
                 .addSort(“createdDate”,
                 SortDirection.DESCENDING)
                 .addFilter(“name”, FilterOperator.EQUAL,
                 “Kickass Project”)

def results = datastore.prepare(query).asList( withLimit(20) )
Datastore (5)

/ Latest Query DSL -- Not release yet
 /

 'SELECT * FROM projects
   WHERE name = “Kickass Project”
    ORDER BY createdDate DESC'
<!-- Making use of results from controller -->

<% def results = request.results %>
<ul>
! <% results.each { result -> %>
! ! <li>
! ! ! ${result.name}
! ! </li>
! <% } %>
</ul>
Datastore (4)
/ Create and save entity data
 /
/ in “Project X” context
 /

namespace.of(“projectX”) {
   def project = new Entity(“project”)
   project.name = “Kickass Web Application”
   project.owner = bob.key.id
   project.createdDate = new Date()
   project.save()
}
Email
/ Sending email
 /

mail.send from: "app-admin-email@gmail.com",
 to: "recipient@somecompany.com",
 subject: "Re: Invoice",
 textBody: "Hi, here’s the latest invoice",
 attachment: [data: "Latest Invoice , fileName:
 "invoice.doc"]
Deployment


/ Running on local for development
 /
dev_appserver.sh war

/ Deploy to GAE
 /
appcfg.sh update war
Showcase: AndroidRockeeet
• AndroidRockeeet.appspot.com
• Android deployment tool
• From concept to 1st deploy = 5 hours
• Beta testing now
• Never concerned about scaling
What’s missing from this talk?


          Plugins
           Billing
           Quota
        Advance API
   Apps market integration
             ...
Google App Engine with Gaelyk

Weitere ähnliche Inhalte

Was ist angesagt?

Offline strategies for HTML5 web applications - IPC12
Offline strategies for HTML5 web applications - IPC12Offline strategies for HTML5 web applications - IPC12
Offline strategies for HTML5 web applications - IPC12
Stephan Hochdörfer
 
Polymer
Polymer Polymer
Polymer
jskvara
 
Data Visualization on the Web - Intro to D3
Data Visualization on the Web - Intro to D3Data Visualization on the Web - Intro to D3
Data Visualization on the Web - Intro to D3
Angela Zoss
 

Was ist angesagt? (20)

An Overview of Models in Django
An Overview of Models in DjangoAn Overview of Models in Django
An Overview of Models in Django
 
Offline strategies for HTML5 web applications - IPC12
Offline strategies for HTML5 web applications - IPC12Offline strategies for HTML5 web applications - IPC12
Offline strategies for HTML5 web applications - IPC12
 
Polymer & the web components revolution 6:25:14
Polymer & the web components revolution 6:25:14Polymer & the web components revolution 6:25:14
Polymer & the web components revolution 6:25:14
 
Web Components with Polymer (extra Polymer 2.0)
Web Components with Polymer (extra Polymer 2.0)Web Components with Polymer (extra Polymer 2.0)
Web Components with Polymer (extra Polymer 2.0)
 
Chatbot - The developer's waterboy
Chatbot - The developer's waterboyChatbot - The developer's waterboy
Chatbot - The developer's waterboy
 
Slides
SlidesSlides
Slides
 
Web Components
Web ComponentsWeb Components
Web Components
 
10. Imagini in MongoDB
10. Imagini in MongoDB10. Imagini in MongoDB
10. Imagini in MongoDB
 
Polymer vs other libraries (Devfest Ukraine 2015)
Polymer vs other libraries (Devfest Ukraine 2015)Polymer vs other libraries (Devfest Ukraine 2015)
Polymer vs other libraries (Devfest Ukraine 2015)
 
Google Polymer Framework
Google Polymer FrameworkGoogle Polymer Framework
Google Polymer Framework
 
Polymer
Polymer Polymer
Polymer
 
Resource Oriented Design
Resource Oriented DesignResource Oriented Design
Resource Oriented Design
 
How to build a Dart and Firebase app in 30 mins
How to build a Dart and Firebase app in 30 minsHow to build a Dart and Firebase app in 30 mins
How to build a Dart and Firebase app in 30 mins
 
Introduction to polymer project
Introduction to polymer projectIntroduction to polymer project
Introduction to polymer project
 
Django
DjangoDjango
Django
 
Polymer, A Web Component Polyfill Library
Polymer, A Web Component Polyfill LibraryPolymer, A Web Component Polyfill Library
Polymer, A Web Component Polyfill Library
 
Data Visualization on the Web - Intro to D3
Data Visualization on the Web - Intro to D3Data Visualization on the Web - Intro to D3
Data Visualization on the Web - Intro to D3
 
Neos CMS and SEO
Neos CMS and SEONeos CMS and SEO
Neos CMS and SEO
 
Why Django
Why DjangoWhy Django
Why Django
 
How I Became a WordPress Hacker
How I Became a WordPress HackerHow I Became a WordPress Hacker
How I Became a WordPress Hacker
 

Andere mochten auch

Archives International Auctions Sale 37
Archives International Auctions Sale 37Archives International Auctions Sale 37
Archives International Auctions Sale 37
Archives International Auctions
 
Bases para la plaza de Operario Servicios Múltiples - Jardinería (2013)
Bases para la plaza de Operario Servicios Múltiples - Jardinería (2013)Bases para la plaza de Operario Servicios Múltiples - Jardinería (2013)
Bases para la plaza de Operario Servicios Múltiples - Jardinería (2013)
Ayuntamiento del Valle de Mena
 
Log Engineering: Towards Systematic Log Mining to Support the Development of ...
Log Engineering: Towards Systematic Log Mining to Support the Development of ...Log Engineering: Towards Systematic Log Mining to Support the Development of ...
Log Engineering: Towards Systematic Log Mining to Support the Development of ...
SAIL_QU
 

Andere mochten auch (20)

Archives International Auctions Sale 37
Archives International Auctions Sale 37Archives International Auctions Sale 37
Archives International Auctions Sale 37
 
Flash8 serial key
Flash8 serial keyFlash8 serial key
Flash8 serial key
 
Resume
ResumeResume
Resume
 
Tutkimusdatakysely Helsingin yliopiston tutkijoille 2016
Tutkimusdatakysely Helsingin yliopiston tutkijoille 2016Tutkimusdatakysely Helsingin yliopiston tutkijoille 2016
Tutkimusdatakysely Helsingin yliopiston tutkijoille 2016
 
Digital analytics: Tableau (Lecture 6)
Digital analytics: Tableau (Lecture 6)Digital analytics: Tableau (Lecture 6)
Digital analytics: Tableau (Lecture 6)
 
PMABeverly
PMABeverlyPMABeverly
PMABeverly
 
É uma viagem
É uma viagemÉ uma viagem
É uma viagem
 
Escrito poveda Playas del Vicario
Escrito poveda Playas del VicarioEscrito poveda Playas del Vicario
Escrito poveda Playas del Vicario
 
PresentacióN1
PresentacióN1PresentacióN1
PresentacióN1
 
Hallwaze lends a helping hand to ..
Hallwaze lends a helping hand to ..Hallwaze lends a helping hand to ..
Hallwaze lends a helping hand to ..
 
Bases para la plaza de Operario Servicios Múltiples - Jardinería (2013)
Bases para la plaza de Operario Servicios Múltiples - Jardinería (2013)Bases para la plaza de Operario Servicios Múltiples - Jardinería (2013)
Bases para la plaza de Operario Servicios Múltiples - Jardinería (2013)
 
Why halwaze
Why halwaze Why halwaze
Why halwaze
 
Archives International Auctions Sale 36 U.S. & Worldwide Scripophily, Banknotes
Archives International Auctions Sale 36 U.S. & Worldwide Scripophily, BanknotesArchives International Auctions Sale 36 U.S. & Worldwide Scripophily, Banknotes
Archives International Auctions Sale 36 U.S. & Worldwide Scripophily, Banknotes
 
I Simply Excel
I Simply ExcelI Simply Excel
I Simply Excel
 
Oracle Commerce as a Secure, Scalable Hybrid Cloud Service, webinar slides
Oracle Commerce as a Secure,  Scalable Hybrid Cloud Service, webinar slidesOracle Commerce as a Secure,  Scalable Hybrid Cloud Service, webinar slides
Oracle Commerce as a Secure, Scalable Hybrid Cloud Service, webinar slides
 
Social selling - Miten tehdä sosiaalista myyntiä?
Social selling - Miten tehdä sosiaalista myyntiä?Social selling - Miten tehdä sosiaalista myyntiä?
Social selling - Miten tehdä sosiaalista myyntiä?
 
Log Engineering: Towards Systematic Log Mining to Support the Development of ...
Log Engineering: Towards Systematic Log Mining to Support the Development of ...Log Engineering: Towards Systematic Log Mining to Support the Development of ...
Log Engineering: Towards Systematic Log Mining to Support the Development of ...
 
Introduction to ayurveda
Introduction to ayurveda Introduction to ayurveda
Introduction to ayurveda
 
WHO Guidance on HVAC Systems for Non Sterile Pharmaceuticals
WHO Guidance on HVAC  Systems for Non Sterile PharmaceuticalsWHO Guidance on HVAC  Systems for Non Sterile Pharmaceuticals
WHO Guidance on HVAC Systems for Non Sterile Pharmaceuticals
 
JW Marriott Mumbai Sahar Social Media Campaign Report
JW Marriott Mumbai Sahar Social Media Campaign ReportJW Marriott Mumbai Sahar Social Media Campaign Report
JW Marriott Mumbai Sahar Social Media Campaign Report
 

Ähnlich wie Google App Engine with Gaelyk

Building Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And Tricks
Mike Hugo
 
Jquery dojo slides
Jquery dojo slidesJquery dojo slides
Jquery dojo slides
helenmga
 
Spca2014 hillier 3rd party_javascript_libraries
Spca2014 hillier 3rd party_javascript_librariesSpca2014 hillier 3rd party_javascript_libraries
Spca2014 hillier 3rd party_javascript_libraries
NCCOMMS
 

Ähnlich wie Google App Engine with Gaelyk (20)

Html5 drupal7 with mandakini kumari(1)
Html5 drupal7 with mandakini kumari(1)Html5 drupal7 with mandakini kumari(1)
Html5 drupal7 with mandakini kumari(1)
 
The Big Picture and How to Get Started
The Big Picture and How to Get StartedThe Big Picture and How to Get Started
The Big Picture and How to Get Started
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenery
 
Single Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle StorySingle Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle Story
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 
Boost your testing: End-to-End with Docker and Geb
 Boost your testing: End-to-End with Docker and Geb Boost your testing: End-to-End with Docker and Geb
Boost your testing: End-to-End with Docker and Geb
 
Web Components With Rails
Web Components With RailsWeb Components With Rails
Web Components With Rails
 
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect ModelComprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
 
Building Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And Tricks
 
Jquery dojo slides
Jquery dojo slidesJquery dojo slides
Jquery dojo slides
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Web-Performance
Web-PerformanceWeb-Performance
Web-Performance
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the Web
 
Design Tips & Development with jQuery Mobile and PhoneGap
Design Tips & Development with jQuery Mobile and PhoneGapDesign Tips & Development with jQuery Mobile and PhoneGap
Design Tips & Development with jQuery Mobile and PhoneGap
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
 
Droidcon Paris 2015
Droidcon Paris 2015Droidcon Paris 2015
Droidcon Paris 2015
 
Spca2014 hillier 3rd party_javascript_libraries
Spca2014 hillier 3rd party_javascript_librariesSpca2014 hillier 3rd party_javascript_libraries
Spca2014 hillier 3rd party_javascript_libraries
 
Building a Dynamic Website Using Django
Building a Dynamic Website Using DjangoBuilding a Dynamic Website Using Django
Building a Dynamic Website Using Django
 
Web development - technologies and tools
Web development - technologies and toolsWeb development - technologies and tools
Web development - technologies and tools
 

Mehr von Choong Ping Teo (6)

Launchstack Manifesto
Launchstack ManifestoLaunchstack Manifesto
Launchstack Manifesto
 
Problem solving tools
Problem solving toolsProblem solving tools
Problem solving tools
 
App script
App scriptApp script
App script
 
Software Developer Guide to Nootropics
Software Developer Guide to NootropicsSoftware Developer Guide to Nootropics
Software Developer Guide to Nootropics
 
Social Hacking
Social HackingSocial Hacking
Social Hacking
 
Open Source Software Development Practices that Works
Open Source Software Development Practices that WorksOpen Source Software Development Practices that Works
Open Source Software Development Practices that Works
 

Kürzlich hochgeladen

Microsoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdfMicrosoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdf
Overkill Security
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
FIDO Alliance
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
FIDO Alliance
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
Wonjun Hwang
 

Kürzlich hochgeladen (20)

Microsoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdfMicrosoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdf
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
How to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in PakistanHow to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in Pakistan
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
 
Navigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi DaparthiNavigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi Daparthi
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 

Google App Engine with Gaelyk

  • 1. Google App Engine with Gaelyk Easy cloud development. Or why using Gaelyk is like cheating the cloud development game.
  • 2. About me #java #groovy #grails #android #iphone-dev #clojure #lisp #agile #ruby #jruby #macruby #favoriteMedium #software_architect #cloud #gae
  • 4. Teach Yourself Gaelyk in 30 minutes • Introduction to Google App Engine • Overview of Gaelyk • Getting Started • Future of GAE and Gaelyk
  • 5.
  • 7. Guillaume Laforge Head of Groovy Development at SpringSource http://www.slideshare.net/glaforge
  • 8. Software as a Service Gmail, SalesForce Platform as a Service Google App Engine Infrastructure as a Service Amazon EC2, Azure
  • 9. Platform as a Service Google App Engine
  • 10. Gaelyk Services • Template pages • Datastore (similar to NoSQL) • Email • XMPP (Jabber e.g., Gtalk) • Multi-tenant(namespace) • Caching (Memcache)
  • 11.
  • 12. • Download “gaelyk-template-project” • Create groovy class • Create gtpl template pages • dev_appserver.sh war • http://localhost:8080/
  • 14. URL Routing / Simple URL routings config in routes.groovy / get "/about", redirect: "/general/about.html"
  • 15. URL Routing / Advance URL routings config in routes.groovy / get “/project/@id”, forward: “/project.groovy?id=@id” get “/delete/@id”, forward: “/delete.groovy?id=@id” get “/more/*”, forward: ”/more.groovy” / More involved example / get “/edit/@project/@id”, forward: “/edit.groovy?id=@id&project=@project”
  • 16. Controller / Simple Groovlet controller / def name = params.name def now = new Date() request.now = now request.name = name forward “hello.gtpl”
  • 17. Views/Templates <body> <% def name = params.name def message = "Hi ${name} Hello World!" %> <p> ${message} </p> </body>
  • 18. Views/Templates (2) <% def user = session.user %> <html> <body> <% if (user) { %> <p>You are currently logged in.</p> <% } else { %> <p>You're not logged in.</p> <% } %> </body> </html>
  • 19. Datastore (1) / Create and save entity data / def project = new Entity(“project”) project.name = “Kickass Web Application” project.owner = bob.key.id project.createdDate = new Date() project.save()
  • 20. Datastore (2) def project = new Entity(“project”) project.name = “Kickass Web Application” project.owner = bob.key.id project.createdDate = new Date() project.save() //...sometime to delete data project.delete()
  • 21. Datastore (3) / Querying data / def query = new Query(“project”) query.addSort(“createdDate”, SortDirection.DESCENDING) query.addFilter(“name”, FilterOperator.EQUAL, “Kickass Project”) def preparedQuery = datastore.prepare(query) def results = preparedQuery.adList( withLimit(20) )
  • 22. Datastore (4) / Querying data with more Groovy meta-programming / def query = new Query(“project”) .addSort(“createdDate”, SortDirection.DESCENDING) .addFilter(“name”, FilterOperator.EQUAL, “Kickass Project”) def results = datastore.prepare(query).asList( withLimit(20) )
  • 23. Datastore (5) / Latest Query DSL -- Not release yet /  'SELECT * FROM projects WHERE name = “Kickass Project” ORDER BY createdDate DESC'
  • 24. <!-- Making use of results from controller --> <% def results = request.results %> <ul> ! <% results.each { result -> %> ! ! <li> ! ! ! ${result.name} ! ! </li> ! <% } %> </ul>
  • 25. Datastore (4) / Create and save entity data / / in “Project X” context / namespace.of(“projectX”) { def project = new Entity(“project”) project.name = “Kickass Web Application” project.owner = bob.key.id project.createdDate = new Date() project.save() }
  • 26. Email / Sending email / mail.send from: "app-admin-email@gmail.com", to: "recipient@somecompany.com", subject: "Re: Invoice", textBody: "Hi, here’s the latest invoice", attachment: [data: "Latest Invoice , fileName: "invoice.doc"]
  • 27. Deployment / Running on local for development / dev_appserver.sh war / Deploy to GAE / appcfg.sh update war
  • 29.
  • 30. • AndroidRockeeet.appspot.com • Android deployment tool • From concept to 1st deploy = 5 hours • Beta testing now • Never concerned about scaling
  • 31. What’s missing from this talk? Plugins Billing Quota Advance API Apps market integration ...

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n