CQ5 Sling

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

cq5 and Sling overview

Bertrand Delacrtaz Senior Developer, R&D, Day Software, www.day.com Apache Software Foundation Member
http://grep.codeconsult.ch - twitter: @bdelacretaz - bdelacretaz@apache.org Logica Geneva monthly developer meeting, February 2010 slides revision: 2010-02-25

CQ5 and Sling overview

1
Bertrand Delacrtaz

Basel, Switzerland headquarters (~80 people, ~150 worldwide) Munich London Newport Beach, CA Toronto
Day allows us to quickly and reliably deliver content to our entire McFamily, helping us to be exible and drive new opportunities. Steve Wilson, Senior Director of Web Communications, McDonalds
Swiss open source award / business / 2008

content-centric products

www.day.com
2001
2001

(everything is content)

note the 3-letter domain name: weve been doing this for a while... Strong ties to the Apache Software Foundation

2009 Survived tough times (SWX:DAYN) Roy T. Fielding and David Nuescheler, Mr. REST and Mr. JCR

What
is cq5?
content management system everything is content no database? No SQL?

digital assets
JCR repository

OSGi applications framework


Marketing dept. loves IT dept.?

fun to use

CQ5 and Sling overview

cq5: welcome

cq5: content tree

cq5: page editing

cq5: visual workow

cq5: multivariate testing


User provides 3 (N) possible banner designs (drag & drop)

cq5 provides statistics on impressions and clickthrough rates -> helps selecting the best banner.

cq5: zero-install IDE

content
structures
no database? No SQL?

everything is content

JCR repository

CQ5 and Sling overview

geometrixx page content


/content /geometrixx /en /company /jcr:content /par /title

blog design content

/etc/designs/blog/kubrick/jcr:content

code content!
/libs /cq /code /install /xyz.jar

dynamic java modules (OSGi)

Apache Sling
Apache Software Foundation

script == servlet

open source open development


OSGi-based

Applications layer for JCR repositories

HTTP

debugger

lesystem

browser

content administration UI standard servlets resource resolution custom servlets and components servlet/script resolution JSR 223 scripting WebDAV server Sling OSGi console

javascript JSP Ruby Velocity etc..

Apache Sling framework

OSGi framework (Apache Felix) JSR-170 API JCR content repository

CQ5/Sling architecture

storage components

HTTP

debugger

lesystem

browser

content administration UI standard servlets resource resolution custom servlets and components servlet/script resolution JSR 223 scripting WebDAV server Sling OSGi console

javascript JSP Ruby Velocity etc..

OSGi framework (Apache Felix) JSR-170 API JCR repository

open source? you bet!

storage components

OSGi?
OSGi is great for modularity Fosters better structured code Dynamic services and plugins Tooling needs to improve, but usable OSGi skills? - OSGi way of thinking is new... Asynchronous startup can be problematic if using declarative services
CQ5 and Sling overview
Bertrand Delacrtaz

Sling blog
46 lines of code

Sling POST servlet


# POST to Sling curl -F title=hi http://localhost:8888/foo -> 200 OK # GET created node in json format curl http://localhost:8888/foo.tidy.json { "jcr:primaryType": "nt:unstructured", "title": "hi" } POST ters se t e param operties node pr CQ5 and Sling overview
20
Bertrand Delacrtaz

blog step 1: create content


<form method="POST"> Title: <input type="text" name="title"/> Text: <textarea name="text"></textarea> <input type="submit" value="save"/> <input type="hidden" name=":redirect" value="*"/> </form> CQ5 and Sling overview

s d l e i f Form e h t e v i r d el d o m t conten

21
Bertrand Delacrtaz

blog step 2: retrieve content


<script src="/system/sling.js"></script> <form method="POST"> ...(as in step 1)... </form> <!-- set form fields to current node values --> <script>Sling.wizard();</script>

) D ( U R C t Instan
CQ5 and Sling overview
22
Bertrand Delacrtaz

blog step 3: navigation


<ul> <li> <a href="/content/blog/*">[Create post]</a> </li> <script> var posts = Sling.getContent("/content/blog", 2); for(var post in posts) { document.write( "<li><a href= + post + "'>" + posts[post].title + "</a></li>"); } </script> </ul>

CQ5 and Sling overview

23
Bertrand Delacrtaz

weve got a blog!


html form + Sling wizard() + Sling.getContent()

more info?
www.day.com/cq5 www.day.com/crx (free download) sling.apache.org jackrabbit.apache.org felix.apache.org slideshare.net/bdelacretaz
CQ5 and Sling overview
Bertrand Delacrtaz

This slide deck is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3 license. Copyright (C) 2010, Bertrand Delacretaz

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy