SlideShare a Scribd company logo
1 of 21
Plugins
Mail plugin
• Install:
grails install-plugin mail
Dependency:
compile "org.grails.plugins:mail:1.0.7"
sendMail {
to "fred@g2one.com"
subject "Hello Fred"
body 'How are you?'
}
Mail plugin
sendMail {
to "fred@g2one.com"
subject "Hello John"
html '<b>Hello</b> World'
}
=======================================
sendMail {
to "john@g2one.com"
subject "Hello John"
html g.render(template:"myMailTemplate")
}
Mail plugin async
sendMail {
async true
to "john@g2one.com"
subject "Hello John"
html g.render(template:"myMailTemplate")
}
===========
sendMail {
multipart true
to issue.watchers.email.toArray()
subject "The issue you watch has been updated"
body "Hello Watcher!"
attachBytes "Some-File-Name.xml", "text/xml", contentOrder.getBytes("UTF-8")
//To get started quickly, try the following
//attachBytes './web-app/images/grails_logo.jpg','image/jpg', new File('./web-
app/images/grails_logo.jpg').readBytes()
Mail plugin
Configuration(grails-app/Config.groovy)
grails {
mail {
host = "smtp.gmail.com"
port = 465
username = "youracount@gmail.com"
password = "yourpassword"
props = ["mail.smtp.auth":"true",
"mail.smtp.socketFactory.port":"465",
"mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory
",
"mail.smtp.socketFactory.fallback":"false"]
}
}
Mail plugin default
grails.mail.default.from=""
grails.mail.overrideAddress=""
grails.mail.poolSize=5
Quartz plugin
Quartz plugin allows your Grails application to schedule jobs to
be executed using a specified interval or cron expression.
Dependency:
compile "org.grails.plugins:quartz:1.0.2"
compile ':quartz:1.0.1' (build.config)
Quartz plugin
Job Scheduling:
class MyJob {
static triggers = {
simple name: 'mySimpleTrigger', startDelay: 60000,
repeatInterval: 1000
}
def group = "MyGroup"
def description = "Example job with Simple Trigger"
def execute(){
print "Job run!"
}
Quartz plugin cron
Cron expression:
cronExpression: "s m h D M W Y"
| | | | | | `- Year [optional]
| | | | | `- Day of Week, 1-7 or SUN-SAT, ?
| | | | `- Month, 1-12 or JAN-DEC
| | | `- Day of Month, 1-31, ?
| | `- Hour, 0-23
| `- Minute, 0-59
`- Second, 0-59
Quartz with cron
class MyJob {
static triggers = {
cron name: 'myTrigger', cronExpression: "0 0 6 * * ?"
}
def group = "MyGroup"
def description = "Example job with Cron Trigger"
def execute(){
print "Job run!"
}
}
Quartz configuration
quartz {
autoStartup = true
jdbcStore = false
}
environments {
test {
quartz {
autoStartup = false
}
}
}
Console plugin
Console plugin provides a web-based Groovy console for
interactive runtime application management and debugging.
Dependency:
compile "org.grails.plugins:console:1.5.7"
plugins {
runtime ':console:1.5.7'
}
Local Storage uses HTML5 Web Storage. The files are serialized
and stored in the browser as a map under the key gconsole.files.
Remote Storage uses the filesystem of the server on which the
application is running.
Console plugin
Implicit variable:
ctx - the Spring ApplicationContext
grailsApplication - the GrailsApplication instance
config - the Grails configuration
request - the current HTTP request
session - the current HTTP session
out - the output PrintStream
restricting access to localhost Ips:
grails.plugin.springsecurity.controllerAnnotations.staticRules = [
"/console/**": ["hasRole('ROLE_ADMIN') &&
(hasIpAddress('127.0.0.1') || hasIpAddress('::1'))"],
"/plugins/console*/**": ["hasRole('ROLE_ADMIN') &&
(hasIpAddress('127.0.0.1') || hasIpAddress('::1'))"]
]
Console plugin
Console plugin command
Key Command
Ctrl-Enter / Cmd-Enter Execute
Ctrl-S / Cmd-S Save
EscClear output
Link:(For properties and their description)
https://github.com/sheehan/grails-
console/blob/master/README.md
DB migration plugin
The Database Migration plugin helps you manage database
changes while developing Grails applications. The plugin uses
the Liquibase library.
Dependency:
runtime "org.grails.plugins:database-migration:1.4.1"
plugins {
runtime ':database-migration:1.3.6'
}
All of the scripts start with dbm- to ensure that they're unique and
don't clash with scripts from Grails or other plugins.
DB migration plugin
To generate changelog
• grails dbm-generate-gorm-changelog changelog.xml
To sync db with changelog
• grails dbm-changelog-sync
Database Migration plugin uses ./grails-app/migrations as the
default. So, you can either move your scripts or add this setting
to your grails-app/conf/Config.groovy file:
• grails.plugin.databasemigration.changelogLocation =
"whereEverYouWantLocatin"
DB migration plugin
Link:(Configurations)
http://grails-plugins.github.io/grails-database-migration/docs/manual/gui
grails.plugin.databasemigration.reports.updateOntart = true
grails.plugin.databasemigration.reports.changelogFileName =
changelog-reports.groovy
DB migration plugin
• You have a few options with dbm-gorm-diff:
• dbm-gorm-diff will dump to the console if no filename is
specified, so you can copy/paste from there
• Gorm support(Grails object relational mapping )
create-drop, create, and update
• It's very pessimistic and won't make any changes that could
lose data. So it will add new tables and columns, but won't
drop anything. If you remove a not-null domain class property
you'll find you can't insert anymore since the column is still
there. And it will create not-null columns as nullable since
otherwise existing data would be invalid. It won't even widen
a column e.g. from VARCHAR(100) to VARCHAR(200).
DB migration
Dbm-gorm-diff
This command provide a script that will compare your GORM
current domain model with a database that you specify, and the
result is a Liquibase changeset - dbm-gorm-diff. This is the same
changeset you would get if you exported your domain model to a
scratch database and diffed it with the other database, but it's
more convenient.
Thanks for listening...

More Related Content

What's hot

Instant and offline apps with Service Worker
Instant and offline apps with Service WorkerInstant and offline apps with Service Worker
Instant and offline apps with Service WorkerChang W. Doh
 
Leveraging parse.com for Speedy Development
Leveraging parse.com for Speedy DevelopmentLeveraging parse.com for Speedy Development
Leveraging parse.com for Speedy DevelopmentAndrew Kozlik
 
(DEV307) Introduction to Version 3 of the AWS SDK for Python (Boto) | AWS re:...
(DEV307) Introduction to Version 3 of the AWS SDK for Python (Boto) | AWS re:...(DEV307) Introduction to Version 3 of the AWS SDK for Python (Boto) | AWS re:...
(DEV307) Introduction to Version 3 of the AWS SDK for Python (Boto) | AWS re:...Amazon Web Services
 
API Days Paris - Automatic Testing of (RESTful) API Documentation
API Days Paris - Automatic Testing of (RESTful) API DocumentationAPI Days Paris - Automatic Testing of (RESTful) API Documentation
API Days Paris - Automatic Testing of (RESTful) API DocumentationRouven Weßling
 
Mastering Grails 3 Plugins - GR8Conf EU 2016
Mastering Grails 3 Plugins - GR8Conf EU 2016Mastering Grails 3 Plugins - GR8Conf EU 2016
Mastering Grails 3 Plugins - GR8Conf EU 2016Alvaro Sanchez-Mariscal
 
Service Worker - Reliability bits
Service Worker - Reliability bitsService Worker - Reliability bits
Service Worker - Reliability bitsjungkees
 
Building Android apps with Parse
Building Android apps with ParseBuilding Android apps with Parse
Building Android apps with ParseDroidConTLV
 
Web Automation Testing Using Selenium
Web Automation Testing Using SeleniumWeb Automation Testing Using Selenium
Web Automation Testing Using SeleniumPete Chen
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code維佋 唐
 
Service workers
Service workersService workers
Service workersjungkees
 
Search 500-video-clips
Search 500-video-clipsSearch 500-video-clips
Search 500-video-clipsphanhung20
 
An Overview of Node.js
An Overview of Node.jsAn Overview of Node.js
An Overview of Node.jsAyush Mishra
 
Coolblue - Behind the Scenes Continuous Integration & Deployment
Coolblue - Behind the Scenes Continuous Integration & DeploymentCoolblue - Behind the Scenes Continuous Integration & Deployment
Coolblue - Behind the Scenes Continuous Integration & DeploymentMatthew Hodgkins
 
PWA 應用 - 實現網站離線瀏覽
PWA 應用 - 實現網站離線瀏覽PWA 應用 - 實現網站離線瀏覽
PWA 應用 - 實現網站離線瀏覽Anna Su
 

What's hot (20)

Instant and offline apps with Service Worker
Instant and offline apps with Service WorkerInstant and offline apps with Service Worker
Instant and offline apps with Service Worker
 
Leveraging parse.com for Speedy Development
Leveraging parse.com for Speedy DevelopmentLeveraging parse.com for Speedy Development
Leveraging parse.com for Speedy Development
 
(DEV307) Introduction to Version 3 of the AWS SDK for Python (Boto) | AWS re:...
(DEV307) Introduction to Version 3 of the AWS SDK for Python (Boto) | AWS re:...(DEV307) Introduction to Version 3 of the AWS SDK for Python (Boto) | AWS re:...
(DEV307) Introduction to Version 3 of the AWS SDK for Python (Boto) | AWS re:...
 
API Days Paris - Automatic Testing of (RESTful) API Documentation
API Days Paris - Automatic Testing of (RESTful) API DocumentationAPI Days Paris - Automatic Testing of (RESTful) API Documentation
API Days Paris - Automatic Testing of (RESTful) API Documentation
 
Mastering Grails 3 Plugins - GR8Conf EU 2016
Mastering Grails 3 Plugins - GR8Conf EU 2016Mastering Grails 3 Plugins - GR8Conf EU 2016
Mastering Grails 3 Plugins - GR8Conf EU 2016
 
Service Worker - Reliability bits
Service Worker - Reliability bitsService Worker - Reliability bits
Service Worker - Reliability bits
 
Selenium&amp;scrapy
Selenium&amp;scrapySelenium&amp;scrapy
Selenium&amp;scrapy
 
Building Android apps with Parse
Building Android apps with ParseBuilding Android apps with Parse
Building Android apps with Parse
 
Apache ofbiz
Apache ofbizApache ofbiz
Apache ofbiz
 
Web Automation Testing Using Selenium
Web Automation Testing Using SeleniumWeb Automation Testing Using Selenium
Web Automation Testing Using Selenium
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code
 
Service workers
Service workersService workers
Service workers
 
Node.js and Parse
Node.js and ParseNode.js and Parse
Node.js and Parse
 
Iac d.damyanov 4.pptx
Iac d.damyanov 4.pptxIac d.damyanov 4.pptx
Iac d.damyanov 4.pptx
 
Bosh 2.0
Bosh 2.0Bosh 2.0
Bosh 2.0
 
Svelte JS introduction
Svelte JS introductionSvelte JS introduction
Svelte JS introduction
 
Search 500-video-clips
Search 500-video-clipsSearch 500-video-clips
Search 500-video-clips
 
An Overview of Node.js
An Overview of Node.jsAn Overview of Node.js
An Overview of Node.js
 
Coolblue - Behind the Scenes Continuous Integration & Deployment
Coolblue - Behind the Scenes Continuous Integration & DeploymentCoolblue - Behind the Scenes Continuous Integration & Deployment
Coolblue - Behind the Scenes Continuous Integration & Deployment
 
PWA 應用 - 實現網站離線瀏覽
PWA 應用 - 實現網站離線瀏覽PWA 應用 - 實現網站離線瀏覽
PWA 應用 - 實現網站離線瀏覽
 

Viewers also liked (20)

Command objects
Command objectsCommand objects
Command objects
 
Unit testing
Unit testingUnit testing
Unit testing
 
Bootstrap
BootstrapBootstrap
Bootstrap
 
Config BuildConfig
Config BuildConfigConfig BuildConfig
Config BuildConfig
 
Grails Services
Grails ServicesGrails Services
Grails Services
 
GORM
GORMGORM
GORM
 
Grails Views
Grails ViewsGrails Views
Grails Views
 
Linux Introduction
Linux IntroductionLinux Introduction
Linux Introduction
 
Introduction to Grails
Introduction to GrailsIntroduction to Grails
Introduction to Grails
 
Meta Programming in Groovy
Meta Programming in GroovyMeta Programming in Groovy
Meta Programming in Groovy
 
Groovy
GroovyGroovy
Groovy
 
Groovy intro
Groovy introGroovy intro
Groovy intro
 
Docker
DockerDocker
Docker
 
Introduction to mongo db
Introduction to mongo dbIntroduction to mongo db
Introduction to mongo db
 
Unit test-using-spock in Grails
Unit test-using-spock in GrailsUnit test-using-spock in Grails
Unit test-using-spock in Grails
 
MetaProgramming with Groovy
MetaProgramming with GroovyMetaProgramming with Groovy
MetaProgramming with Groovy
 
Java reflection
Java reflectionJava reflection
Java reflection
 
Actors model in gpars
Actors model in gparsActors model in gpars
Actors model in gpars
 
Grails services
Grails servicesGrails services
Grails services
 
Grails Controllers
Grails ControllersGrails Controllers
Grails Controllers
 

Similar to Grails Plugins

Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016Alvaro Sanchez-Mariscal
 
Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Ryan Cuprak
 
Mastering Grails 3 Plugins - GR8Conf US 2016
Mastering Grails 3 Plugins - GR8Conf US 2016Mastering Grails 3 Plugins - GR8Conf US 2016
Mastering Grails 3 Plugins - GR8Conf US 2016Alvaro Sanchez-Mariscal
 
Agile Database Modeling with Grails - Preview of GORM 1.4 - SF Grails Meetup ...
Agile Database Modeling with Grails - Preview of GORM 1.4 - SF Grails Meetup ...Agile Database Modeling with Grails - Preview of GORM 1.4 - SF Grails Meetup ...
Agile Database Modeling with Grails - Preview of GORM 1.4 - SF Grails Meetup ...Philip Stehlik
 
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 WebJames Rakich
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with GradleRyan Cuprak
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with GradleRyan Cuprak
 
Config BuildConfig
Config BuildConfigConfig BuildConfig
Config BuildConfigVijay Shukla
 
Grails Plugin
Grails PluginGrails Plugin
Grails Pluginguligala
 
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 StoryKon Soulianidis
 
Making the Most of Your Gradle Builds
Making the Most of Your Gradle BuildsMaking the Most of Your Gradle Builds
Making the Most of Your Gradle BuildsEgor Andreevich
 
Grails Plugin Best Practices
Grails Plugin Best PracticesGrails Plugin Best Practices
Grails Plugin Best PracticesBurt Beckwith
 
Mastering Grails 3 Plugins - Greach 2016
Mastering Grails 3 Plugins - Greach 2016Mastering Grails 3 Plugins - Greach 2016
Mastering Grails 3 Plugins - Greach 2016Alvaro Sanchez-Mariscal
 
Automating Front-End Workflow
Automating Front-End WorkflowAutomating Front-End Workflow
Automating Front-End WorkflowDimitris Tsironis
 
Google App Engine with Gaelyk
Google App Engine with GaelykGoogle App Engine with Gaelyk
Google App Engine with GaelykChoong Ping Teo
 
Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)Jared Burrows
 
Gradle - Build system evolved
Gradle - Build system evolvedGradle - Build system evolved
Gradle - Build system evolvedBhagwat Kumar
 
Config/BuildConfig
Config/BuildConfigConfig/BuildConfig
Config/BuildConfigVijay Shukla
 

Similar to Grails Plugins (20)

Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016
 
Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]
 
Mastering Grails 3 Plugins - GR8Conf US 2016
Mastering Grails 3 Plugins - GR8Conf US 2016Mastering Grails 3 Plugins - GR8Conf US 2016
Mastering Grails 3 Plugins - GR8Conf US 2016
 
Agile Database Modeling with Grails - Preview of GORM 1.4 - SF Grails Meetup ...
Agile Database Modeling with Grails - Preview of GORM 1.4 - SF Grails Meetup ...Agile Database Modeling with Grails - Preview of GORM 1.4 - SF Grails Meetup ...
Agile Database Modeling with Grails - Preview of GORM 1.4 - SF Grails Meetup ...
 
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
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
 
Config BuildConfig
Config BuildConfigConfig BuildConfig
Config BuildConfig
 
Grails Plugin
Grails PluginGrails Plugin
Grails Plugin
 
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
 
Making the Most of Your Gradle Builds
Making the Most of Your Gradle BuildsMaking the Most of Your Gradle Builds
Making the Most of Your Gradle Builds
 
Spring boot
Spring bootSpring boot
Spring boot
 
Grails Plugin Best Practices
Grails Plugin Best PracticesGrails Plugin Best Practices
Grails Plugin Best Practices
 
Mastering Grails 3 Plugins - Greach 2016
Mastering Grails 3 Plugins - Greach 2016Mastering Grails 3 Plugins - Greach 2016
Mastering Grails 3 Plugins - Greach 2016
 
Automating Front-End Workflow
Automating Front-End WorkflowAutomating Front-End Workflow
Automating Front-End Workflow
 
Google App Engine with Gaelyk
Google App Engine with GaelykGoogle App Engine with Gaelyk
Google App Engine with Gaelyk
 
Google Gears
Google GearsGoogle Gears
Google Gears
 
Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)
 
Gradle - Build system evolved
Gradle - Build system evolvedGradle - Build system evolved
Gradle - Build system evolved
 
Config/BuildConfig
Config/BuildConfigConfig/BuildConfig
Config/BuildConfig
 

More from NexThoughts Technologies (20)

Alexa skill
Alexa skillAlexa skill
Alexa skill
 
GraalVM
GraalVMGraalVM
GraalVM
 
Docker & kubernetes
Docker & kubernetesDocker & kubernetes
Docker & kubernetes
 
Apache commons
Apache commonsApache commons
Apache commons
 
HazelCast
HazelCastHazelCast
HazelCast
 
MySQL Pro
MySQL ProMySQL Pro
MySQL Pro
 
Microservice Architecture using Spring Boot with React & Redux
Microservice Architecture using Spring Boot with React & ReduxMicroservice Architecture using Spring Boot with React & Redux
Microservice Architecture using Spring Boot with React & Redux
 
Swagger
SwaggerSwagger
Swagger
 
Solid Principles
Solid PrinciplesSolid Principles
Solid Principles
 
Arango DB
Arango DBArango DB
Arango DB
 
Jython
JythonJython
Jython
 
Introduction to TypeScript
Introduction to TypeScriptIntroduction to TypeScript
Introduction to TypeScript
 
Smart Contract samples
Smart Contract samplesSmart Contract samples
Smart Contract samples
 
My Doc of geth
My Doc of gethMy Doc of geth
My Doc of geth
 
Geth important commands
Geth important commandsGeth important commands
Geth important commands
 
Ethereum genesis
Ethereum genesisEthereum genesis
Ethereum genesis
 
Ethereum
EthereumEthereum
Ethereum
 
Springboot Microservices
Springboot MicroservicesSpringboot Microservices
Springboot Microservices
 
An Introduction to Redux
An Introduction to ReduxAn Introduction to Redux
An Introduction to Redux
 
Google authentication
Google authenticationGoogle authentication
Google authentication
 

Recently uploaded

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 DiscoveryTrustArc
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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 organizationRadu Cotescu
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
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...apidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
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 2024The Digital Insurer
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
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 CVKhem
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 

Recently uploaded (20)

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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
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...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
+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...
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Grails Plugins

  • 2. Mail plugin • Install: grails install-plugin mail Dependency: compile "org.grails.plugins:mail:1.0.7" sendMail { to "fred@g2one.com" subject "Hello Fred" body 'How are you?' }
  • 3. Mail plugin sendMail { to "fred@g2one.com" subject "Hello John" html '<b>Hello</b> World' } ======================================= sendMail { to "john@g2one.com" subject "Hello John" html g.render(template:"myMailTemplate") }
  • 4. Mail plugin async sendMail { async true to "john@g2one.com" subject "Hello John" html g.render(template:"myMailTemplate") } =========== sendMail { multipart true to issue.watchers.email.toArray() subject "The issue you watch has been updated" body "Hello Watcher!" attachBytes "Some-File-Name.xml", "text/xml", contentOrder.getBytes("UTF-8") //To get started quickly, try the following //attachBytes './web-app/images/grails_logo.jpg','image/jpg', new File('./web- app/images/grails_logo.jpg').readBytes()
  • 5. Mail plugin Configuration(grails-app/Config.groovy) grails { mail { host = "smtp.gmail.com" port = 465 username = "youracount@gmail.com" password = "yourpassword" props = ["mail.smtp.auth":"true", "mail.smtp.socketFactory.port":"465", "mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory ", "mail.smtp.socketFactory.fallback":"false"] } }
  • 7. Quartz plugin Quartz plugin allows your Grails application to schedule jobs to be executed using a specified interval or cron expression. Dependency: compile "org.grails.plugins:quartz:1.0.2" compile ':quartz:1.0.1' (build.config)
  • 8. Quartz plugin Job Scheduling: class MyJob { static triggers = { simple name: 'mySimpleTrigger', startDelay: 60000, repeatInterval: 1000 } def group = "MyGroup" def description = "Example job with Simple Trigger" def execute(){ print "Job run!" }
  • 9. Quartz plugin cron Cron expression: cronExpression: "s m h D M W Y" | | | | | | `- Year [optional] | | | | | `- Day of Week, 1-7 or SUN-SAT, ? | | | | `- Month, 1-12 or JAN-DEC | | | `- Day of Month, 1-31, ? | | `- Hour, 0-23 | `- Minute, 0-59 `- Second, 0-59
  • 10. Quartz with cron class MyJob { static triggers = { cron name: 'myTrigger', cronExpression: "0 0 6 * * ?" } def group = "MyGroup" def description = "Example job with Cron Trigger" def execute(){ print "Job run!" } }
  • 11. Quartz configuration quartz { autoStartup = true jdbcStore = false } environments { test { quartz { autoStartup = false } } }
  • 12. Console plugin Console plugin provides a web-based Groovy console for interactive runtime application management and debugging. Dependency: compile "org.grails.plugins:console:1.5.7" plugins { runtime ':console:1.5.7' } Local Storage uses HTML5 Web Storage. The files are serialized and stored in the browser as a map under the key gconsole.files. Remote Storage uses the filesystem of the server on which the application is running.
  • 13. Console plugin Implicit variable: ctx - the Spring ApplicationContext grailsApplication - the GrailsApplication instance config - the Grails configuration request - the current HTTP request session - the current HTTP session out - the output PrintStream restricting access to localhost Ips: grails.plugin.springsecurity.controllerAnnotations.staticRules = [ "/console/**": ["hasRole('ROLE_ADMIN') && (hasIpAddress('127.0.0.1') || hasIpAddress('::1'))"], "/plugins/console*/**": ["hasRole('ROLE_ADMIN') && (hasIpAddress('127.0.0.1') || hasIpAddress('::1'))"] ]
  • 15. Console plugin command Key Command Ctrl-Enter / Cmd-Enter Execute Ctrl-S / Cmd-S Save EscClear output Link:(For properties and their description) https://github.com/sheehan/grails- console/blob/master/README.md
  • 16. DB migration plugin The Database Migration plugin helps you manage database changes while developing Grails applications. The plugin uses the Liquibase library. Dependency: runtime "org.grails.plugins:database-migration:1.4.1" plugins { runtime ':database-migration:1.3.6' } All of the scripts start with dbm- to ensure that they're unique and don't clash with scripts from Grails or other plugins.
  • 17. DB migration plugin To generate changelog • grails dbm-generate-gorm-changelog changelog.xml To sync db with changelog • grails dbm-changelog-sync Database Migration plugin uses ./grails-app/migrations as the default. So, you can either move your scripts or add this setting to your grails-app/conf/Config.groovy file: • grails.plugin.databasemigration.changelogLocation = "whereEverYouWantLocatin"
  • 19. DB migration plugin • You have a few options with dbm-gorm-diff: • dbm-gorm-diff will dump to the console if no filename is specified, so you can copy/paste from there • Gorm support(Grails object relational mapping ) create-drop, create, and update • It's very pessimistic and won't make any changes that could lose data. So it will add new tables and columns, but won't drop anything. If you remove a not-null domain class property you'll find you can't insert anymore since the column is still there. And it will create not-null columns as nullable since otherwise existing data would be invalid. It won't even widen a column e.g. from VARCHAR(100) to VARCHAR(200).
  • 20. DB migration Dbm-gorm-diff This command provide a script that will compare your GORM current domain model with a database that you specify, and the result is a Liquibase changeset - dbm-gorm-diff. This is the same changeset you would get if you exported your domain model to a scratch database and diffed it with the other database, but it's more convenient.