862
Transcript of 862
![Page 1: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/1.jpg)
Content Management with Apache Jackrabbit
Jukka Zitt ing
Day Software
(862)
![Page 2: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/2.jpg)
2
Overview
What to expect
> Apache Jackrabbit
> JCR content modeling
> Best practices
> Things to watch for
> Engineering perspective
What not to expect
> Source code
> Live demo
> Business perspective
> Management perspective
![Page 3: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/3.jpg)
3
Agenda
> Apache Jackrabbit
> Basic content modeling
> References and search
> Advanced features
> Summary and questions
![Page 4: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/4.jpg)
4
Apache Jackrabbit
> JSR 170 reference implementation
> Apache TLP since 2006
> Looking back
– 1.0: April 2006
– 1.1: October 2006
– 1.2: January 2007
– 1.3: April 2007
> Looking forward (tentative)
– 1.4: 2007
– 2.0: 2008 (JCR 2.0 RI)
> Components
– Core, API, RMI, WebDAV, webapp, JCA, …
http:/ / jackrabbit.apache.org/
![Page 5: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/5.jpg)
5
Apache Jackrabbit: Words of advice
> Read (or browse) the JCR specif icat ion
– jcr- 1.0.jar included
> Gett ing started with Jackrabbit
– jackrabbit- webapp: Drop- in deployment
– First Hops: Embedded repository
– Take your t ime
> Resources
– Mailing lists: Excellent support, but may delay you
– Website: Some good parts, but not complete or very well structured
– Wiki: End user experience (especially for JBoss)
– FAQ: outdated
– Issue tracker: Good response t ime
![Page 6: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/6.jpg)
6
Agenda
> Apache Jackrabbit
> Basic content modeling
> References and search
> Advanced features
> Summary and questions
![Page 7: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/7.jpg)
7
Introducing JCR Tunes
> JCR example application
– “How to implement a music store or library with JCR?”
– Designed to showcase JCR features and best practices
– JCR book in progress
> Store and manage individual “tunes”, optionally organized in albums, etc.
> Support alternative views like predefined genres, or more ad- hoc searches
> Integrated handling of reviews, cover images, and other related content
> Staged publishing and t imed releases of tunes or albums
> Personalization for things like sett ings, favorites, personal play- lists, etc.
> Extensibility and flexibility
![Page 8: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/8.jpg)
8
Starting point: Leverage the standard node types
Type hierarchy Content hierarchy
nt:hierarchyNode
nt:folder
nt:file
nt:linkedFile
nt:resource
![Page 9: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/9.jpg)
9
Bottom- up modeling: Content types
my:resource > nt:resource- codec (string)- bitrate (long)
my:tune > nt:f ile- artist (string)- release date (date)
my:album > nt:folder- artist (string)- release date (date)
my:review > nt:f ile- author (string)- star rating (long)
![Page 10: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/10.jpg)
10
Top- down modeling: Content hierarchies
Album
Images
Tune
Band
Label Label
Tune
Album
Reviews
Label
Band
Reviews TuneImages
![Page 11: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/11.jpg)
11
Content Modeling: Words of advice
> Namespaces
– Use a single namespace per company or application
– Use a reasonably unique namespace prefix
– Prefixed names for structured content
– Default namespace for unstructured content
> Use an application root node, / my:content
– Good for searching, backup, and migration
> Avoid flat hierarchies
– User interface complexity
– Jackrabbit performance
> Content- driven design
– Design your content before your application
![Page 12: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/12.jpg)
12
Agenda
> Apache Jackrabbit
> Basic content modeling
> References and search
> Advanced features
> Summary and questions
![Page 13: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/13.jpg)
13
Alternative Views: References
Rock
tags tunes
Tune
Tune
Classic Top 10
playlists
Picks
linklinklink
![Page 14: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/14.jpg)
14
Alternative Views: Search
SELECT * FROM my:review
WHERE
jcr:path LIKE ‘ / my:tunes/ %’
AND CONTAINS(*,‘…’)
/ jcr:root/ my:tunes/ / element(*,my:review)
/ jcr:content[jcr:contains(.,’…’)]
Reviews with keywords
SELECT * FROM my:tune
WHERE
jcr:path LIKE ‘ / my:tunes/ %’
AND released > DATE ‘…’
/ jcr:root/ my:tunes/ / element(*,my:tune)
[@released > xs:dateTime(‘…’)]
Latest releases
SQLXPathLooking for
![Page 15: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/15.jpg)
15
Alternative Views: Words of advice
> Moderate use of references
– Circular references only within a subtree
– Plan for backup and content migration
– Jackrabbit performance: max 10k references to a single node
> Best search performance when selecting a small subset of content
> No joins or aggregate searches
> Full text indexing of binary propert ies only for jcr:data in nt:resource nodes
> Formatt ing date queries
– ISO 8601 as the string format
– session.getValueFactory().createValue(Calendar.getInstance()).getString()
> JCR 2.0: Query Object Model? Mandatory SQL?
![Page 16: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/16.jpg)
16
Agenda
> Apache Jackrabbit
> Basic content modeling
> References and search
> Advanced features
> Summary and questions
![Page 17: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/17.jpg)
17
Version store
LiveStaging
Staged Publishing: Versioning
![Page 18: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/18.jpg)
18
Personalization
tunes
Tune
Tune
John
users
Jane
playliststunes
link link
favorites
![Page 19: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/19.jpg)
19
Authentication and Authorization
> Java Authentication and Authorization Services (JAAS)
– Mostly the authentication part is current ly used by Jackrabbit
– Pluggable authentication components
– Support for single sing- on
> Custom AccessManager interface in Jackrabbit
– Pluggable authorization components
– The default implementation supports only global read, write, and admin access
– More advanced implementations are proprietary
> Repository- level authentication and authorizat ion applies to all clients
– Better than application- level authorization
![Page 20: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/20.jpg)
20
Agenda
> Apache Jackrabbit
> Basic content modeling
> References and search
> Advanced features
> Summary and questions
![Page 21: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/21.jpg)
21
Last words
> Everything is content
– Application content
– HTML pages, CSS and JavaScript f iles, static images
– JSP pages, Java classes and libraries
– Documentation, resource bundles, etc.
– With versioning, export/ import, full text search, etc.
> Web- friendly
– Trivial URI mapping
– WebDAV access for free
– Dispatch on node type, not on URI path
> In your application?
![Page 22: 862](https://reader031.fdocuments.us/reader031/viewer/2022020122/55599c79d8b42ac7648b56de/html5/thumbnails/22.jpg)
Jukka Zitting http:/ / www.day.com/
Day Software jukka.zit t [email protected]
Apache Jackrabbithttp:/ / jackrabbit .apache.org/
users@jackrabbit .apache.org
Apache Software Foundation http:/ / www.apache.org/