SlideShare ist ein Scribd-Unternehmen logo
1 von 43
“Build your own CMS with Apache Sling”
             By Bob Paulin
          Paulin Solutions LLC
Independent
      Developer/Architect/Lead

            Focused on:
Web Centric Application Development
              Mobile
      Development Support
Stuff Sling doesn't give you
BYO...

Robust Login Security
XSS Protection
WYSIWYG Editors
The Problem:
I want to create a content driven website.
Lots of Options
STOP!

Do one of these meet all of my needs or are
      they just part of the solution?
Why not use a framework instead!

            SLING
What is Sling?
Best of Breed

Apache Felix (OSGi)
Apache Jackrabbit (JCR)
REST
Who's already using Sling?


       Adobe CQ 5
How does Sling Work?
Sling Post Servlet
         One stop shop for Content CRUD
http://sling.apache.org/site/manipulating-content-the-slingpostservlet-servletspost.html
Create/Modify
               curl -u admin:admin -Fmulti=one -Fmulti=two
                    http://localhost:8080/content/sample

                             Copy/Move
     curl -u admin:admin -F":operation=copy" -F":dest=/content/target"
                    http://localhost:8080/content/sample

                                 Delete
curl -u admin:admin -F":operation=delete" http://localhost:8080/content/target
Resource Resolution
How do I get what I want how I want it
     http://sling.apache.org/site/dispatching-requests.html

      http://sling.apache.org/site/url-decomposition.html
Method
             Resource Path
             Selectors
             Extension
             Suffix

POST /content/project/test.page.html/cool
HTML
/content/sample.html
JSON
/content/sample.json
XML
/content/sample.xml
JCR
What no tables?
Putting it all together
Everything is content.
   Configuration
       Scripts
       Assets
    Everything.
Other fun OOTB Stuff

Authentication (form based, openid)
Scheduling (Quartz)
Version Control (JCR)
Other JVM Languages (EcmaScript,
Groovy, Scala.....)
Lets do some CODING!!
Recipe
  JDK 1.6
  Eclipse
   Maven
Apache Sling
     Git
 Bootstrap
   jQuery
  ckeditor
Installing Sling

          1) Place JAR in Directory

             2) java -jar -Xmx1024m
            -XX:MaxPermSize=256m
-agentlib:jdwp=transport=dt_socket,address=30
            303,server=y,suspend=n
  org.apache.sling.launchpad-6-standalone.jar
Generate Project Archetypes

1) Create Parent POM
2) Create module sling-initial-content-archetype
Install a few bundles from extras

http://localhost:8080/system/console/bundles

     1) Sling Engine 2.2.4 (Bug Fix)
     2) JSTL libs
     3) Groovy
Create a Base Script

1) HTML boilerplate
2) Styles (bootstrap)
3) Any JavaScript
4) Test Content
Create a WYSIWYG Page

1) Import ckeditor JavaScript libs
2) Add JavaScript Include to head.jsp
3) Create new Script for content page
4) Add sling include to base script
5) Add content node to Home Page
Create a Build a New Page...Page

1) Create new Script
2) Add content node
3) Add to menu
Build an Image Upload Page

1) Create image upload script
2) Add content node
3) Add to menu
Making it Groovy!
(or Scala or Ruby or whatever
you're willing to implement with
            JSR 233)
Build a Menu that builds itself
                                    <%
          def resourceResolver = request.getResourceResolver();
def rootContent = resourceResolver.getResource("/content/slingdemo/home");

                                  %>
    <%
    rootContent.listChildren().each{ curRes ->
       if(curRes.isResourceType("slingdemo:base"))
       {
          def curPageNode = curRes.adaptTo(javax.jcr.Node);
          %>
          <li><a href="<%=curRes.getPath()%>.html"><%=
    curPageNode.getProperty("title").getString()%></a></li>
          <%
       }
    }
    %>
Make the Image Page Groovy
<%
    def resourceResolver = request.getResourceResolver();
    def rootContent =
resourceResolver.getResource("/content/slingdemo/assets/img");

%>

<%
        rootContent.listChildren().each{ curRes ->

%>
            <img src="<%= curRes.getPath()%>"/></br>
<%
            }
%>
References
                 https://github.com/bobpaulin/sling-cms-demo
                     http://sling.apache.org/site/index.html
http://dev.day.com/content/docs/en/cq/current/developing/sling_cheatsheet.html
Questions

 ??????
Thank You.

         Go forth and enjoy Sling

Email: bob@bobpaulin.com
Twitter: @bobpaulin
Linkedin: http://www.linkedin.com/in/bobpaulin
Blog: http://bobpaulin.com

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction à spring boot
Introduction à spring bootIntroduction à spring boot
Introduction à spring bootAntoine Rey
 
Apache Jackrabbit Oak - Scale your content repository to the cloud
Apache Jackrabbit Oak - Scale your content repository to the cloudApache Jackrabbit Oak - Scale your content repository to the cloud
Apache Jackrabbit Oak - Scale your content repository to the cloudRobert Munteanu
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootJosué Neis
 
Dynamic Components using Single-Page-Application Concepts in AEM/CQ
Dynamic Components using Single-Page-Application Concepts in AEM/CQDynamic Components using Single-Page-Application Concepts in AEM/CQ
Dynamic Components using Single-Page-Application Concepts in AEM/CQNetcetera
 
Apache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDBApache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDBMongoDB
 
/path/to/content - the Apache Jackrabbit content repository
/path/to/content - the Apache Jackrabbit content repository/path/to/content - the Apache Jackrabbit content repository
/path/to/content - the Apache Jackrabbit content repositoryJukka Zitting
 
ES6 presentation
ES6 presentationES6 presentation
ES6 presentationritika1
 
Sling models by Justin Edelson
Sling models by Justin Edelson Sling models by Justin Edelson
Sling models by Justin Edelson AEM HUB
 
JWT-spring-boot-avancer.pdf
JWT-spring-boot-avancer.pdfJWT-spring-boot-avancer.pdf
JWT-spring-boot-avancer.pdfJaouad Assabbour
 
ReactJS Tutorial For Beginners | ReactJS Redux Training For Beginners | React...
ReactJS Tutorial For Beginners | ReactJS Redux Training For Beginners | React...ReactJS Tutorial For Beginners | ReactJS Redux Training For Beginners | React...
ReactJS Tutorial For Beginners | ReactJS Redux Training For Beginners | React...Edureka!
 
Apache Sling : JCR, OSGi, Scripting and REST
Apache Sling : JCR, OSGi, Scripting and RESTApache Sling : JCR, OSGi, Scripting and REST
Apache Sling : JCR, OSGi, Scripting and RESTCarsten Ziegeler
 
JCR - Java Content Repositories
JCR - Java Content RepositoriesJCR - Java Content Repositories
JCR - Java Content RepositoriesCarsten Ziegeler
 
Formation Spring Avancé gratuite par Ippon 2014
Formation Spring Avancé gratuite par Ippon 2014Formation Spring Avancé gratuite par Ippon 2014
Formation Spring Avancé gratuite par Ippon 2014Ippon
 
Module design pattern i.e. express js
Module design pattern i.e. express jsModule design pattern i.e. express js
Module design pattern i.e. express jsAhmed Assaf
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API07.pallav
 

Was ist angesagt? (20)

Introduction à spring boot
Introduction à spring bootIntroduction à spring boot
Introduction à spring boot
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
 
Apache Jackrabbit Oak - Scale your content repository to the cloud
Apache Jackrabbit Oak - Scale your content repository to the cloudApache Jackrabbit Oak - Scale your content repository to the cloud
Apache Jackrabbit Oak - Scale your content repository to the cloud
 
Spring Boot Tutorial
Spring Boot TutorialSpring Boot Tutorial
Spring Boot Tutorial
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
 
Dynamic Components using Single-Page-Application Concepts in AEM/CQ
Dynamic Components using Single-Page-Application Concepts in AEM/CQDynamic Components using Single-Page-Application Concepts in AEM/CQ
Dynamic Components using Single-Page-Application Concepts in AEM/CQ
 
Apache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDBApache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDB
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
/path/to/content - the Apache Jackrabbit content repository
/path/to/content - the Apache Jackrabbit content repository/path/to/content - the Apache Jackrabbit content repository
/path/to/content - the Apache Jackrabbit content repository
 
ES6 presentation
ES6 presentationES6 presentation
ES6 presentation
 
Sling models by Justin Edelson
Sling models by Justin Edelson Sling models by Justin Edelson
Sling models by Justin Edelson
 
JWT-spring-boot-avancer.pdf
JWT-spring-boot-avancer.pdfJWT-spring-boot-avancer.pdf
JWT-spring-boot-avancer.pdf
 
ReactJS Tutorial For Beginners | ReactJS Redux Training For Beginners | React...
ReactJS Tutorial For Beginners | ReactJS Redux Training For Beginners | React...ReactJS Tutorial For Beginners | ReactJS Redux Training For Beginners | React...
ReactJS Tutorial For Beginners | ReactJS Redux Training For Beginners | React...
 
Workshop 21: React Router
Workshop 21: React RouterWorkshop 21: React Router
Workshop 21: React Router
 
Apache Sling : JCR, OSGi, Scripting and REST
Apache Sling : JCR, OSGi, Scripting and RESTApache Sling : JCR, OSGi, Scripting and REST
Apache Sling : JCR, OSGi, Scripting and REST
 
JCR - Java Content Repositories
JCR - Java Content RepositoriesJCR - Java Content Repositories
JCR - Java Content Repositories
 
Formation Spring Avancé gratuite par Ippon 2014
Formation Spring Avancé gratuite par Ippon 2014Formation Spring Avancé gratuite par Ippon 2014
Formation Spring Avancé gratuite par Ippon 2014
 
Module design pattern i.e. express js
Module design pattern i.e. express jsModule design pattern i.e. express js
Module design pattern i.e. express js
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
 

Andere mochten auch

Effective Web Application Development with Apache Sling
Effective Web Application Development with Apache SlingEffective Web Application Development with Apache Sling
Effective Web Application Development with Apache SlingRobert Munteanu
 
Apache Sling as a Microservices Gateway
Apache Sling as a Microservices GatewayApache Sling as a Microservices Gateway
Apache Sling as a Microservices GatewayRobert Munteanu
 
Rapid RESTful Web Applications with Apache Sling and Jackrabbit
Rapid RESTful Web Applications with Apache Sling and JackrabbitRapid RESTful Web Applications with Apache Sling and Jackrabbit
Rapid RESTful Web Applications with Apache Sling and JackrabbitCraig Dickson
 
Rapid JCR applications development with Sling
Rapid JCR applications development with SlingRapid JCR applications development with Sling
Rapid JCR applications development with SlingBertrand Delacretaz
 
RESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 versionRESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 versionBertrand Delacretaz
 
Hippo get together workshop automatic export
Hippo get together   workshop automatic exportHippo get together   workshop automatic export
Hippo get together workshop automatic exportHippo
 
JCR In Action (ApacheCon US 2009)
JCR In Action (ApacheCon US 2009)JCR In Action (ApacheCon US 2009)
JCR In Action (ApacheCon US 2009)Carsten Ziegeler
 
Web Applications Development
Web Applications DevelopmentWeb Applications Development
Web Applications Developmentriround
 
Introducing Apricot, The Eclipse Content Management Platform
Introducing Apricot, The Eclipse Content Management PlatformIntroducing Apricot, The Eclipse Content Management Platform
Introducing Apricot, The Eclipse Content Management PlatformNuxeo
 
The Java Content Repository
The Java Content RepositoryThe Java Content Repository
The Java Content Repositorynobby
 
App and web with Hippo CMS and AngularJS
App and web with Hippo CMS and AngularJS App and web with Hippo CMS and AngularJS
App and web with Hippo CMS and AngularJS Peter Broekroelofs
 
Cms integration of apache solr how we did it.
Cms integration of apache solr   how we did it.Cms integration of apache solr   how we did it.
Cms integration of apache solr how we did it.lucenerevolution
 

Andere mochten auch (20)

Effective Web Application Development with Apache Sling
Effective Web Application Development with Apache SlingEffective Web Application Development with Apache Sling
Effective Web Application Development with Apache Sling
 
JCR and Sling Quick Dive
JCR and Sling Quick DiveJCR and Sling Quick Dive
JCR and Sling Quick Dive
 
Apache Sling as a Microservices Gateway
Apache Sling as a Microservices GatewayApache Sling as a Microservices Gateway
Apache Sling as a Microservices Gateway
 
Rapid RESTful Web Applications with Apache Sling and Jackrabbit
Rapid RESTful Web Applications with Apache Sling and JackrabbitRapid RESTful Web Applications with Apache Sling and Jackrabbit
Rapid RESTful Web Applications with Apache Sling and Jackrabbit
 
Rapid JCR applications development with Sling
Rapid JCR applications development with SlingRapid JCR applications development with Sling
Rapid JCR applications development with Sling
 
Introduction to JCR
Introduction to JCR Introduction to JCR
Introduction to JCR
 
JCR In 10 Minutes
JCR In 10 MinutesJCR In 10 Minutes
JCR In 10 Minutes
 
RESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 versionRESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 version
 
Hippo Presentation Jboye Study tour
Hippo Presentation Jboye Study tourHippo Presentation Jboye Study tour
Hippo Presentation Jboye Study tour
 
Hippo CMS at OpenCo Amsterdam 2014
Hippo CMS at OpenCo Amsterdam 2014Hippo CMS at OpenCo Amsterdam 2014
Hippo CMS at OpenCo Amsterdam 2014
 
Hippo get together workshop automatic export
Hippo get together   workshop automatic exportHippo get together   workshop automatic export
Hippo get together workshop automatic export
 
JCR In Action (ApacheCon US 2009)
JCR In Action (ApacheCon US 2009)JCR In Action (ApacheCon US 2009)
JCR In Action (ApacheCon US 2009)
 
Web Applications Development
Web Applications DevelopmentWeb Applications Development
Web Applications Development
 
What's new in JSR-283?
What's new in JSR-283?What's new in JSR-283?
What's new in JSR-283?
 
2008-12 OJUG JCR Demo
2008-12 OJUG JCR Demo2008-12 OJUG JCR Demo
2008-12 OJUG JCR Demo
 
Introducing Apricot, The Eclipse Content Management Platform
Introducing Apricot, The Eclipse Content Management PlatformIntroducing Apricot, The Eclipse Content Management Platform
Introducing Apricot, The Eclipse Content Management Platform
 
The Java Content Repository
The Java Content RepositoryThe Java Content Repository
The Java Content Repository
 
App and web with Hippo CMS and AngularJS
App and web with Hippo CMS and AngularJS App and web with Hippo CMS and AngularJS
App and web with Hippo CMS and AngularJS
 
JCR and ModeShape
JCR and ModeShapeJCR and ModeShape
JCR and ModeShape
 
Cms integration of apache solr how we did it.
Cms integration of apache solr   how we did it.Cms integration of apache solr   how we did it.
Cms integration of apache solr how we did it.
 

Ähnlich wie Build Your Own CMS with Apache Sling

JavaScript performance patterns
JavaScript performance patternsJavaScript performance patterns
JavaScript performance patternsStoyan Stefanov
 
JavaScript Performance Patterns
JavaScript Performance PatternsJavaScript Performance Patterns
JavaScript Performance PatternsStoyan Stefanov
 
Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Google I/O 2012 - Protecting your user experience while integrating 3rd party...Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Google I/O 2012 - Protecting your user experience while integrating 3rd party...Patrick Meenan
 
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...tdc-globalcode
 
Attractive HTML5~開発者の視点から~
Attractive HTML5~開発者の視点から~Attractive HTML5~開発者の視点から~
Attractive HTML5~開発者の視点から~Sho Ito
 
Writing your Third Plugin
Writing your Third PluginWriting your Third Plugin
Writing your Third PluginJustin Ryan
 
JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)Steve Souders
 
JavaScript Perfomance
JavaScript PerfomanceJavaScript Perfomance
JavaScript PerfomanceAnatol Alizar
 
The new static resources framework
The new static resources frameworkThe new static resources framework
The new static resources frameworkmarcplmer
 
"Your script just killed my site" by Steve Souders
"Your script just killed my site" by Steve Souders"Your script just killed my site" by Steve Souders
"Your script just killed my site" by Steve SoudersDmitry Makarchuk
 
AFUP Lorraine - Symfony Webpack Encore
AFUP Lorraine - Symfony Webpack EncoreAFUP Lorraine - Symfony Webpack Encore
AFUP Lorraine - Symfony Webpack EncoreEngineor
 
Modular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSModular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSGunnar Hillert
 
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングscalaconfjp
 
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Ngoc Dao
 
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com RubyFisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com RubyFabio Akita
 
BP-6 Repository Customization Best Practices
BP-6 Repository Customization Best PracticesBP-6 Repository Customization Best Practices
BP-6 Repository Customization Best PracticesAlfresco Software
 

Ähnlich wie Build Your Own CMS with Apache Sling (20)

JavaScript performance patterns
JavaScript performance patternsJavaScript performance patterns
JavaScript performance patterns
 
Sanjeev ghai 12
Sanjeev ghai 12Sanjeev ghai 12
Sanjeev ghai 12
 
JavaScript Performance Patterns
JavaScript Performance PatternsJavaScript Performance Patterns
JavaScript Performance Patterns
 
Taking your Web App for a walk
Taking your Web App for a walkTaking your Web App for a walk
Taking your Web App for a walk
 
Webpack
Webpack Webpack
Webpack
 
Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Google I/O 2012 - Protecting your user experience while integrating 3rd party...Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Google I/O 2012 - Protecting your user experience while integrating 3rd party...
 
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
 
Attractive HTML5~開発者の視点から~
Attractive HTML5~開発者の視点から~Attractive HTML5~開発者の視点から~
Attractive HTML5~開発者の視点から~
 
Web-Performance
Web-PerformanceWeb-Performance
Web-Performance
 
Writing your Third Plugin
Writing your Third PluginWriting your Third Plugin
Writing your Third Plugin
 
JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)
 
JavaScript Perfomance
JavaScript PerfomanceJavaScript Perfomance
JavaScript Perfomance
 
The new static resources framework
The new static resources frameworkThe new static resources framework
The new static resources framework
 
"Your script just killed my site" by Steve Souders
"Your script just killed my site" by Steve Souders"Your script just killed my site" by Steve Souders
"Your script just killed my site" by Steve Souders
 
AFUP Lorraine - Symfony Webpack Encore
AFUP Lorraine - Symfony Webpack EncoreAFUP Lorraine - Symfony Webpack Encore
AFUP Lorraine - Symfony Webpack Encore
 
Modular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSModular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJS
 
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
 
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014
 
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com RubyFisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
 
BP-6 Repository Customization Best Practices
BP-6 Repository Customization Best PracticesBP-6 Repository Customization Best Practices
BP-6 Repository Customization Best Practices
 

Mehr von Bob Paulin

Fundraising At Apache
Fundraising At ApacheFundraising At Apache
Fundraising At ApacheBob Paulin
 
Open Development When You're Not in Charge
Open Development When You're Not in ChargeOpen Development When You're Not in Charge
Open Development When You're Not in ChargeBob Paulin
 
Apache When You're Not in Charge
Apache When You're Not in ChargeApache When You're Not in Charge
Apache When You're Not in ChargeBob Paulin
 
Modular Open Source in Java for Now and Later
Modular Open Source in Java for Now and LaterModular Open Source in Java for Now and Later
Modular Open Source in Java for Now and LaterBob Paulin
 
Microservice Networking in Anger
Microservice Networking in AngerMicroservice Networking in Anger
Microservice Networking in AngerBob Paulin
 
User Groups: The Gateway to Apache
User Groups: The Gateway to ApacheUser Groups: The Gateway to Apache
User Groups: The Gateway to ApacheBob Paulin
 
What's My Modularity
What's My ModularityWhat's My Modularity
What's My ModularityBob Paulin
 
Do more with LESS, Handlebars, Coffeescript and other Web Resources in AEM
Do more with LESS, Handlebars, Coffeescript and other Web Resources in AEMDo more with LESS, Handlebars, Coffeescript and other Web Resources in AEM
Do more with LESS, Handlebars, Coffeescript and other Web Resources in AEMBob Paulin
 
Adding Modularity Afterward with Embedded OSGi
Adding Modularity Afterward with Embedded OSGiAdding Modularity Afterward with Embedded OSGi
Adding Modularity Afterward with Embedded OSGiBob Paulin
 
Continuous delivery with Gradle
Continuous delivery with GradleContinuous delivery with Gradle
Continuous delivery with GradleBob Paulin
 
Frontend 'vs' Backend Getting the Right Mix
Frontend 'vs' Backend   Getting the Right MixFrontend 'vs' Backend   Getting the Right Mix
Frontend 'vs' Backend Getting the Right MixBob Paulin
 
Code Quality Practice and Tools
Code Quality Practice and ToolsCode Quality Practice and Tools
Code Quality Practice and ToolsBob Paulin
 

Mehr von Bob Paulin (12)

Fundraising At Apache
Fundraising At ApacheFundraising At Apache
Fundraising At Apache
 
Open Development When You're Not in Charge
Open Development When You're Not in ChargeOpen Development When You're Not in Charge
Open Development When You're Not in Charge
 
Apache When You're Not in Charge
Apache When You're Not in ChargeApache When You're Not in Charge
Apache When You're Not in Charge
 
Modular Open Source in Java for Now and Later
Modular Open Source in Java for Now and LaterModular Open Source in Java for Now and Later
Modular Open Source in Java for Now and Later
 
Microservice Networking in Anger
Microservice Networking in AngerMicroservice Networking in Anger
Microservice Networking in Anger
 
User Groups: The Gateway to Apache
User Groups: The Gateway to ApacheUser Groups: The Gateway to Apache
User Groups: The Gateway to Apache
 
What's My Modularity
What's My ModularityWhat's My Modularity
What's My Modularity
 
Do more with LESS, Handlebars, Coffeescript and other Web Resources in AEM
Do more with LESS, Handlebars, Coffeescript and other Web Resources in AEMDo more with LESS, Handlebars, Coffeescript and other Web Resources in AEM
Do more with LESS, Handlebars, Coffeescript and other Web Resources in AEM
 
Adding Modularity Afterward with Embedded OSGi
Adding Modularity Afterward with Embedded OSGiAdding Modularity Afterward with Embedded OSGi
Adding Modularity Afterward with Embedded OSGi
 
Continuous delivery with Gradle
Continuous delivery with GradleContinuous delivery with Gradle
Continuous delivery with Gradle
 
Frontend 'vs' Backend Getting the Right Mix
Frontend 'vs' Backend   Getting the Right MixFrontend 'vs' Backend   Getting the Right Mix
Frontend 'vs' Backend Getting the Right Mix
 
Code Quality Practice and Tools
Code Quality Practice and ToolsCode Quality Practice and Tools
Code Quality Practice and Tools
 

Kürzlich hochgeladen

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
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
 
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 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
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...Martijn de Jong
 
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
 
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 DevelopmentsTrustArc
 
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
 
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
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
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...apidays
 
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.pdfsudhanshuwaghmare1
 

Kürzlich hochgeladen (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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...
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
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...
 
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
 
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
 
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...
 
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
 
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...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
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...
 
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
 

Build Your Own CMS with Apache Sling

  • 1. “Build your own CMS with Apache Sling” By Bob Paulin Paulin Solutions LLC
  • 2. Independent Developer/Architect/Lead Focused on: Web Centric Application Development Mobile Development Support
  • 3. Stuff Sling doesn't give you BYO... Robust Login Security XSS Protection WYSIWYG Editors
  • 4. The Problem: I want to create a content driven website.
  • 6. STOP! Do one of these meet all of my needs or are they just part of the solution?
  • 7. Why not use a framework instead! SLING
  • 9. Best of Breed Apache Felix (OSGi) Apache Jackrabbit (JCR) REST
  • 10. Who's already using Sling? Adobe CQ 5
  • 11. How does Sling Work?
  • 12. Sling Post Servlet One stop shop for Content CRUD http://sling.apache.org/site/manipulating-content-the-slingpostservlet-servletspost.html
  • 13. Create/Modify curl -u admin:admin -Fmulti=one -Fmulti=two http://localhost:8080/content/sample Copy/Move curl -u admin:admin -F":operation=copy" -F":dest=/content/target" http://localhost:8080/content/sample Delete curl -u admin:admin -F":operation=delete" http://localhost:8080/content/target
  • 14. Resource Resolution How do I get what I want how I want it http://sling.apache.org/site/dispatching-requests.html http://sling.apache.org/site/url-decomposition.html
  • 15. Method Resource Path Selectors Extension Suffix POST /content/project/test.page.html/cool
  • 20.
  • 21. Putting it all together
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27. Everything is content. Configuration Scripts Assets Everything.
  • 28. Other fun OOTB Stuff Authentication (form based, openid) Scheduling (Quartz) Version Control (JCR) Other JVM Languages (EcmaScript, Groovy, Scala.....)
  • 29. Lets do some CODING!!
  • 30. Recipe JDK 1.6 Eclipse Maven Apache Sling Git Bootstrap jQuery ckeditor
  • 31. Installing Sling 1) Place JAR in Directory 2) java -jar -Xmx1024m -XX:MaxPermSize=256m -agentlib:jdwp=transport=dt_socket,address=30 303,server=y,suspend=n org.apache.sling.launchpad-6-standalone.jar
  • 32. Generate Project Archetypes 1) Create Parent POM 2) Create module sling-initial-content-archetype
  • 33. Install a few bundles from extras http://localhost:8080/system/console/bundles 1) Sling Engine 2.2.4 (Bug Fix) 2) JSTL libs 3) Groovy
  • 34. Create a Base Script 1) HTML boilerplate 2) Styles (bootstrap) 3) Any JavaScript 4) Test Content
  • 35. Create a WYSIWYG Page 1) Import ckeditor JavaScript libs 2) Add JavaScript Include to head.jsp 3) Create new Script for content page 4) Add sling include to base script 5) Add content node to Home Page
  • 36. Create a Build a New Page...Page 1) Create new Script 2) Add content node 3) Add to menu
  • 37. Build an Image Upload Page 1) Create image upload script 2) Add content node 3) Add to menu
  • 38. Making it Groovy! (or Scala or Ruby or whatever you're willing to implement with JSR 233)
  • 39. Build a Menu that builds itself <% def resourceResolver = request.getResourceResolver(); def rootContent = resourceResolver.getResource("/content/slingdemo/home"); %> <% rootContent.listChildren().each{ curRes -> if(curRes.isResourceType("slingdemo:base")) { def curPageNode = curRes.adaptTo(javax.jcr.Node); %> <li><a href="<%=curRes.getPath()%>.html"><%= curPageNode.getProperty("title").getString()%></a></li> <% } } %>
  • 40. Make the Image Page Groovy <% def resourceResolver = request.getResourceResolver(); def rootContent = resourceResolver.getResource("/content/slingdemo/assets/img"); %> <% rootContent.listChildren().each{ curRes -> %> <img src="<%= curRes.getPath()%>"/></br> <% } %>
  • 41. References https://github.com/bobpaulin/sling-cms-demo http://sling.apache.org/site/index.html http://dev.day.com/content/docs/en/cq/current/developing/sling_cheatsheet.html
  • 43. Thank You. Go forth and enjoy Sling Email: bob@bobpaulin.com Twitter: @bobpaulin Linkedin: http://www.linkedin.com/in/bobpaulin Blog: http://bobpaulin.com

Hinweis der Redaktion

  1. Sell yourself I write code I do design/architecture I lead teams I make development teams better.
  2. And that&apos;s a good thing because these are often things that we want to define.
  3. I want to build a website that people can go to and enter content. Without training, intuitive
  4. Lots of product options. Each has it&apos;s benefits Many can be stood up quickly out of the box. But what if I want to customize?
  5. Wait you just said the C word Customizing a product can be death by 1000 cuts depending on what you&apos;re doing.
  6. Frameworks offer a middle ground. They solve a problem but still grant you the flexibility to customize.
  7. So lets talk about sling
  8. Combination of open source projects to make content driven sites easier.
  9. Kind of a chicken or egg thing here. David Neuschler of Day Software created the JSR for JCR. They build Day CQ. Then donated the Sling framework to Apache. A number of Day (now Adobe) employees still run the community for it.
  10. Very different mind set than your typical Web App. Content not MVC runs the show.
  11. So Sling is RESTful by design HTTP request to get data in and out GET - retrieve POST – Create/Modify
  12. Run simple curl commands Note we&apos;re creating a multi value field Display the urls through curl
  13. The most sophisticated part of the system. And the hardest to learn. But once you get it. Some incredibly hard problems become easy.
  14. Resource Path – just like your typical web app. Where to retrieve information from. Selectors – Identifies specific content and acts as a parameter passer. Great for SEO. Extention – helps identify the script we&apos;re running. Suffix – a second path that is useful to identify additional content.
  15. Note that the multi field is missing. A Bug? Maybe I should submit a jira :).
  16. JCR is the persistence for sling. Underlying it is a file system or a Database. Can run on several Dbs. OOTB it&apos;s HSQL.
  17. Eclipse provides a plugin to view and do some simple JCR modifications. One way to administer. Also could use WebDav to move files. Or maven or json/xml with sling.
  18. Lets trace what a homepage request will look like in our soon to be live CMS.
  19. Here is the structure Bot extend the JCR root Apps directory contains scripts: JSP, GSP, ESP.. could be more. Content directory contains content nodes.
  20. Request comes into sling and resolves to a node. That node looks at it&apos;s type then tries to resolve a script
  21. That type searches the apps directory (also could go to the libs directory) Once it gets to the folder it wants then it tries to resolve to a script using selectors and extentions. Script executes but wait theirs a sling include tag
  22. Ok we&apos;re looking for a node content that&apos;s a child of the node we asked for. Child also then resolves it&apos;s type
  23. Back to the script directory Selectors and extensions are once again used. If none are provided they are inherited from the parent. Page returns.
  24. It&apos;s a polygot programmers playground