Top Banner
Not another old fashioned web framework! Nuxeo Web Engine unveiled The content-centric web framework
42

Nuxeo WebEngine unveiled

Jul 13, 2015

Download

Business

Eric Barroca
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: Nuxeo WebEngine unveiled

Not another old fashioned

web framework!

Nuxeo WebEngine unveiledThe content-centric web framework

Page 2: Nuxeo WebEngine unveiled

“Nuxeo WebEngine is a lightweight, content-centric web framework to quickly

build and deliver slices of web”

Page 3: Nuxeo WebEngine unveiled

what the webreally is about?

Page 4: Nuxeo WebEngine unveiled
Page 5: Nuxeo WebEngine unveiled

URLHTMLCSS

RSS / ATOMJavaScript

Page 6: Nuxeo WebEngine unveiled

URLHTMLCSS

RSS / ATOMJavaScript

Page 7: Nuxeo WebEngine unveiled

content

content

content

Page 8: Nuxeo WebEngine unveiled

why WebEngine?

Page 9: Nuxeo WebEngine unveiled

because URLs matter

Page 10: Nuxeo WebEngine unveiled

because you have content to expose on the web

Page 11: Nuxeo WebEngine unveiled

because you want morethan web publishing

Page 12: Nuxeo WebEngine unveiled

content repositoryecm platformmany services and featuresflexible and modularcomponents everywhere

Page 13: Nuxeo WebEngine unveiled

do you need anything else to create your content-oriented web apps?

Page 14: Nuxeo WebEngine unveiled

sure!

Page 15: Nuxeo WebEngine unveiled

dynamichorizontal scalingeasy programing modeldesigned for the web

Page 16: Nuxeo WebEngine unveiled

and what about that?

Page 17: Nuxeo WebEngine unveiled

lightweight frameworkcontent-centricextensible with scriptingcomponents architecturelightspeed startup

Page 18: Nuxeo WebEngine unveiled

Nuxeo WebEngineless abstraction, more control

Page 19: Nuxeo WebEngine unveiled

Overview

Page 20: Nuxeo WebEngine unveiled

Easier and faster development for content-oriented web applications

leverage a complete ECM platform

...and a powerful component model

Page 21: Nuxeo WebEngine unveiled

focus on content

built on REST (HTTP means something)

no JSF, EJBs, Java EE required

no magic

less abstraction

Page 22: Nuxeo WebEngine unveiled

more control

the browser is a platform

widgets are the key to expose your content

scripting for business logic

fast code/test cycle

Page 23: Nuxeo WebEngine unveiled

smart & elegant

Page 24: Nuxeo WebEngine unveiled

Designed by web’s children, for the web you like

Content is king

URL matters

REST everywhere, because the web has a soul

and... in developers we trust

Page 25: Nuxeo WebEngine unveiled

WebEngine Essentials

easy MVC

smart URL dispatcher

flexible views on content

powerful templating language — Freemarker

scripting for logic — Groovy, JS, Python, Ruby, etc.

Page 26: Nuxeo WebEngine unveiled

a real MVC model

View

Templates(Freemarker)

Model

ContentDocumentModelfrom Nuxeo Core

Controler

Scripts

or Java Code

Page 27: Nuxeo WebEngine unveiled

smart URLs

/articles/cars/porsche/cs/overview@@view?param=value

or simply:

/articles/cars/bmw/s3/overview

(because the view action is implied)

content path(in the repository)

actionselector

parametersapp ID

Page 28: Nuxeo WebEngine unveiled

smart URLs: mappings

You can also define mappings to control your URLs

<mapping pattern="/user/(?username:[a-zA-Z0-9]+)$"> <script>/users/user_detail.groovy</script></mapping>

Will make the URL /user/JohnDoe call the script user_detail.groovy, with the variable username (having the value“JohnDoe”) automatically passed to it.

Page 29: Nuxeo WebEngine unveiled

@@actions

an action...

points to a template, a script or a Java class

has a guard (ex: permission)

is bound to a content type

belongs to a category

is prefixed in the URL by @@ (ex: @@print)

actions represent a powerful way to bind views and logic to content

Page 30: Nuxeo WebEngine unveiled

@@actions

<object id="WikiPage" extends="WikiObject"> <actions> <action id="view_content" enabled="true"> <permission expression="Read"/> <category>tab</category> </action>

<action id="show_comments" enabled="true" script="show_comments.groovy"> <permission expression="Read"/> <category>tab</category> </action> </actions></object>

New action view_content on WikiObjects.WebEngine will look for a template called view_content.ftl and use it as view.

New action show_comments on WikiObjects.As a script is defined, WebEngine will execute the script show_comments.groovy and return the result.

Page 31: Nuxeo WebEngine unveiled

#templates

based on the FreeMarker engine

template inheritance

easy access to content

extensible context (variable injection)

and... extensible Nuxeo’s style! You can use your preferred template engine (PHP anyone?)

Page 32: Nuxeo WebEngine unveiled

Scripting

scripts can access all services of the Nuxeo Platform services

several scripting languages included — Groovy, Python, JavaScript, Ruby, etc. (thank you, JSR-233!)

easy logic, powerful features

and... the strength of the Java VM

Page 33: Nuxeo WebEngine unveiled

here is how you list the comments on a document

//get the current document as commentable documentcdoc = Document.getAdapter(CommentableDocument)

//render the template passing named variablesContext.render("comments/show_comments.ftl", ['comments': cdoc.comments])

Page 34: Nuxeo WebEngine unveiled

or perform a query

//define your querypquery = "SELECT * FROM Document WHERE (dc:created BETWEEN DATE '2008-01-01' AND DATE '2008-12-31') AND (ecm:path STARTSWITH '/')"

//perform the query and get the resultsresults = Request.query(pquery)

Page 35: Nuxeo WebEngine unveiled

or list a folder’s content

//Document is the current content objectdocchildren = Document.children

Page 36: Nuxeo WebEngine unveiled

MVC in your hands

#template

View

DocumentModel(from the core)

Model

@@action

Controler

Page 37: Nuxeo WebEngine unveiled

Based on a completeECM platform

content store (Nuxeo Core, JCR-based)

advanced Access Control (through permissions)

enterprise-class authentication & user/group management

indexing and search

comments, relations, etc.

and a dozen more! ;-)

Page 38: Nuxeo WebEngine unveiled

Components everywhere

hot-reloadable extension points

compose your apps dynamically with plugins

works with Jetty, JBoss and GlassFish3

and... Nuxeo style! :-)

Page 39: Nuxeo WebEngine unveiled

showtime

Page 40: Nuxeo WebEngine unveiled
Page 41: Nuxeo WebEngine unveiled