SlideShare a Scribd company logo
1 of 28
Integrating Magnolia with Spring Framework  using Blossom using Blossom Magnolia is a registered trademark used by permission
Speaker Qualifications Magnolia is a registered trademark used by permission
Why use Spring? Why use Spring? Magnolia is a registered trademark used by permission
Spring is the enabler Magnolia is a registered trademark used by permission ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Spring is everywhere  Magnolia is a registered trademark used by permission ,[object Object],[object Object],[object Object]
Spring is comprehensive  Magnolia is a registered trademark used by permission ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How does Blossom integrate Spring? Magnolia is a registered trademark used by permission ,[object Object],[object Object],[object Object],[object Object]
Model View Controller Pattern Magnolia is a registered trademark used by permission Controller Model View The controller receives input, performs requested operations and provides the resulting model. The view is responsible for providing the UI representation of the model. Keeps business logic separated from presentation.
Spring Web MVC Annotation Based Controller Annotation Based Controller Magnolia is a registered trademark used by permission @Controller public   class  BookController  { @ Autowired private  BookStoreWebService webService ; @ RequestMapping ( "/book" ) public  ModelAndView handleRequest (@ RequestParam ( "id" )   int  bookId )   { ModelAndView mav  =   new  ModelAndView ( "book.jsp" ) ; mav . addAttribute ( "book" ,  webService . getBook ( bookId )) ; return  mav ; } } http://acmebookstore.com/book?id=1327
How can Spring Web MVC fit in Magnolia? Magnolia is a registered trademark used by permission Template Paragraph Paragraph
Blossom managed templates and paragraphs Magnolia is a registered trademark used by permission Template C M V Paragraph C M V Paragraph C M V Templates and paragraphs are decoupled from view rendering
Pre-executing a controller (paragraph) Magnolia is a registered trademark used by permission Template C M V Paragraph C M V Paragraph C M V C The pre-executed controller can choose to skip page rendering by sending a redirect or directly render something on its own
Pre-executing a controller (paragraph) Magnolia is a registered trademark used by permission ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Template C M V Paragraph C M V Paragraph C M V C
The Blossom Programming Model Magnolia is a registered trademark used by permission ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Templates Magnolia is a registered trademark used by permission @Controller @Template("Two Columns") public   class  TwoColumnsTemplate  { @ RequestMapping ( "/twoColumns" ) public  ModelAndView handleRequest ()   { return   new  ModelAndView ( "twoColumnsTemplate.jsp" ) ; } }
Paragraphs Magnolia is a registered trademark used by permission @Controller @Paragraph(value = "Simple paragraph", dialog=”simple-dialog”) @ParagraphDescription("Simple paragraph that renders a JSP") public   class  SimpleParagraph  { @ RequestMapping ( "/simple" ) public  ModelAndView render ()   { return   new  ModelAndView ( "simpleParagraph.jsp" ) ; } }
Blossom managed dialogs Magnolia is a registered trademark used by permission ,[object Object],[object Object],[object Object],[object Object]
Blossom managed dialogs Magnolia is a registered trademark used by permission @DialogFactory("page-dialog") public   class  PageDialog  { @ TabFactory ( "Content" ) public   void  contentTab ( TabBuilder tab )   { tab . addEdit ( "title" ,   "Title" ,   "Title of this page" ) ; tab . addCheckbox ( "navigation" ,   "Navigation" ,   "Include page in menu" ) ; } @ TabFactory ( "Meta" ) public   void  metaTab ( TabBuilder tab )   { tab . addEdit ( "author" ,   "Author" ,   "" ) ; tab . addEdit ( "keywords" ,   "Keywords" ,   "Keywords for this page" ) ; tab . addEdit ( "description" ,   "Description" ,   "Concise page explanation" ) ; } }
Dialog inheritance Magnolia is a registered trademark used by permission public   abstract   class  BaseDialog  { @ TabFactory ( "Meta" ) public   void  metaTab ( TabBuilder tab )   { tab . addEdit ( "keywords" ,   "Keywords" ,   "Keywords for this page" ) ; tab . addEdit ( "description" ,   "Description" ,   "Concise page explanation" ) ; } } @DialogFactory("news-properties") @TabOrder( "Content" ,  “Meta” ) public   class  NewsPageDialog  extends  BaseDialog  { @ TabFactory ( "Content" ) public   void  contentTab ( TabBuilder tab )   { tab . addEdit ( "subject" ,   "Subject" ,   "News subject" ) ; tab . addDate ( "date" ,   "Publication Date" ,   "Date of publication" ) ; tab . addFckEditor ( "text" ,   "Text" ,   "" ) ; tab . addFile ( "image" ,   "Image" ,   "" ) ; } }
Dialog validation Magnolia is a registered trademark used by permission @DialogFactory(&quot;page-properties&quot;) public   class  PagePropertiesDialog  { @ TabFactory ( &quot;Meta&quot; ) public   void  metaTab ( TabBuilder tab )   { tab . addEdit ( &quot;description&quot; ,   &quot;Description&quot; ,   &quot;A concise page explanation&quot; ) ; } @ TabValidator ( &quot;Meta&quot; ) public   void  validateMetaTab ( DialogTab tab )   { if   ( tab . getSub ( &quot;description&quot; ). getValue (). length ()   <   20 ) AlertUtil . setMessage ( &quot;Meta description needs to be longer&quot; ) ; } }
Paragraphs can create their own dialogs Magnolia is a registered trademark used by permission @Controller @Paragraph(&quot;Text and Image&quot;) public   class  TextAndImageParagraph  { @ RequestMapping ( &quot;/textAndImage&quot; ) public  ModelAndView render ()   { return   new  ModelAndView ( &quot;textAndImage.jsp&quot; ) ; } @ TabFactory ( &quot;Content&quot; ) public   void  contentTab ( TabBuilder tab )   throws  RepositoryException  { tab . addFckEditor ( &quot;text&quot; ,   &quot;Text&quot; ,   &quot;&quot; ) ; tab . addFile ( &quot;image&quot; ,   &quot;Image&quot; ,   &quot;&quot; ) ; } }
Templates can contain dialog factories Magnolia is a registered trademark used by permission @Controller @Template(&quot;Section&quot;) public   class  SectionTemplate  { @ RequestMapping ( &quot;/section&quot; ) public  ModelAndView handleRequest ()   { return   new  ModelAndView ( &quot;sectionTemplate.jsp&quot; ) ; } @ DialogFactory ( &quot;section-properties&quot; ) public   void  propertiesDialog ( DialogBuilder dialog )   { TabBuilder contentTab  =  dialog . addTab ( &quot;Content&quot; ) ; contentTab . addEdit ( &quot;title&quot; ,   &quot;Title&quot; ,   &quot;Title of this page&quot; ) ; TabBuilder metaTab  =  dialog . addTab ( &quot;Meta&quot; ) ; metaTab . addEdit ( &quot;description&quot; ,   &quot;Description&quot; ,   &quot;Page explanation&quot; ) ; } }
Dialogs be dynamically populated Magnolia is a registered trademark used by permission @Controller @Paragraph(“Book”) public   class  BookParagraph  { @ Autowired private  BookStoreWebService webService ; @ RequestMapping ( &quot;/book&quot; ) public  ModelAndView handleRequest ()   { Content content  =  MgnlContext . getAggregationState (). getCurrentContent () ; String  bookId  =  content . getNodeData ( &quot;id&quot; ). getString () ; ModelAndView mav  =   new  ModelAndView ( &quot;book.jsp&quot; ) ; mav . addAttribute ( &quot;book&quot; ,  webService . getBook ( bookId )) ; return  mav ; } @ TabFactory ( &quot;Content&quot; ) public   void  contentTab ( TabBuilder tab )   { tab . addSelect ( &quot;id&quot; ,   &quot;Book&quot; ,   &quot;Select the book&quot; ,  webService . getBooks ()) ; } }
View Technologies Magnolia is a registered trademark used by permission ,[object Object],[object Object],[object Object],[object Object]
Ticket Privatresor AB (www.ticket.se) Magnolia is a registered trademark used by permission ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summary Magnolia is a registered trademark used by permission ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Project Goal Magnolia is a registered trademark used by permission ,[object Object],[object Object],[object Object],[object Object],[object Object]
Questions? Magnolia is a registered trademark used by permission

More Related Content

More from bkraft

Magnolia Conference 2013: Keynote
Magnolia Conference 2013: KeynoteMagnolia Conference 2013: Keynote
Magnolia Conference 2013: Keynotebkraft
 
Webinar slides: Orchestrate Your Digital Channels with Magnolia 5
Webinar slides: Orchestrate Your Digital Channels with Magnolia 5Webinar slides: Orchestrate Your Digital Channels with Magnolia 5
Webinar slides: Orchestrate Your Digital Channels with Magnolia 5bkraft
 
Webinar - Why Magnolia 5 Rocks For IT
Webinar - Why Magnolia 5 Rocks For ITWebinar - Why Magnolia 5 Rocks For IT
Webinar - Why Magnolia 5 Rocks For ITbkraft
 
Increase Online Sales with Magnolia CMS' Shop Module
Increase Online Sales with Magnolia CMS' Shop ModuleIncrease Online Sales with Magnolia CMS' Shop Module
Increase Online Sales with Magnolia CMS' Shop Modulebkraft
 
Virtual Presence Management at Magnolia Amplify Miami 2013
Virtual Presence Management at Magnolia Amplify Miami 2013Virtual Presence Management at Magnolia Amplify Miami 2013
Virtual Presence Management at Magnolia Amplify Miami 2013bkraft
 
High performance and scalability
High performance and scalability High performance and scalability
High performance and scalability bkraft
 
Blossom on the web
Blossom on the webBlossom on the web
Blossom on the webbkraft
 
Work life balance
Work life balanceWork life balance
Work life balancebkraft
 
Magnolia and PHPCR
Magnolia and PHPCRMagnolia and PHPCR
Magnolia and PHPCRbkraft
 
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
 
Core capabilities of wcm - magnolia
Core capabilities of wcm -  magnoliaCore capabilities of wcm -  magnolia
Core capabilities of wcm - magnoliabkraft
 

More from bkraft (20)

Magnolia Conference 2013: Keynote
Magnolia Conference 2013: KeynoteMagnolia Conference 2013: Keynote
Magnolia Conference 2013: Keynote
 
Webinar slides: Orchestrate Your Digital Channels with Magnolia 5
Webinar slides: Orchestrate Your Digital Channels with Magnolia 5Webinar slides: Orchestrate Your Digital Channels with Magnolia 5
Webinar slides: Orchestrate Your Digital Channels with Magnolia 5
 
Webinar - Why Magnolia 5 Rocks For IT
Webinar - Why Magnolia 5 Rocks For ITWebinar - Why Magnolia 5 Rocks For IT
Webinar - Why Magnolia 5 Rocks For IT
 
Increase Online Sales with Magnolia CMS' Shop Module
Increase Online Sales with Magnolia CMS' Shop ModuleIncrease Online Sales with Magnolia CMS' Shop Module
Increase Online Sales with Magnolia CMS' Shop Module
 
Virtual Presence Management at Magnolia Amplify Miami 2013
Virtual Presence Management at Magnolia Amplify Miami 2013Virtual Presence Management at Magnolia Amplify Miami 2013
Virtual Presence Management at Magnolia Amplify Miami 2013
 
High performance and scalability
High performance and scalability High performance and scalability
High performance and scalability
 
Blossom on the web
Blossom on the webBlossom on the web
Blossom on the web
 
Work life balance
Work life balanceWork life balance
Work life balance
 
Magnolia and PHPCR
Magnolia and PHPCRMagnolia and PHPCR
Magnolia and PHPCR
 
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
 
Core capabilities of wcm - magnolia
Core capabilities of wcm -  magnoliaCore capabilities of wcm -  magnolia
Core capabilities of wcm - magnolia
 

Integrating Magnolia with Spring Framework using Blossom

  • 1. Integrating Magnolia with Spring Framework using Blossom using Blossom Magnolia is a registered trademark used by permission
  • 2. Speaker Qualifications Magnolia is a registered trademark used by permission
  • 3. Why use Spring? Why use Spring? Magnolia is a registered trademark used by permission
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. Model View Controller Pattern Magnolia is a registered trademark used by permission Controller Model View The controller receives input, performs requested operations and provides the resulting model. The view is responsible for providing the UI representation of the model. Keeps business logic separated from presentation.
  • 9. Spring Web MVC Annotation Based Controller Annotation Based Controller Magnolia is a registered trademark used by permission @Controller public class BookController { @ Autowired private BookStoreWebService webService ; @ RequestMapping ( &quot;/book&quot; ) public ModelAndView handleRequest (@ RequestParam ( &quot;id&quot; ) int bookId ) { ModelAndView mav = new ModelAndView ( &quot;book.jsp&quot; ) ; mav . addAttribute ( &quot;book&quot; , webService . getBook ( bookId )) ; return mav ; } } http://acmebookstore.com/book?id=1327
  • 10. How can Spring Web MVC fit in Magnolia? Magnolia is a registered trademark used by permission Template Paragraph Paragraph
  • 11. Blossom managed templates and paragraphs Magnolia is a registered trademark used by permission Template C M V Paragraph C M V Paragraph C M V Templates and paragraphs are decoupled from view rendering
  • 12. Pre-executing a controller (paragraph) Magnolia is a registered trademark used by permission Template C M V Paragraph C M V Paragraph C M V C The pre-executed controller can choose to skip page rendering by sending a redirect or directly render something on its own
  • 13.
  • 14.
  • 15. Templates Magnolia is a registered trademark used by permission @Controller @Template(&quot;Two Columns&quot;) public class TwoColumnsTemplate { @ RequestMapping ( &quot;/twoColumns&quot; ) public ModelAndView handleRequest () { return new ModelAndView ( &quot;twoColumnsTemplate.jsp&quot; ) ; } }
  • 16. Paragraphs Magnolia is a registered trademark used by permission @Controller @Paragraph(value = &quot;Simple paragraph&quot;, dialog=”simple-dialog”) @ParagraphDescription(&quot;Simple paragraph that renders a JSP&quot;) public class SimpleParagraph { @ RequestMapping ( &quot;/simple&quot; ) public ModelAndView render () { return new ModelAndView ( &quot;simpleParagraph.jsp&quot; ) ; } }
  • 17.
  • 18. Blossom managed dialogs Magnolia is a registered trademark used by permission @DialogFactory(&quot;page-dialog&quot;) public class PageDialog { @ TabFactory ( &quot;Content&quot; ) public void contentTab ( TabBuilder tab ) { tab . addEdit ( &quot;title&quot; , &quot;Title&quot; , &quot;Title of this page&quot; ) ; tab . addCheckbox ( &quot;navigation&quot; , &quot;Navigation&quot; , &quot;Include page in menu&quot; ) ; } @ TabFactory ( &quot;Meta&quot; ) public void metaTab ( TabBuilder tab ) { tab . addEdit ( &quot;author&quot; , &quot;Author&quot; , &quot;&quot; ) ; tab . addEdit ( &quot;keywords&quot; , &quot;Keywords&quot; , &quot;Keywords for this page&quot; ) ; tab . addEdit ( &quot;description&quot; , &quot;Description&quot; , &quot;Concise page explanation&quot; ) ; } }
  • 19. Dialog inheritance Magnolia is a registered trademark used by permission public abstract class BaseDialog { @ TabFactory ( &quot;Meta&quot; ) public void metaTab ( TabBuilder tab ) { tab . addEdit ( &quot;keywords&quot; , &quot;Keywords&quot; , &quot;Keywords for this page&quot; ) ; tab . addEdit ( &quot;description&quot; , &quot;Description&quot; , &quot;Concise page explanation&quot; ) ; } } @DialogFactory(&quot;news-properties&quot;) @TabOrder( &quot;Content&quot; , “Meta” ) public class NewsPageDialog extends BaseDialog { @ TabFactory ( &quot;Content&quot; ) public void contentTab ( TabBuilder tab ) { tab . addEdit ( &quot;subject&quot; , &quot;Subject&quot; , &quot;News subject&quot; ) ; tab . addDate ( &quot;date&quot; , &quot;Publication Date&quot; , &quot;Date of publication&quot; ) ; tab . addFckEditor ( &quot;text&quot; , &quot;Text&quot; , &quot;&quot; ) ; tab . addFile ( &quot;image&quot; , &quot;Image&quot; , &quot;&quot; ) ; } }
  • 20. Dialog validation Magnolia is a registered trademark used by permission @DialogFactory(&quot;page-properties&quot;) public class PagePropertiesDialog { @ TabFactory ( &quot;Meta&quot; ) public void metaTab ( TabBuilder tab ) { tab . addEdit ( &quot;description&quot; , &quot;Description&quot; , &quot;A concise page explanation&quot; ) ; } @ TabValidator ( &quot;Meta&quot; ) public void validateMetaTab ( DialogTab tab ) { if ( tab . getSub ( &quot;description&quot; ). getValue (). length () < 20 ) AlertUtil . setMessage ( &quot;Meta description needs to be longer&quot; ) ; } }
  • 21. Paragraphs can create their own dialogs Magnolia is a registered trademark used by permission @Controller @Paragraph(&quot;Text and Image&quot;) public class TextAndImageParagraph { @ RequestMapping ( &quot;/textAndImage&quot; ) public ModelAndView render () { return new ModelAndView ( &quot;textAndImage.jsp&quot; ) ; } @ TabFactory ( &quot;Content&quot; ) public void contentTab ( TabBuilder tab ) throws RepositoryException { tab . addFckEditor ( &quot;text&quot; , &quot;Text&quot; , &quot;&quot; ) ; tab . addFile ( &quot;image&quot; , &quot;Image&quot; , &quot;&quot; ) ; } }
  • 22. Templates can contain dialog factories Magnolia is a registered trademark used by permission @Controller @Template(&quot;Section&quot;) public class SectionTemplate { @ RequestMapping ( &quot;/section&quot; ) public ModelAndView handleRequest () { return new ModelAndView ( &quot;sectionTemplate.jsp&quot; ) ; } @ DialogFactory ( &quot;section-properties&quot; ) public void propertiesDialog ( DialogBuilder dialog ) { TabBuilder contentTab = dialog . addTab ( &quot;Content&quot; ) ; contentTab . addEdit ( &quot;title&quot; , &quot;Title&quot; , &quot;Title of this page&quot; ) ; TabBuilder metaTab = dialog . addTab ( &quot;Meta&quot; ) ; metaTab . addEdit ( &quot;description&quot; , &quot;Description&quot; , &quot;Page explanation&quot; ) ; } }
  • 23. Dialogs be dynamically populated Magnolia is a registered trademark used by permission @Controller @Paragraph(“Book”) public class BookParagraph { @ Autowired private BookStoreWebService webService ; @ RequestMapping ( &quot;/book&quot; ) public ModelAndView handleRequest () { Content content = MgnlContext . getAggregationState (). getCurrentContent () ; String bookId = content . getNodeData ( &quot;id&quot; ). getString () ; ModelAndView mav = new ModelAndView ( &quot;book.jsp&quot; ) ; mav . addAttribute ( &quot;book&quot; , webService . getBook ( bookId )) ; return mav ; } @ TabFactory ( &quot;Content&quot; ) public void contentTab ( TabBuilder tab ) { tab . addSelect ( &quot;id&quot; , &quot;Book&quot; , &quot;Select the book&quot; , webService . getBooks ()) ; } }
  • 24.
  • 25.
  • 26.
  • 27.
  • 28. Questions? Magnolia is a registered trademark used by permission