Showing posts with label Grails. Show all posts
Showing posts with label Grails. Show all posts

Authenticating a new user - Grails - Spring Security REST

http://stackoverflow.com/questions/25543592/rest-spring-security-manually-authenticating-a-new-user-and-getting-access-to

Groovy style

http://groovy.codehaus.org/Groovy+style+and+language+feature+guidelines+for+Java+developers

Grails event driven architecture

Grails event driven architecture


http://www.slideshare.net/pledbrook/grails-application-architectures
http://grails.org/plugin/spring-events
https://www.youtube.com/watch?v=ih3qo87qq0g&list=PLXcHRe1w86EdmLLNs1chNt5QdEJb_skTj#t=802

Deploy Grails app to the EC2 instance


Deploy Grails app to the EC2 instance


1) Download private_key.pem private key for amazon instance connection to the private folder
2) cd ~/private
3) chmod 400 private_key.pem
4) ssh -i ./private_key.pem ubuntu@my.ec2.com
5) Install Tomcat
tar xvzf apache-tomcat-7.0.59.tar.gz
wget http://apache.cp.if.ua/tomcat/tomcat-7/v7.0.59/bin/apache-tomcat-7.0.59.tar.gz
6) Get ROOT.war file of your Grails app with production settings
7) Copy ROOT.war to remote server
scp -i ../../../../private/private_key.pem ROOT.war ubuntu@my.ec2.com:/opt/apache-tomcat-7.0.59/webapps
8) Rename apache-tomcat-7.0.59 to AppName
9) Enable log
tail -f catalina.out
10) Srartup
/opt/AppName/bin$ ./catalina.sh srartup


============= Additional notes ================

// Reloading nginx configuration
/etc/nginx/sites-available# /etc/init.d/nginx reload

// Delete all from /opt/AppName/temp and /opt/AppName/work from db.
// Terminate tomcat
ps aux | grep tomcat
sudo kill -9 PORT

// Delete ROOT folder from /opt/AppName/webapps
sudo rm -r ROOT

// Stop process
ps aux|grep tomcat
lsof -i:8127
kill 4749



Grails AWS SDK

Grails AWS SDK


https://github.com/agorapulse/grails-aws-sdk
https://github.com/agorapulse/grails-aws-sdk-demo/blob/master/grails-app/controllers/aws/sdk/demo/S3Controller.groovy
http://stackoverflow.com/questions/15953587/how-can-attach-new-ebs-volume-to-existing-ec2-instance-using-java-sdk
http://stackoverflow.com/questions/13543071/invalidamiid-notfound-aws-error-message-the-ami-id-ami-c1aaabb5-does-not-exi

Grails criteria queries


Grails criteria queries

http://stackoverflow.com/questions/22176491/grails-where-query-with-optional-associations
http://stackoverflow.com/questions/15947481/dynamically-creating-a-query-based-on-params-being-passed-to-a-controller

Grails Websocket

Grails Websocket

https://github.com/vahidhedayati/grails-websocket-example/blob/master/README.md
http://docs.spring.io/spring/docs/current/spring-framework-reference/html/websocket.html#websocket-stomp-authentication
https://github.com/alvarosanchez/grails-spring-security-rest/issues/146
http://www.grazal.de/blog/WebSockets-mit-Grails-2.4-Spring-4.0
https://github.com/zyro23/grails-spring-websocket
https://github.com/zyro23/grails-spring-websocket-sample-events

Websocket annotations

http://docs.spring.io/spring/docs/current/spring-framework-reference/html/websocket.htmlhttp://assets.spring.io/wp/WebSocketBlogPost.html









Grails: custom response marshalling

Grails: custom response marshalling

I have chosen this one:
https://github.com/aruizca/grails-marshallers

But there are a lot of topics:

https://jira.grails.org/browse/GRAILS-10567
http://stackoverflow.com/questions/24171450/grails-excluding-class-from-json-response-works-only-after-hot-code-loading
http://stackoverflow.com/questions/8175286/custom-string-formatting-in-grails-json-marshaller/8186689#8186689
http://stackoverflow.com/questions/10188643/how-to-register-a-custom-json-marshaller-in-grails
http://manbuildswebsite.com/2010/02/15/rendering-json-in-grails-part-3-customise-your-json-with-object-marshallers/
http://stackoverflow.com/questions/4973919/inject-grails-application-configuration-into-service


Grails app with Spring Security REST (example)

Grails app with Spring Security REST (example)
https://github.com/alvarosanchez/restful-grails-springsecurity-greach2014

Grails Tests

Grails Tests
http://stackoverflow.com/questions/23916383/test-restfulcontroller-with-grails