SlideShare ist ein Scribd-Unternehmen logo
1 von 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.

Weitere ähnliche Inhalte

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
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
 
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
 

Kürzlich hochgeladen (20)

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
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
 

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.