what shall be served by a cms?

34
What shall be served by a CMS ? Just editorial content Basel, September 2013 Thomas Körner experiences of a real project

Upload: magnolia-cms

Post on 27-Dec-2014

697 views

Category:

Technology


2 download

DESCRIPTION

This presentation was given at Magnolia Conference 2013 by Thomas Körner, Senior IT Consultant at Kreuzwerker: http://www.kreuzwerker.de. Building a full featured web application raises an old question: implement or integrate features from existing software components. Starting a new project with a CMS involved raises an old question: What kind of data should be managed by a CMS and what should be handled elsewhere? To what degree should business logic reside inside the CMS? Editorial content belongs in the CMS, a Ruby on Rails application handles the rest. Our task was to replace a social community platform providing features like private messaging, friendships, uploading and organizing photos and videos, as well as public question and answer sections. The original implementation was based on an old version of Drupal without a chance to be extended. The customer, one of the biggest cruise lines in Germany, wanted to enrich the platform by serving community games and polls as well as all kind of marketing events. Moreover, there was a high demand on integrating the application into the company web publishing strategy. Based on the challenging customer requirements, our architecture was built on the following cornerstones: Magnolia CMS serving the static editorial content, a Ruby on Rails application managing all user interactions within the web page. Both software parts are coupled by using a Varnish reverse proxy aggregating page elements using Edge Side Includes (ESI). The talk will walk the auditorium through the technical solution of integrating Magnolia with Rails applications by focusing on how to separate editorial content from user generated content, rendering concerns, weaving CMS and Rails content and managing multiple admin interfaces. It will focus on how to deal with such an architecture from the developer's point of view by outlining pitfalls and benefits.

TRANSCRIPT

Page 1: What Shall be Served by a CMS?

What shall be served by a CMS ? Just editorial content

Basel, September 2013 Thomas Körner

… experiences of a real project

Page 2: What Shall be Served by a CMS?

Agenda

!  Project Scope

!  Objectives

!  Technical Wrap Up

!  Experiences

What shall be served by a CMS kreuzwerker 2

Page 3: What Shall be Served by a CMS?

Agenda

!  Project Scope

!  Objectives

!  Technical Wrap Up

!  Experiences

kreuzwerker 3 What shall be served by a CMS

Page 4: What Shall be Served by a CMS?

Social Community Platform of one of the biggest cruise lines in Germany !  user generated content as travelogues, blogs,

photo galleries, video albums !  private messaging !  questions and answer module !  contests, polls and games !  commenting, likes

Project Scope

kreuzwerker 4 What shall be served by a CMS

Page 5: What Shall be Served by a CMS?

Technical Re-Invest !  tight coupling of CMS and community functions

prevented migration to new Drupal version !  CMS change according to the customers web

publishing strategy !  usage of a custom digital asset management

system

Project Scope

kreuzwerker 5 What shall be served by a CMS

Page 6: What Shall be Served by a CMS?

Agenda

!  Project Scope

!  Objectives

!  Technical Wrap Up

!  Experiences

kreuzwerker 6 What shall be served by a CMS

Page 7: What Shall be Served by a CMS?

Objectives

kreuzwerker 7

Customer‘s Main Objectives. Experiencing a technical dead end in regard of CMS updates

due to heavy customization expandability as well as easy updatability was in the customer’s focus.

High Responsive

Easy to Extend

Easy to Update

Magnolia

Sync

of

user

content

Custom DAM

What shall be served by a CMS

Page 8: What Shall be Served by a CMS?

Strategy

Magnolia

Ruby on Rails

Widget Approach

Varnish

3 2

1

!  limit custom code in the CMS

Updatability

!  state of the art web framework to cover business requirements

Expandability

!  fragment caching of static content.

Responsiveness

!  Web Publishing Strategy

3 2

1

kreuzwerker 8 What shall be served by a CMS

Page 9: What Shall be Served by a CMS?

CMS Functions

!  Design & Branding !  navigation bar !  footer !  teaser

!  Configuration !  polls !  games

!  Editorial Content !  static pages (e.g. Impressum) !  information about cruises, staff, etc.

!  Administration !  process based publication

CMS

kreuzwerker 9 What shall be served by a CMS

Page 10: What Shall be Served by a CMS?

Application Functions

!  Asset Management !  photos / videos !  travelogues !  galleries

!  Community Functions !  votes/likes !  private messaging !  friendships

Ruby on Rails

kreuzwerker 10

!  Extensions !  map features !  poll/game logic

!  User Management !  accounts !  personal spaces

What shall be served by a CMS

Page 11: What Shall be Served by a CMS?

Agenda

!  Project Scope

!  Objectives

!  Technical Wrap Up

!  Experiences

kreuzwerker 11 What shall be served by a CMS

Page 12: What Shall be Served by a CMS?

Architectural Sketch

kreuzwerker 12

The production system is deployed on two hosts routed by a load balancer. Each host provides its own varnish, a public CMS instance and a Rails application instance. !  Varnish

!  routing by selecting the appropriate backend

!  ESI … Edge Side Includes !  Backends

!  CMS !  Rails Application

What shall be served by a CMS

Page 13: What Shall be Served by a CMS?

!  fixed page layout in regard of branding

!  application logic dependent layout for content area

!  limited number of AJAX calls

Rails Application

Rendering Master ? Rails App was set to be the rendering master for all pages focusing on user generated content CMS was set to be the rendering master for all static pages as well as pages requiring free editorial layouts (e.g. polls, games).

!  embedding application logic as widget requires heavy use of AJAX

!  limited editorial freedom regarding application pages

CMS

kreuzwerker 13 What shall be served by a CMS

Page 14: What Shall be Served by a CMS?

Rendering Master – Rails App’

kreuzwerker 14 What shall be served by a CMS

Page 15: What Shall be Served by a CMS?

Rendering Master – Rails App’

kreuzwerker 15

ESI

What shall be served by a CMS

Page 16: What Shall be Served by a CMS?

Rendering Master – Rails App’

kreuzwerker 16

ESI

What shall be served by a CMS

Page 17: What Shall be Served by a CMS?

Rendering Master – Rails App’

kreuzwerker 17

ESI

What shall be served by a CMS

Page 18: What Shall be Served by a CMS?

Rendering Master – Rails App’

kreuzwerker 18

ESI

What shall be served by a CMS

Page 19: What Shall be Served by a CMS?

Rendering Master – Rails App’

kreuzwerker 19

ESI

What shall be served by a CMS

Page 20: What Shall be Served by a CMS?

Rendering Master – CMS

kreuzwerker 20 What shall be served by a CMS

Page 21: What Shall be Served by a CMS?

Rendering Master – CMS

kreuzwerker 21

ESI

ESI

What shall be served by a CMS

Page 22: What Shall be Served by a CMS?

!  branding !  editorial content !  games !  polls

!  moderation of comments !  company blogs (editorial

content) !  user generated content !  assessment of polls / games

Rails Application CMS

Administration

SSO to ease the burden of two applications

kreuzwerker 22 What shall be served by a CMS

Page 23: What Shall be Served by a CMS?

SSO between CMS and Rails App

kreuzwerker 23

!  missing company SSO !  external editors

Pre-Condition

CMS login authenticates user in the Rails Apps

What shall be served by a CMS

Page 24: What Shall be Served by a CMS?

Key: Magnolia Filter Chain

… common servlet filter … back door login/logout code encapsulated … update compatible

Pitfalls:

!  Cross Site Protection Mechanism of Rails !  X-CSRF Token !  Cookie

!  Storage of Rails App Authentication Cookie

SSO between CMS and Rails App

kreuzwerker 24 What shall be served by a CMS

Page 25: What Shall be Served by a CMS?

Games & Polls

!  game runtime resides in Rails App via participation widgets, which allow the user interaction

!  widget is embedded into the game/poll CMS page via ESI

!  game assessment is done via admin interface (active admin)

Rails App

!  game configuration is done in the CMS !  start and end of participation !  number of participation

attempts !  intro texts, images etc. !  layout of pages

!  winner announcement by embedding announcement widgets via ids

CMS

kreuzwerker 25 What shall be served by a CMS

Page 26: What Shall be Served by a CMS?

Games & Polls Interaction CMS "# Rails (1/3)

kreuzwerker 26

Game Setup

game template !  supports game

container including various rails widgets, common CMS editorial content paragraphs

Publish Game

game config

!  hidden form parameter secured by shared secret

!  first request creates game in Rails DB

Game Runtime

game content

!  assets and users only known to Rails

!  depiction on CMS pages via widgets

What shall be served by a CMS

Page 27: What Shall be Served by a CMS?

Games & Polls Interaction CMS "# Rails (2/3)

kreuzwerker 27

Game Assessment

administration/assessment !  Rails Active

Admin pages

Winner Announcement

announcement

!  CMS paragraph configuration via user and asset ids known only to rails

!  widget approach

Game Removal

game container deletion

!  Rails backend has to be informed about container removal

What shall be served by a CMS

Page 28: What Shall be Served by a CMS?

Games & Polls Removal of the Game

kreuzwerker 28

!  a new version of a page is created when pushing

changes from author to public !  check predecessor version for game identifiers not

included in current page !  de-activate polls in rails via HTTP GET Request

(signature in header secures request) !  synchronous call

What shall be served by a CMS

Page 29: What Shall be Served by a CMS?

Agenda

!  Project Scope

!  Objectives

!  Technical Wrap Up

!  Experiences

kreuzwerker 29 What shall be served by a CMS

Page 30: What Shall be Served by a CMS?

Experiences

!  agile development framework for application logic

!  complex development setup

Strengths

!  easy adding of new features without CMS know how

!  re-use of once developed modules

!  abstraction level !  learning curve of

development team

Opportunities Threats

Weaknesses +

kreuzwerker 30

+

What shall be served by a CMS

Page 31: What Shall be Served by a CMS?

kreuzwerker 31

Experiences Development Setup

!  automated setup of target platform via vagrant on top of Virtual Box on each developer machine !  Mac OS vs. Linux machines

!  provisioning of vagrant box via puppet !  automated deployment of Rails App via rake !  automated deployment of CMS via maven and

shell scripts

What shall be served by a CMS

Page 32: What Shall be Served by a CMS?

kreuzwerker 32

Experiences Development Setup

!  prolonged development cycle due to deployment overhead !  mocking of CMS in Rails part !  ignoring Rails calls in CMS

!  additional time for integration tests

What shall be served by a CMS

Page 33: What Shall be Served by a CMS?

!  setup of infrastructure with small team before development phase

!  continuous monitoring of setup

!  re-use of technology in staging and production area

!  continuous mentoring of development & test team

!  continuous integration by testing team

!  independent development due to sparse mocking

Continuous Education & QM Ramp Up

additional operational costs covered by advantages in the long term

kreuzwerker 33

Experiences Development Setup

What shall be served by a CMS

Page 34: What Shall be Served by a CMS?

Thomas Körner

Thanks, for your attention

mail: [email protected]

website:

www.kreuzwerker.de

kreuzwerker 34 What shall be served by a CMS