MVC in Jahia 7
Using Spring Web Flow
Sergiy Shyrkov - Senior Software Engineer
Jahia Solutions Group SA
(sergiy.shyrkov@ja...
Who Am I

2

© 2002 - 2014 Jahia Solutions Group SA
Who Am I
Sergiy Shyrkov
Senior Software Engineer
sergiy.shyrkov@jahia.com

@Jahia since 2007
Web project development for 1...
Outline
Why Spring Web Flow
What is Spring Web Flow
How is it integrated in Jahia
Examples and demo
What can be done with ...
Why Spring Web Flow – Drivers (1)
Main drivers:
Customer feedback about the need for
more powerful:
form processing and au...
Why Spring Web Flow – Criteria (2)
Criteria:
Seamless integration into Jahia rendering system
Automatic data binding and f...
Why Spring Web Flow – Result (3)
Spring Web Flow (SWF) comes into play:
matched our goals
comes from the Spring landscape ...
What Is Spring Web Flow (1)
“Spring Web Flow builds on Spring MVC and allows
implementing the "flows" of a web application...
What Is Spring Web Flow (2)
Introduced flow concept
Extended application scopes
Essential language elements: flow, view-st...
How Is It Integrated in Jahia (1)
Rendering concepts:
Content node needs a template (full page view)
Template will define ...
How Is It Integrated in Jahia (2)
Request rendering flow:

11

© 2002 - 2014 Jahia Solutions Group SA
How Is It Integrated in Jahia (3)
To render a content node Jahia needs a script file(s)
called a view:
jnt_news/html/news....
How Is It Integrated in Jahia (4)
View (script) types:
JSP (javax.servlet.RequestDispatcher)
JSR-223: Groovy, Velocity, Fr...
How Is It Integrated in Jahia (5)
What Jahia does for you:
detects and registers/unregisters flow definitions in
modules
p...
How Is It Integrated in Jahia (6)
What you need to use it:
have a Spring beans file (1)
a view (folder) of type “flow” (2)...
Example – Job Application (1)
Flow-based view for job application (job.showcase-apply.flow):

(visualized by Spring Tool S...
Example – Job Application (2)
Second view for application review (job.showcase-review.flow):

(visualized by Spring Tool S...
Example – Job Application (3)

Demo
https://github.com/shyrkov/jahia-spring-webflow-showcase

18

© 2002 - 2014 Jahia Solu...
Jahia Server / Site Settings (4)

Demo

19

© 2002 - 2014 Jahia Solutions Group SA
What Can Be Done With It
Flow-based data processing
Validation
Complex business logic
External data / service integration
...
Summary and Next Steps
Summary:
Our goals met and needs covered :-)
New powerful mechanism for data processing
Next steps
...
Questions

22

© 2002 - 2014 Jahia Solutions Group SA
Thank you!
Sergiy Shyrkov - Senior Software Engineer
Jahia Solutions Group SA
(sergiy.shyrkov@jahia.com)
23

© 2002 - 2014...
Upcoming SlideShare
Loading in …5
×

JahiaOne - MVC in Jahia 7 Using Spring Web Flow

3,079 views

Published on

With Jahia 7, we’ve introduced the Spring Web Flow framework to ease developers work and dynamic data manipulation. This session is an introduction to Web Flow, how it is integrated in Jahia, how to use it with examples of usages in Jahia 7 detailed.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,079
On SlideShare
0
From Embeds
0
Number of Embeds
372
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

JahiaOne - MVC in Jahia 7 Using Spring Web Flow

  1. 1. MVC in Jahia 7 Using Spring Web Flow Sergiy Shyrkov - Senior Software Engineer Jahia Solutions Group SA (sergiy.shyrkov@jahia.com) © 2002 - 2014 Jahia Solutions Group SA
  2. 2. Who Am I 2 © 2002 - 2014 Jahia Solutions Group SA
  3. 3. Who Am I Sergiy Shyrkov Senior Software Engineer sergiy.shyrkov@jahia.com @Jahia since 2007 Web project development for 12+ years Integration of frameworks and external services Spring, Spring MVC – a solid integration basis 3 © 2002 - 2014 Jahia Solutions Group SA
  4. 4. Outline Why Spring Web Flow What is Spring Web Flow How is it integrated in Jahia Examples and demo What can be done with it Summary and next steps Questions 4 © 2002 - 2014 Jahia Solutions Group SA
  5. 5. Why Spring Web Flow – Drivers (1) Main drivers: Customer feedback about the need for more powerful: form processing and automatic data binding validation business logic Server and Site settings refactoring in Jahia 7 5 © 2002 - 2014 Jahia Solutions Group SA
  6. 6. Why Spring Web Flow – Criteria (2) Criteria: Seamless integration into Jahia rendering system Automatic data binding and form processing Support for complex / custom validation Advanced control over “page navigation” Easy to learn and use 6 © 2002 - 2014 Jahia Solutions Group SA
  7. 7. Why Spring Web Flow – Result (3) Spring Web Flow (SWF) comes into play: matched our goals comes from the Spring landscape (bean definitions, MVC, type converters, binding, etc.) control layer on top of MVC (Spring MVC, JSF, Struts, etc.) → content views based on Web Flow in Jahia 7 © 2002 - 2014 Jahia Solutions Group SA
  8. 8. What Is Spring Web Flow (1) “Spring Web Flow builds on Spring MVC and allows implementing the "flows" of a web application. A flow encapsulates a sequence of steps that guide a user through the execution of some business task.” (source: http://projects.spring.io/spring-webflow/) History: Started as an extension of Spring MVC by Erwin Vervaet in 2004 1.0 release in October 2006 2.3.2 release in January 2013 8 © 2002 - 2014 Jahia Solutions Group SA
  9. 9. What Is Spring Web Flow (2) Introduced flow concept Extended application scopes Essential language elements: flow, view-state, transition, end-state, ... Actions (<evaluate>): can be executed on various flow points 9 © 2002 - 2014 Jahia Solutions Group SA
  10. 10. How Is It Integrated in Jahia (1) Rendering concepts: Content node needs a template (full page view) Template will define which elements to display and where to display them: areas Area renders a content node using a view 10 © 2002 - 2014 Jahia Solutions Group SA
  11. 11. How Is It Integrated in Jahia (2) Request rendering flow: 11 © 2002 - 2014 Jahia Solutions Group SA
  12. 12. How Is It Integrated in Jahia (3) To render a content node Jahia needs a script file(s) called a view: jnt_news/html/news.link.jsp jnt_news/html/news.jsp News item (jnt:news) default jnt_news/html/news.large.jsp large 12 © 2002 - 2014 Jahia Solutions Group SA
  13. 13. How Is It Integrated in Jahia (4) View (script) types: JSP (javax.servlet.RequestDispatcher) JSR-223: Groovy, Velocity, FreeMarker, etc. (javax.script.ScriptEngineManager) Web Flow (javax.servlet.RequestDispatcher) dispatching to a dedicated controller (/flow/*) 13 © 2002 - 2014 Jahia Solutions Group SA
  14. 14. How Is It Integrated in Jahia (5) What Jahia does for you: detects and registers/unregisters flow definitions in modules proper dispatching to controller, URL mappings, handler mapping, view resolution, message source resolution (i18n), etc. 14 © 2002 - 2014 Jahia Solutions Group SA
  15. 15. How Is It Integrated in Jahia (6) What you need to use it: have a Spring beans file (1) a view (folder) of type “flow” (2) flow definition file – flow.xml (3) flow view template files action handlers validation i18n resources 15 © 2002 - 2014 Jahia Solutions Group SA
  16. 16. Example – Job Application (1) Flow-based view for job application (job.showcase-apply.flow): (visualized by Spring Tool Suite 3.4.0.RELEASE) Featuring: form binding (model, <form:*/> tags) file upload (Spring's MultipartResolver) JSR-303 validation 16 © 2002 - 2014 Jahia Solutions Group SA
  17. 17. Example – Job Application (2) Second view for application review (job.showcase-review.flow): (visualized by Spring Tool Suite 3.4.0.RELEASE) Example of classical drill-down use case: overview → details → action → overview 17 © 2002 - 2014 Jahia Solutions Group SA
  18. 18. Example – Job Application (3) Demo https://github.com/shyrkov/jahia-spring-webflow-showcase 18 © 2002 - 2014 Jahia Solutions Group SA
  19. 19. Jahia Server / Site Settings (4) Demo 19 © 2002 - 2014 Jahia Solutions Group SA
  20. 20. What Can Be Done With It Flow-based data processing Validation Complex business logic External data / service integration ... 20 © 2002 - 2014 Jahia Solutions Group SA
  21. 21. Summary and Next Steps Summary: Our goals met and needs covered :-) New powerful mechanism for data processing Next steps It is a “first iteration” Gather feedback ... 21 © 2002 - 2014 Jahia Solutions Group SA
  22. 22. Questions 22 © 2002 - 2014 Jahia Solutions Group SA
  23. 23. Thank you! Sergiy Shyrkov - Senior Software Engineer Jahia Solutions Group SA (sergiy.shyrkov@jahia.com) 23 © 2002 - 2014 Jahia Solutions Group SA

×