SlideShare une entreprise Scribd logo
1  sur  33
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

Contenu connexe

Tendances

Darian Lowe Portfolio
Darian Lowe PortfolioDarian Lowe Portfolio
Darian Lowe Portfolio
darian.lowe
 
A Designer's Intro to Oracle JET
A Designer's Intro to Oracle JETA Designer's Intro to Oracle JET
A Designer's Intro to Oracle JET
Lauren Beatty
 
How to Build, Manage, and Promote APIs
How to Build, Manage, and Promote APIsHow to Build, Manage, and Promote APIs
How to Build, Manage, and Promote APIs
WSO2
 
Build your silver light application
Build your silver light applicationBuild your silver light application
Build your silver light application
Pranay Rana
 
Session4-Sharepoint Online-chrismayo
Session4-Sharepoint Online-chrismayoSession4-Sharepoint Online-chrismayo
Session4-Sharepoint Online-chrismayo
Mithun T. Dhar
 

Tendances (19)

Presentazione Sharepoint 2010
Presentazione Sharepoint 2010Presentazione Sharepoint 2010
Presentazione Sharepoint 2010
 
Developing Sandbox Solutions
Developing Sandbox SolutionsDeveloping Sandbox Solutions
Developing Sandbox Solutions
 
Sitecore MVC Advanced
Sitecore MVC AdvancedSitecore MVC Advanced
Sitecore MVC Advanced
 
Darian Lowe Portfolio
Darian Lowe PortfolioDarian Lowe Portfolio
Darian Lowe Portfolio
 
SilverStripe Meetup Presentation 03/03/2011
SilverStripe Meetup Presentation 03/03/2011SilverStripe Meetup Presentation 03/03/2011
SilverStripe Meetup Presentation 03/03/2011
 
WSO2 Product Release Webinar: WSO2 Dashboard Server 2.0
WSO2 Product Release Webinar: WSO2 Dashboard Server 2.0WSO2 Product Release Webinar: WSO2 Dashboard Server 2.0
WSO2 Product Release Webinar: WSO2 Dashboard Server 2.0
 
Sitecore MVC: What it is and why it's important
Sitecore MVC: What it is and why it's importantSitecore MVC: What it is and why it's important
Sitecore MVC: What it is and why it's important
 
SAP NetWeaver Portal 7.3 - top 5 Reasons to upgrade your portal
SAP NetWeaver Portal 7.3 - top 5 Reasons to upgrade your portalSAP NetWeaver Portal 7.3 - top 5 Reasons to upgrade your portal
SAP NetWeaver Portal 7.3 - top 5 Reasons to upgrade your portal
 
We Have Experimental Modules, Now What?
We Have Experimental Modules, Now What?We Have Experimental Modules, Now What?
We Have Experimental Modules, Now What?
 
MuleSoft Surat Live Demonstration Virtual Meetup#5 - Salesforce Composite Con...
MuleSoft Surat Live Demonstration Virtual Meetup#5 - Salesforce Composite Con...MuleSoft Surat Live Demonstration Virtual Meetup#5 - Salesforce Composite Con...
MuleSoft Surat Live Demonstration Virtual Meetup#5 - Salesforce Composite Con...
 
A Designer's Intro to Oracle JET
A Designer's Intro to Oracle JETA Designer's Intro to Oracle JET
A Designer's Intro to Oracle JET
 
How to Build, Manage, and Promote APIs
How to Build, Manage, and Promote APIsHow to Build, Manage, and Promote APIs
How to Build, Manage, and Promote APIs
 
Build your silver light application
Build your silver light applicationBuild your silver light application
Build your silver light application
 
Anypoint connector dev kit
Anypoint connector dev kitAnypoint connector dev kit
Anypoint connector dev kit
 
Anypoint connector basics
Anypoint connector basicsAnypoint connector basics
Anypoint connector basics
 
Scalable web-based workflow platform
Scalable web-based workflow platformScalable web-based workflow platform
Scalable web-based workflow platform
 
Micro Front Ends for Micro Services using Oracle JET
Micro Front Ends for Micro Services using Oracle JETMicro Front Ends for Micro Services using Oracle JET
Micro Front Ends for Micro Services using Oracle JET
 
Session4-Sharepoint Online-chrismayo
Session4-Sharepoint Online-chrismayoSession4-Sharepoint Online-chrismayo
Session4-Sharepoint Online-chrismayo
 
Connections Administration Toolkit (CAT)
Connections Administration Toolkit (CAT)Connections Administration Toolkit (CAT)
Connections Administration Toolkit (CAT)
 

Similaire à JahiaOne - Advanced modules - choose the right strategy

IBM Innovate 2013: Making Rational HATS a Strategic Investment
IBM Innovate 2013: Making Rational HATS a Strategic InvestmentIBM Innovate 2013: Making Rational HATS a Strategic Investment
IBM Innovate 2013: Making Rational HATS a Strategic Investment
Strongback Consulting
 
Using advanced C# features in Sharepoint development
Using advanced C# features in Sharepoint developmentUsing advanced C# features in Sharepoint development
Using advanced C# features in Sharepoint development
sadomovalex
 
Programming Server side with Sevlet
 Programming Server side with Sevlet  Programming Server side with Sevlet
Programming Server side with Sevlet
backdoor
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
vstorm83
 

Similaire à JahiaOne - Advanced modules - choose the right strategy (20)

MVC 4
MVC 4MVC 4
MVC 4
 
بررسی چارچوب جنگو
بررسی چارچوب جنگوبررسی چارچوب جنگو
بررسی چارچوب جنگو
 
IBM Innovate 2013: Making Rational HATS a Strategic Investment
IBM Innovate 2013: Making Rational HATS a Strategic InvestmentIBM Innovate 2013: Making Rational HATS a Strategic Investment
IBM Innovate 2013: Making Rational HATS a Strategic Investment
 
Cognos Software Development Kit
Cognos Software Development KitCognos Software Development Kit
Cognos Software Development Kit
 
Intro lift
Intro liftIntro lift
Intro lift
 
Background Tasks with Worker Service
Background Tasks with Worker ServiceBackground Tasks with Worker Service
Background Tasks with Worker Service
 
Dn D Custom 1
Dn D Custom 1Dn D Custom 1
Dn D Custom 1
 
Dn D Custom 1
Dn D Custom 1Dn D Custom 1
Dn D Custom 1
 
Using advanced C# features in Sharepoint development
Using advanced C# features in Sharepoint developmentUsing advanced C# features in Sharepoint development
Using advanced C# features in Sharepoint development
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
 
Company Visitor Management System Report.docx
Company Visitor Management System Report.docxCompany Visitor Management System Report.docx
Company Visitor Management System Report.docx
 
Programming Server side with Sevlet
 Programming Server side with Sevlet  Programming Server side with Sevlet
Programming Server side with Sevlet
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
 
ASP.NET OVERVIEW
ASP.NET OVERVIEWASP.NET OVERVIEW
ASP.NET OVERVIEW
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6
 
Webcast Wcm
Webcast WcmWebcast Wcm
Webcast Wcm
 
PoP - “Platform of Platforms”: Framework for building Single-Page Application...
PoP - “Platform of Platforms”: Framework for building Single-Page Application...PoP - “Platform of Platforms”: Framework for building Single-Page Application...
PoP - “Platform of Platforms”: Framework for building Single-Page Application...
 
Building Restful Web App Rapidly in CakePHP
Building Restful Web App Rapidly in CakePHPBuilding Restful Web App Rapidly in CakePHP
Building Restful Web App Rapidly in CakePHP
 
Writing a massive javascript app
Writing a massive javascript appWriting a massive javascript app
Writing a massive javascript app
 

Plus de Jahia Solutions Group

Plus de Jahia Solutions Group (20)

The Road ahead: What we see as the future of digital. By Elie Auvray
The Road ahead: What we see as the future of digital. By Elie AuvrayThe Road ahead: What we see as the future of digital. By Elie Auvray
The Road ahead: What we see as the future of digital. By Elie Auvray
 
Monitoring and Data-Driven Decision Making with Daniel Maher
Monitoring and Data-Driven Decision Making with Daniel MaherMonitoring and Data-Driven Decision Making with Daniel Maher
Monitoring and Data-Driven Decision Making with Daniel Maher
 
The ultimate search of the perfect customer experience By Brian Solis
The ultimate search of the perfect customer experience By Brian SolisThe ultimate search of the perfect customer experience By Brian Solis
The ultimate search of the perfect customer experience By Brian Solis
 
Docker, Kubernetes, Openshift: Jahia on steroids in production with Julian Ma...
Docker, Kubernetes, Openshift: Jahia on steroids in production with Julian Ma...Docker, Kubernetes, Openshift: Jahia on steroids in production with Julian Ma...
Docker, Kubernetes, Openshift: Jahia on steroids in production with Julian Ma...
 
Data for Dummies by Dan Katz, CDO at Safran
Data for Dummies by Dan Katz, CDO at SafranData for Dummies by Dan Katz, CDO at Safran
Data for Dummies by Dan Katz, CDO at Safran
 
Content and commerce: The perfect combo. By Catherine Barba
Content and commerce: The perfect combo. By Catherine BarbaContent and commerce: The perfect combo. By Catherine Barba
Content and commerce: The perfect combo. By Catherine Barba
 
The power of great customer experience in today’s world. Olivier Mourrieras &...
The power of great customer experience in today’s world. Olivier Mourrieras &...The power of great customer experience in today’s world. Olivier Mourrieras &...
The power of great customer experience in today’s world. Olivier Mourrieras &...
 
Making Digital simpler. Occam’s Razor, Horses, Zebras, and Evolution
Making Digital simpler. Occam’s Razor, Horses, Zebras, and EvolutionMaking Digital simpler. Occam’s Razor, Horses, Zebras, and Evolution
Making Digital simpler. Occam’s Razor, Horses, Zebras, and Evolution
 
Elasticsearch powered EDP by Cedric Mailleux
Elasticsearch powered EDP by Cedric MailleuxElasticsearch powered EDP by Cedric Mailleux
Elasticsearch powered EDP by Cedric Mailleux
 
Jahia Cloud Offerings by Julian Maurel & Abass Safoutou
Jahia Cloud Offerings by Julian Maurel & Abass SafoutouJahia Cloud Offerings by Julian Maurel & Abass Safoutou
Jahia Cloud Offerings by Julian Maurel & Abass Safoutou
 
Learn how to go headless with Jahia DX by Serge Huber
Learn how to go headless with Jahia DX by Serge HuberLearn how to go headless with Jahia DX by Serge Huber
Learn how to go headless with Jahia DX by Serge Huber
 
Making the life of patients easier in the healthcare sector thanks to digital...
Making the life of patients easier in the healthcare sector thanks to digital...Making the life of patients easier in the healthcare sector thanks to digital...
Making the life of patients easier in the healthcare sector thanks to digital...
 
Impletementing Analytics - Stop talking, Start doing! by Ben Salmon, We are C...
Impletementing Analytics - Stop talking, Start doing! by Ben Salmon, We are C...Impletementing Analytics - Stop talking, Start doing! by Ben Salmon, We are C...
Impletementing Analytics - Stop talking, Start doing! by Ben Salmon, We are C...
 
Strategy for content with local and global sites by Romain Gauthier
Strategy for content with local and global sites by Romain GauthierStrategy for content with local and global sites by Romain Gauthier
Strategy for content with local and global sites by Romain Gauthier
 
Apache Unomi presentation and update. By Serge Huber, CTO Jahia
Apache Unomi presentation and update. By Serge Huber, CTO JahiaApache Unomi presentation and update. By Serge Huber, CTO Jahia
Apache Unomi presentation and update. By Serge Huber, CTO Jahia
 
Personalisation and Headless in a business context by Lars Petersen
Personalisation and Headless in a business context by Lars PetersenPersonalisation and Headless in a business context by Lars Petersen
Personalisation and Headless in a business context by Lars Petersen
 
Digital Revolution from Silo to Platform by Gilles Babinet
Digital Revolution from Silo to Platform by Gilles BabinetDigital Revolution from Silo to Platform by Gilles Babinet
Digital Revolution from Silo to Platform by Gilles Babinet
 
A customer journey with AI by Xavier Vaccari, Softeam Group
A customer journey with AI by Xavier Vaccari, Softeam GroupA customer journey with AI by Xavier Vaccari, Softeam Group
A customer journey with AI by Xavier Vaccari, Softeam Group
 
Using CX to unlock Total Experience by David Balko, Tribal
Using CX to unlock Total Experience by David Balko, TribalUsing CX to unlock Total Experience by David Balko, Tribal
Using CX to unlock Total Experience by David Balko, Tribal
 
AI-monitor & Marketing Factory, customer case study by Valerie Voci
AI-monitor & Marketing Factory, customer case study by Valerie VociAI-monitor & Marketing Factory, customer case study by Valerie Voci
AI-monitor & Marketing Factory, customer case study by Valerie Voci
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

JahiaOne - Advanced modules - choose the right strategy

  • 1. Advanced module development Choose the right strategy Thomas Draier 1
  • 3. Define your content     Definitions Initializers ( for default values / autocreated ) ChoiceListInitializers Define constraints  Mandatory property / subnode  Regular expressions  Validators 3
  • 4. How to render content to users Display your content 4
  • 5. 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
  • 6. Display your content  Simple JSPs  Simple to use  Can use all jahia taglibs / JSTL  Include your own taglib for complex code 6
  • 7. 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
  • 8. 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
  • 9. 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
  • 10. Different ways to let the user modify the content Create and update content 10
  • 11. 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
  • 12. 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
  • 13. 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
  • 14. 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
  • 15. How to listen to content modifications React to events 15
  • 16. 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
  • 17. 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
  • 18. How to transform your content after rendering Post process your content 18
  • 19. 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
  • 20. 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
  • 21. 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
  • 22. Always check how your content is cached in live … Cache management 22
  • 23. 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
  • 24. 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
  • 25. 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
  • 26. 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
  • 27. Reuse the frameworks and services provided by Jahia Use shared services 27
  • 28. 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
  • 29. 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
  • 30. Use shared services  Atmosphere  Develop asynchronous web application  Push / broadcast content to users Extending Jahia with NoSQL - Thursday, 04:45 PM 30
  • 31. 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
  • 32. Use shared services  Spring Data Extending Jahia with NoSQL - Thursday, 04:45 PM  External providers External Data Provider - Friday, 09:45 AM 32

Notes de l'éditeur

  1. reuseability
  2. list events
  3. ex wiki
  4. cache expiration -> macros, acl key part
  5. example
  6. example