名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン
Upcoming SlideShare
Loading in...5
×
 

名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン

on

  • 2,811 views

 

Statistics

Views

Total Views
2,811
Views on SlideShare
2,332
Embed Views
479

Actions

Likes
0
Downloads
6
Comments
0

4 Embeds 479

http://d.hatena.ne.jp 466
http://webcache.googleusercontent.com 6
http://www.slideshare.net 5
http://hatenatunnel.appspot.com 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン 名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン Presentation Transcript

  • JGGUG japan grails/groovy user group DTP Web 80% Grails Struts JGGUG( ) Grails 9-11 Grails Acegi Plugin http://d.hatena.ne.jp/mottsnite/ twitter @tyama
  • Grails CMS
  • public class HelloWorld { String name; public void setName(String name){ this.name = name; } public String getName(){ return name; } public String greet(){ return "Hello "+name; } public static void main(String[] args){ HelloWorld helloWorld = new HelloWorld(); helloWorld.setName("Groovy"); System.out.println(helloWorld.greet()); } } View slide
  • public class HelloWorld { String name; public void setName(String name){ this.name = name; } public String getName(){ return name; } public String greet(){ return "Hello "+name; } public static void main(String[] args){ HelloWorld helloWorld = new HelloWorld(); helloWorld.setName("Groovy"); System.out.println(helloWorld.greet()); } } View slide
  • public class HelloWorld { String name public void setName(String name){ this.name = name } public String getName(){ return name } public String greet(){ return "Hello "+name } public static void main(String[] args){ HelloWorld helloWorld = new HelloWorld() helloWorld.setName("Groovy") System.out.println(helloWorld.greet()) } }
  • public class HelloWorld { String name public String greet(){ return "Hello "+name } public static void main(String[] args){ HelloWorld helloWorld = new HelloWorld() helloWorld.setName("Groovy") System.out.println(helloWorld.greet()) } }
  • public class HelloWorld { String name public String greet(){ return "Hello "+name } } HelloWorld helloWorld = new HelloWorld() helloWorld.setName("Groovy") System.out.println(helloWorld.greet())
  • class HelloWorld { String name def greet(){ return "Hello "+name } } def helloWorld = new HelloWorld() helloWorld.setName("Groovy") println(helloWorld.greet())
  • class HelloWorld { String name def greet(){ return "Hello "+name } } def helloWorld = new HelloWorld() helloWorld.name = "Groovy" println helloWorld.greet()
  • class HelloWorld { String name def greet(){ "Hello $name"} } def helloWorld = new HelloWorld() helloWorld.name = "Groovy" println helloWorld.greet()
  • class HelloWorld { String name def greet(){ "Hello $name"} } def helloWorld = new HelloWorld(name: "Groovy") println helloWorld.greet()
  • def arr = [1,2,3,'hoge'] def map = [a:1,b:2,c:'hoge']
  • @Grab('net.homeip.yusuke:twitter4j:[2.0,)') import twitter4j.* def user="username",pass="pass" new Twitter(user,pass).friendsTimeline.each { println "${it.user.name}: ${it.text}" } maven
  • GAE/J+Grails PermGen
  • http://gist.github.com/263610
  • grails create-app myapp cd myapp grails create-domain-class jp.grails.Todo grails create-controller jp.grails.Todo
  • http://gist.github.com/263610
  • grails install-plugin app-engine jpa/jdo ”jpa”
  • grails install-plugin gorm-jpa
  • google.appengine.application="mygaeapp"
  • http://gist.github.com/263511 @Entity class Chat implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) Long id @Column ... ... String message JPA class Chat { ... ... String message ... ... grails generate-all jp.grails.Chat app-engine
  • s/Groovy/Grails/ Gr stringchararrayaccessor.disabled=true
  • grails.project.plugins.dir="plugins"
  • 11
  • http://gist.github.com/263509 import groovy.xml.StreamingMarkupBuilder import groovy.xml.MarkupBuilder includeTargets << new File("${appEnginePluginDir}/scripts/_AppEngineCommon.groovy") eventStatusFinal = { msg -> def appXmlFile = new File("$stagingDir/WEB-INF/appengine-web.xml") def xml = new XmlSlurper().parse(appXmlFile) xml."system-properties".appendNode { property(name:"stringchararrayaccessor.disabled",value:"true") } def smb = new StreamingMarkupBuilder() def result = smb.bind{ mkp.declareNamespace("":"http://appengine.google.com/ns/1.0") mkp.yield xml } new FileOutputStream(appXmlFile).withWriter('UTF8'){w-> w << result } } <appengine-web-app xmlns='http://appengine.google.com/ns/1.0'> <application>jggugv4</application> <version>2</version> <sessions-enabled>true</sessions-enabled> <ssl-enabled>true</ssl-enabled> <system-properties> <property name='stringchararrayaccessor.disabled' value='true'/> </appengine-web-app>
  • $ grails app-engine run = GAE grails set-version 1 GAE grails app-engine package GAE SDK $APPENGINE_HOME/bin/appcfg.sh update ./target/war grails app-engine deploy
  • APPENGINE_HOME export APPENGINE_HOME=/opt/appengine-java-sdk-1.3.0 grails install-plugin app-engine grails install-plugin gorm-jpa grails app-engine run grails set-version 1 grails app-engine package GAE SDK $APPENGINE_HOME/bin/appcfg.sh update ./target/war grails app-engine package $APPENGINE_HOME/bin/appcfg.sh update ./target/war
  • Grails/Groovy http://www.jggug.org/