JahiaOne - Advanced modules - choose the right strategy

50 %
50 %
Information about JahiaOne - Advanced modules - choose the right strategy
Technology

Published on February 18, 2014

Author: Jahia

Source: slideshare.net

Description

This session will provide an overview of the different technics available to developers to create advanced modules, the extension points and explain when it is preferable to use one approach or another depending on the scenario.

Advanced module development Choose the right strategy Thomas Draier 1

Define your content 2

Define your content     Definitions Initializers ( for default values / autocreated ) ChoiceListInitializers Define constraints  Mandatory property / subnode  Regular expressions  Validators 3

How to render content to users Display your content 4

Display your content  Jahia rendering system  Use render service for every node  Render chain ends up with view call  Views : one folder per component type  A module can override exisiting views 5

Display your content  Simple JSPs  Simple to use  Can use all jahia taglibs / JSTL  Include your own taglib for complex code 6

Display your content  Groovy scripts  Better for complex code with method declaration, recursions, …  Limited rendering  Cannot use any taglib, but access to Jahia /JCR API  Example : navigation menu 7

Display your content  Webflow  MVC model  Can call controller class to prepare view  Use JSPs for views  Allows user interaction  Example : administration components Using Spring Web Flow - Friday, 02:00 PM 8

Display your content  Spring controller  Same as a servlet  Can return any content type  No mapping with nodes, need to define your own parameters  Can be declared in a module 9

Different ways to let the user modify the content Create and update content 10

Create and update content  REST API  Create a single node, update properties  Can be used in AJAX or simple HTML forms  Can redirect to a jahia page, or return Json 11

Create and update content  Json REST API  Create nodes, update properties, full Json  More powerful  HATEOAS, Use HAL style links  Can be used only in AJAX Jahia 7 new Rest API, 11:45 AM 12

Create and update content  Actions  Custom code, can use all Jahia / JCR API  Can be used in AJAX or simple forms  Can redirect to a jahia page  Can return info to the user only in AJAX 13

Create and update content  Webflow  Custom code, can use all Jahia / JCR API  Stateful  Cannot be used with AJAX calls Using Spring Web Flow - Friday, 02:00 PM 14

How to listen to content modifications React to events 15

React to events  Rules  Easy to create and modify  Many simple conditions/consequences available - look at existing DSL files  Module can register reusable custom services and DSL  Rule can start background jobs, workflows, …  Rule can replace action, when combined with Rest API  Cluster : triggered only on the server which created the event 16

React to events  Listeners  Direct access to all JCR events (node or properties added/removed/updated)  Easier to debug  Can have a performance impact  Cluster : can listen to event on other servers 17

How to transform your content after rendering Post process your content 18

Post process your content  Macros  Simple groovy scripts  Can be called on whole page : WEB-INF/macros ##username## , ##requestParameters##  or per module : WEB-INF/modules-macros ##authorName## , ##creationdate##  Page level macros are not cached !  Available in edit engine for editors 19

Post process your content  Render Filter  Used to prepare and/or alter the rendering  Can be placed anywhere in the render chain - need to specify a correct priority !  Use different scopes : whole page or module  Example : set up connection with external system, transform content after rendering … 20

Post process your content  Errors JSPs or Error Handlers  Use JSPs error only to display message  Use error handler to catch exceptions and handle some processing  Example : Wiki redirects 404 to creation form 21

Always check how your content is cached in live … Cache management 22

Cache management  Use expiration settings carefully  Default expiration set to 4h  Reduce expiration time for content which can change with time  Never set expiration=0 for content with heavy processing ( queries, … ), customize cache key or use AJAX calls instead ! 23

Cache management  Cache key  Cache fragment = HTML rendering of a component, without its submodules  Each fragment has a key  Key is composed of multiple parts : node path, view used, language, acls, request parameters, context site, … 24

Cache management  ACL Cache key  Users with different roles on the node see different things - different fragments generated by default  Customizable implementation  Correctly set with cache.dependsOnVisibilityOf property  Example : jnt:contentList cache.dependsOnVisibilityOf=$currentNode/[^/]* 25

Cache management  Cache Key customization  Define parameters that are known to alter the rendering  Test the node type before adding things in the key  Beware of number of dimensions - cache size can grow quickly !  Example : add user segment to the key 26

Reuse the frameworks and services provided by Jahia Use shared services 27

Use shared services  Workflows : define processes which imply user interaction  JBPM 6 / BPMN 2  Create workflows for any type of operation  Start workflow with actions  User tasks appear in dashboard  Define workflow participant through the roles  Create custom work handlers 28

Use shared services  Social module : activity feed  Create an activity type [jnt:socialActivity] > jnt:baseSocialActivity  Set up a rule to trigger activities creation Add activity of type {activityType} on {node} with parameters {params}  Define a recorder that will populate activity nodes void recordActivity(…)  Create views for your activities 29

Use shared services  Atmosphere  Develop asynchronous web application  Push / broadcast content to users Extending Jahia with NoSQL - Thursday, 04:45 PM 30

Use shared services  CAMEL  Can send or receive events through different channels  Configure routes in Gateway service  Can receive mail using decoders  Supports Enterprise Integration Pattern  Example : Wise mail integration 31

Use shared services  Spring Data Extending Jahia with NoSQL - Thursday, 04:45 PM  External providers External Data Provider - Friday, 09:45 AM 32

Questions 33

Add a comment

Related presentations

Related pages

Sessions - JahiaOne

Sessions ... Advanced modules - choose the right strategy Presented by ... Slides from presentation JahiaOne - Advanced modules - choose the right strategy ...
Read more

PressArchive: 9 2016 - firmenpresse.de

Opinionmeter Introduces Advanced Mobile Web Surveys to its ... Jahia Introduces JahiaOne, ... Rifkin Consulting Discusses How To Choose The Right Job:
Read more

Archive News & Video for Tuesday, 12 Nov 2013 | Reuters.com

Site Archive for Tuesday, 12 Nov 2013. ... Advanced Energy to Webcast Analyst Day Presentation ... Edenred is stepping up its strategy for delivering ...
Read more

Media - Jahia

Mit ihrem Konto anmelden. Login-Daten speichern Login Haben Sie Ihre Login-Daten vergessen?
Read more

Archive News & Video for Thursday, 16 Jan 2014 | Reuters.com

Site Archive for Thursday, 16 Jan 2014. ... ADVANCED MICRO SHAREHOLDER ALERT BY FORMER LOUISIANA ... Digital Right to Repair Coalition Calls for DMCA ...
Read more

Media - Jahia

When it comes right down to it, ... and advanced users to create web projects quickly by using any ... Improved Social Media Modules 2010-04-14 ...
Read more