SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
Taming content repositories
                              with Apache Sling



  Bertrand Delacrétaz, Senior R&D Developer
  Michael Marth, Technology Evangelist
  Day Software, www.day.com

  OpenExpo 2008, Winterthur, September 25th
  Slides revision: 2008-09-24
  Slides design: David Nuescheler




  Technology Presentation                                   1

mercredi, 24 septembre 2008                                     1
Taming Content Repositories
                                          Web Development




                         The Web vs. JCR - Intro
                         Blog in 15 minutes             silve
                                                              r


                         So what?




mercredi, 24 septembre 2008                                       2
Intro to JCR
                         JCR = Java Content Repository API
                         JSR-170 / JSR283
                                      -
                                                      silve
                                                            r


                         Everything Is Content - and JCR manages it as
                         trees of Nodes and Properties, using rich data
                         types.




mercredi, 24 septembre 2008                                               3
What’s JCR?
                              gpoJNTM

                   `çåíÉåí=oÉéçëáíçêó=Ñçê=
                   g~î~qj=íÉÅÜåçäçÖó=^mf
                   péÉÅJiÉ~ÇW
                   a~ó=pçÑíï~êÉ
                   pí~íìëW=
                   cáå~ä=oÉäÉ~ëÉ=NTJàìåJOMMR


                   bñéÉêí=dêçìéW




mercredi, 24 septembre 2008                           4
What’s JCR?
                              gpoJNTM   gpoJOUP

                   `çåíÉåí=oÉéçëáíçêó=Ñçê=
                   g~î~qj=íÉÅÜåçäçÖó=^mf=îOKM
                   péÉÅJiÉ~ÇW
                   a~ó=pçÑíï~êÉ
                   pí~íìëW=
                   mìÄäáÅ=oÉîáÉï=`äçëÉÇ=ëÉéJOMMT


                   bñéÉêí=dêçìéW




mercredi, 24 septembre 2008                           5
What’s JCR?
                         “The API should be a standard,
                         implementation independent, way to
                         access content bi-directionally on a
                         granular level to a
                         content repository.” ?

mercredi, 24 septembre 2008                                     6
Best of both worlds.
                                               data base                   file s ys t e m
                                                                                    hier-
                                   integ                                          archi
                                        rity
                                                      structu
                                                             re                        es
                                                                    read                    streams


                                   tx                             write
                                                                                               access
                                                    query                         locking     control



                          multi-
                          value
                                    un-structured                               obser-      versioning
                                                    “full-text”   sort          vation
                                                                  order

                                                            content repo sit or y
mercredi, 24 septembre 2008                                                                              7
Known compliant Repositories
                                                                             * using third party connector

                                                                                     *                   *

                                                        Exo              Microsoft
     Apache Jackrabbit            Oracle XML DB     ECMS Platform       Sharepoint       OpenText Livelink

                                                                                                         *

             Day CRX              IBM FileNet P8   Xythos Repository   Alfresco ECM        Vignette V7

                              *                                 *
                                                                                                   any ors
                                                                                              ow mvendd?
                                                                                             H S e
           Interwoven                                             +hund                      DBMou ne
                                                                                            R do y
                                                                       r s
           Repository                IBM CM        EMC Documentum    regiede of TCKs
                                                                         st red
mercredi, 24 septembre 2008                                                                                  8
Some known JCR Applications

                                                                                           Fast
            BEA Portal        Sun                            Oracle Portal          Enterprise Search
                                         JBoss Portal                        Interface 21
                         OpenPortal
                                                       Day Communique Spring Framework
            magnolia WCMS                                    DAM
                                    Apache Sling                                   Day Communique
                         Alfresco ECMS                 Mindquarry                        Collab
                                                     Collaboration         Apache Tapestry
                              QSLabs
            Apache          Compliance        Day Communiqué
            Cocoon                                 WCMS                                  IBM FileNet
                                           Artifactory             medic-2-medic      WebSiteManager
                    Apache James         Maven Proxy              mapofmedicine
                                     Exo
                                ECMS Platform               TYPO3
           GX WebManager                                  v5.0 WCM
                                            InfoQ                 Hippo                      Liferay
                       Nuxeo ECM Online Community                 CMS                   Enterprise Portal
                                                        Jahia                   Sakai
               Percussion                            Framework               E-learning
               Rhythmix             QuickWCM                                          Sourcemix
                                      WCMS                     Lutece                 Sourcemix
mercredi, 24 septembre 2008
                                                               Portal                                       9
JCR code excerpt
          Repository repository = new TransientRepository();
          Session session = repository.login(...);
          / Create content
          /
          Node root = session.getRootNode();
          Node hello = root.addNode(quot;helloquot;);
          Node world = hello.addNode(quot;worldquot;);
          world.setProperty(quot;messagequot;, quot;Hello, World!quot;);
          session.save();
          / Retrieve content
           /
          Node node = root.getNode(quot;hello/worldquot;);
          print(node.getPath());
          print(node.getProperty(quot;messagequot;).getString());
mercredi, 24 septembre 2008                                    10
Sling builds on top of JCR

                         Scriptable applications layer on top of JCR
                         OSGi-based industrial-strength framework
                         Simple, powerful, JCR inside
                         Runs on Apache Jackrabbit by default


                                  http:/
                                       /incubator.apache.org/sling
mercredi, 24 septembre 2008                                            11
REST over JCR


                               REST -> Roy T. Fielding


                                                                        scheler
                                                         JCR: David Nue
                                                                                                2005
         rele a                                                                   1.0 r
                                                                                  v    ele ased
               sed y
         162 p 2k                                                                     +300 pages
                ages



mercredi, 24 septembre 2008                                                                            12
Reclaiming the web.
                              Sling URL decomposition.
                              /cars/audi/s4.details.html

                Content                        ...selects a
  Repository epository Path
           R                                particular scrip
                                                            t




mercredi, 24 septembre 2008                                     13
Sling architecture
                         HTTP                                   debugger      filesystem    browser



                       standard        custom servlets                        WebDAV      Sling OSGi
                       servlets        and components                          server       console
                                                                 javascript

               resource           servlet/script   OSGi bundles
                                                   JSR 223
                                                             JSP
                                                                   Ruby
              resolution           resolution      scripting                     OSGi framework
                                                                  Velocity
                                                                   etc..
                                                                                  (Apache Felix)
                  OSGi webapp
                                                         JSR-170 API


                                                            JCR
                                                         repository




mercredi, 24 septembre 2008                                                                            14
A Sling-based blog
                         282 lines of code
                         100% scripted, no tools required besides Sling
                         Simple, modular code structure
                         Promotes RESTful thinking




mercredi, 24 septembre 2008                                               15
Sling blog scripts
             admin.esp        56 lines - admin page (.admin.html)
             header.esp        7 lines - <head> generation (sling.include)
             html.esp         75 lines - html rendering of a post (.html)
             list.esp         60 lines - list of posts (.list.html)
             menu.esp         18 lines - home/admin/new (sling.include)
             post.esp         39 lines - “new post” page (.post.html)
             xml.esp          27 lines - RSS feed (.xml)

             TOTAL            282 lines (including whitespace/comments)

mercredi, 24 septembre 2008                                                  16
Creating content (post.esp)
             <form method=quot;POSTquot;
              action=quot;/content/myblog/posts/*quot;>
             <p><label>Title</label>
             <input name=quot;titlequot; type=quot;textquot;/></p>
             <p><p><label>Body</label>
             <textarea name=quot;posttextquot; cols=quot;40quot; rows=quot;5quot;>
             <input name=quot;:redirectquot; type=quot;hiddenquot;
             value=quot;/content/myblog/posts.admin.htmlquot;/>
             <input type=quot;submitquot; value=quot;Postquot;>
             </form>

mercredi, 24 septembre 2008                                  17
Rendering content (html.esp)
             <html>
             <% sling.include(quot;/content/myblog.header.htmlquot;) %>

             <body>
               <h2> <%=currentNode.title %> </h2>
               <%
               var a = currentNode.getNode(quot;attachmentsquot;).getNodes() ;
               for(i in a) {
                 var attachmentNode = a[i];
               ... %>
             }

             </body>
             </html>

mercredi, 24 septembre 2008                                              18
Sling blog demo




mercredi, 24 septembre 2008                     19
Can I have fries with that?

                         How do we add functionality that is not easily
                         scriptable?
                         Example: thumbnails generated in Java code,
                         by observing the repository for new files.




mercredi, 24 septembre 2008                                               20
JCR observation
                     String[] nodeTypes = { quot;nt:filequot; };
                     boolean isDeep = true;
                     observationManager.addEventListener(
                       this,
                       Event.NODE_ADDED | Event.NODE_REMOVED,
                       quot;/content/myblog/postsquot;,
                       isDeep, ...types);
                     ...
                     public void onEvent(
                       EventIterator eventIterator) { ... }
mercredi, 24 septembre 2008                                     21
Thumbnails bundle demo




mercredi, 24 septembre 2008                            22
Conclusions

                         JCR rocks - and everything is content!
                         Sling makes JCR easy and fun.
                         A good JCR content model is key.
                         Join the fun at incubator.apache.org/sling!




mercredi, 24 septembre 2008                                            23

Contenu connexe

En vedette

Open Innovation means Open Source
Open Innovation means Open SourceOpen Innovation means Open Source
Open Innovation means Open SourceBertrand Delacretaz
 
It's just a Web server - a plea for simplicity
It's just a Web server - a plea for simplicityIt's just a Web server - a plea for simplicity
It's just a Web server - a plea for simplicityBertrand Delacretaz
 
Life in Open Source Communities, ApacheCon US 2009
Life in Open Source Communities, ApacheCon US 2009Life in Open Source Communities, ApacheCon US 2009
Life in Open Source Communities, ApacheCon US 2009Bertrand Delacretaz
 
Open Source Tools Are Good For You!
Open Source Tools Are Good For You!Open Source Tools Are Good For You!
Open Source Tools Are Good For You!Bertrand Delacretaz
 
Open-Source Collaboration Tools are Good for You - 2009 edition
Open-Source Collaboration Tools are Good for You - 2009 editionOpen-Source Collaboration Tools are Good for You - 2009 edition
Open-Source Collaboration Tools are Good for You - 2009 editionBertrand Delacretaz
 

En vedette (6)

Open Innovation means Open Source
Open Innovation means Open SourceOpen Innovation means Open Source
Open Innovation means Open Source
 
It's just a Web server - a plea for simplicity
It's just a Web server - a plea for simplicityIt's just a Web server - a plea for simplicity
It's just a Web server - a plea for simplicity
 
Life in Open Source Communities, ApacheCon US 2009
Life in Open Source Communities, ApacheCon US 2009Life in Open Source Communities, ApacheCon US 2009
Life in Open Source Communities, ApacheCon US 2009
 
Tales from the OSGi trenches
Tales from the OSGi trenchesTales from the OSGi trenches
Tales from the OSGi trenches
 
Open Source Tools Are Good For You!
Open Source Tools Are Good For You!Open Source Tools Are Good For You!
Open Source Tools Are Good For You!
 
Open-Source Collaboration Tools are Good for You - 2009 edition
Open-Source Collaboration Tools are Good for You - 2009 editionOpen-Source Collaboration Tools are Good for You - 2009 edition
Open-Source Collaboration Tools are Good for You - 2009 edition
 

Similaire à Taming Jcr With Sling

µjax in 30 minutes (for Stockholm)
µjax in 30 minutes (for Stockholm)µjax in 30 minutes (for Stockholm)
µjax in 30 minutes (for Stockholm)guestf67bc2
 
µjax in 30 minutes (for Stockholm)
µjax in 30 minutes (for Stockholm)µjax in 30 minutes (for Stockholm)
µjax in 30 minutes (for Stockholm)Lars Trieloff
 
Open stack in sina
Open stack in sinaOpen stack in sina
Open stack in sinaHui Cheng
 
Crypto With OpenSSL
Crypto With OpenSSLCrypto With OpenSSL
Crypto With OpenSSLZhi Guan
 
Millions quotes per second in pure java
Millions quotes per second in pure javaMillions quotes per second in pure java
Millions quotes per second in pure javaRoman Elizarov
 
Web Content Management And Agile
Web Content Management And AgileWeb Content Management And Agile
Web Content Management And AgileValtech UK
 
Valtech Days 2009 Paris Presentation: WCM in 2010 and an intro to CQ5
Valtech Days 2009 Paris Presentation: WCM in 2010 and an intro to CQ5Valtech Days 2009 Paris Presentation: WCM in 2010 and an intro to CQ5
Valtech Days 2009 Paris Presentation: WCM in 2010 and an intro to CQ5David Nuescheler
 
ElastiCache: Deep Dive Best Practices and Usage Patterns - AWS Online Tech Talks
ElastiCache: Deep Dive Best Practices and Usage Patterns - AWS Online Tech TalksElastiCache: Deep Dive Best Practices and Usage Patterns - AWS Online Tech Talks
ElastiCache: Deep Dive Best Practices and Usage Patterns - AWS Online Tech TalksAmazon Web Services
 
Bangalore cloudstack user group
Bangalore cloudstack user groupBangalore cloudstack user group
Bangalore cloudstack user groupShapeBlue
 
Upgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVC
Upgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVCUpgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVC
Upgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVCFPGA Central
 
Eb07 Day Communiqué Web Content Management En
Eb07 Day Communiqué Web Content Management EnEb07 Day Communiqué Web Content Management En
Eb07 Day Communiqué Web Content Management EnValtech
 
Developing and Deploying Java applications on the Amazon Elastic Compute Clou...
Developing and Deploying Java applications on the Amazon Elastic Compute Clou...Developing and Deploying Java applications on the Amazon Elastic Compute Clou...
Developing and Deploying Java applications on the Amazon Elastic Compute Clou...Chris Richardson
 
Windows Azure Interoperability
Windows Azure InteroperabilityWindows Azure Interoperability
Windows Azure InteroperabilityMihai Dan Nadas
 
CloudStack for Java User Group
CloudStack for Java User GroupCloudStack for Java User Group
CloudStack for Java User GroupSebastien Goasguen
 

Similaire à Taming Jcr With Sling (20)

µjax in 30 minutes (for Stockholm)
µjax in 30 minutes (for Stockholm)µjax in 30 minutes (for Stockholm)
µjax in 30 minutes (for Stockholm)
 
µjax in 30 minutes (for Stockholm)
µjax in 30 minutes (for Stockholm)µjax in 30 minutes (for Stockholm)
µjax in 30 minutes (for Stockholm)
 
µjax in 30 minutes
µjax in 30 minutesµjax in 30 minutes
µjax in 30 minutes
 
Open stack in sina
Open stack in sinaOpen stack in sina
Open stack in sina
 
Crypto With OpenSSL
Crypto With OpenSSLCrypto With OpenSSL
Crypto With OpenSSL
 
Millions quotes per second in pure java
Millions quotes per second in pure javaMillions quotes per second in pure java
Millions quotes per second in pure java
 
Web Content Management And Agile
Web Content Management And AgileWeb Content Management And Agile
Web Content Management And Agile
 
Valtech Days 2009 Paris Presentation: WCM in 2010 and an intro to CQ5
Valtech Days 2009 Paris Presentation: WCM in 2010 and an intro to CQ5Valtech Days 2009 Paris Presentation: WCM in 2010 and an intro to CQ5
Valtech Days 2009 Paris Presentation: WCM in 2010 and an intro to CQ5
 
ElastiCache: Deep Dive Best Practices and Usage Patterns - AWS Online Tech Talks
ElastiCache: Deep Dive Best Practices and Usage Patterns - AWS Online Tech TalksElastiCache: Deep Dive Best Practices and Usage Patterns - AWS Online Tech Talks
ElastiCache: Deep Dive Best Practices and Usage Patterns - AWS Online Tech Talks
 
Agile Edge Valtech
Agile Edge ValtechAgile Edge Valtech
Agile Edge Valtech
 
Bangalore cloudstack user group
Bangalore cloudstack user groupBangalore cloudstack user group
Bangalore cloudstack user group
 
Upgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVC
Upgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVCUpgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVC
Upgrading to System Verilog for FPGA Designs, Srinivasan Venkataramanan, CVC
 
Eb07 Day Communiqué Web Content Management En
Eb07 Day Communiqué Web Content Management EnEb07 Day Communiqué Web Content Management En
Eb07 Day Communiqué Web Content Management En
 
Intro to Cloudstack
Intro to CloudstackIntro to Cloudstack
Intro to Cloudstack
 
Developing and Deploying Java applications on the Amazon Elastic Compute Clou...
Developing and Deploying Java applications on the Amazon Elastic Compute Clou...Developing and Deploying Java applications on the Amazon Elastic Compute Clou...
Developing and Deploying Java applications on the Amazon Elastic Compute Clou...
 
Introducing CQ 5.1
Introducing CQ 5.1Introducing CQ 5.1
Introducing CQ 5.1
 
Windows Azure Interoperability
Windows Azure InteroperabilityWindows Azure Interoperability
Windows Azure Interoperability
 
Apache CloudStack AlpesJUG
Apache CloudStack AlpesJUGApache CloudStack AlpesJUG
Apache CloudStack AlpesJUG
 
Building FOSS clouds
Building FOSS cloudsBuilding FOSS clouds
Building FOSS clouds
 
CloudStack for Java User Group
CloudStack for Java User GroupCloudStack for Java User Group
CloudStack for Java User Group
 

Plus de Bertrand Delacretaz

VanillaJS & the Web Platform, a match made in heaven?
VanillaJS & the Web Platform, a match made in heaven?VanillaJS & the Web Platform, a match made in heaven?
VanillaJS & the Web Platform, a match made in heaven?Bertrand Delacretaz
 
Surviving large online communities with conciseness and clarity
Surviving large online communities with conciseness and clarity Surviving large online communities with conciseness and clarity
Surviving large online communities with conciseness and clarity Bertrand Delacretaz
 
Repoinit: a mini-language for content repository initialization
Repoinit: a mini-language for content repository initializationRepoinit: a mini-language for content repository initialization
Repoinit: a mini-language for content repository initializationBertrand Delacretaz
 
The Moving House Model, adhocracy and remote collaboration
The Moving House Model, adhocracy and remote collaborationThe Moving House Model, adhocracy and remote collaboration
The Moving House Model, adhocracy and remote collaborationBertrand Delacretaz
 
GraphQL in Apache Sling - but isn't it the opposite of REST?
GraphQL in Apache Sling - but isn't it the opposite of REST?GraphQL in Apache Sling - but isn't it the opposite of REST?
GraphQL in Apache Sling - but isn't it the opposite of REST?Bertrand Delacretaz
 
How to convince your left brain (or manager) to follow the Open Source path t...
How to convince your left brain (or manager) to follow the Open Source path t...How to convince your left brain (or manager) to follow the Open Source path t...
How to convince your left brain (or manager) to follow the Open Source path t...Bertrand Delacretaz
 
L'Open Source change le Monde - BlendWebMix 2019
L'Open Source change le Monde - BlendWebMix 2019L'Open Source change le Monde - BlendWebMix 2019
L'Open Source change le Monde - BlendWebMix 2019Bertrand Delacretaz
 
Shared Neurons - the Secret Sauce of Open Source communities?
Shared Neurons - the Secret Sauce of Open Source communities?Shared Neurons - the Secret Sauce of Open Source communities?
Shared Neurons - the Secret Sauce of Open Source communities?Bertrand Delacretaz
 
Sling and Serverless, Best Friends Forever?
Sling and Serverless, Best Friends Forever?Sling and Serverless, Best Friends Forever?
Sling and Serverless, Best Friends Forever?Bertrand Delacretaz
 
Serverless - introduction et perspectives concrètes
Serverless - introduction et perspectives concrètesServerless - introduction et perspectives concrètes
Serverless - introduction et perspectives concrètesBertrand Delacretaz
 
State of the Feather - ApacheCon North America 2018
State of the Feather - ApacheCon North America 2018State of the Feather - ApacheCon North America 2018
State of the Feather - ApacheCon North America 2018Bertrand Delacretaz
 
Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?Bertrand Delacretaz
 
Open Source at Scale: the Apache Software Foundation (2018)
Open Source at Scale: the Apache Software Foundation (2018)Open Source at Scale: the Apache Software Foundation (2018)
Open Source at Scale: the Apache Software Foundation (2018)Bertrand Delacretaz
 
They don't understand me! Tales from the multi-cultural trenches
They don't understand me! Tales from the multi-cultural trenchesThey don't understand me! Tales from the multi-cultural trenches
They don't understand me! Tales from the multi-cultural trenchesBertrand Delacretaz
 
Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)
Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)
Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)Bertrand Delacretaz
 
Project and Community Services the Apache Way
Project and Community Services the Apache WayProject and Community Services the Apache Way
Project and Community Services the Apache WayBertrand Delacretaz
 
La Fondation Apache - keynote au Paris Open Source Summit 2017
La Fondation Apache - keynote au Paris Open Source Summit 2017La Fondation Apache - keynote au Paris Open Source Summit 2017
La Fondation Apache - keynote au Paris Open Source Summit 2017Bertrand Delacretaz
 
Asynchronous Decision Making - FOSS Backstage 2017
Asynchronous Decision Making - FOSS Backstage 2017Asynchronous Decision Making - FOSS Backstage 2017
Asynchronous Decision Making - FOSS Backstage 2017Bertrand Delacretaz
 
Building an Apache Sling Rendering Farm
Building an Apache Sling Rendering FarmBuilding an Apache Sling Rendering Farm
Building an Apache Sling Rendering FarmBertrand Delacretaz
 

Plus de Bertrand Delacretaz (20)

VanillaJS & the Web Platform, a match made in heaven?
VanillaJS & the Web Platform, a match made in heaven?VanillaJS & the Web Platform, a match made in heaven?
VanillaJS & the Web Platform, a match made in heaven?
 
Surviving large online communities with conciseness and clarity
Surviving large online communities with conciseness and clarity Surviving large online communities with conciseness and clarity
Surviving large online communities with conciseness and clarity
 
Repoinit: a mini-language for content repository initialization
Repoinit: a mini-language for content repository initializationRepoinit: a mini-language for content repository initialization
Repoinit: a mini-language for content repository initialization
 
The Moving House Model, adhocracy and remote collaboration
The Moving House Model, adhocracy and remote collaborationThe Moving House Model, adhocracy and remote collaboration
The Moving House Model, adhocracy and remote collaboration
 
GraphQL in Apache Sling - but isn't it the opposite of REST?
GraphQL in Apache Sling - but isn't it the opposite of REST?GraphQL in Apache Sling - but isn't it the opposite of REST?
GraphQL in Apache Sling - but isn't it the opposite of REST?
 
Open Source Changes the World!
Open Source Changes the World!Open Source Changes the World!
Open Source Changes the World!
 
How to convince your left brain (or manager) to follow the Open Source path t...
How to convince your left brain (or manager) to follow the Open Source path t...How to convince your left brain (or manager) to follow the Open Source path t...
How to convince your left brain (or manager) to follow the Open Source path t...
 
L'Open Source change le Monde - BlendWebMix 2019
L'Open Source change le Monde - BlendWebMix 2019L'Open Source change le Monde - BlendWebMix 2019
L'Open Source change le Monde - BlendWebMix 2019
 
Shared Neurons - the Secret Sauce of Open Source communities?
Shared Neurons - the Secret Sauce of Open Source communities?Shared Neurons - the Secret Sauce of Open Source communities?
Shared Neurons - the Secret Sauce of Open Source communities?
 
Sling and Serverless, Best Friends Forever?
Sling and Serverless, Best Friends Forever?Sling and Serverless, Best Friends Forever?
Sling and Serverless, Best Friends Forever?
 
Serverless - introduction et perspectives concrètes
Serverless - introduction et perspectives concrètesServerless - introduction et perspectives concrètes
Serverless - introduction et perspectives concrètes
 
State of the Feather - ApacheCon North America 2018
State of the Feather - ApacheCon North America 2018State of the Feather - ApacheCon North America 2018
State of the Feather - ApacheCon North America 2018
 
Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?
 
Open Source at Scale: the Apache Software Foundation (2018)
Open Source at Scale: the Apache Software Foundation (2018)Open Source at Scale: the Apache Software Foundation (2018)
Open Source at Scale: the Apache Software Foundation (2018)
 
They don't understand me! Tales from the multi-cultural trenches
They don't understand me! Tales from the multi-cultural trenchesThey don't understand me! Tales from the multi-cultural trenches
They don't understand me! Tales from the multi-cultural trenches
 
Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)
Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)
Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)
 
Project and Community Services the Apache Way
Project and Community Services the Apache WayProject and Community Services the Apache Way
Project and Community Services the Apache Way
 
La Fondation Apache - keynote au Paris Open Source Summit 2017
La Fondation Apache - keynote au Paris Open Source Summit 2017La Fondation Apache - keynote au Paris Open Source Summit 2017
La Fondation Apache - keynote au Paris Open Source Summit 2017
 
Asynchronous Decision Making - FOSS Backstage 2017
Asynchronous Decision Making - FOSS Backstage 2017Asynchronous Decision Making - FOSS Backstage 2017
Asynchronous Decision Making - FOSS Backstage 2017
 
Building an Apache Sling Rendering Farm
Building an Apache Sling Rendering FarmBuilding an Apache Sling Rendering Farm
Building an Apache Sling Rendering Farm
 

Dernier

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Dernier (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Taming Jcr With Sling

  • 1. Taming content repositories with Apache Sling Bertrand Delacrétaz, Senior R&D Developer Michael Marth, Technology Evangelist Day Software, www.day.com OpenExpo 2008, Winterthur, September 25th Slides revision: 2008-09-24 Slides design: David Nuescheler Technology Presentation 1 mercredi, 24 septembre 2008 1
  • 2. Taming Content Repositories Web Development The Web vs. JCR - Intro Blog in 15 minutes silve r So what? mercredi, 24 septembre 2008 2
  • 3. Intro to JCR JCR = Java Content Repository API JSR-170 / JSR283 - silve r Everything Is Content - and JCR manages it as trees of Nodes and Properties, using rich data types. mercredi, 24 septembre 2008 3
  • 4. What’s JCR? gpoJNTM `çåíÉåí=oÉéçëáíçêó=Ñçê= g~î~qj=íÉÅÜåçäçÖó=^mf péÉÅJiÉ~ÇW a~ó=pçÑíï~êÉ pí~íìëW= cáå~ä=oÉäÉ~ëÉ=NTJàìåJOMMR bñéÉêí=dêçìéW mercredi, 24 septembre 2008 4
  • 5. What’s JCR? gpoJNTM gpoJOUP `çåíÉåí=oÉéçëáíçêó=Ñçê= g~î~qj=íÉÅÜåçäçÖó=^mf=îOKM péÉÅJiÉ~ÇW a~ó=pçÑíï~êÉ pí~íìëW= mìÄäáÅ=oÉîáÉï=`äçëÉÇ=ëÉéJOMMT bñéÉêí=dêçìéW mercredi, 24 septembre 2008 5
  • 6. What’s JCR? “The API should be a standard, implementation independent, way to access content bi-directionally on a granular level to a content repository.” ? mercredi, 24 septembre 2008 6
  • 7. Best of both worlds. data base file s ys t e m hier- integ archi rity structu re es read streams tx write access query locking control multi- value un-structured obser- versioning “full-text” sort vation order content repo sit or y mercredi, 24 septembre 2008 7
  • 8. Known compliant Repositories * using third party connector * * Exo Microsoft Apache Jackrabbit Oracle XML DB ECMS Platform Sharepoint OpenText Livelink * Day CRX IBM FileNet P8 Xythos Repository Alfresco ECM Vignette V7 * * any ors ow mvendd? H S e Interwoven +hund DBMou ne R do y r s Repository IBM CM EMC Documentum regiede of TCKs st red mercredi, 24 septembre 2008 8
  • 9. Some known JCR Applications Fast BEA Portal Sun Oracle Portal Enterprise Search JBoss Portal Interface 21 OpenPortal Day Communique Spring Framework magnolia WCMS DAM Apache Sling Day Communique Alfresco ECMS Mindquarry Collab Collaboration Apache Tapestry QSLabs Apache Compliance Day Communiqué Cocoon WCMS IBM FileNet Artifactory medic-2-medic WebSiteManager Apache James Maven Proxy mapofmedicine Exo ECMS Platform TYPO3 GX WebManager v5.0 WCM InfoQ Hippo Liferay Nuxeo ECM Online Community CMS Enterprise Portal Jahia Sakai Percussion Framework E-learning Rhythmix QuickWCM Sourcemix WCMS Lutece Sourcemix mercredi, 24 septembre 2008 Portal 9
  • 10. JCR code excerpt Repository repository = new TransientRepository(); Session session = repository.login(...); / Create content / Node root = session.getRootNode(); Node hello = root.addNode(quot;helloquot;); Node world = hello.addNode(quot;worldquot;); world.setProperty(quot;messagequot;, quot;Hello, World!quot;); session.save(); / Retrieve content / Node node = root.getNode(quot;hello/worldquot;); print(node.getPath()); print(node.getProperty(quot;messagequot;).getString()); mercredi, 24 septembre 2008 10
  • 11. Sling builds on top of JCR Scriptable applications layer on top of JCR OSGi-based industrial-strength framework Simple, powerful, JCR inside Runs on Apache Jackrabbit by default http:/ /incubator.apache.org/sling mercredi, 24 septembre 2008 11
  • 12. REST over JCR REST -> Roy T. Fielding scheler JCR: David Nue 2005 rele a 1.0 r v ele ased sed y 162 p 2k +300 pages ages mercredi, 24 septembre 2008 12
  • 13. Reclaiming the web. Sling URL decomposition. /cars/audi/s4.details.html Content ...selects a Repository epository Path R particular scrip t mercredi, 24 septembre 2008 13
  • 14. Sling architecture HTTP debugger filesystem browser standard custom servlets WebDAV Sling OSGi servlets and components server console javascript resource servlet/script OSGi bundles JSR 223 JSP Ruby resolution resolution scripting OSGi framework Velocity etc.. (Apache Felix) OSGi webapp JSR-170 API JCR repository mercredi, 24 septembre 2008 14
  • 15. A Sling-based blog 282 lines of code 100% scripted, no tools required besides Sling Simple, modular code structure Promotes RESTful thinking mercredi, 24 septembre 2008 15
  • 16. Sling blog scripts admin.esp 56 lines - admin page (.admin.html) header.esp 7 lines - <head> generation (sling.include) html.esp 75 lines - html rendering of a post (.html) list.esp 60 lines - list of posts (.list.html) menu.esp 18 lines - home/admin/new (sling.include) post.esp 39 lines - “new post” page (.post.html) xml.esp 27 lines - RSS feed (.xml) TOTAL 282 lines (including whitespace/comments) mercredi, 24 septembre 2008 16
  • 17. Creating content (post.esp) <form method=quot;POSTquot; action=quot;/content/myblog/posts/*quot;> <p><label>Title</label> <input name=quot;titlequot; type=quot;textquot;/></p> <p><p><label>Body</label> <textarea name=quot;posttextquot; cols=quot;40quot; rows=quot;5quot;> <input name=quot;:redirectquot; type=quot;hiddenquot; value=quot;/content/myblog/posts.admin.htmlquot;/> <input type=quot;submitquot; value=quot;Postquot;> </form> mercredi, 24 septembre 2008 17
  • 18. Rendering content (html.esp) <html> <% sling.include(quot;/content/myblog.header.htmlquot;) %> <body> <h2> <%=currentNode.title %> </h2> <% var a = currentNode.getNode(quot;attachmentsquot;).getNodes() ; for(i in a) { var attachmentNode = a[i]; ... %> } </body> </html> mercredi, 24 septembre 2008 18
  • 19. Sling blog demo mercredi, 24 septembre 2008 19
  • 20. Can I have fries with that? How do we add functionality that is not easily scriptable? Example: thumbnails generated in Java code, by observing the repository for new files. mercredi, 24 septembre 2008 20
  • 21. JCR observation String[] nodeTypes = { quot;nt:filequot; }; boolean isDeep = true; observationManager.addEventListener( this, Event.NODE_ADDED | Event.NODE_REMOVED, quot;/content/myblog/postsquot;, isDeep, ...types); ... public void onEvent( EventIterator eventIterator) { ... } mercredi, 24 septembre 2008 21
  • 22. Thumbnails bundle demo mercredi, 24 septembre 2008 22
  • 23. Conclusions JCR rocks - and everything is content! Sling makes JCR easy and fun. A good JCR content model is key. Join the fun at incubator.apache.org/sling! mercredi, 24 septembre 2008 23