extreme web productivity with spring roo

Download Extreme Web Productivity with Spring Roo

If you can't read please download the document

Upload: stefan-schmidt

Post on 14-Jan-2015

15.768 views

Category:

Technology


1 download

DESCRIPTION

Discussion of the Web UI features in Spring Roo. Spring Roo is a Java-based rapid application development framework. This presentation was given by me at SpringOne 2GX Americas in October 09.

TRANSCRIPT

  • 1. Extreme Web Productivity with Spring Roo Stefan Schmidt - SpringSource

2. Agenda Example Application Roo Web Features & Details Add-on Demonstrations Spring Roo Roadmap SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 3. Agenda Example Application Roo Pizza Shop Roo Web Features Add-on Demonstrations Spring Roo Roadmap SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 4. Pizza Shop Domain Model SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 5. Roo Pizza Shop Script project --topLevelPackage com.springsource.pizzashop persistence setup --provider HIBERNATE --database MYSQL database properties set --key database.url --value jdbc:mysql://localhost:3306/pizza database properties set --key database.username --value root entity --class ~.domain.Topping --testAutomatically field string --fieldName name --notNull --sizeMin 2 entity --class ~.domain.Base --testAutomatically field string --fieldName name --notNull --sizeMin 2 entity --class ~.domain.Pizza --testAutomatically field string --fieldName name --notNull --sizeMin 2 field number --type java.lang.Double --fieldName price --min 0 --primitive field reference --type ~.domain.Base --fieldName base --notNull field set --element ~.domain.Topping --fieldName toppings --cardinality MANY_TO_MANY entity --class ~.domain.PizzaOrder testAutomatically field string --fieldName name --notNull --sizeMin 2 field string --fieldName address --sizeMax 50 field date --type java.util.Date --fieldName deliveryDate --class ~.domain.PizzaOrder field set --element ~.domain.Pizza --fieldName pizzas --sizeMin 1 field number --type java.lang.Double --fieldName total --min 0 --primitive controller all --package ~.web logging setup --level DEBUG --package WEB selenium test --controller com.springsource.pizzashop.web.BaseController finder add --finderName findPizzasByToppingsAndPriceLessThan --class ~.domain.Pizza security setup controller scaffold --class ~.web.PublicPizzaController --path /public/pizza --disallowedOperations create,update,delete --entity ~.domain.Pizza web flowSpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 6. Demonstration Creating the domain model SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 7. Agenda Example Application Roo Web Features & Details Web Architecture Web Artifacts Commands Directory Layout REST URI Mappings Add-on Demonstrations Spring Roo RoadmapSpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 8. Web Architecture Controllers interact with Domain entities OpenEntityManagerInViewFilter "Open EntityManager in View" pattern JPA EntityManager bound to the thread for the entireprocessing of the request allow for lazy loading in web views original transactions already being completed Service layer optional used for business logic spanning multiple entitiesSpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 9. Web Artifacts Java & Aspects Spring MVC @Controllers Property Editors JSPX clear format and structuring fully XML compliant Spring JS & Dojo client-side validation form usability improvements SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 10. Web Artifacts (cont.) CSS flexible UI customization Apache Tiles flexible templating of jspx pages Tags reusable pagination theme selectors language selectors URLRewrite Filter simplification of URIs SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 11. Web Artifacts (cont.) XML configuration of various technologies Spring MVC & WebFlow application contexts Tiles configurations web.xml Properties Files internationalization support via message properties theming configurationSpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 12. Roo Web Commands Generation of Web artifacts controller scaffold generate a controller for a given entity controller all generate controllers for all entities without an existingcontroller controller class generate a simple Spring @MVC controller with a postand a get methodSpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 13. Demonstration The Web directory SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 14. Web Project Directory Layout All web-related artifacts in src/main/webappSpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 15. Web Project Directory LayoutDirectory Purpose /styles style sheets (CSS) /images graphics /WEB-INF/classes/*.properties theme configurations /WEB-INF/spring/*.xml Web-related Spring application contexts /WEB-INF/i18n/*.propertiesinternationalization message files /WEB-INF/layouts/layout.jspxTiles definition for master layout /WEB-INF/tags/*.tagxTag libraries (pagination, language, etc) /WEB-INF/views/**/* Tiles and other view artifacts /WEB-INF/web.xmlWeb application context /WEB-INF/urlrewrite.xml URL rewrite filter configurationSpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 16. REST URI MappingResource GET PUTPOST DELETE Create a newList the members of topping in the Collection URI such as the collection. For collection where http://domain.com/ example list all theNot used. Not used. the ID is assigned pizzashop/topping/ toppings available in automatically bythe application. the collection.Update theDelete the Member URI such asRetrieve the addressedaddressed addressed http://domain.com/Not used.topping with id=5 topping withtopping pizzashop/topping/5id=5. with id=5. Member URI such as Create Form - returns http://domain.com/ an initialized, butNot used.Not used.Not used. pizzashop/topping/ empty topping for form form binding. Member URI such as Update Form returns http://domain.com/ the topping resourceNot used.Not used.Not used. pizzashop/topping/5/ which is pre-populated form for form bindingSpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 17. Agenda Example Application Roo Web Features & Details Add-on Demonstrations Selenium Tests Dynamic Finders Spring Security Web Flow Spring Roo Roadmap SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 18. Demonstration Selenium Tests Dynamic Finders Spring Security Spring Web FlowSpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 19. @RooWebScaffold@RooWebScaffold(path = "public/order",automaticallyMaintainView = true,formBackingObject = PizzaOrder.class,update = false,delete = false,create = true,exposeFinders = true,dateFormat = dd-MM-yyyy) @RequestMapping("/public/order/**") @Controller public class PublicPizzaOrderController { }!roo> controller scaffold --name ~.web.PublicPizzaOrderController --entity ~.domain.PizzaOrder -- path public/pizza --disallowedOperations update,delete --dateFormat dd-MM-yyyy SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 20. Agenda Example Application Roo Web Features & Details Testing & Securing Views Web Flow Spring Roo Roadmap SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 21. Roadmap Ordering & sorting of entities Form field & menu ordering Ajax (partial page refresh) Content negotiation UI usability and look & feel enhancements Drop-in templating Spring Blaze DS & Flex UI Google Web Toolkit UI Comet & BayeuxNote: The information on the roadmap is intended to outline our general product direction and should not be incorporated into any contract. Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. SpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 22. Project Resources Home http://www.springsource.org/roo Contains links to all other resources Forum http://forum.springsource.org Roo team actively monitor forum and answer queries Issues http://jira.springframework.org/browse/ROO Twitter #roo hash key follow @schmidtstefan & @benalexauSpringOne 2GX 2009. All rights reserved. Do not distribute without permission. 23. Q&A SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.