SlideShare ist ein Scribd-Unternehmen logo
1 von 97
Downloaden Sie, um offline zu lesen
2009/10/08 @JJUG CCC




def speaker = new Cast(name:”T.Yamamoto”,version:”G*C-2009-10-08”)
(             )


 DTP                          Web
           75%Grails
JGGUG(                 )
 Grails                9-11
Grails Acegi Plugin

http://d.hatena.ne.jp/mottsnite/
twitter @tyama
JGGUG
japan grails/groovy user group
JGGUG
japan grails/groovy user group
Grails
         CMS
JGGUG
japan grails/groovy user group
Grails   PaaS
# curl -L http://stax-downloads.s3.amazonaws.com/sdk/
stax-sdk-0.3.6-dist.zip > stax_sdk.zip

# unzip stax_sdk.zip

# rm stax_sdk.zip

# cd stax-sdk-0.3.6




       export STAX_HOME=/opt/stax-sdk-0.3.6
       export PATH=$PATH:$STAX_HOME
...   ...
dataSource {
  dbCreate = "update"
  driverClassName = "com.staxnet.jdbc.Driver"
  url = "jdbc:stax://jggug"
  username = "tyama"
  password = "*****"
}

...   ...
...
  log4j = {
    appenders {
        null name:'stacktrace'
...   ...
Cloud Tool
grails create-app demo
cd demo
grails install-plugin cloud-tool.zip

Config.groovy
import
aws.properties



grails cloud-tools-deploy


grails cloud-tools-describe


grails cloud-tools-stop
war




      DB
IP
DB
     EBS
UPTIME
Apache




            tc Server


    MySQL
HTTPD

        TC
AWS ACCESS KEY ID




          KEY PAIRS
SSH
export APPENGINE_HOME=/opt/appengine-java-sdk-1.2.5


google.appengine.sdk='/opt/appengine-java-sdk-1.2.5'
$ grails install-plugin app-engine


Do you want to use JPA or JDO for persistence? (jpa, jdo)
jpa



                grails-app/conf/

datastore-indexes.xml
persistence.xml


  grails-app/conf/Config.groovy GAE
google.appengine.application="jggugv4"

 Grails
$ grails install-plugin gorm-jpa


resources.groovy       entityManagerFactory         transactionManager
entityManagerFactory(org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)
{
  beanClassLoader = ref("classLoader")
}

transactionManager(org.springframework.orm.jpa.JpaTransactionManager) {
  entityManagerFactory = entityManagerFactory
}


      datanucleus-enhancer*.jar
cp $APPENGINE_HOME/lib/tools/orm/datanucleus-enhancer-1.1.4.jar lib
import org.datanucleus.jpa.annotations.Extension
import javax.persistence.*;

@Entity
class Event implements Serializable {

  @Id
  @GeneratedValue (strategy = GenerationType.IDENTITY)
  @Extension (vendorName = "datanucleus",
               key = "gae.encoded-pk", value = "true")
  String id

  /**                */
  @Column //
  String eventName
def save = {
  def eventInstance = new Event(params)
  Event.withTransaction{
    if(eventInstance.save(flush:true)) {
      flash.message = "Event ${eventInstance.id} created"
      redirect action:"show", id:eventInstance.id
    }
    else {
      render view:'create', model:[eventInstance:eventInstance]
    }
  }
}
$ grails set-version 1


$ grails app-engine run
$ grails set-version 1
    $ grails app-engine deploy




$ grails app-engine package
$ rm target/war/WEB-INF/lib/jul-to-slf4j-1.5.6.jar
$ appcfg.sh update ./target/war
$ dev_appserver.sh ./war

※Windows     .sh→.cmd
View
request.setAttribute 'list', [1, 2, 3, 4]
request.setAttribute 'date', new Date()
 
forward 'display.gtpl'
mailService.send to: 'foobar@gmail.com',
        subject: 'Hello World',
        htmlBody: '<bold>Hello</bold>'



datastoreService.withTransaction {
    // your code
}
import com.google.appengine.api.datastore.Entity

def person = new Entity("person")

person['name'] = "           "
println person['name']

person.age = 31
println person.age

//
person.save()

//
person.delete()

//
def q = new Query('person')
def list = datastoreService.prepare(q).asList(
                Builder.withLimit(20).offset(0) )
<system-properties>
  <property name="file.encoding" value="UTF-8"/>
  <property name="groovy.source.encoding"
            value="UTF-8"/>
</system-properties>
$ ./gaelyk-setup.sh myapp001
Grails/Groovy
http://www.jggug.org/

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

World of Logging
World of LoggingWorld of Logging
World of Logging
 
Grailsx@ロンドンへ行ってきた報告。
Grailsx@ロンドンへ行ってきた報告。Grailsx@ロンドンへ行ってきた報告。
Grailsx@ロンドンへ行ってきた報告。
 
Quicli - From zero to a full CLI application in a few lines of Rust
Quicli - From zero to a full CLI application in a few lines of RustQuicli - From zero to a full CLI application in a few lines of Rust
Quicli - From zero to a full CLI application in a few lines of Rust
 
Tdc 2013 - Ecossistema Ruby
Tdc 2013 - Ecossistema RubyTdc 2013 - Ecossistema Ruby
Tdc 2013 - Ecossistema Ruby
 
お題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part Aお題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part A
 
Puppet and Openshift
Puppet and OpenshiftPuppet and Openshift
Puppet and Openshift
 
わかった気になるgitit-0.8
わかった気になるgitit-0.8わかった気になるgitit-0.8
わかった気になるgitit-0.8
 
React for Beginners
React for BeginnersReact for Beginners
React for Beginners
 
GPars For Beginners
GPars For BeginnersGPars For Beginners
GPars For Beginners
 
Creating ASTTs The painful truth
Creating ASTTs The painful truthCreating ASTTs The painful truth
Creating ASTTs The painful truth
 
CouchDB Day NYC 2017: MapReduce Views
CouchDB Day NYC 2017: MapReduce ViewsCouchDB Day NYC 2017: MapReduce Views
CouchDB Day NYC 2017: MapReduce Views
 
gunicorn introduction
gunicorn introductiongunicorn introduction
gunicorn introduction
 
Grails 1.4.0.M1 メモLT
Grails 1.4.0.M1 メモLTGrails 1.4.0.M1 メモLT
Grails 1.4.0.M1 メモLT
 
Do something in 5 with gas 3-simple invoicing app
Do something in 5 with gas 3-simple invoicing appDo something in 5 with gas 3-simple invoicing app
Do something in 5 with gas 3-simple invoicing app
 
Do something in 5 minutes with gas 1-use spreadsheet as database
Do something in 5 minutes with gas 1-use spreadsheet as databaseDo something in 5 minutes with gas 1-use spreadsheet as database
Do something in 5 minutes with gas 1-use spreadsheet as database
 
React native-firebase startup-mtup
React native-firebase startup-mtupReact native-firebase startup-mtup
React native-firebase startup-mtup
 
Rntb20200805
Rntb20200805Rntb20200805
Rntb20200805
 
PHP 机智问答
PHP 机智问答PHP 机智问答
PHP 机智问答
 
Virthualenvwrapper
VirthualenvwrapperVirthualenvwrapper
Virthualenvwrapper
 
Git Tutorial Yang Yang
Git Tutorial Yang YangGit Tutorial Yang Yang
Git Tutorial Yang Yang
 

Ähnlich wie G*なクラウド ~雲のかなたに~

Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best Practices
Yekmer Simsek
 
After max+phonegap
After max+phonegapAfter max+phonegap
After max+phonegap
yangdj
 
混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaver混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaver
yangdj
 
Grails Plugin
Grails PluginGrails Plugin
Grails Plugin
guligala
 
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
 

Ähnlich wie G*なクラウド ~雲のかなたに~ (20)

第3回Grails/Groovy勉強会名古屋「Grails名古屋座談会」
第3回Grails/Groovy勉強会名古屋「Grails名古屋座談会」第3回Grails/Groovy勉強会名古屋「Grails名古屋座談会」
第3回Grails/Groovy勉強会名古屋「Grails名古屋座談会」
 
Let Grunt do the work, focus on the fun! [Open Web Camp 2013]
Let Grunt do the work, focus on the fun! [Open Web Camp 2013]Let Grunt do the work, focus on the fun! [Open Web Camp 2013]
Let Grunt do the work, focus on the fun! [Open Web Camp 2013]
 
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
 
Taking Jenkins Pipeline to the Extreme
Taking Jenkins Pipeline to the ExtremeTaking Jenkins Pipeline to the Extreme
Taking Jenkins Pipeline to the Extreme
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best Practices
 
Gradle in 45min - JBCN2-16 version
Gradle in 45min - JBCN2-16 versionGradle in 45min - JBCN2-16 version
Gradle in 45min - JBCN2-16 version
 
Javascript is your (Auto)mate
Javascript is your (Auto)mateJavascript is your (Auto)mate
Javascript is your (Auto)mate
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
 
After max+phonegap
After max+phonegapAfter max+phonegap
After max+phonegap
 
混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaver混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaver
 
Grunt & Front-end Workflow
Grunt & Front-end WorkflowGrunt & Front-end Workflow
Grunt & Front-end Workflow
 
Let Grunt do the work, focus on the fun!
Let Grunt do the work, focus on the fun!Let Grunt do the work, focus on the fun!
Let Grunt do the work, focus on the fun!
 
Grails Plugin
Grails PluginGrails Plugin
Grails Plugin
 
Golang Project Layout and Practice
Golang Project Layout and PracticeGolang Project Layout and Practice
Golang Project Layout and Practice
 
Dropwizard and Friends
Dropwizard and FriendsDropwizard and Friends
Dropwizard and Friends
 
Androidaop 170105090257
Androidaop 170105090257Androidaop 170105090257
Androidaop 170105090257
 
Building Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And Tricks
 
Web development tools { starter pack }
Web development tools { starter pack }Web development tools { starter pack }
Web development tools { starter pack }
 
Get Grulping with JavaScript Task Runners (Matt Gifford)
Get Grulping with JavaScript Task Runners (Matt Gifford)Get Grulping with JavaScript Task Runners (Matt Gifford)
Get Grulping with JavaScript Task Runners (Matt Gifford)
 
Gradle in 45min
Gradle in 45minGradle in 45min
Gradle in 45min
 

Mehr von Tsuyoshi Yamamoto

Mehr von Tsuyoshi Yamamoto (19)

JJUG CCC 20150411 grails3 Spring-boot
JJUG CCC 20150411 grails3 Spring-bootJJUG CCC 20150411 grails3 Spring-boot
JJUG CCC 20150411 grails3 Spring-boot
 
Groovy Grails eXchage 2014 報告
Groovy Grails eXchage 2014 報告Groovy Grails eXchage 2014 報告
Groovy Grails eXchage 2014 報告
 
JGGUG grails-spring-boot
JGGUG grails-spring-bootJGGUG grails-spring-boot
JGGUG grails-spring-boot
 
Grailsx@London 2011 報告
Grailsx@London 2011 報告Grailsx@London 2011 報告
Grailsx@London 2011 報告
 
Grails 2.0.0.M1の話
Grails 2.0.0.M1の話 Grails 2.0.0.M1の話
Grails 2.0.0.M1の話
 
G * magazine 1
G * magazine 1G * magazine 1
G * magazine 1
 
G * magazine 0
G * magazine 0G * magazine 0
G * magazine 0
 
JGGUG 2011-02 LT
JGGUG 2011-02 LTJGGUG 2011-02 LT
JGGUG 2011-02 LT
 
Grailsのススメ(仮)
Grailsのススメ(仮)Grailsのススメ(仮)
Grailsのススメ(仮)
 
G*ワークショップ in 仙台 Grails(とことん)入門
G*ワークショップ in 仙台 Grails(とことん)入門G*ワークショップ in 仙台 Grails(とことん)入門
G*ワークショップ in 仙台 Grails(とことん)入門
 
groovyプラプラとか「はやい、はやいよ」
groovyプラプラとか「はやい、はやいよ」groovyプラプラとか「はやい、はやいよ」
groovyプラプラとか「はやい、はやいよ」
 
第1回名古屋Grails/Groogy勉強会「Grailsを始めてみよう!」
第1回名古屋Grails/Groogy勉強会「Grailsを始めてみよう!」第1回名古屋Grails/Groogy勉強会「Grailsを始めてみよう!」
第1回名古屋Grails/Groogy勉強会「Grailsを始めてみよう!」
 
Groovy ネタ NGK 忘年会2009 ライトニングトーク
Groovy ネタ NGK 忘年会2009 ライトニングトークGroovy ネタ NGK 忘年会2009 ライトニングトーク
Groovy ネタ NGK 忘年会2009 ライトニングトーク
 
JGGUG Camp 2009 いっぽう熱海では、
JGGUG Camp 2009 いっぽう熱海では、JGGUG Camp 2009 いっぽう熱海では、
JGGUG Camp 2009 いっぽう熱海では、
 
ExtJS勉強会@名古屋
ExtJS勉強会@名古屋ExtJS勉強会@名古屋
ExtJS勉強会@名古屋
 
はじめてのGroovy
はじめてのGroovyはじめてのGroovy
はじめてのGroovy
 
GrailsでSpringをGroovyにしよう!
GrailsでSpringをGroovyにしよう!GrailsでSpringをGroovyにしよう!
GrailsでSpringをGroovyにしよう!
 
Grails-1.1を斬る!~Grails-1.1からのチーム開発~ in Tokyo
Grails-1.1を斬る!~Grails-1.1からのチーム開発~ in TokyoGrails-1.1を斬る!~Grails-1.1からのチーム開発~ in Tokyo
Grails-1.1を斬る!~Grails-1.1からのチーム開発~ in Tokyo
 
「Grails-1.1を斬る!〜Grails-1.1からのチーム開発〜」
「Grails-1.1を斬る!〜Grails-1.1からのチーム開発〜」「Grails-1.1を斬る!〜Grails-1.1からのチーム開発〜」
「Grails-1.1を斬る!〜Grails-1.1からのチーム開発〜」
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

G*なクラウド ~雲のかなたに~