Top Banner
Baking content with Jahia Digital Factory Serge Huber, CTO, [email protected]
28

JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

Jul 31, 2015

Download

Technology

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

Baking content with Jahia Digital Factory

Serge Huber, CTO, [email protected]

Page 2: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

This presentation is NOT…

About my mom’s brownies

… but I hope it will make you hungry !

Page 3: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

Baking vs Frying Difference in “when”

templates are applied to content

Baking : applied when content is published

Frying : applied when user requests a page

Page 4: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

Baking vs Frying

Baking Frying

Page is dynamic ✅

Very fast to serve ✅

Low CPU usage ✅

Personalizable ✅

Page 5: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

Baking vs Frying Jahia Digital Factory is a “frying” system DF has a built-in HTML cache system to

improve performance and lower CPU usage

In most scenarios “frying” makes the most sense

Page 6: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

Baking use cases Purely static HTML site

needed But it could also use client-

side Javascript to make it dynamic (not SEO friendly though)

Also useful for building static HTML to be included in mobile applications that use Apache Cordova

Page 7: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

The Content Sync Module

Introducing

Page 8: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

History Initially created to generate static content to

build Mobile Applications using Apache Cordova framework

Generate HTML from DF site to sync website look and feel with native mobile apps

Page 9: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

What is it ? A module to synchronize (or “bake”) content between

the JCR and different file systems Can be used to create static copies of Digital Factory

websites Uses Apache Commons VFS as a file system

abstraction Makes it possible to copy to : local file system, FTP,

SFTP, WebDAV + implement others (JCR)

Page 10: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

Basic static HTMLDemo

Page 11: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

How it works Uses a built-in web crawler to copy the HTML

and all static resources needed (CSS, Javascript, images, …)

Integrates with publishing system to trigger syncs on publication

Uses background jobs to perform the sync only on processing server (doesn’t impact other servers)

Sync output uses Apache Commons VFS to send content to others uses

Uses new static channels to generate alternate renders for new dynamic sync components

Page 12: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

Channel integration Example with top-right search box Normally performs an internal

Jahia search engine call Using a separate channel

“static_html_ver1” we can configure an alternative view

This alternative view is configured to use a Google Site search on our synched static copy

Page 13: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

Channel integrationDemo

Page 14: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

For the longest time… …it’s been about

Page 15: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

What if…

Page 16: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

You had one Jahia Studio to rule them all ?

Page 17: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

Introducing…

Page 18: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

Dynamic Sync components

Page 19: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

Dynamic sync components

Demo

Page 20: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

The overview

Digital Factory

PHP Apps (Drupal,

phpBB, …)

.NET apps (Sitefinity

Content Syncdynamic

sync components

Page 21: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

Dynamic sync components

Components can react to the extension used to generate the static synched copy (PHP, .NET, JSP)

The channel changes automatically for each extension

Makes it possible to generate custom output for each supported extension

A single component can render PHP, .NET or JSP code !

Page 22: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

Dynamic sync component

Request info example : dump request info<h2>ASP Request headers</h2><table border="1" cellpadding="5" cellspacing="0"> <thead> <tr> <th>Header name</th> <th>Header value</th> </tr> </thead> <tbody><% for each x in Request.ServerVariables response.write("<tr><td>") response.write(x) response.write("</td><td>") response.write(Request.ServerVariables(x)) response.write("</td></tr>") next%> </tbody></table>

.NET (ASP)

<h2>PHP Request headers</h2><table border="1" cellpadding="5" cellspacing="0"> <thead> <tr> <th>Header name</th> <th>Header value</th> </tr> </thead> <tbody><?phpforeach (getallheaders() as $name => $value) { echo "<tr><td>$name</td><td>$value</td></tr>";}?> </tbody></table>

PHP

Page 23: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

Dynamic component example

Page 24: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

What needs to be done Improve administration UI / add image synching Native integrations with Marketing Factory Add/improve mobile project sync Optimize sync algorithm to avoid regenerating full site

everything all the time Improve sync implementation to support Ant patterns for

inclusion / exclusion Add more dynamic components

Page 25: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

Other sync components ideas

“Hole” component that would just reference a native PHP/.NET/JSP scripts that exists on the destination servers

Components that integrate with other software such as SugarCRM (PHP) / Drupal (PHP) / Sitefinity (.NET)

Integration with existing custom software built/used in-house

The sky’s the limit… lots of other possibilities !

Page 26: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

Where/when can I get it ? No horizon defined yet Open to collaborative dev Open to ideas / discussions with customers

To prioritize features To define scope / use cases

Page 27: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

Q & A

Page 28: JahiaOne 2015 - Baking Static Content with Digital Factory by Serge Huber

Thank you !Serge Huber, CTO, [email protected]