Your SlideShare is downloading. ×
Grails Plugins DJUG and Colorado Springs Open Source User's Group 2009
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Grails Plugins DJUG and Colorado Springs Open Source User's Group 2009

708
views

Published on

An overview of Grails plugin development and specifics on the development and use of the multi tenant plugin

An overview of Grails plugin development and specifics on the development and use of the multi tenant plugin

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
708
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Grails Plugin Magic Scott Ryan Soaring Eagle L.L.C. [email_address] March 2010 Colorado Spring Open Source User Group
  • 2. Agenda
    • Grails Overview
    • Plugin Architecture
    • Sample Plugins
    • Other Modification Options
    • Q & A
  • 3. What do you know?
    • Grails
    • Java, Groovy
    • Spring, Hibernate
    • Maven , Ivy
  • 4. Grails Overview
    • Integrated framework based on Groovy
      • Spring MVC / GSP
      • Spring
      • Hibernate
      • GSP
      • Sitemesh
  • 5. Grails Overview
    • Convention over configuration
    • Dynamic framework for ease of development
    • Lots of code generation
    • Plugin Framework allows extension
  • 6. Grails Benefits
    • Supports Java Framework Leadership Technologies
    • Quick development turn-around
    • Good performance
    • Easy extensibility
    • Runs on the JVM
  • 7. Plugin Functions
    • Integrate new libraries
    • Add incremental Functionality
    • Exchange Frameworks
    • Inject or Modify behavior
    • Add build support
    • Can include other libraries or plugins
  • 8. Plugin Development
    • Uses standard Grails Application
    • grails create-plugin name
    • Update the plugin class
    • Create the plugin
    • grails package-plugin
    • grails release-plugin
    • grails install-plugin (local or repository)
  • 9. Plugin Integration
    • Plugins never modify application main source
    • Source is copied to /plugins/-name-/grails-app
    • Static resources are copied to web-app/plugins/-name-/js etc.
    • Plugins never modify web.xml or application.xml
    • ${pluginContextPath} variable helps locate resources
  • 10. What can I do in a Plugin?
    • Add Basic Artifacts (Controllers, GSP , Services, etc.)
    • Integrate with build script events
    • Integrate with runtime configuration
    • Add Dynamic Methods
    • Integrate with auto reload events
  • 11. Adding Basic Artifacts
    • Domain,Controllers, Services, GSP
    • Follow conventions
    • Try to use unique names (UGH)
    • Use packages for all code
    • Integrate with conf.groovy or provide config file
    • Remember you are only a guest
  • 12. Scripts
    • _Install.groovy
      • Called on installation
      • Can be used to copy or modify files
      • Gant based
    • _Upgrade.groovy
      • Called on upgraded
      • Gant based
  • 13. Hooking into Build Events
    • _Events.groovy
      • One per plugin
      • Per User file in .grails user directory
    • Open Framework
      • Closures begin with “event” and then the name of the event
      • Trigger events with event method
        • event( eventName, message)
  • 14. Integrating with Runtime
    • doWithSpring closure
      • Allows you to add to the spring configuration using spring bean builder syntax
    • doWithWebDescriptor closure
      • Passes in the xml variable
    • doWithApplicationContext closure
      • Run after the application context is assembled
      • Passes in the application context
  • 15. Adding Dynamic Methods
    • doWithDynamicMethods closure
      • Grails artifacts expose the metaclass via the expandometaclass to add methods, constructors, etc.
      • Other classes allow you to use the metaclass to add methods, constructors, etc.
      • Application context is passed in so you can interact with artifacts within it.
  • 16. Sample Plugins
    • Jquery
    • Hibernate Filter
    • Falcone
    • Multi tenant

×