This document outlines an agenda for a Grails beginners workshop. It includes installing Grails, an introduction to Grails, creating a sample conference application, and exercises. The sample application allows attendees to register for talks and rate them. Domain classes are created for Attendee, Talk, and Rating with relationships. Services are introduced to move logic from controllers. Taglibs, assets, styling with Bootstrap, and layouts are also covered.
Gerrit at Eclipse Foundation have really long history. Initially only EGit and JGit projects could use this tool, but starting from February 2012 Gerrit become fist class citizen in Eclipse ecosystem. Every Eclipse Foundation's project can immediately start using its powerful code review capabilities. Capabilities that together with TDD and CI create safety net against bugs for software development.
For quite long time Gerrit features set was pretty closed and adding new functionality required upstream code base changes. That means either you ended up in port and rebase nightmare or contributed your changes back to community... where they could not have been accepted because they solve your domain's problem not something that is vital for the community edition.
Plugin support in Gerrit was initially introduced in version 2.5. Since then amount of available extension points substantially increased. In this presentation we will understand Gerrit plugins architecture. We will discuss extensions and plugins especially differences between them and which one to choose when. We will see how to combine everything together (including WEB UI) to get your first full blown Gerrit plugin.
Google has developed the programming language called Go. Go is a freedom-respecting and open source programming language and it is designed by Robert Griesemer, Rob Pike, and Ken Thompson in the year 2007. Go language was released in 2009. The syntax of the Go language resembles the C programming language and Go language is a statically typed programming language which is often called golang. Go language is detailed understood by golang online course.
These slides highlight what’s new in Grails® framework 5, Micronaut Integration, Groovy 3, and the current developments around Grails framework.
It is originally presented at Madrid GUG on 15 December, 2021.
Quick overview of building plugins using pure JavaScript or Google Web Toolkit (GWT), and a group discussion to identify important UI extension points for Gerrit contributors to make available.
Docker allows simple environment isolation and repeatability so that we can create a run-time environment once, package it up, then run it again on any other machine. Furthermore, everything that runs in that environment is isolated from the underlying host (much like a virtual machine). And best of all, everything is fast and simple.
This presentation, we’ll provide basic introduction. What is Docker? why to use it? and demonstrate how we can use Docker to compose and deploy an application.
**Watch the full webinar at https://codefresh.io/events/terraform-gitops-codefresh/
Today we write "Infrastructure as Code" and even "Pipelines as Code", so let's start treating our "code as code" and practice CI/CD with GitOps! In this talk, we'll show you how we build and deploy applications with Terraform using GitOps and Codefresh. Cloud Posse is a Terraform power user that has developed over 130 Terraform modules which are free and open source. We'll share how we handle automation with security while making the process easy for engineers.
Gerrit at Eclipse Foundation have really long history. Initially only EGit and JGit projects could use this tool, but starting from February 2012 Gerrit become fist class citizen in Eclipse ecosystem. Every Eclipse Foundation's project can immediately start using its powerful code review capabilities. Capabilities that together with TDD and CI create safety net against bugs for software development.
For quite long time Gerrit features set was pretty closed and adding new functionality required upstream code base changes. That means either you ended up in port and rebase nightmare or contributed your changes back to community... where they could not have been accepted because they solve your domain's problem not something that is vital for the community edition.
Plugin support in Gerrit was initially introduced in version 2.5. Since then amount of available extension points substantially increased. In this presentation we will understand Gerrit plugins architecture. We will discuss extensions and plugins especially differences between them and which one to choose when. We will see how to combine everything together (including WEB UI) to get your first full blown Gerrit plugin.
Google has developed the programming language called Go. Go is a freedom-respecting and open source programming language and it is designed by Robert Griesemer, Rob Pike, and Ken Thompson in the year 2007. Go language was released in 2009. The syntax of the Go language resembles the C programming language and Go language is a statically typed programming language which is often called golang. Go language is detailed understood by golang online course.
These slides highlight what’s new in Grails® framework 5, Micronaut Integration, Groovy 3, and the current developments around Grails framework.
It is originally presented at Madrid GUG on 15 December, 2021.
Quick overview of building plugins using pure JavaScript or Google Web Toolkit (GWT), and a group discussion to identify important UI extension points for Gerrit contributors to make available.
Docker allows simple environment isolation and repeatability so that we can create a run-time environment once, package it up, then run it again on any other machine. Furthermore, everything that runs in that environment is isolated from the underlying host (much like a virtual machine). And best of all, everything is fast and simple.
This presentation, we’ll provide basic introduction. What is Docker? why to use it? and demonstrate how we can use Docker to compose and deploy an application.
**Watch the full webinar at https://codefresh.io/events/terraform-gitops-codefresh/
Today we write "Infrastructure as Code" and even "Pipelines as Code", so let's start treating our "code as code" and practice CI/CD with GitOps! In this talk, we'll show you how we build and deploy applications with Terraform using GitOps and Codefresh. Cloud Posse is a Terraform power user that has developed over 130 Terraform modules which are free and open source. We'll share how we handle automation with security while making the process easy for engineers.
GitHub Integration for Orangescrum Cloud Released!Orangescrum
GitHub integration reduces a lot of time and confusion to switching between two products and increase productivity by bringing both tools seamlessly into your workflow.
React is a UI library developed at Facebook to facilitate the creation of interactive, stateful & reusable UI components. It is used at Facebook in production, and Instagram.com is written entirely in React.
Do you know how Continuous Delivery of Java Open Source libraries looks? How big is your release overhead? Do you update release notes and include contributors manually? How do you handle versioning? Do you use semantic versioning?
During this workshop, you will learn how to set up Continuous Delivery for your library. You’ll never have to manually release new versions again. We will use the following tools: GitHub, TravisCI, Bintray, Maven Central. We will glue everything using Shipkit.org - a project born from Mockito (and still used there). You’ll additionally learn SerVer.
This workshop is mostly for Java open source and Gradle plugins developers. We will use a library prepared especially for this training, so no worries if you don’t have your own open source project (yet).
Prerequisites: GitHub account, Java & Gradle basics.
Google在2013開始導入Gradle工具作為新的Android build system,Gradle的使用正是實踐DevOps的良好利器,除了方便進行automated building外, Gradle更幫助我們消弭不同開發環境/工具間的差異問題,如同infarsture as code之於web application/service的重要性,build script as code就是幫助Android App快速發佈版本並維持品質穩定的關鍵最後一哩路。
此次主題將探討如何利用gradle進行精實良好的系統開發配置管理,建立一條下達開發者本地端上通產品發佈系統的透明化產品開發流水線。你是否常常一個App剛發佈不久,下一個idea已經生成,舊程式需要繼續維護同時又要添加新功能,你的開發方法是否能讓多方產品流水線順暢運行而且並行不悖?妥善利用Gradle並深入理解Build by convention的內涵是最好的選擇。
Griffon: Re-imaging Desktop Java TechnologyJames Williams
Griffon is a desktop framework for Java Swing leveraging the dynamic language Groovy and values convention over configuration.
Presented at Devoxx 2008
A presentation for the Vancouver Island Java User's Group showcasing how Groovy and the Griffon application framework can ease the pain of coding Swing applications.
GitHub Integration for Orangescrum Cloud Released!Orangescrum
GitHub integration reduces a lot of time and confusion to switching between two products and increase productivity by bringing both tools seamlessly into your workflow.
React is a UI library developed at Facebook to facilitate the creation of interactive, stateful & reusable UI components. It is used at Facebook in production, and Instagram.com is written entirely in React.
Do you know how Continuous Delivery of Java Open Source libraries looks? How big is your release overhead? Do you update release notes and include contributors manually? How do you handle versioning? Do you use semantic versioning?
During this workshop, you will learn how to set up Continuous Delivery for your library. You’ll never have to manually release new versions again. We will use the following tools: GitHub, TravisCI, Bintray, Maven Central. We will glue everything using Shipkit.org - a project born from Mockito (and still used there). You’ll additionally learn SerVer.
This workshop is mostly for Java open source and Gradle plugins developers. We will use a library prepared especially for this training, so no worries if you don’t have your own open source project (yet).
Prerequisites: GitHub account, Java & Gradle basics.
Google在2013開始導入Gradle工具作為新的Android build system,Gradle的使用正是實踐DevOps的良好利器,除了方便進行automated building外, Gradle更幫助我們消弭不同開發環境/工具間的差異問題,如同infarsture as code之於web application/service的重要性,build script as code就是幫助Android App快速發佈版本並維持品質穩定的關鍵最後一哩路。
此次主題將探討如何利用gradle進行精實良好的系統開發配置管理,建立一條下達開發者本地端上通產品發佈系統的透明化產品開發流水線。你是否常常一個App剛發佈不久,下一個idea已經生成,舊程式需要繼續維護同時又要添加新功能,你的開發方法是否能讓多方產品流水線順暢運行而且並行不悖?妥善利用Gradle並深入理解Build by convention的內涵是最好的選擇。
Griffon: Re-imaging Desktop Java TechnologyJames Williams
Griffon is a desktop framework for Java Swing leveraging the dynamic language Groovy and values convention over configuration.
Presented at Devoxx 2008
A presentation for the Vancouver Island Java User's Group showcasing how Groovy and the Griffon application framework can ease the pain of coding Swing applications.
These are the slides for a talk/workshop delivered to the Cloud Native Wales user group (@CloudNativeWal) on 2019-01-10.
In these slides, we go over some principles of gitops and a hands on session to apply these to manage a microservice.
You can find out more about GitOps online https://www.weave.works/technologies/gitops/
Maven and Ant have dominated the build landscape in the Java world for more than a decade. Why on earth do we need or want another one? That’s a question many people ask themselves when hearing about Gradle. In this talk, I provide some context to what makes a good build and hence what you should expect from your build tools.
You will then learn how Gradle provides the features you need to solve any build problem, while still being easy to use for standard stuff. Afterwards, you’ll start to understand why Google picked Gradle for the new Android build system.
By Eduardo Lima.
GNOME, the free desktop environment, has embraced Javascript. Starting from version 3.0, Javascript is at the core of the user experience delivered to tens of thousands of GNOME users out there. We call it the gnome-shell, but the real beauty lies within.
This presentation will give you a brief tour around the great technology behind the shell, a technology that GNOME hackers use to have automatic reflection of their core libraries into Javascript. Yes, you read well, automatic! It is called gobject-introspection and gives you the super-powers of Javascript-ing most of the hardcore C libraries that powers GNOME, from multimedia, web browsing, accelerated 2D and 3D graphics, communications, UX, hardware interaction, and many more.
During the talk, a couple of examples will be discussed, some demos dropped, and we might hack the shell on-the-fly as well!
Introduction to Gradle in 45min as done at JBCN 2016. Covers the basics of Gradle for people familiar with other build tools. Includes building Java, Scala, Groovy & Kotlin projects
Docman - The swiss army knife for Drupal multisite docroot management and dep...Aleksey Tkachenko
Introducing Docman (available on github, alpha state, but used already in production environment): the Swiss Army Knife for Drupal multisite docroot management and deployment. Docman acts as a layer between your docroot – usually a git repository somewhere, but not limited to it– and multiple vendors working on different websites using your standards and predefined sets of modules.
Building Instruqt, a scalable learning platformInstruqt
On February 15th I gave a talk on how we built Instruqt. We use Kubernetes, Terraform and Google Cloud, and in my talk I explain the benefits of using these tools and services correctly.
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...Gavin Pickin
For a long time, some frontend Javascript frameworks have helped you with one or two styles of Apps, but Quasar is an amazing new VueJS framework that allows you to build Single Page Apps (SPA), Server-side Rendered Apps (SSR), Progressive Web Apps (PWA), Mobile Apps (Android and IOS) through Cordova as well as Multi-platform Desktop Apps using Electron. With the Quasar CLI, you can quickly start a project, and have a single code base that can output multiple formats, as needed. Come to this session and find out how.
Presented at Into the Box 2019
Gradle is an open-source build automation tool focused on flexibility, build reproducibility and performance. Over the years, this tool has evolved and introduced new concepts and features around dependency management, publication and other aspects on build and release of artifacts for the Java platform.
Keeping up to date with all these features across several projects can be challenging. How do you make sure that all your projects can be upgraded to the latest version of Gradle? What if you have thousands of projects and hundreds of engineers? How can you abstract common tasks for them and make sure that new releases work as expected?
At Netflix, we built Nebula, a collection of Gradle plugins that helps engineers remove boilerplate in Gradle build files, and makes building software the Netflix way easy. This reduces the cognitive load on developers, allowing them to focus on writing code.
In this talk, I’ll share with you our philosophy on how to build JVM artifacts and the pieces that help us boost the productivity of engineers at Netflix. I’ll talk about:
- What is Nebula
- What are the common problems we face and try to solve
- How we distribute it to every JVM engineer
- How we ensure that Nebula/Gradle changes do not break builds so we can ship new features with confidence at Netflix
How Recreation Management Software Can Streamline Your Operations.pptxwottaspaceseo
Recreation management software streamlines operations by automating key tasks such as scheduling, registration, and payment processing, reducing manual workload and errors. It provides centralized management of facilities, classes, and events, ensuring efficient resource allocation and facility usage. The software offers user-friendly online portals for easy access to bookings and program information, enhancing customer experience. Real-time reporting and data analytics deliver insights into attendance and preferences, aiding in strategic decision-making. Additionally, effective communication tools keep participants and staff informed with timely updates. Overall, recreation management software enhances efficiency, improves service delivery, and boosts customer satisfaction.
Large Language Models and the End of ProgrammingMatt Welsh
Talk by Matt Welsh at Craft Conference 2024 on the impact that Large Language Models will have on the future of software development. In this talk, I discuss the ways in which LLMs will impact the software industry, from replacing human software developers with AI, to replacing conventional software with models that perform reasoning, computation, and problem-solving.
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immutable events, provided robust auditing and "time travel" debugging for Wix Stores' microservices. Despite its benefits, the complexity it introduced in state management slowed development. Wix responded by adopting a simpler, unified CRUD model. This talk will explore the challenges of event sourcing and the advantages of Wix's new "CRUD on steroids" approach, which streamlines API integration and domain event management while preserving data integrity and system resilience.
Participants will gain valuable insights into Wix's strategies for ensuring atomicity in database updates and event production, as well as caching, materialization, and performance optimization techniques within a distributed system.
Join us to discover how Wix has mastered the art of balancing simplicity and extensibility, and learn how the re-adoption of the modest CRUD has turbocharged their development velocity, resilience, and scalability in a high-growth environment.
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaYara Milbes
Discover the transformative power of the WhatsApp API in our latest SlideShare presentation, "Top 7 Unique WhatsApp API Benefits." In today's fast-paced digital era, effective communication is crucial for both personal and professional success. Whether you're a small business looking to enhance customer interactions or an individual seeking seamless communication with loved ones, the WhatsApp API offers robust capabilities that can significantly elevate your experience.
In this presentation, we delve into the top 7 distinctive benefits of the WhatsApp API, provided by the leading WhatsApp API service provider in Saudi Arabia. Learn how to streamline customer support, automate notifications, leverage rich media messaging, run scalable marketing campaigns, integrate secure payments, synchronize with CRM systems, and ensure enhanced security and privacy.
Understanding Globus Data Transfers with NetSageGlobus
NetSage is an open privacy-aware network measurement, analysis, and visualization service designed to help end-users visualize and reason about large data transfers. NetSage traditionally has used a combination of passive measurements, including SNMP and flow data, as well as active measurements, mainly perfSONAR, to provide longitudinal network performance data visualization. It has been deployed by dozens of networks world wide, and is supported domestically by the Engagement and Performance Operations Center (EPOC), NSF #2328479. We have recently expanded the NetSage data sources to include logs for Globus data transfers, following the same privacy-preserving approach as for Flow data. Using the logs for the Texas Advanced Computing Center (TACC) as an example, this talk will walk through several different example use cases that NetSage can answer, including: Who is using Globus to share data with my institution, and what kind of performance are they able to achieve? How many transfers has Globus supported for us? Which sites are we sharing the most data with, and how is that changing over time? How is my site using Globus to move data internally, and what kind of performance do we see for those transfers? What percentage of data transfers at my institution used Globus, and how did the overall data transfer performance compare to the Globus users?
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
In this slide, we show the simulation example and the way to compile this solver.
In this solver, the Helmholtz equation can be solved by helmholtzFoam. Also, the Helmholtz equation with uniformly dispersed bubbles can be simulated by helmholtzBubbleFoam.
Software Engineering, Software Consulting, Tech Lead, Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Transaction, Spring MVC, OpenShift Cloud Platform, Kafka, REST, SOAP, LLD & HLD.
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Globus
Large Language Models (LLMs) are currently the center of attention in the tech world, particularly for their potential to advance research. In this presentation, we'll explore a straightforward and effective method for quickly initiating inference runs on supercomputers using the vLLM tool with Globus Compute, specifically on the Polaris system at ALCF. We'll begin by briefly discussing the popularity and applications of LLMs in various fields. Following this, we will introduce the vLLM tool, and explain how it integrates with Globus Compute to efficiently manage LLM operations on Polaris. Attendees will learn the practical aspects of setting up and remotely triggering LLMs from local machines, focusing on ease of use and efficiency. This talk is ideal for researchers and practitioners looking to leverage the power of LLMs in their work, offering a clear guide to harnessing supercomputing resources for quick and effective LLM inference.
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
Utilocate offers a comprehensive solution for locate ticket management by automating and streamlining the entire process. By integrating with Geospatial Information Systems (GIS), it provides accurate mapping and visualization of utility locations, enhancing decision-making and reducing the risk of errors. The system's advanced data analytics tools help identify trends, predict potential issues, and optimize resource allocation, making the locate ticket management process smarter and more efficient. Additionally, automated ticket management ensures consistency and reduces human error, while real-time notifications keep all relevant personnel informed and ready to respond promptly.
The system's ability to streamline workflows and automate ticket routing significantly reduces the time taken to process each ticket, making the process faster and more efficient. Mobile access allows field technicians to update ticket information on the go, ensuring that the latest information is always available and accelerating the locate process. Overall, Utilocate not only enhances the efficiency and accuracy of locate ticket management but also improves safety by minimizing the risk of utility damage through precise and timely locates.
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
Launch Your Streaming Platforms in MinutesRoshan Dwivedi
The claim of launching a streaming platform in minutes might be a bit of an exaggeration, but there are services that can significantly streamline the process. Here's a breakdown:
Pros of Speedy Streaming Platform Launch Services:
No coding required: These services often use drag-and-drop interfaces or pre-built templates, eliminating the need for programming knowledge.
Faster setup: Compared to building from scratch, these platforms can get you up and running much quicker.
All-in-one solutions: Many services offer features like content management systems (CMS), video players, and monetization tools, reducing the need for multiple integrations.
Things to Consider:
Limited customization: These platforms may offer less flexibility in design and functionality compared to custom-built solutions.
Scalability: As your audience grows, you might need to upgrade to a more robust platform or encounter limitations with the "quick launch" option.
Features: Carefully evaluate which features are included and if they meet your specific needs (e.g., live streaming, subscription options).
Examples of Services for Launching Streaming Platforms:
Muvi [muvi com]
Uscreen [usencreen tv]
Alternatives to Consider:
Existing Streaming platforms: Platforms like YouTube or Twitch might be suitable for basic streaming needs, though monetization options might be limited.
Custom Development: While more time-consuming, custom development offers the most control and flexibility for your platform.
Overall, launching a streaming platform in minutes might not be entirely realistic, but these services can significantly speed up the process compared to building from scratch. Carefully consider your needs and budget when choosing the best option for you.
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
The Earth System Grid Federation (ESGF) is a global network of data servers that archives and distributes the planet’s largest collection of Earth system model output for thousands of climate and environmental scientists worldwide. Many of these petabyte-scale data archives are located in proximity to large high-performance computing (HPC) or cloud computing resources, but the primary workflow for data users consists of transferring data, and applying computations on a different system. As a part of the ESGF 2.0 US project (funded by the United States Department of Energy Office of Science), we developed pre-defined data workflows, which can be run on-demand, capable of applying many data reduction and data analysis to the large ESGF data archives, transferring only the resultant analysis (ex. visualizations, smaller data files). In this talk, we will showcase a few of these workflows, highlighting how Globus Flows can be used for petabyte-scale climate analysis.
3. JACOB AAE MIKKELSEN
Senior Engineer at Lego
Microservice based architechture on JVM
Previously 4 years at Gennemtænkt IT
Consultant on Groovy and Grails
External Associate Professor - University of Southern
Denmark
@JacobAae
Blogs The Grails Diary
5. USB WITH MATERIAL
On the USB Sick passed around, the following materials are
available
These slides
Git repository with Grails application
Grails
IntelliJ editor
Bootstrap files
6. MAC & LINUX
Use Gvm tool
curl s get.gvmtool.net | bash
Restart terminal
gvm install grails 3.0.1
7. WINDOWS
Option 1: Use GVM Tool in Cygwin
Option 2: Use Posh-GVM in Powershell
( )https://github.com/flofreud/posh-gvm
Option 3 Download Grails, and setup GRAILS_HOME
(
)
http://grails.asia/grails-tutorial-for-beginners-setup-your-
windows-development-environment/
8. GRAILS INTRO
Grails is a full stack framework
-
Embrace the Don’t Repeat Yourself (DRY) principle
-
Encourages proper testing
-
Use the Groovy language and extensive use of Domain
Specific Languages (DSLs)
9. INCLUDED WITH GRAILS
Object Relational Mapping (ORM) layer → Hibernate
Expressive view technology → Groovy Server Pages (GSP)
Controller layer → Spring MVC
Interactive command line env and build system → Gradle
Embedded Tomcat container with on the fly reloading
Dependency injection → Spring container
i18n → Spring’s core MessageSource concept
Transactional service layer → Spring’s transaction
abstraction
10. LATEST VERSION: 3.0.1
Groovy 2.4
Spring 4.1 and Spring Boot 1.2
Gradle Build System
Application Profiles
Redesigned API based on Traits
Filters → Interceptors
Main class → Easy to run from any IDE
11. APPLICATION SCENARIO
Lets make a small conference application that can
keep track at what talks and workshops you have
attended
let attendees rate and supply feedback
12. MODEL
We need 3 domain classes in this small application
Attendee
Talk
Rating
16. FUNCTIONALITY
Attendees must be able to register which talks he
attended
An attendee must be able to rate a talk from 1-5 and
submit a comment too
A list of comments and an average grade must be
available when vieving a talk
17. STEP 1: CREATING THE APPLICATION
To create a new Grails Application, run the grails
create-appcommand in a terminal
grails createapp eugr8confgrailsdemo
Lets go through the tree view of whats generated
You don’t have to do the above step, if you clone this
repo - then it is all done :)
git clone https://github.com/JacobAae/eugr8confgrailsdemo.git
25. STEP 2: FIRST DOMAIN CLASS
Lets create the first domin class with controller and views:
Attendee
26. CREATING THE DOMAIN CLASS
In interactive mode
createdomainclass eu.gr8conf.grailsdemo.Attendee
Resulting in
| Created grails-app/domain/eu/gr8conf/grailsdemo/Attendee.groovy
| Created src/test/groovy/eu/gr8conf/grailsdemo/AttendeeSpec.groovy
28. PROPERTIES AND CONSTRAINTS
Edit the Attendee class to contain
String name
String email
String nationality
Date dateCreated
Date lastUpdated
static constraints = {
name blank: false
email blank: false, unique: true, email: true
nationality nullable: true
}
30. TESTING
Here is an example of a test for constraints that are violated
@Unroll
void "Test invalid properties for attendee: #comment"() {
when:
Attendee attendee = new Attendee(name: name,
email: email, nationality: nationality)
then:
!attendee.validate()
where:
name | email | nationality | comment
'' | 'jacob@gr8conf.org' | 'Danish' | 'Blank name'
}
INFO: Lets add positive and more negative tests for the
constraints.
31. CONTROLLER AND VIEWS
In interactive mode
generateall eu.gr8conf.grailsdemo.Attendee
And run the app again - and click the controller
36. CONTROLLERS
A controller handles requests and creates or prepares the
response
Business logic placed elsewhere (services)
Placed in controller folder and ends in Controller
Methods → actions
Databinding
37. VIEWS AND TEMPLATES
Made with Groovy Server Pages (GSP)
Extensive suite of tags
formatting
looping
input fields
38. CONTROLLERS AND VIEWS
Problem: Lets make a new Display Attendee page, where we
can see talks attended better.
What to do:
Make a displayaction in the AttendeeController
Add a display.gspview
add link to the new display or replace the show action
We could also rewrite the show action :)
42. EXERCISES
Make a link for each talk to go to an add rating page
Implement the add rating functionality
43. STEP 4: SERVICES
The default code leaves too much logic in the controller, this
should be in a service, that also should handle transactions
etc.
Lets try to cleanup the attendee controller and place some
of the logic in a service
46. USING SERVICES - AUTOINJECTION
In the AttendeeController, where we will use the service, all
we need to do, is add this line
AttendeeService attendeeService
Then it will be autoinjected because Grails recognices the
name
48. HELPER CLASSES
In src/main/groovyyou can place helper classes, or
non-Grails-artefacts
class Result {
def item
Status status
}
enum Status {
OK,
NOT_FOUND,
HAS_ERRORS
}
49. SERVICE METHOD
The service method could look like
Result saveAttendee(Attendee attendee) {
if (attendee == null) {
transactionStatus.setRollbackOnly()
return new Result(status: Status.NOT_FOUND)
}
if (attendee.hasErrors()) {
transactionStatus.setRollbackOnly()
return new Result(status: Status.HAS_ERRORS, item: attendee)
}
attendee.save flush:true
return new Result(status: Status.OK, item: attendee)
}
65. FIXING ICONS
In bootstrap.css, update the path to Glyphicons font
(line 267++)
views/attendee/display.gsp
@fontface {
fontfamily: 'Glyphicons Halflings';
src: url('../assets/fonts/glyphiconshalflingsregular.eot');
src: url('../assets/fonts/glyphiconshalflingsregular.eot?#iefix') for
}