Top Banner
1 A JCR view of the world 1 juin 2012 14:18:09 http://localhost:4502/content/bb12.html a - jcr - node propertyA : Nodes have 0 . . N properties anotherProperty : Another value a - subfolder a - jcr - folder A JCR view of the world Everything is content, everything is a tree Bertrand Delacretaz , Senior Developer, Adobe CQ5 team. Apache Software Foundation member and (current) director @bdelacretaz - http://grep.codeconsult.ch Berlin Buzzwords 2012 Powered by Apache Sling (content and rendering) and deck.js (presentation)
16

A JCR view of the world: everything is content, everything is a tree!

May 12, 2015

Download

Technology

Slides of my Berlin Buzzwords 2012 talk: http://berlinbuzzwords.de/sessions/jcr-view-world-everything-content-everything-tree

This talk presents a number of real-world examples of how JCR tree structures are used to store content in heavy-duty content management systems such as Adobe CQ5. We'll describe a number of macro- and micro-tree structures that expose your content in a transparent, evolvable and self-documenting way.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: A JCR view of the world: everything is content, everything is a tree!

1A JCR view of the world

1 juin 2012 14:18:09http://localhost:4502/content/bb12.html

a-jcr-nodepropertyA : Nodes have 0..N propertiesanotherProperty : Another value

a-subfoldera-jcr-folder

A JCR view of the world

Everything is content, everything is a tree

Bertrand Delacretaz , Senior Developer, Adobe CQ5 team.Apache Software Foundation member and (current) director@bdelacretaz - http://grep.codeconsult.ch

Berlin Buzzwords 2012Powered by Apache Sling (content and rendering) and deck.js(presentation)

Page 2: A JCR view of the world: everything is content, everything is a tree!

2A JCR view of the world

1 juin 2012 14:18:09http://localhost:4502/content/bb12.html

JCR?

Java API for content repositories (JSR 283)

A big tree of nodes and properties.

Rich infrastructure for content-based applications.

Page 3: A JCR view of the world: everything is content, everything is a tree!

3A JCR view of the world

1 juin 2012 14:18:09http://localhost:4502/content/bb12.html

JCR Explorer

Java API for content repositories (JSR 283)

A big tree of nodes and properties.

Rich infrastructure for content-based applications.

Page 4: A JCR view of the world: everything is content, everything is a tree!

4A JCR view of the world

1 juin 2012 14:18:09http://localhost:4502/content/bb12.html

image_1.jpg

image_2.jpg

images

jcr:contentjcr:text : This is the text of the page.jcr:title : Title of my page

my-page

A basic website page

The jcr:content subnode will later act as a container for morecomplex content structures.

Page 5: A JCR view of the world: everything is content, everything is a tree!

5A JCR view of the world

1 juin 2012 14:18:09http://localhost:4502/content/bb12.html

block_1

block_2

content -blocks

original .jpg

first-image-212x43.jpg

first-image-512x83.jpg

renditions

first-image.jpgimages

jcr:contentjcr:title : Title of my page

/content /my-site/my-page

A more realistic page

Uses JCR observation to generate renditions when original image isuploaded.

The first-image node is a folder, not just a file. A "micro-tree" ofcontent.

Page 6: A JCR view of the world: everything is content, everything is a tree!

6A JCR view of the world

1 juin 2012 14:18:09http://localhost:4502/content/bb12.html

printjob _20120524 _1502incoming

done

printjob _20120524 _1458

canonMP640

Laserjet 5M

printers

printjob _20120524 _1458rejected

print-queue-example

A print queue

Jobs arrive under "incoming" and move under a printer's node whilethey are executed. Remember unix spooling?

The "rejected" folder holds jobs that could not be executed.

Page 7: A JCR view of the world: everything is content, everything is a tree!

7A JCR view of the world

1 juin 2012 14:18:09http://localhost:4502/content/bb12.html

www_geometrixx _desling:internalRedirect : /content /geometrixx /desling:match : www.geometrixx .de/$www_geometrixx _frsling:internalRedirect : /content /geometrixx /frsling:match : www.geometrixx .fr/$

/etc/map/http

Defining virtual hosts

Obvious, transparent...no explanation needed

Page 8: A JCR view of the world: everything is content, everything is a tree!

8A JCR view of the world

1 juin 2012 14:18:09http://localhost:4502/content/bb12.html

geometrixx _encontent

config

install

wcm/mobilelibs

installwcm/mobile

apps

virtual -hostsetc

compiled-scriptsvar

Adobe CQ5's content structure

Looks familiar?

Page 9: A JCR view of the world: everything is content, everything is a tree!

9A JCR view of the world

1 juin 2012 14:18:09http://localhost:4502/content/bb12.html

a-bundle .jar

sling.get.servlet .jar

install

o.a.sling.GET.configconfig

o.a.sling.logging .configconfig .dev

/apps/my-app

Code and configurations

Sling's JCR installer detects and installs bundles, configs and otherresources.

Scary? Extremely useful - with access controls of course.

Page 10: A JCR view of the world: everything is content, everything is a tree!

10A JCR view of the world

1 juin 2012 14:18:09http://localhost:4502/content/bb12.html

preconditions

transitions

state_1

preconditions

transitions

state_2

states

/etc/workflow/models/my-modeljcr:description : Please approve ...jcr:title : Content Approval

A workflow model

Useful JCR features: versioning, access control, observation, ...

Semi-generic editor is relatively easy to implement .

Page 11: A JCR view of the world: everything is content, everything is a tree!

11A JCR view of the world

1 juin 2012 14:18:09http://localhost:4502/content/bb12.html

wf_45f23cmodelPath : /etc/models/approve _contentwf_45f23d

day24

wf_6534efday25

month03year2012

year2011

/var/workflow/instances

Workflow instances

Under /var for distinct access control and lifecycle .

Purge old workflows? Delete year2011 folder.

Page 12: A JCR view of the world: everything is content, everything is a tree!

12A JCR view of the world

1 juin 2012 14:18:09http://localhost:4502/content/bb12.html

some_image.jpg

invalid .pdf

/var/public /incoming

image-to-check.jpg/var/assets /to-validate

validated _image.jpgmonth04

year2012/content /assets

other_invalid .pdf/var/readonly /rejected

Ingesting assets

Watch the incoming folder using JCR observation

Validate , accept and route assets based on content, filenames, etc.

Only incoming folder needs to be writable by users.

Page 13: A JCR view of the world: everything is content, everything is a tree!

13A JCR view of the world

1 juin 2012 14:18:09http://localhost:4502/content/bb12.html

order_b45627

order_f32136

confirmed -ordersprivate

order_c325421coffeeType : espressocupSize : tall

public

/content /slingbucks

Slingbucks sample: ordering coffee

Access control requirements for the private/public folders is obvious.

Orders move from public to private, as if passed over the counter(using JCR observation).

Page 14: A JCR view of the world: everything is content, everything is a tree!

14A JCR view of the world

1 juin 2012 14:18:09http://localhost:4502/content/bb12.html

capuccino

espresso

coffee -type

small

mediumprice_factor : 1.4name_fr : Moyennename_en : Medium

cup-type

/content /slingbucks

Slingbucks sample: coffee options

Options are defined in content, updates are dynamically applied.

Access control defines who can modify options.

Page 15: A JCR view of the world: everything is content, everything is a tree!

15A JCR view of the world

1 juin 2012 14:18:09http://localhost:4502/content/bb12.html

Thanks for your attention - I'm @bdelacretaz

Page 16: A JCR view of the world: everything is content, everything is a tree!

16A JCR view of the world

1 juin 2012 14:18:09http://localhost:4502/content/bb12.html