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
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
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
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
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