Blossom on the web
-
Upload
boris-kraft -
Category
Technology
-
view
523 -
download
0
description
Transcript of Blossom on the web
![Page 1: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/1.jpg)
Magnolia is a registered trademark owned by Magnolia International Ltd.Version 1.1
Tobias Mattsson, Senior Software Engineer
07.03.2014 at Magnolia Amplify
Blossom on the WebSpring and Content Management
1
Thursday, 7 March 2013
![Page 2: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/2.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.2
Spring Framework
Spring is a java based application framework• Focus on web applications and enterprise
applications• One of the most popular frameworks in the Java
space
Pioneered a broad feature set• Lightweight container• Dependency Injection (DI)• Aspect Oriented Programming (AOP)• Enterprise Service Abstraction
Thursday, 7 March 2013
![Page 3: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/3.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.3
Spring is everywhere
2.5 million developers use Spring (two thirds!)
More than half of the Fortune 500 power their Java applications with Spring
More than 70 percent of enterprises cite improved productivity, faster project completion, improved portability and application quality as reasons for using Spring
Thursday, 7 March 2013
![Page 4: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/4.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.
Spring projects
Spring Web MVC
Spring WebFlowSpring Security
Spring WebServicesSpring Social
• Twitter, Facebook, LinkedIn etc
Spring Data• MongoDB, Neo4j, Riak, Cassandra etc
4
Thursday, 7 March 2013
![Page 5: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/5.jpg)
Magnolia is a registered trademark owned by Magnolia International Ltd.Version 1.15
Spring and the CMS
Thursday, 7 March 2013
![Page 6: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/6.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.6
Blossom integrates it for you
Integrates Spring into the Magnolia module mechanism
• Module Lifecycle
Extends Spring Web MVC for templatingAnd additional bridging
Thursday, 7 March 2013
![Page 7: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/7.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.7
Spring Web MVC with Content
No configuration just code
Based on annotationsNon-intrusive
Spring centric approach• The controller is the template• The controller is the component• and they’re automatically available in Magnolia
Thursday, 7 March 2013
![Page 8: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/8.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.
Spring Web MVC
8
@Controllerpublic class ExampleController {
@RequestMapping("/customers/list") public String render(ModelMap model) { model.put("title", "List of all customers"); model.put("customers", customerService.findAllCustomers()); return "customers/list"; }}
Thursday, 7 March 2013
![Page 9: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/9.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.9
Templates
@Controller@Template(title = "Main template", id = "blossomSample:pages/main")public class MainTemplate {
@RequestMapping("/mainTemplate") public String render(Node page, ModelMap model) { return "pages/main.ftl"; }}
Thursday, 7 March 2013
![Page 10: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/10.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.10
Areas
@Controller@Template(title = "Main template", id = "blossomSample:pages/main")public class MainTemplate {
@Controller @Area("main") public static class MainArea {
@RequestMapping("/mainTemplate/main") public String render() { return "areas/mainArea.ftl"; } }
...}
Thursday, 7 March 2013
![Page 11: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/11.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.11
Components
@Controller@Template(title = "Shopping Cart", id = "blossomSample:components/shoppingCart")@TemplateDescription("Shopping cart")public class ShoppingCartComponent {
@RequestMapping("/shoppingCart") public String handleRequest() { ... return "components/shoppingCart.ftl"; }
...}
Thursday, 7 March 2013
![Page 12: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/12.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.12
Specifying what goes into an area
@Controller@Area("promos")@AvailableComponentClasses({TextComponent.class, ShoppingCartComponent.class})public static class PromosArea {
@RequestMapping("/mainTemplate/promos") public String render() { return "areas/promosArea.ftl"; }
}
Thursday, 7 March 2013
![Page 13: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/13.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.13
Inheritance
@Controller@Area("promos")@Inherits@AvailableComponentClasses({TextComponent.class, ShoppingCartComponent.class})public static class PromosArea { @RequestMapping("/mainTemplate/promos") public String render() { return "areas/promos.jsp"; }}
Thursday, 7 March 2013
![Page 14: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/14.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.14
Dialogs
Dialogs are created using code, not configuration
Based on annotationsDynamic behavior
Validation of dialog inputDetected and automatically available in Magnolia
Thursday, 7 March 2013
![Page 15: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/15.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.
Dialog factories
15
@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"); }}
Thursday, 7 March 2013
![Page 16: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/16.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.
Dialog inheritance
16
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", ""); }}
Thursday, 7 March 2013
![Page 17: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/17.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.
Inline dialogs
17
@Controller@Template(title = "Main template", id = "blossomSample:pages/main")public class MainTemplate {
@RequestMapping("/mainTemplate") public String render(Node page, ModelMap model) { return "pages/main.ftl"; }
@TabFactory("Content") public void propertiesDialog(TabBuilder tab) { tab.addEdit("title", "Title", ""); }}
Thursday, 7 March 2013
![Page 18: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/18.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.
Inline dialogs
18
@Controller@Template(title = "Main template", id = "blossomSample:pages/main")public class MainTemplate {
@Controller @Area("main") public static class MainArea {
@TabFactory("Content") public void contentTab(TabBuilder tab) { tab.addEdit("borderWidth", "Border width", "Width of the border around the area"); }
@RequestMapping("/mainTemplate/main") public String render() { return "areas/mainArea.ftl"; } }
...}
Thursday, 7 March 2013
![Page 19: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/19.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.
Dynamic dialogs
19
@Controller@Template(id="blossomSample:components/book", title="Book")public class BookComponent {
@Inject private BookStoreWebService webService;
@TabFactory("Content") public void contentTab(TabBuilder tab) { tab.addSelect("id", "Book", "Select the book", webService.getBooks()); }
@RequestMapping("/book") public String handleRequest(ModelMap model, Node content) { String bookId = content.getProperty("id").getString(); model.put("book", webService.getBook(bookId)); return "components/book.ftl"; }}
Thursday, 7 March 2013
![Page 20: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/20.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.
Validation
20
@DialogFactory("page-properties")public class PagePropertiesDialog {
@TabFactory("Meta") public void metaTab(TabBuilder tab) { tab.addEdit("description", "Description", "A concise page explanation"); }
@TabValidator("Meta") public void validateMetaTab(DialogTab tab) { if (tab.getSub("description").getValue().length() < 20) AlertUtil.setMessage("Meta description needs to be longer"); }}
Thursday, 7 March 2013
![Page 21: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/21.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.21
Pre-execution
Portal like semantics
Allows a component to fully process a requestDevelopers can implement backing logic entirely in the components
Thursday, 7 March 2013
![Page 22: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/22.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.
View technologies
Best of both worlds approach
Magnolia and Spring constructs work side by sideBuilt-in support for Freemarker and JSP
Everything Spring supports work out-of-the-box, such as JSON, PDF, XML and RSS
22
Thursday, 7 March 2013
![Page 23: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/23.jpg)
Magnolia is a registered trademark owned by Magnolia International Ltd.Version 1.123
Blossom in the wild
Thursday, 7 March 2013
![Page 24: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/24.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.24
Maglev - Magnolia and Grails
Brings Magnolia to the Grails platform
Development entirely in groovy and GSPGrails productivity
Builds on Blossom
Thursday, 7 March 2013
![Page 25: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/25.jpg)
Version 1.1Magnolia is a registered trademark owned by Magnolia
International Ltd.
Summary
Enables access to Spring features and technologies• Directly in templates, components and dialogs
Spring centric approach on templating• Based on annotations• Connects the CMS with Spring Web MVC
Code over configuration• Versioning• Collaboration
25
Thursday, 7 March 2013
![Page 26: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/26.jpg)
Magnolia is a registered trademark owned by Magnolia International Ltd.Version 1.126
Questions?
Thursday, 7 March 2013
![Page 27: Blossom on the web](https://reader033.fdocuments.in/reader033/viewer/2022052310/554e1fe8b4c90511778b4db2/html5/thumbnails/27.jpg)
Magnolia is a registered trademark owned by Magnolia International Ltd.Version 1.1
www.magnolia-cms.com
Tobias Mattsson, Senior Software EngineerMagnolia International Ltd.
07.03.2013 at Magnolia [email protected]
27
Thanks for listening!
Thursday, 7 March 2013