Divide et impera
Nathan Van Gheem - Ramon Navarro Bosch - Timo Stollenwerk
Plone Conference Bucharest 2015
Modern Web Applications
DISCLAIMER
Brave New (JS) World
Client Server Architecture
JSON RPC API
POST: nohost/api
method: create_content
type: Document
title: My Document
container: <UID>
wsapi4plone
Use multiple URLs
POST: nohost/api/my-folder
method: create_content
type: Document
title: My Document
plone.jsonapi
Use HTTP Methods
nohost/my-folder
GET
POST: type/id/title
PUT: type/id/title
DELETE
REST / CRUD
plone.rest
<plone:service
method="DELETE"
for="IDexterityContent"
factory=".service.Patch"
/>
plone.rest
DELETE nohost/my-folder
Accept: application/json
{
"status": "201"
}
Javascript REST Adapters
Angular JS Resource
var user = $resource('/user/:userId');
user.get()
user.query()
user.save()
user.remove()
user.delete()
Representational State Transfer
Hypermedia / HATEOAS
JSON LD / Hydra
{
"@id": "/folder/",
"member": [
{"@id": "/folder/document"}
],
"operation": […]
}
plone.rest / plone.restapi
Ramon: PAS
SECURITY
• ElasticSearch/Solr
• Plone security
• JS Frontend
PAS
GROUPS
GLOBAL ROLES
LOCAL ROLES
[‘role1’,’role2’]
[‘role2’]WORKFLOW
PERMISSION
PAS
• What happens with LDAP/lots of users?
• Groups / recursive ?
• Managing users
External Extensible Service
[‘role1’,’role2’]
Which roles in
this context
REST API
MANAGEMENT INTERFACE
JWT TOKENS
LDAP BACK
Nathan: Mosaic
Page rendering(now)
Turn a URL request from a user into structure HTML response.
Almost all rendering done in python
Take request object, context, various other configuration bits of data, and
render to an HTML response
Much of the time Plone takes in processing the request is “rendering” HTML
Often, HTML output is coupled with the implementation of the CMS. For
example, you *need* an HTML form to edit a page.
Current state of page rendering
Turn a URL request from a user into a structured HTML response.
Templating
Plone uses the Chameleon templating engine for generating HTML
There are many JavaScript templating frameworks that could be used to
replace chameleon templating.
Frameworks like Angular have their own templating implementation
Rendering moves out of Plone, faster
Viewlets/Portlets
Viewlets and portlets are additional tools used to produce bits of rendered
HTML
Would no longer be necessary
This type of functionality moves to HTML5 components
Diazo
Diazo is an xslt transformation done on the html output to map content
generated from Plone into an HTML theme.
Original Diazo implementation also worked with an alternative browser
transformation
Diazo is likely unnecessary though as there is HTML rendering is decoupled
from the CMS
Mosaic
Mosaic tiles are bits of rendered HTML(usually from templates) that can be
moved around on a page. Data is stored in “layouts” and/or persistent
annotations on the content.
Diazo editor is already JavaScript
Storage can stay the same
Rendering would be moved to JavaScript templating
Page rendering(REST)
With JavaScript using the REST API to do the page rendering...
How might it work?
Plone server running with REST API
Static JavaScript/HTML/CSS files deployed on web server, pointed at Plone
server endpoint
JavaScript handles all the page rendering from REST API
Harder problems
Unclear what the interaction would look like with CMS managed theming and
the HTML/JavaScript/CSS application or if it would be possible
First page load does not include any HTML(SEO)
It’s possible to load first page with NodeJS with Angular and ReactJS
Search engines are playing nicer with JavaScript
Further Topics
Forms
ZCatalog / Search
Diazo
Dexterity
Hackability
Superlekker Questions?

Divide et impera