This document discusses creating and distributing Grails custom plugins. It covers:
1. What a plugin is and how to create one using "grails create-plugin".
2. The structure of a plugin project and key files like the plugin descriptor class.
3. How to add functionality to a plugin like controllers, services, scripts, and dynamic methods.
4. Distributing a plugin locally or by publishing to the Grails plugin repository so other projects can install it.
5. Hooking a plugin into build events, configuration, and controlling plugin loading order and dependencies.
Friday session where we explained what is gradle and some of the hidden features and possibilities that gradle gives to developers to customize their builds in a clean and easy way.
What's new with the Gradle Daemon in Gradle 3.0, how to maximize performance with the Gradle Daemon, and where it will be going in the future. Presented at the Gradle Summit 2016.
The Drizzle Project is a fork of the MySQL 6.0 server. One of the many goals of Drizzle is to enable a large plugin ecosystem by improving, simplifying, and modernizing the application programming interfaces between the kernel and the modules providing services for Drizzle. This tutorial serves to showcase the new APIs for Drizzle's replication through a series of in-depth examples.
Friday session where we explained what is gradle and some of the hidden features and possibilities that gradle gives to developers to customize their builds in a clean and easy way.
What's new with the Gradle Daemon in Gradle 3.0, how to maximize performance with the Gradle Daemon, and where it will be going in the future. Presented at the Gradle Summit 2016.
The Drizzle Project is a fork of the MySQL 6.0 server. One of the many goals of Drizzle is to enable a large plugin ecosystem by improving, simplifying, and modernizing the application programming interfaces between the kernel and the modules providing services for Drizzle. This tutorial serves to showcase the new APIs for Drizzle's replication through a series of in-depth examples.
Here are slides from basic training for Gradle.
This training is aimed to help Java Developers to get hands-on experience to use Gradle as a primary build tool for Java source code starting from simple compilation continuing with different kinds of tests and finishing with code quality analysis and artefacts publishing.
Gradle is an open source build automation system that builds upon the concepts of Apache Ant and Apache Maven and introduces a Groovy-based domain-specific language (DSL) instead of the XML form used by Apache Maven for declaring the project configuration.
An Introduction to the Gradle by Mr. Aruna Swain - Senior Software Developer at Nibodha Technologies : Gradle is build automation which can automate the building, testing, publishing, deployment. Ant and Maven have occupied opposing positions on the build continuum over the past decade.Ant and Maven have shared considerable success in the Java marketplace,despite important shortcomings in both tools.On the one hand, Gradle presents itself as a sensible middle ground between both extremes, offering thoughtful conventions for your build, and making it easy for you to extend or redefine those conventions when you want to. - See more at: http://www.nibodha.com/blog/?p=328#sthash.woOHgiJd.dpuf
A look at some of the configuration issues that containers introduce, and how to avoid or fix them. Discusses immutable infrastructure, the difference between build-time and runtime configuration, scheduler configuration and more.
Here are the slides from Gareth Rushgrove's PuppetConf 2016 presentation called Running Puppet Software in Docker Containers. Watch the videos at https://www.youtube.com/playlist?list=PLV86BgbREluVjwwt-9UL8u2Uy8xnzpIqa
How to Implement Micro Frontend Architecture using Angular FrameworkRapidValue
Micro-frontends are small applications mostly divided by subdomain or functionality working together to deliver a larger application. Sometimes your frontend app might be a small part of another big application or your app consists a lot of sections and features which are developed by different teams or your app is being released into production feature by feature with developed by separate teams. If you are in one of these situations then you need to think about Micro Frontends. For more information visit: https://www.rapidvaluesolutions.com/
With Grails 3, the plugin development experience changes a little bit compared to that of Grails 2. In this talk, Álvaro (member of the Grails team at OCI, Grails committer and author of several plugins) will cover several topics to understand how plugins work in Grails 3, focusing on best practices.
The session is structured as a set of tips and tricks with code samples in the following areas: modularisation, build system, testing and publishing.
Here are slides from basic training for Gradle.
This training is aimed to help Java Developers to get hands-on experience to use Gradle as a primary build tool for Java source code starting from simple compilation continuing with different kinds of tests and finishing with code quality analysis and artefacts publishing.
Gradle is an open source build automation system that builds upon the concepts of Apache Ant and Apache Maven and introduces a Groovy-based domain-specific language (DSL) instead of the XML form used by Apache Maven for declaring the project configuration.
An Introduction to the Gradle by Mr. Aruna Swain - Senior Software Developer at Nibodha Technologies : Gradle is build automation which can automate the building, testing, publishing, deployment. Ant and Maven have occupied opposing positions on the build continuum over the past decade.Ant and Maven have shared considerable success in the Java marketplace,despite important shortcomings in both tools.On the one hand, Gradle presents itself as a sensible middle ground between both extremes, offering thoughtful conventions for your build, and making it easy for you to extend or redefine those conventions when you want to. - See more at: http://www.nibodha.com/blog/?p=328#sthash.woOHgiJd.dpuf
A look at some of the configuration issues that containers introduce, and how to avoid or fix them. Discusses immutable infrastructure, the difference between build-time and runtime configuration, scheduler configuration and more.
Here are the slides from Gareth Rushgrove's PuppetConf 2016 presentation called Running Puppet Software in Docker Containers. Watch the videos at https://www.youtube.com/playlist?list=PLV86BgbREluVjwwt-9UL8u2Uy8xnzpIqa
How to Implement Micro Frontend Architecture using Angular FrameworkRapidValue
Micro-frontends are small applications mostly divided by subdomain or functionality working together to deliver a larger application. Sometimes your frontend app might be a small part of another big application or your app consists a lot of sections and features which are developed by different teams or your app is being released into production feature by feature with developed by separate teams. If you are in one of these situations then you need to think about Micro Frontends. For more information visit: https://www.rapidvaluesolutions.com/
With Grails 3, the plugin development experience changes a little bit compared to that of Grails 2. In this talk, Álvaro (member of the Grails team at OCI, Grails committer and author of several plugins) will cover several topics to understand how plugins work in Grails 3, focusing on best practices.
The session is structured as a set of tips and tricks with code samples in the following areas: modularisation, build system, testing and publishing.
Improving build solutions dependency management with webpackNodeXperts
Do you know ? - " The fine art of Webpack "
Topics Covered :
- What are Build Tools ?
- What is a Dependency graph ?
- What is webpack & its impacts
- What is a webpack config file and how is it written ?
- Webpack VS Grunt/Gulp & Browserify
With Grails 3, the plugin development experience changes a little bit compared to that of Grails 2. In this talk, Álvaro (member of the Grails team at OCI, Grails committer and author of several plugins) will cover several topics to understand how plugins work in Grails 3, focusing on best practices.
The session is structured as a set of tips and tricks with code samples in the following areas: modularisation, build system, testing and publishing.
With Grails 3, the plugin development experience changes a little bit compared to that of Grails 2. In this talk, Álvaro (member of the Grails team at OCI, Grails committer and author of several plugins) will cover several topics to understand how plugins work in Grails 3, focusing on best practices.
The session is structured as a set of tips and tricks with code samples in the following areas: modularisation, build system, testing and publishing.
Cut your Grails application to pieces - build feature pluginsGR8Conf
Reuse has been taught in CS classes since the very beginning. But how should you practically do to reuse functionality from one Grails application in other applications? The plugin subsystem in Grails is an awesome machinery that makes it easy to separate functionality into distinct plugins. Plugins that can be used in many applications with similar functionality. Yet have unique features without creating a maintenance hell.
In this session you will learn how to think "feature plugins" when you're designing and developing your Grails applications. We will cover topics like inter-plugin communication using application events and how to support different look and feel for each application using "theme plugins". You will also learn how each plugin can be tested and documented separately from the application.
After this session "grails create-plugin" will be your best friend.
The Asset-Pipeline is a plugin used for resource management i.e., managing and processing static assets in Grails applications.
Asset-Pipeline functions include processing and minification of both CSS and JavaScript files during compile time.
It is also capable of being extended to compile custom static assets, such as LESS, CoffeeScript, SASS.
Agenda:
-> Overview
-> Advantages over Standard grails asset Resource Plugin
-> Usage?
-> Assets Bundling
-> Assets Minification
-> Behaviour With and Without Asset-Pipeline
-> Developing with Asset-Pipeline
-> Javascript Manifest file: application.js
-> Css Manifest file: application.css
-> Directives
-> Dynamic Directives
-> Including Assets in Grails app views
-> Linking to Assets in GSP views
-> How to add page specific file
-> Other References
More Enhancements to Grails:
Topics covered:
Grails Plugins
Resources
Restful API
Integration Tests
What’s new in grails 2.0
What’s new in grails 2.1
What’s new in grails 2.2
How to upgrade plugins
CommissionCalculation/build/classes/.netbeans_automatic_build
CommissionCalculation/build/classes/.netbeans_update_resources
CommissionCalculation/build/classes/commissioncalculation/CommissionCalculation.rs
CommissionCalculation/build/classes/commissioncalculation/SalesPerson.rs
CommissionCalculation/build/classes/CommissionCalculation.classpublicsynchronizedclass CommissionCalculation {
public void CommissionCalculation();
publicstatic void main(String[]);
}
CommissionCalculation/build/classes/SalesPerson.classpublicsynchronizedclass SalesPerson {
privatefinal double fixedSalary;
privatefinal double commissionRate;
privatefinal double salesTarget;
privatefinal double accelerationfactor;
private String name;
private double totalComm;
private double annualSales;
public SalesPerson saleperson;
public double getTotalComm();
public void setTotalComm(double);
public SalesPerson getSaleperson();
public void setSaleperson(SalesPerson);
public String getName();
public void setName(String);
public void SalesPerson();
public void SalesPerson(String, double, double);
public void SalesPerson(double);
public double getAnnualSales();
public void setAnnualSales(double);
public double getCommission();
public double getAnnualCompensation();
}
CommissionCalculation/build.xml
Builds, tests, and runs the project CommissionCalculation.
CommissionCalculation/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
META-INF/MANIFEST.MF
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.9.2
Created-By: 1.7.0_25-b15 (Oracle Corporation)
NetBeans-Own-Library: true
org/netbeans/modules/java/j2seproject/copylibstask/Bundle.properties
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
#
# Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
#
# Oracle and Java are registered trademarks of Oracle and/or its affiliates.
# Other names may be trademarks of their respective owners.
#
# The contents of this file are subject to the terms of either the GNU
# General Public License Version 2 only ("GPL") or the Common
# Development and Distribution License("CDDL") (collectively, the
# "License"). You may not use this file except in compliance with the
# License. You can obtain a copy of the License at
# http://www.netbeans.org/cddl-gplv2.html
# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
# specific language governing permissions and limitations under the
# License. When distributing the software, include this License Header
# Notice in each file and include the License file at
# nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the GPL Version 2 section of the License file that
# accompanied this code. If applicable, add the following below the
# License Header, with the fields enclosed by brackets [] replaced b.
With Grails 3, the plugin development experience changes a little bit compared to that of Grails 2. In this talk, Álvaro (member of the Grails team at OCI, Grails committer and author of several plugins) will cover several topics to understand how plugins work in Grails 3, focusing on best practices.
The session is structured as a set of tips and tricks with code samples in the following areas: modularisation, build system, testing and publishing.
Adam has authored CodeIgniter 1.7 Professional Development; the first advanced CodeIgniter book, gives an overview of what's new with CodeIgniter 2.0, how to upgrade your applications and a detailed overview of how to create drivers.
It is a build tool that puts all of your assets, including Javascript, images, fonts,
CSS, in a dependency graph.
It lets us use require() in our source code to point to local files, like images.
We can decide how they’re processed in our final javascript bundle, like
replacing the path with a URL.
Groovy 3.0 has introduced a lot of features from Java 7 and 8. Here are some features try-with-resource, identity common comparison,!in, !instanceof, etc.
Jython is an implementation of Python for the JVM.
It takes the Python programming languages syntax and enables it to run on the Java Platform.
Most of the Python modules will run without changes under Jython, but if they use extensions then they will probably not work.
Vert.x is a toolkit or platform for implementing reactive applications on the JVM.
General Purpose Application Framework
Polyglot (Java, Groovy, Scala, Kotlin, JavaScript, Ruby and Ceylon)
Event Driven, non-blocking
Lightweight & fast
Reusable modules.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
2. Agenda
× What is plugin.
× Creating and Installing plugin
× Plugin Repositories
× Understanding a Plugin’s Structure
× Evaluating Conventions
× Hooking into Build Events
× Hooking into runtime configuration
× Adding methods at compile time
× Adding Dynamic method at runtime
× Understanding Plugin loader
3. What is Plugin
× A plugin is a software component which adds a specific
feature to an existing software application.
× Very similar to Grails application project
× A plugin descriptor file *GrailsPlugin.groovy
4. Creating and Installing Plugin
grails create-plugin [plugin-name]
× In grails-3.* you should profile to create a plugin.
× If you want to create web environment then
grails create-plugin [plugin-name] --profile=web-plugin
× If you want to create a plugin which will be used with other profile
grails create-plugin [plugin-name] --profile=plugin
Note*:- Make sure the plugin name does not contain more than one capital letter
in a row, or it won't work. Camel case is fine, though.
5. × The structure of a Grails plugin is very nearly the same as a Grails application
project's except that in the src/main/groovy directory under the plugin
package structure you will find a plugin descriptor class (a class that ends in
"GrailsPlugin").
× Being a regular Grails project has a number of benefits in that you can
immediately test your plugin by running (if the plugin targets the "web"
profile):
Note*:- Plugin projects don't provide an index.gsp by default since most plugins
don't need it. So, if you try to view the plugin running in a browser right after
creating it, you will receive a page not found error. You can easily create a grails-
app/views/index.gsp for your plugin if you'd like.
6. Plugin Descriptor
Class CustomGrailsPlugin{
}
This class defines the metadata about the plugin.
× Title:- short one-sentence description of your plugin
× grailsVersion:- The version range of Grails that the plugin supports. eg. "1.2 > *" (indicating 1.2 or
higher)
× Author :- plugin author's name
× authorEmail:- plugin author's contact e-mail
× Description:- full multi-line description of plugin's features
× Documentation:- URL of the plugin's documentation
× License:- License of the plugin
× Issuemanagement:- Issue Tracker of the plugin
× Scm:- Source code management location of the plugin
7. Installing Local Plugin
× Add plugin path in BuildConfig
× Add plugin in local maven then add in BuildConfig
8. Plugin Repositories
× The preferred way to distribute plugin is to publish to the official Grails
Central Plugin Repository. This will make your plugin visible to the list-
plugins command:
grails list-plugins
which lists all plugins that are in the central repository.
× Your plugin will also be available to the plugin-info command:
grails plugin-info [plugin-name]
which prints extra information about it, such as its description, who wrote,
etc.
10. × When plugin installed, will go directly as plugins/custom-plugin/grails-app.
They will not be copied into main source tree.
× When you run the plugin in development mode the link to the resource will
resolve to something like /js/mycode.js. However, when the plugin is installed
into an application the path will automatically change to something like
/plugin/custom-plugin/js/mycode.js and Grails will deal with making sure the
resources are in the right place.
× pluginContextPath is responsible to manage the static resource path.
× At runtime the pluginContextPath variable will either evaluate to an empty
string or /plugins/custom-plugin depending on whether the plugin is running
standalone or has been installed in an application.
× Java and Groovy code that the plugin provides within the lib and src/java and
src/groovy directories will be compiled into the main project's web-app/WEB-
INF/classes directory so that they are made available at runtime.
11. Providing Basic Artefacts
Adding a new script
Adding a new grails-app artifact (controller, taglib,
service, etc.)
Providing Views, Templates and view resolution.
Excluded Artefacts
12. Adding a new Script
A plugin can add a new script simply by providing the
relevant Gant script in its scripts directory:
× CustomPlugin
× Grails-app
× scripts <--Add script here
× Grails create-script ShowDetailsScript
13. Adding a new grails-app artifact (Controller, Tag Library, Service, etc.)
× CustomPlugin
× grails-app
× controllers
× services
× etc.
× lib
× scripts
14. Providing Views, Templates and View resolution
× When a plugin provides a controller it may also provide default views
to be rendered.
× Grails' view resolution mechanism will first look for the view in the
application it is installed into and if that fails will attempt to look for
the view within the plugin.
× This means that you can override views provided by a plugin by
creating corresponding GSPs in the application's grails-app/views
directory.
× if the view uses templates that are also provided by the plugin then:-
× <g:render template="fooTemplate" plugin="amazon"/>
15. Excluded Artefacts
By default Grails excludes the following files during the packaging process:
× grails-app/conf/BootStrap.groovy
× grails-app/conf/BuildConfig.groovy (although it is used to generate dependencies.groovy)
× grails-app/conf/Config.groovy
× grails-app/conf/DataSource.groovy (and any other *DataSource.groovy)
× grails-app/conf/UrlMappings.groovy
× grails-app/conf/spring/resources.groovy
× Everything within /web-app/WEB-INF
× Everything within /web-app/plugins/**
× Everything within /test/**
× SCM management files within **/.svn/** and **/CVS/**
If your plugin requires files under the web-app/WEB-INF directory it is recommended that you modify the plugin's
scripts/_Install.groovy Gant script to install these artefacts into the target project's directory tree.
In addition, the default UrlMappings.groovy file is excluded to avoid naming conflicts, however you are free to add a
UrlMappings definition under a different name which will be included. For example a file called grails-
app/conf/BlogUrlMappings.groovy is fine.
The list of excludes is extensible with the pluginExcludes property:
// resources that are excluded from plugin packaging
def pluginExcludes = [
"grails-app/views/error.gsp"
]
16. Evaluating Conventions
Every plugin has an implicit application variable which is an instance of the GrailsApplication interface.
The GrailsApplication interface provides methods to evaluate the conventions within the project and
internally stores references to all artifact classes within your application.
Artifacts implement the GrailsClass interface, which represents a Grails resource such as a controller or a
tag library. For example to get all GrailsClassinstances you can do:
for (grailsClass in application.allClasses) {
println grailsClass.name
}
for (controllerClass in application.controllerClasses) {
println controllerClass.name
}
17. The dynamic method conventions are as follows:
× *Classes - Retrieves all the classes for a particular artefact name. For example
application.controllerClasses.
× get*Class - Retrieves a named class for a particular artefact. For example
application.getControllerClass("PersonController")
× is*Class - Returns true if the given class is of the given artefact type. For
example application.isControllerClass(PersonController)
18. The GrailsClass interface has a number of useful methods that let you further evaluate and work with
the conventions. These include:
× getPropertyValue - Gets the initial value of the given property on the class
× hasProperty - Returns true if the class has the specified property
× newInstance - Creates a new instance of this class.
× getName - Returns the logical name of the class in the application without the trailing
convention part if applicable
× getShortName - Returns the short name of the class without package prefix
× getFullName - Returns the full name of the class in the application with the trailing convention
part and with the package name
× getPropertyName - Returns the name of the class as a property name
× getLogicalPropertyName - Returns the logical property name of the class in the application
19. Hooking into Build Events
Grails plugins can do post-install configuration. This is achieved using a specially named script
under the scripts directory of the plugin -_Install.groovy.
_Install.groovy is executed after the plugin has been installed.
Below will create a new directory type under the grails-app directory and install a
configuration template:
ant.mkdir(dir: "${basedir}/grails-app/jobs")
ant.copy(file: "${pluginBasedir}/src/samples/SamplePluginConfig.groovy",
todir: "${basedir}/grails-app/conf")
The pluginBasedir variable is not available in custom scripts, but you can use fooPluginDir,
where foo is the name of your plugin.
20. Hooking into Runtime Configuration
Hooking into the Grails Spring configuration
Participating in web.xml Generation
Doing Post Initialisation Configuration
21. Hooking into the Grails Spring configuration
you can hook in Grails runtime configuration by
providing a property called doWithSpring which is
assigned a block of code
def doWithSpring = {
customPluginObject(CustomPluginObject) {}
}
22. Adding Dynamic Methods at Runtime
Grails plugins let you register dynamic methods with any Grails-managed or other
class at runtime. This work is done in a doWithDynamicMethods closure.
For Grails-managed classes like controllers, tag libraries and so forth you can add
methods, constructors etc. using the ExpandoMetaClass mechanism by accessing
each controller's MetaClass:
For more:-
http://docs.grails.org/2.4.4/guide/plugins.html#addingDynamicMethodsAtRuntime
23. Understanding Plugin Load Order
Controlling Plugin Dependencies
Controlling Load Order
Scopes and Environments
24. Controlling Plugin Dependencies
Plugins often depend on the presence of other plugins and can adapt depending on the presence of
others. This is implemented with two properties. The first is called dependsOn
def dependsOn = [dataSource: "1.0",
domainClass: "1.0",
i18n: "1.0",
core: "1.0"]
The dependsOn property also supports a mini expression language for specifying version ranges
def dependsOn = [foo: "* > 1.0"]
def dependsOn = [foo: "1.0 > 1.1"]
def dependsOn = [foo: "1.0 > *"]
When the wildcard * character is used it denotes "any" version. The expression syntax also excludes any
suffixes such as -BETA, -ALPHA etc. so for example the expression "1.0 > 1.1" would match any of the
following versions:
25. Controlling Load Order
Using dependsOn establishes a "hard" dependency in that if the dependency is
not resolved, the plugin will give up and won't load. It is possible though to have a
weaker dependency using the loadAfter and loadBefore properties
def loadAfter = ['otherplugin']
Here the plugin will be loaded after the controllers plugin if it exists, otherwise it
will just be loaded. The plugin can then adapt to the presence of the other plugin.
You can also use the loadBefore property to specify one or more plugins that your
plugin should load before:
def loadBefore = ['rabbitmq']
26. Scopes and Environments
It's not only plugin load order that you can control. You can also specify which environments your plugin should be
loaded in and which scopes (stages of a build). Simply declare one or both of these properties in your plugin
descriptor:
def environments = ['development', 'test', 'myCustomEnv']
def scopes = [excludes:'war']
the plugin will only load in the 'development' and 'test' environments. Nor will it be packaged into the WAR file,
because it's excluded from the 'war' phase. This allows development-only plugins to not be packaged for
production use.
The full list of available scopes are defined by the enum BuildScope,
Both properties can be one of:
× a string - a sole inclusion
× a list - a list of environments or scopes to include
× a map - for full control, with 'includes' and/or 'excludes' keys that can have string or list values
27. Register on local
× Comment export = false
× grails compile: to trigger dependency resolution
× grails maven-install: will work once the release plugin in BuildConfig.groovy is installed for
your plugin.
× Note that this isn't plugin installation, it's faking out a plugin release by putting the ZIP
and the POM file in your mavenLocal() repo.
28. Releasing our plugin
× Register on grails.org
× Fill out this form
× Provide good documentation for the users to get started.
× Once approved, install the release plugin in the plugin application
× grails publish-plugin --stacktrace
× Once successful, the plugin will be published in the grails plugin
repository. Users will be able to install it directly from Grails Plugin
portal by adding the dependency in BuildConfig.groovy