Top Banner
Jahia Mobile Webinar Serge Huber, CTO [email protected] © 2002-2011 Jahia Solutions Group SA
27

Jahia mobile webinar v2

May 31, 2015

Download

Business

Slides from the Webinar "Jahia Mobile" given by Serge Huber, Jahia CTO
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: Jahia mobile webinar v2

© 2002-2011 Jahia Solutions Group SA

Jahia Mobile Webinar

Serge Huber, [email protected]

Page 2: Jahia mobile webinar v2

Using HTML to build mobile views

HTML Rendering

© 2002-2011 Jahia Solutions Group SA

Page 3: Jahia mobile webinar v2

Multi-channel

iPhone Android

Page 4: Jahia mobile webinar v2

Default scaling

• Proper default scale• Reduce need to zoom in

and out (or prevent it)

Page 5: Jahia mobile webinar v2

Orientation support

Page 6: Jahia mobile webinar v2

DemoHTML Rendering

© 2002-2011 Jahia Solutions Group SA

Page 7: Jahia mobile webinar v2

How it worksHTML Rendering

© 2002-2011 Jahia Solutions Group SA

Page 8: Jahia mobile webinar v2

User agent matching

<bean class="org.jahia.services.render.filter.UserAgentFilter"><property name="priority" value="6" /><property name="applyOnModes" value="live,preview" /><property name="applyOnConfigurations" value="page" /><property name="userAgentMatchingRules"> <map>

<entry key=".*iPhone.*" value="iphone" /><entry key=".*iPod.*" value="iphone" />

<entry key=".*iPad.*" value="iphone" /> <entry key=".*Android.*" value="iphone" />

</map></property>

</bean>

User-Agent: Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_1_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5A345 Safari/525.20

html-iphoneOutput channel

Page 9: Jahia mobile webinar v2

Output channels

Default output channel : HTMLCalled from URL extensions part:http://localhost:8080/cms/*.htmlOther possible channels:- RSS- CSV- XML- Mobile channels using Extensions (*-iphone)

Page 10: Jahia mobile webinar v2

Default output channelDefault output channel view file : html/template.templates-web-blue.jsp :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><%@ page language="java" contentType="text/html;charset=UTF-8" %>…<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${fn:substring(renderContext.request.locale,0,2)}"><head> …</head> <body> <div class="bodywrapper"><!--start bodywrapper-->

<template:area path="pagecontent"/></div><!--stop bodywrapper--> <c:if test="${renderContext.editMode}"> <template:addResources type="css" resources="edit.css" /></c:if><template:addResources type="css" resources="960.css,01web.css,02mod.css,navigationN1.css,navigationN2-2.css"/><template:theme/> </body></html>

Page 11: Jahia mobile webinar v2

iPhone output channel

Now let’s look at the html-iphone/template.template-web-blue.jsp :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">….<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${fn:substring(renderContext.request.locale,0,2)}"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />…</head>

Page 12: Jahia mobile webinar v2

iPhone output channel (2)<body><div class="bodywrapper"><!--start bodywrapper--> <!-- ACME logo --> <div id="header">

<template:module path="header-col1"/> </div> <!-- Navigation menu -->

<template:module path="headerBottom-colContent"/> <!-- Main content for most templates -->

<template:area path="maincontent"/> <!-- News detail view -->

<template:area path="row-col1/mainResourceDisplay"/> <!-- Event list view -->

<template:area path="row1-col1/events"/> <!-- Publications list view -->

<template:area path="row1-col1/publications"/></div><!--stop bodywrapper--> <c:if test="${renderContext.editMode}"> <template:addResources type="css" resources="edit.css" /></c:if>

<template:addResources type="css" resources="960.css,mobile-01web.css,02mod.css,mobile-navigationN1.css,navigationN2-2.css"/><template:theme/> </body></html>

Page 13: Jahia mobile webinar v2

Locating content

Contains ACME logo

Contains navigation

Content tree

Page 14: Jahia mobile webinar v2

Using REST API to build native mobile clients

Native Mobile Rendering

Page 15: Jahia mobile webinar v2

Features

• Server-customizable• Native application, good user experience,

fast, and works offline• Flexible architecture

Page 16: Jahia mobile webinar v2

DemoNative Mobile Rendering

Page 17: Jahia mobile webinar v2

Initial connection

Mobile device Jahia Server

retrieve configuration

fetch section data

section data

fetch data template

data template & resources

Page 18: Jahia mobile webinar v2

Fetching new section

Mobile device Jahia Server

fetch section data

section data

Page 19: Jahia mobile webinar v2

Offline operation

•Data is cached locally•Upon reconnection, data is retrieved from

server• If server or connection falls, requests default

back to cache

Page 20: Jahia mobile webinar v2

Templates

• HTML rendering• Merged client side• Template for each

node type• Different template

for different devices

<html><body><h1>$$$jcr:title$$$</h1><a href="$$$file$$$"><img src="$$$preview$$$"/></a><p>$$$date$$$</p>$$$body$$$</body></html>

Page 21: Jahia mobile webinar v2

Rapid Application Development

• All files are reloaded from server when connected

• No changes needed on the client side, only on server side !

• Resources such as images, CSS, Javascript can be changed on-the-fly on the server.

• Per node-type templates, modify rendering one object at a time

Page 22: Jahia mobile webinar v2

Submitting content

• Uses REST POST API• Submits data file first, then uses returned

UUID to create a node with a reference to data file

• Mappings are used to configure content creation location and property names

Page 24: Jahia mobile webinar v2

Q & A

Page 25: Jahia mobile webinar v2

Other HTML alternatives

Create a separate “m.jahia.com” mobile specific site and use content references or queries to retrieve content

Benefits:• Can use Template Studio to design templates• Can add mobile specific content

Disadvantages:• More editorial work to keep both sites in sync• Not as seemless, be careful about navigation

PugPig Framework : http://pugpig.com/

BKRender Framework : http://bkrender.com/

Apache Mobile Filter: http://www.apachemobilefilter.org

Page 26: Jahia mobile webinar v2

Native Authentication

Stored in settingPersonalized contentAccess controlAccess to MyProfile data:

– My Connections– My Messages– …

Page 27: Jahia mobile webinar v2

Thank you

Serge [email protected]