A JCR view of the world a-jcr-folder a-subfolder a-jcr-node - - PDF document

a jcr view of the world
SMART_READER_LITE
LIVE PREVIEW

A JCR view of the world a-jcr-folder a-subfolder a-jcr-node - - PDF document

A JCR view of the world 1 A JCR view of the world a-jcr-folder a-subfolder a-jcr-node propertyA : Nodes have 0..N properties anotherProperty : Another value Everything is content, everything is a tree Bertrand Delacretaz, Senior Developer,


slide-1
SLIDE 1

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)

slide-2
SLIDE 2

2 A JCR view of the world 1 juin 2012 14:18:09 http://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.

slide-3
SLIDE 3

3 A JCR view of the world 1 juin 2012 14:18:09 http://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.

slide-4
SLIDE 4

4 A JCR view of the world 1 juin 2012 14:18:09 http://localhost:4502/content/bb12.html

image_1.jpg image_2.jpg images jcr:content jcr: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 more complex content structures.

slide-5
SLIDE 5

5 A JCR view of the world 1 juin 2012 14:18:09 http://localhost:4502/content/bb12.html

block_1 block_2 content-blocks

  • riginal.jpg

first-image-212x43.jpg first-image-512x83.jpg renditions first-image.jpg images jcr:content jcr:title : Title of my page /content/my-site/my-page

A more realistic page

Uses JCR observation to generate renditions when original image is uploaded. The first-image node is a folder, not just a file. A "micro-tree" of content.

slide-6
SLIDE 6

6 A JCR view of the world 1 juin 2012 14:18:09 http://localhost:4502/content/bb12.html

printjob_20120524 _1502 incoming done printjob_20120524 _1458 canonMP640 Laserjet5M printers printjob_20120524 _1458 rejected print-queue-example

A print queue

Jobs arrive under "incoming" and move under a printer's node while they are executed. Remember unix spooling? The "rejected" folder holds jobs that could not be executed.

slide-7
SLIDE 7

7 A JCR view of the world 1 juin 2012 14:18:09 http://localhost:4502/content/bb12.html

www_geometrixx_de sling:internalRedirect : /content/geometrixx/de sling:match : www.geometrixx.de/$ www_geometrixx_fr sling:internalRedirect : /content/geometrixx/fr sling:match : www.geometrixx.fr/$ /etc/map/http

Defining virtual hosts

Obvious, transparent...no explanation needed

slide-8
SLIDE 8

8 A JCR view of the world 1 juin 2012 14:18:09 http://localhost:4502/content/bb12.html

geometrixx_en content config install wcm/mobile libs install wcm/mobile apps virtual-hosts etc compiled-scripts var

Adobe CQ5's content structure

Looks familiar?

slide-9
SLIDE 9

9 A JCR view of the world 1 juin 2012 14:18:09 http://localhost:4502/content/bb12.html

a-bundle.jar sling.get.servlet.jar install

  • .a.sling.GET.config

config

  • .a.sling.logging.config

config.dev /apps/my-app

Code and configurations

Sling's JCR installer detects and installs bundles, configs and other resources. Scary? Extremely useful - with access controls of course.

slide-10
SLIDE 10

10 A JCR view of the world 1 juin 2012 14:18:09 http://localhost:4502/content/bb12.html

preconditions transitions state_1 preconditions transitions state_2 states /etc/workflow/models/my-model jcr: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.

slide-11
SLIDE 11

11 A JCR view of the world 1 juin 2012 14:18:09 http://localhost:4502/content/bb12.html

wf_45f23c modelPath : /etc/models/approve_content wf_45f23d day24 wf_6534ef day25 month03 year2012 year2011 /var/workflow/instances

Workflow instances

Under /var for distinct access control and lifecycle. Purge old workflows? Delete year2011 folder.

slide-12
SLIDE 12

12 A JCR view of the world 1 juin 2012 14:18:09 http://localhost:4502/content/bb12.html

some_image.jpg invalid.pdf /var/public/incoming image-to-check.jpg /var/assets/to-validate validated_image.jpg month04 year2012 /content/assets

  • ther_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.

slide-13
SLIDE 13

13 A JCR view of the world 1 juin 2012 14:18:09 http://localhost:4502/content/bb12.html

  • rder_b45627
  • rder_f32136

confirmed-orders private

  • rder_c325421

coffeeType : espresso cupSize : 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).

slide-14
SLIDE 14

14 A JCR view of the world 1 juin 2012 14:18:09 http://localhost:4502/content/bb12.html

capuccino espresso coffee-type small medium price_factor : 1.4 name_fr : Moyenne name_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.

slide-15
SLIDE 15

15 A JCR view of the world 1 juin 2012 14:18:09 http://localhost:4502/content/bb12.html

Thanks for your attention - I'm @bdelacretaz

slide-16
SLIDE 16

16 A JCR view of the world 1 juin 2012 14:18:09 http://localhost:4502/content/bb12.html