When the technology stack of a content and logic driven web application gets defined, there is often the question if it should be build on an open source content management system like Magnolia or if it should be a standalone app which might include several pages from a CMS. Agido's Moritz Rebbert will show an approach where the web application is based on and delivered by the CMS but it's logic is completely separated within REST based services and AngularJS based client side code.
2. Who am I
➤ Moritz Rebbert, moritz.rebbert@agido.com
➤ Software Developer and Consultant
➤ Living in JCR-Trees for the last couple of years
➤ Employee of agido GmbH in Dortmund
➤ Using Magnolia since version 3.something
➤ Longterm developement and operations for a large
sport betting application
➤ Mobile applications based on web technologies
3. What am I doing here
1. Where we come from
a. Large Multi-Tier application
b. CMS Based Portal
2. What we do now
a. Angular JS components
b. Single page applications
4. What am I doing here
1. Where we come from
a. Large Multi-Tier application
b. CMS Based Portal
2. What we do now
a. Angular JS components
b. Single page applications
5. Large Multi-Tier application
➤ Classic Multi Tier
Application
➤ Magnolia as content
backend
➤ Internal Requests by
Web-Tier
Webclients
Webserver
Business Logic
External
Services
User Terminals
Magnolia CMS
DB
~80
~12
6. Large Multi-Tier application
➤ JSF/SpringMVC as
rendering master
➤ HTML-snippets
➤ No page structure in
magnolia
Webclients
(HTML/ JavaScript)
Webserver
(SpringMVC, JSF)
Business Logic
(EJB3)
WEB Mobile Tablet
External
Services
Administration
(Swing/Web)
User Terminals
(Special Hardware
/Swing)
Magnolia CMS
DB
Webclients
Webserver
Business Logic
External
Services
User Terminals
Magnolia CMS
DB
7. Large Multi-Tier application
Problems:
➤ Designer: Templates at
two locations
➤ Developer: At least
three templating
contexts
Webclients
(HTML/ JavaScript)
Business Logic
(EJB3)
WEB Mobile Tablet
External
Services
Administration
(Swing/Web)
User Terminals
(Special Hardware
/Swing)
Magnolia CMS
DB
Webclients
Webserver
Business Logic
External
Services
User Terminals
Magnolia CMS
DB
.xhtml .jsp
.jsp
8. Large Multi-Tier application
Problems:
➤ Author: No WYSIWYG
of whole page in CMS
Webclients
(HTML/ JavaScript)
Business Logic
(EJB3)
WEB Mobile Tablet
External
Services
Administration
(Swing/Web)
User Terminals
(Special Hardware
/Swing)
Magnolia CMS
DB
Webclients
Webserver
Business Logic
External
Services
User Terminals
Magnolia CMS
DB
9. What am I doing here
1. Where we come from
a. Large Multi-Tier application
b. CMS Based Portal
2. What we do now
a. Angular JS components
b. Single page applications
10. CMS Based Portal
➤ Magnolia Based
Reseller Portal
➤ Services
➤ DMS Access
➤ Communication to
accounting system
➤ Custom user
management
➤ Videos from additional
streaming service
Magnolia CMS
Business Logic/
Servlet
External
Services
11. CMS Based Portal
➤ Magnolia as
rendering master
➤ Growing business
logic
➤ Mess in CLASSPATH
Magnolia CMS
Business Logic/
Servlet
External
Services
12. What we have learned
Magnolia CMS
Business Logic/
Servlet
External
Services
Webclients
(HTML/ JavaScript)
Webserver
(SpringMVC, JSF)
Business Logic
(EJB3)
WEB Mobile Tablet
External
Services
Administration
(Swing/Web)
User Terminals
(Special Hardware
/Swing)
Magnolia CMS
DB
Webclients
Webserver
Business Logic
External
Services
User Terminals
Magnolia CMS
DB
13. What we have learned
➤ Flexibility, if magnolia is an isolated part
(first approach)
➤ Customer needs to control overall structure
(second approach)
➤ Growing need for rich client sided applications
(complicated in both ways)
14. What am I doing here
1. Where we come from
a. Large Multi-Tier application
b. CMS Based Portal
2. What we do now
a. Angular JS components
b. Single page applications
15. Angular JS components
➤ Build mobile application based on web
technologies
➤ Lots of user interaction
➤ Single page applications
➤ Offline mode
28. Angular JS components
➤ Fetch data via REST-
API
➤ CMS backend stays
stateless.
Select
Statistics
News Feed
Imprint
Header / Navigation
Calls Twitter API
Call Statistics API
29. Angular JS components
➤ Angular.js as JavaScript Framework
➤ REST Services
➤ Magnolia delivers the application
BROWSER
REST-Services
30. Upsides
➤ Templates are in one
place
➤ Scalability: Services are
stateless.
➤ Server sided Portability:
CMS uncoupled from
angular application.
Downsides
➤ Complexity: Two styles
of markup. What is
content what is data.
➤ Client sided Portablity:
Components logical
independent but share
the same client sided
libs
31. What am I doing here
1. Where we come from
a. Large Multi-Tier application
b. CMS Based Portal
2. What we do now
a. Angular JS components
b. Single page applications
34. Single page application
➤ Magnolia 5 is a REST-
Service now
➤ Fetch page structure
➤ Page transformation
with ng-route*
➤ Hierarchical structure
of states
➤ Create navigation, wizard,
workflow
➤ No full page refresh
➤ CMS Pages as subviews
*(or ui-router)
36. Single page application
1. Fetch Structure via REST-API
2. Generate model for navigation
5. fill subview
3. Trigger state change
4. Async fetch content of subview
38. Characteristics
➤ Application logic in Angular JS more coupled
with magnolias internal structure.
➤ Page in Magnolia might be only a part/subview
of the visible view on client.
41. Conclusion
No WYSIWYG
Complex development stack
Templates spread
accross application
cms stateless
Editor controls whole
page structure
Static content and business
logic mixed
mess in CLASSPATH
42. Conclusion
No WYSIWYG
Complex development stack
Templates spread
accross application
cms stateless
Editor controls whole
page structure
Static content and business
logic mixed
cms stateless
component based
business logic
separated from
content
Editor controls whole page
structure
mess in CLASSPATH
43. What is next
➤ Requirement management for client libs
➤ require.js, other solutions
➤ CMS Context available in angular
➤ From ${content.title} to {{content.title}}
➤ Scalability but performance ¯(°_o)/¯
44. Thank you for your attention!
Questions?
Contact: moritz.rebbert@agido.com
http://agido.com
@ztiromoritz