SlideShare une entreprise Scribd logo
1  sur  40
Magnolia + Grails = Maglev

    Peter Wayner                                                                      WebCast




1    Version 1.1              Magnolia is a registered trademark owned by Magnolia International Ltd.
Maglev
                   Table-driven data with Grails
                   Template-driven pages with Magnolia
    Peter Wayner                                                                            WebCast




2    Version 1.1                    Magnolia is a registered trademark owned by Magnolia International Ltd.
Is it possible to mix the ease of
          Grails with the Magnolia?




3   Version 1.1         Magnolia is a registered trademark owned by Magnolia International Ltd.
Yes! With Maglev, a plugin




4   Version 1.1                 Magnolia is a registered trademark owned by Magnolia International Ltd.
Why?
                  Grails is a Java-based Web App
                  Framework
                  Grails is open source
                  Grails is template-driven (GSP and JSP)
                  Grails is extendable with plugins.




5   Version 1.1                     Magnolia is a registered trademark owned by Magnolia International Ltd.
Magnolia is Similar
                  Magnolia is a Java-based Content
                  Management System
                  Magnolia is open source
                  Magnolia is template-driven (Freemarker
                  and JSP)
                  Magnolia is extendable with plugins.




6   Version 1.1                     Magnolia is a registered trademark owned by Magnolia International Ltd.
Invention
                  Developed by Kimmo Björnsson and Åke
                  Argéus, Lead Developers, Bonheur AB
                  They saw that the two tools that
                  complemented each other well.
                  They turned Magnolia into a plugin that
                  lives in Grails.




7   Version 1.1                     Magnolia is a registered trademark owned by Magnolia International Ltd.
Let’s mix them together
                  Maglev bundles together all of Magnolia
                  into a Grails plugin.
                  It’s plugged into Grails, but Magnolia ends
                  up driving the front.
                  Grails handles the table-driven objects.
                  Magnolia handles the templates




8   Version 1.1                      Magnolia is a registered trademark owned by Magnolia International Ltd.
Benefits
                  Rapid prototyping. Grails builds
                  databases quickly.
                  Data/Content integration. Magnolia knits
                  together content well.
                  Separation of code from presentation.
                  (Grails handles backend, Magnolia the
                  front.)


9   Version 1.1                      Magnolia is a registered trademark owned by Magnolia International Ltd.
Example
                   Affiliate marketing for a web site needs a
                   table of URLs. If someone clicks on the
                   URL, the web site gets some revenue.
                   Lets store them in a table.
                   Display them in a Magnolia template.




10   Version 1.1                       Magnolia is a registered trademark owned by Magnolia International Ltd.
Grails just needs an object definition

                   class AffiliateItem {
                        String name   // The item being advertised.
                        Date dateCreated // When started.
                        String url    // Where the item can be purchased.
                        String shortDescription // A short description.
                        String longDescription // A long description.
                        Date startDate     // When available.
                        Date stopDate    // The last day it is available.
                   }




11   Version 1.1                                Magnolia is a registered trademark owned by Magnolia International Ltd.
Grails lets you add constraints

                   class AffiliateItem {
                     static constraints = {
                         name blank:false, unique:true
                         url url:true,blank:false, unique:true
                         shortDescription maxSize:26
                         longDescription widget:textarea
                     }
                    /// ….




12   Version 1.1                           Magnolia is a registered trademark owned by Magnolia International Ltd.
Just add a controller

                   class AffiliateItemController{
                       static scaffold = true
                   }




13   Version 1.1                   Magnolia is a registered trademark owned by Magnolia International Ltd.
One button and Grails Finishes
                   Grails builds CRUD (create, update,
                   delete) routines for object tables.
                   You start up Grails and it analyzes your
                   object definition.
                   Then it creates all of the code necessary
                   to let you build up tables filled with the
                   objects.


14   Version 1.1                       Magnolia is a registered trademark owned by Magnolia International Ltd.
Just some of the code built by Grails for free
                   package testgrails1


                   import org.springframework.dao.DataIntegrityViolationException


                   class AffiliateItemController {


                   static allowedMethods = [save: "POST", update: "POST", delete: "POST"]


                   def index() {
                   redirect(action: "list", params: params)
                   }


                   def list() {
                   params.max = Math.min(params.max ? params.int('max') : 10, 100)
                   [affiliateItemInstanceList: AffiliateItem.list(params), affiliateItemInstanceTotal: AffiliateItem.count()]
                   }


                   def create() {
                   [affiliateItemInstance: new AffiliateItem(params)]
                   }


                   def save() {
                   def affiliateItemInstance = new AffiliateItem(params)
                   if (!affiliateItemInstance.save(flush: true)) {
                   render(view: "create", model: [affiliateItemInstance: affiliateItemInstance])
                   return
                   }


                   flash.message = message(code: 'default.created.message', args: [message(code: 'affiliateItem.label', default: 'AffiliateItem'), affiliateItemInstance.id])
                   redirect(action: "show", id: affiliateItemInstance.id)
                   }


                   def show() {
                   def affiliateItemInstance = AffiliateItem.get(params.id)
                   if (!affiliateItemInstance) {
                   flash.message = message(code: 'default.not.found.message', args: [message(code: 'affiliateItem.label', default: 'AffiliateItem'), params.id])
                   redirect(action: "list")
                   return
                   }


                   [affiliateItemInstance: affiliateItemInstance]
                   }


                   def edit() {
                   def affiliateItemInstance = AffiliateItem.get(params.id)
                   if (!affiliateItemInstance) {
                   flash.message = message(code: 'default.not.found.message', args: [message(code: 'affiliateItem.label', default: 'AffiliateItem'), params.id])
                   redirect(action: "list")
                   return
                   }


                   [affiliateItemInstance: affiliateItemInstance]
                   }


                   def update() {
                   def affiliateItemInstance = AffiliateItem.get(params.id)
                   if (!affiliateItemInstance) {
                   flash.message = message(code: 'default.not.found.message', args: [message(code: 'affiliateItem.label', default: 'AffiliateItem'), params.id])
                   redirect(action: "list")
                   return
                   }


                   if (params.version) {
                   def version = params.version.toLong()
                   if (affiliateItemInstance.version > version) {
                   affiliateItemInstance.errors.rejectValue("version", "default.optimistic.locking.failure",
                   [message(code: 'affiliateItem.label', default: 'AffiliateItem')] as Object[],
                   "Another user has updated this AffiliateItem while you were editing")
                   render(view: "edit", model: [affiliateItemInstance: affiliateItemInstance])
                   return
                   }
                   }


                   affiliateItemInstance.properties = params


                   if (!affiliateItemInstance.save(flush: true)) {
                   render(view: "edit", model: [affiliateItemInstance: affiliateItemInstance])
                   return
                   }


                   flash.message = message(code: 'default.updated.message', args: [message(code: 'affiliateItem.label', default: 'AffiliateItem'), affiliateItemInstance.id])
                   redirect(action: "show", id: affiliateItemInstance.id)
                   }


                   def delete() {
                   def affiliateItemInstance = AffiliateItem.get(params.id)
                   if (!affiliateItemInstance) {
                   flash.message = message(code: 'default.not.found.message', args: [message(code: 'affiliateItem.label', default: 'AffiliateItem'), params.id])
                   redirect(action: "list")
                   return
                   }


                   try {
                   affiliateItemInstance.delete(flush: true)
                   flash.message = message(code: 'default.deleted.message', args: [message(code: 'affiliateItem.label', default: 'AffiliateItem'), params.id])
                   redirect(action: "list")
                   }
                   catch (DataIntegrityViolationException e) {
                   flash.message = message(code: 'default.not.deleted.message', args: [message(code: 'affiliateItem.label', default: 'AffiliateItem'), params.id])
                   redirect(action: "show", id: params.id)
                   }
                   }
                   }




15   Version 1.1                                                                                                                                                                Magnolia is a registered trademark owned by Magnolia International Ltd.
What the user sees




16   Version 1.1          Magnolia is a registered trademark owned by Magnolia International Ltd.
What Magnolia Does
                   Magnolia just needs a controller that can
                   search the tables for what it wants.
                   A template can format what is found.




17   Version 1.1                      Magnolia is a registered trademark owned by Magnolia International Ltd.
MainTemplateController
                   import info.magnolia.module.blossom.annotation.Template

                   @Template(id = "grailsModule:pages/demoTemplate", title = "Demo template")
                   class MainTemplateController {
                       def index() {
                               [count:AffiliateItem.count(), items:AffiliateItem.list()]
                         }
                   }




18   Version 1.1                                       Magnolia is a registered trademark owned by Magnolia International Ltd.
MainTemplateController
                   There are some static methods for looking through the tables of
                   AffiliateItems.

                   import info.magnolia.module.blossom.annotation.Template

                   @Template(id = "grailsModule:pages/demoTemplate", title = "Demo template")
                   class MainTemplateController {
                       def index() {
                               [count:AffiliateItem.count(), items:AffiliateItem.list()]
                         }
                   }




19   Version 1.1                                       Magnolia is a registered trademark owned by Magnolia International Ltd.
MainTemplateController
                   The index method calls the static search methods and bundles
                   the results into a data structure for the template. You can add
                   extra search logic and filtering here.

                   import info.magnolia.module.blossom.annotation.Template

                   @Template(id = "grailsModule:pages/demoTemplate", title = "Demo template")
                   class MainTemplateController {
                       def index() {
                               [count:AffiliateItem.count(), items:AffiliateItem.list()]
                         }
                   }




20   Version 1.1                                       Magnolia is a registered trademark owned by Magnolia International Ltd.
MainTemplateController
                   The Template annotation connects the controller with the
                   templates.

                   import info.magnolia.module.blossom.annotation.Template

                   @Template(id = "grailsModule:pages/demoTemplate", title = "Demo template")
                   class MainTemplateController {
                       def index() {
                               [count:AffiliateItem.count(), items:AffiliateItem.list()]
                         }
                   }




21   Version 1.1                                       Magnolia is a registered trademark owned by Magnolia International Ltd.
Index.gsp
                   <div class="body">
                     There are <i> <%= count %></i> AffiliateItems

                    <ul>
                      <g:each in="${items}" var="x">
                        <li><a href=”${x.url}”>${x.name}</a> --
                        <i>${x.longDescription}</i></li> </g:each>
                   </ul>
                   </div>




22   Version 1.1                          Magnolia is a registered trademark owned by Magnolia International Ltd.
Index.gsp
                   The count is just a number collected from the
                   AffiliateItem.count() static routine in the Controller.


                   <div class="body">
                     There are <i> <%= count %></i> AffiliateItems

                    <ul>
                      <g:each in="${items}" var="x">
                        <li><a href=”${x.url}”>${x.name}</a> --
                        <i>${x.longDescription}</i></li> </g:each>
                   </ul>
                   </div>

23   Version 1.1                                      Magnolia is a registered trademark owned by Magnolia International Ltd.
Index.gsp
                   Grails loops through the list of objects created by the
                   AffiliateItem.list() method in the Controller.


                   <div class="body">
                     There are <i> <%= count %></i> AffiliateItems

                    <ul>
                      <g:each in="${items}" var="x">
                        <li><a href=”${x.url}”>${x.name}</a> --
                        <i>${x.longDescription}</i></li> </g:each>
                   </ul>
                   </div>

24   Version 1.1                                    Magnolia is a registered trademark owned by Magnolia International Ltd.
Magnolia Takes Over
                   Index.gsp becomes a template for
                   Magnolia
                   Magnolia glues it together into the web
                   site like all of the other templates and
                   blocks
                   The Grails blocks sit next to the others.




25   Version 1.1                       Magnolia is a registered trademark owned by Magnolia International Ltd.
What Next?
                   More complicated templates.
                   More logic in the Controllers.
                   Magnolia glues them all together in a nice
                   layout.




26   Version 1.1                      Magnolia is a registered trademark owned by Magnolia International Ltd.
Resources

                   Introduction http://wiki.magnolia-cms.com/display/TALKOOT/Creating+Database-
                   driven+Web+Applications+with+Magnolia+CMS,+Groovy+and+Maglev

                   Maglev quickstart
                   https://github.com/Bonheur/maglev/wiki/Quick-
                   Start
                   Maglev downloads
                   https://github.com/Bonheur/maglev/downloads
                   Maglev JIRA site. http://jira.magnolia-
                   cms.com/browse/MAGLEV
                   http://www.magnolia-cms.com/community/magnolia-
                   conference/program/presentation-
                   day/presentations/bonheur-ab.html
27   Version 1.1                                         Magnolia is a registered trademark owned by Magnolia International Ltd.
28   Version 1.1   Magnolia is a registered trademark owned by Magnolia International Ltd.
Section title with abstract




29   Version 1.1        Magnolia is a registered trademark owned by Magnolia International Ltd.
Section title
                   with image




30   Version 1.1           Magnolia is a registered trademark owned by Magnolia International Ltd.
List of points without subtopics
                   Lay the foundation for future success
                   Improve usability
                   Simplify customization
                   Lower the entry barrier
                   Don’t change what works
                   Provide a migration path




31   Version 1.1                      Magnolia is a registered trademark owned by Magnolia International Ltd.
Title and bullets

                   Editor
                     •   Exposed by View (HasEditors)
                     •   Populate View with data
                     •   Retrieve values entered by user
                   Driver
                     •   Injects values into editors
                     •   Updates underlying model (node, bean)
                     •   Validates data
                   Used in various editable views
                     •   DialogView, TreeView, ParagraphEditView…
32   Version 1.1                                 Magnolia is a registered trademark owned by Magnolia International Ltd.
Title and bullets – 2 columns
             Enterprise Edition                Community Edition
               • Best choice for mission        • Basic content
                  critical websites               management
               • Supported by the vendor          functionality
               • Advanced enterprise            • Supported by the
                  features                        community
               • Visible source via             • Free for unlimited use
                  Magnolia Network              • Open source
                  Agreement                     • Cost effective
               • Cost effective                 • Double the Speed
               • Double the Speed

33   Version 1.1                           Magnolia is a registered trademark owned by Magnolia International Ltd.
Title, bullets & picture
             POJOs (Definitions)
               • Dialogs, trees, actions
               • Vaadin independent
             Contributed in various ways
               • Configuration
               • Annotations
               • Programmatically
             UI Builder builds the Vaadin
             components




34   Version 1.1                            Magnolia is a registered trademark owned by Magnolia International Ltd.
Title and picture horizontal




35   Version 1.1                Magnolia is a registered trademark owned by Magnolia International Ltd.
1             2   3   4


     Series 1, 2, 3, 4
                           Each step one slide




36   Version 1.1                             Magnolia is a registered trademark owned by Magnolia International Ltd.
Where does great content come
                from?




37   Version 1.1     Magnolia is a registered trademark owned by Magnolia International Ltd.
It takes about ten seconds to
         explain how to create content!




38   Version 1.1          Magnolia is a registered trademark owned by Magnolia International Ltd.
Keyboard
                          LTR/RTL

 Accessibility
          Touch                   Mobile




                                           Clouds

             AdminCentral                                  Configuration UI
                            Page editing                                                     Wizards

            Authoring                                  Development
Search                            Clipboard
                    Saved lists                                                  Developer mode

39    Version 1.1                              Magnolia is a registered trademark owned by Magnolia International Ltd.
Final slide

     First Last, Role                                         DD.MM.YYYY at Venue/Customer
     Magnolia International Ltd.                                  first.last@magnolia-cms.com




                                   www.magnolia-cms.com

40     Version 1.1                             Magnolia is a registered trademark owned by Magnolia International Ltd.

Contenu connexe

Plus de bkraft

High performance and scalability
High performance and scalability High performance and scalability
High performance and scalability bkraft
 
Multilingual websites, microsites and landing pages
Multilingual websites, microsites and landing pagesMultilingual websites, microsites and landing pages
Multilingual websites, microsites and landing pagesbkraft
 
Blossom on the web
Blossom on the webBlossom on the web
Blossom on the webbkraft
 
Single sourcing desktop and mobile websites
Single sourcing desktop and mobile websitesSingle sourcing desktop and mobile websites
Single sourcing desktop and mobile websitesbkraft
 
Work life balance
Work life balanceWork life balance
Work life balancebkraft
 
Magnolia and PHPCR
Magnolia and PHPCRMagnolia and PHPCR
Magnolia and PHPCRbkraft
 
Solr and Image Module Extensions of Magnolia
Solr and Image Module Extensions of MagnoliaSolr and Image Module Extensions of Magnolia
Solr and Image Module Extensions of Magnoliabkraft
 
End to end content managed online mobile banking
End to end content managed online mobile bankingEnd to end content managed online mobile banking
End to end content managed online mobile bankingbkraft
 
MBC Group - Magnolia in the Media
MBC Group - Magnolia in the MediaMBC Group - Magnolia in the Media
MBC Group - Magnolia in the Mediabkraft
 
Yet Another E-Commerce Integration: Magnolia Loves Hybris
Yet Another E-Commerce Integration: Magnolia Loves Hybris Yet Another E-Commerce Integration: Magnolia Loves Hybris
Yet Another E-Commerce Integration: Magnolia Loves Hybris bkraft
 
Bridging the Gap: Magnolia Modules and Spring Configured Software
Bridging the Gap: Magnolia Modules and Spring Configured SoftwareBridging the Gap: Magnolia Modules and Spring Configured Software
Bridging the Gap: Magnolia Modules and Spring Configured Softwarebkraft
 
User Management and SSO for Austrian Government
User Management and SSO for Austrian GovernmentUser Management and SSO for Austrian Government
User Management and SSO for Austrian Governmentbkraft
 
Enterprise Extensions to Magnolia's Imaging
Enterprise Extensions to Magnolia's ImagingEnterprise Extensions to Magnolia's Imaging
Enterprise Extensions to Magnolia's Imagingbkraft
 
How the STK, CSS & HTML and Rapid Prototyping Accelerate the Design Process
How the STK, CSS & HTML and Rapid Prototyping Accelerate the Design ProcessHow the STK, CSS & HTML and Rapid Prototyping Accelerate the Design Process
How the STK, CSS & HTML and Rapid Prototyping Accelerate the Design Processbkraft
 
Migros.ch - Modularizing Magnolia for Switzerland's Largest Retailer
Migros.ch - Modularizing Magnolia for Switzerland's Largest RetailerMigros.ch - Modularizing Magnolia for Switzerland's Largest Retailer
Migros.ch - Modularizing Magnolia for Switzerland's Largest Retailerbkraft
 
How AngryNerds Convinced Atlassian to Use Magnolia
How AngryNerds Convinced Atlassian to Use MagnoliaHow AngryNerds Convinced Atlassian to Use Magnolia
How AngryNerds Convinced Atlassian to Use Magnoliabkraft
 
Magnolia 5 Magnolia Conference 2012 Keynote
Magnolia 5 Magnolia Conference 2012 KeynoteMagnolia 5 Magnolia Conference 2012 Keynote
Magnolia 5 Magnolia Conference 2012 Keynotebkraft
 
Webinar 4.5-features-partners
Webinar 4.5-features-partnersWebinar 4.5-features-partners
Webinar 4.5-features-partnersbkraft
 
Core capabilities of wcm - magnolia
Core capabilities of wcm -  magnoliaCore capabilities of wcm -  magnolia
Core capabilities of wcm - magnoliabkraft
 
Disruptive innovation workshop
Disruptive innovation workshopDisruptive innovation workshop
Disruptive innovation workshopbkraft
 

Plus de bkraft (20)

High performance and scalability
High performance and scalability High performance and scalability
High performance and scalability
 
Multilingual websites, microsites and landing pages
Multilingual websites, microsites and landing pagesMultilingual websites, microsites and landing pages
Multilingual websites, microsites and landing pages
 
Blossom on the web
Blossom on the webBlossom on the web
Blossom on the web
 
Single sourcing desktop and mobile websites
Single sourcing desktop and mobile websitesSingle sourcing desktop and mobile websites
Single sourcing desktop and mobile websites
 
Work life balance
Work life balanceWork life balance
Work life balance
 
Magnolia and PHPCR
Magnolia and PHPCRMagnolia and PHPCR
Magnolia and PHPCR
 
Solr and Image Module Extensions of Magnolia
Solr and Image Module Extensions of MagnoliaSolr and Image Module Extensions of Magnolia
Solr and Image Module Extensions of Magnolia
 
End to end content managed online mobile banking
End to end content managed online mobile bankingEnd to end content managed online mobile banking
End to end content managed online mobile banking
 
MBC Group - Magnolia in the Media
MBC Group - Magnolia in the MediaMBC Group - Magnolia in the Media
MBC Group - Magnolia in the Media
 
Yet Another E-Commerce Integration: Magnolia Loves Hybris
Yet Another E-Commerce Integration: Magnolia Loves Hybris Yet Another E-Commerce Integration: Magnolia Loves Hybris
Yet Another E-Commerce Integration: Magnolia Loves Hybris
 
Bridging the Gap: Magnolia Modules and Spring Configured Software
Bridging the Gap: Magnolia Modules and Spring Configured SoftwareBridging the Gap: Magnolia Modules and Spring Configured Software
Bridging the Gap: Magnolia Modules and Spring Configured Software
 
User Management and SSO for Austrian Government
User Management and SSO for Austrian GovernmentUser Management and SSO for Austrian Government
User Management and SSO for Austrian Government
 
Enterprise Extensions to Magnolia's Imaging
Enterprise Extensions to Magnolia's ImagingEnterprise Extensions to Magnolia's Imaging
Enterprise Extensions to Magnolia's Imaging
 
How the STK, CSS & HTML and Rapid Prototyping Accelerate the Design Process
How the STK, CSS & HTML and Rapid Prototyping Accelerate the Design ProcessHow the STK, CSS & HTML and Rapid Prototyping Accelerate the Design Process
How the STK, CSS & HTML and Rapid Prototyping Accelerate the Design Process
 
Migros.ch - Modularizing Magnolia for Switzerland's Largest Retailer
Migros.ch - Modularizing Magnolia for Switzerland's Largest RetailerMigros.ch - Modularizing Magnolia for Switzerland's Largest Retailer
Migros.ch - Modularizing Magnolia for Switzerland's Largest Retailer
 
How AngryNerds Convinced Atlassian to Use Magnolia
How AngryNerds Convinced Atlassian to Use MagnoliaHow AngryNerds Convinced Atlassian to Use Magnolia
How AngryNerds Convinced Atlassian to Use Magnolia
 
Magnolia 5 Magnolia Conference 2012 Keynote
Magnolia 5 Magnolia Conference 2012 KeynoteMagnolia 5 Magnolia Conference 2012 Keynote
Magnolia 5 Magnolia Conference 2012 Keynote
 
Webinar 4.5-features-partners
Webinar 4.5-features-partnersWebinar 4.5-features-partners
Webinar 4.5-features-partners
 
Core capabilities of wcm - magnolia
Core capabilities of wcm -  magnoliaCore capabilities of wcm -  magnolia
Core capabilities of wcm - magnolia
 
Disruptive innovation workshop
Disruptive innovation workshopDisruptive innovation workshop
Disruptive innovation workshop
 

Dernier

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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 

Dernier (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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 

Unlock Enterprise Databases to Create New Online Services with Magnolia and Grails

  • 1. Magnolia + Grails = Maglev Peter Wayner WebCast 1 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 2. Maglev Table-driven data with Grails Template-driven pages with Magnolia Peter Wayner WebCast 2 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 3. Is it possible to mix the ease of Grails with the Magnolia? 3 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 4. Yes! With Maglev, a plugin 4 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 5. Why? Grails is a Java-based Web App Framework Grails is open source Grails is template-driven (GSP and JSP) Grails is extendable with plugins. 5 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 6. Magnolia is Similar Magnolia is a Java-based Content Management System Magnolia is open source Magnolia is template-driven (Freemarker and JSP) Magnolia is extendable with plugins. 6 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 7. Invention Developed by Kimmo Björnsson and Åke Argéus, Lead Developers, Bonheur AB They saw that the two tools that complemented each other well. They turned Magnolia into a plugin that lives in Grails. 7 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 8. Let’s mix them together Maglev bundles together all of Magnolia into a Grails plugin. It’s plugged into Grails, but Magnolia ends up driving the front. Grails handles the table-driven objects. Magnolia handles the templates 8 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 9. Benefits Rapid prototyping. Grails builds databases quickly. Data/Content integration. Magnolia knits together content well. Separation of code from presentation. (Grails handles backend, Magnolia the front.) 9 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 10. Example Affiliate marketing for a web site needs a table of URLs. If someone clicks on the URL, the web site gets some revenue. Lets store them in a table. Display them in a Magnolia template. 10 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 11. Grails just needs an object definition class AffiliateItem { String name // The item being advertised. Date dateCreated // When started. String url // Where the item can be purchased. String shortDescription // A short description. String longDescription // A long description. Date startDate // When available. Date stopDate // The last day it is available. } 11 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 12. Grails lets you add constraints class AffiliateItem { static constraints = { name blank:false, unique:true url url:true,blank:false, unique:true shortDescription maxSize:26 longDescription widget:textarea } /// …. 12 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 13. Just add a controller class AffiliateItemController{ static scaffold = true } 13 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 14. One button and Grails Finishes Grails builds CRUD (create, update, delete) routines for object tables. You start up Grails and it analyzes your object definition. Then it creates all of the code necessary to let you build up tables filled with the objects. 14 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 15. Just some of the code built by Grails for free package testgrails1 import org.springframework.dao.DataIntegrityViolationException class AffiliateItemController { static allowedMethods = [save: "POST", update: "POST", delete: "POST"] def index() { redirect(action: "list", params: params) } def list() { params.max = Math.min(params.max ? params.int('max') : 10, 100) [affiliateItemInstanceList: AffiliateItem.list(params), affiliateItemInstanceTotal: AffiliateItem.count()] } def create() { [affiliateItemInstance: new AffiliateItem(params)] } def save() { def affiliateItemInstance = new AffiliateItem(params) if (!affiliateItemInstance.save(flush: true)) { render(view: "create", model: [affiliateItemInstance: affiliateItemInstance]) return } flash.message = message(code: 'default.created.message', args: [message(code: 'affiliateItem.label', default: 'AffiliateItem'), affiliateItemInstance.id]) redirect(action: "show", id: affiliateItemInstance.id) } def show() { def affiliateItemInstance = AffiliateItem.get(params.id) if (!affiliateItemInstance) { flash.message = message(code: 'default.not.found.message', args: [message(code: 'affiliateItem.label', default: 'AffiliateItem'), params.id]) redirect(action: "list") return } [affiliateItemInstance: affiliateItemInstance] } def edit() { def affiliateItemInstance = AffiliateItem.get(params.id) if (!affiliateItemInstance) { flash.message = message(code: 'default.not.found.message', args: [message(code: 'affiliateItem.label', default: 'AffiliateItem'), params.id]) redirect(action: "list") return } [affiliateItemInstance: affiliateItemInstance] } def update() { def affiliateItemInstance = AffiliateItem.get(params.id) if (!affiliateItemInstance) { flash.message = message(code: 'default.not.found.message', args: [message(code: 'affiliateItem.label', default: 'AffiliateItem'), params.id]) redirect(action: "list") return } if (params.version) { def version = params.version.toLong() if (affiliateItemInstance.version > version) { affiliateItemInstance.errors.rejectValue("version", "default.optimistic.locking.failure", [message(code: 'affiliateItem.label', default: 'AffiliateItem')] as Object[], "Another user has updated this AffiliateItem while you were editing") render(view: "edit", model: [affiliateItemInstance: affiliateItemInstance]) return } } affiliateItemInstance.properties = params if (!affiliateItemInstance.save(flush: true)) { render(view: "edit", model: [affiliateItemInstance: affiliateItemInstance]) return } flash.message = message(code: 'default.updated.message', args: [message(code: 'affiliateItem.label', default: 'AffiliateItem'), affiliateItemInstance.id]) redirect(action: "show", id: affiliateItemInstance.id) } def delete() { def affiliateItemInstance = AffiliateItem.get(params.id) if (!affiliateItemInstance) { flash.message = message(code: 'default.not.found.message', args: [message(code: 'affiliateItem.label', default: 'AffiliateItem'), params.id]) redirect(action: "list") return } try { affiliateItemInstance.delete(flush: true) flash.message = message(code: 'default.deleted.message', args: [message(code: 'affiliateItem.label', default: 'AffiliateItem'), params.id]) redirect(action: "list") } catch (DataIntegrityViolationException e) { flash.message = message(code: 'default.not.deleted.message', args: [message(code: 'affiliateItem.label', default: 'AffiliateItem'), params.id]) redirect(action: "show", id: params.id) } } } 15 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 16. What the user sees 16 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 17. What Magnolia Does Magnolia just needs a controller that can search the tables for what it wants. A template can format what is found. 17 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 18. MainTemplateController import info.magnolia.module.blossom.annotation.Template @Template(id = "grailsModule:pages/demoTemplate", title = "Demo template") class MainTemplateController { def index() { [count:AffiliateItem.count(), items:AffiliateItem.list()] } } 18 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 19. MainTemplateController There are some static methods for looking through the tables of AffiliateItems. import info.magnolia.module.blossom.annotation.Template @Template(id = "grailsModule:pages/demoTemplate", title = "Demo template") class MainTemplateController { def index() { [count:AffiliateItem.count(), items:AffiliateItem.list()] } } 19 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 20. MainTemplateController The index method calls the static search methods and bundles the results into a data structure for the template. You can add extra search logic and filtering here. import info.magnolia.module.blossom.annotation.Template @Template(id = "grailsModule:pages/demoTemplate", title = "Demo template") class MainTemplateController { def index() { [count:AffiliateItem.count(), items:AffiliateItem.list()] } } 20 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 21. MainTemplateController The Template annotation connects the controller with the templates. import info.magnolia.module.blossom.annotation.Template @Template(id = "grailsModule:pages/demoTemplate", title = "Demo template") class MainTemplateController { def index() { [count:AffiliateItem.count(), items:AffiliateItem.list()] } } 21 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 22. Index.gsp <div class="body"> There are <i> <%= count %></i> AffiliateItems <ul> <g:each in="${items}" var="x"> <li><a href=”${x.url}”>${x.name}</a> -- <i>${x.longDescription}</i></li> </g:each> </ul> </div> 22 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 23. Index.gsp The count is just a number collected from the AffiliateItem.count() static routine in the Controller. <div class="body"> There are <i> <%= count %></i> AffiliateItems <ul> <g:each in="${items}" var="x"> <li><a href=”${x.url}”>${x.name}</a> -- <i>${x.longDescription}</i></li> </g:each> </ul> </div> 23 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 24. Index.gsp Grails loops through the list of objects created by the AffiliateItem.list() method in the Controller. <div class="body"> There are <i> <%= count %></i> AffiliateItems <ul> <g:each in="${items}" var="x"> <li><a href=”${x.url}”>${x.name}</a> -- <i>${x.longDescription}</i></li> </g:each> </ul> </div> 24 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 25. Magnolia Takes Over Index.gsp becomes a template for Magnolia Magnolia glues it together into the web site like all of the other templates and blocks The Grails blocks sit next to the others. 25 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 26. What Next? More complicated templates. More logic in the Controllers. Magnolia glues them all together in a nice layout. 26 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 27. Resources Introduction http://wiki.magnolia-cms.com/display/TALKOOT/Creating+Database- driven+Web+Applications+with+Magnolia+CMS,+Groovy+and+Maglev Maglev quickstart https://github.com/Bonheur/maglev/wiki/Quick- Start Maglev downloads https://github.com/Bonheur/maglev/downloads Maglev JIRA site. http://jira.magnolia- cms.com/browse/MAGLEV http://www.magnolia-cms.com/community/magnolia- conference/program/presentation- day/presentations/bonheur-ab.html 27 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 28. 28 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 29. Section title with abstract 29 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 30. Section title with image 30 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 31. List of points without subtopics Lay the foundation for future success Improve usability Simplify customization Lower the entry barrier Don’t change what works Provide a migration path 31 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 32. Title and bullets Editor • Exposed by View (HasEditors) • Populate View with data • Retrieve values entered by user Driver • Injects values into editors • Updates underlying model (node, bean) • Validates data Used in various editable views • DialogView, TreeView, ParagraphEditView… 32 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 33. Title and bullets – 2 columns Enterprise Edition Community Edition • Best choice for mission • Basic content critical websites management • Supported by the vendor functionality • Advanced enterprise • Supported by the features community • Visible source via • Free for unlimited use Magnolia Network • Open source Agreement • Cost effective • Cost effective • Double the Speed • Double the Speed 33 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 34. Title, bullets & picture POJOs (Definitions) • Dialogs, trees, actions • Vaadin independent Contributed in various ways • Configuration • Annotations • Programmatically UI Builder builds the Vaadin components 34 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 35. Title and picture horizontal 35 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 36. 1 2 3 4 Series 1, 2, 3, 4 Each step one slide 36 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 37. Where does great content come from? 37 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 38. It takes about ten seconds to explain how to create content! 38 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 39. Keyboard LTR/RTL Accessibility Touch Mobile Clouds AdminCentral Configuration UI Page editing Wizards Authoring Development Search Clipboard Saved lists Developer mode 39 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.
  • 40. Final slide First Last, Role DD.MM.YYYY at Venue/Customer Magnolia International Ltd. first.last@magnolia-cms.com www.magnolia-cms.com 40 Version 1.1 Magnolia is a registered trademark owned by Magnolia International Ltd.