2008-12 OJUG JCR Demo

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

1 comments

Comments 1 - 1 of 1 previous next Post a comment

Post a comment
Embed Video
Edit your comment Cancel

4 Favorites

2008-12 OJUG JCR Demo - Presentation Transcript

  1. JAVA CONTENT REPOSITORY WITH JACKRABBIT Omaha Java Users Group 2008-12-09 Paul Heaberlin paul@heaberlin.net
  2. Overview • Intro What is JCR? What can you use JCR for? • JCR Basic Structure Repositories, Workspaces and Nodes Galore! • JSR-170 Compliance Levels Level 1 - Read Only Repository Level 2 - Read and Write Optional - Versioning, Transactions and More • Demo!
  3. What is JCR? • JSR-170 defines the Java Content Repository (JCR) API • First approved June 17, 2005, last updated March 1, 2006 • JCR is just an API, it is NOT a Content Repository • Jackrabbit IS a Content Repository, that implements JSR-170 • JCR provides a universal way to access content within a repository • Similar to what JDBC did for RDBMS, JCR does for content repositories
  4. What can you use JCR for? • Common access multiple Content Repositories from different Providers • Other things...
  5. JCR Basic Structure • A Repository has Workspaces • A Workspace is a tree of Items • An Item is a Node or Property • A Property can only be a leaf • Property Values hold the data • A Session is used to access a Workspace in the Repository • Nodes can have Types
  6. Level 1 Compliance - Read Only Repository • Access the Repository • Read Repository Content • Export Repository Content • Search the Repository (via XPath) • Discover configured Node Types • Remap Namespaces within Session
  7. Level 2 Compliance - Level 1 + Edits • Add, Remove or Modify Nodes and Properties • Import Repository Content • Assign Node Types to Nodes • Add, Remove or Modify Namespaces
  8. Optional Features • Can be part of Level 1 or Level 2 compliant implementation • Transactions: Adhere to JTA Spec, support container & user managed • Versioning: Allow checkin and checkout of Nodes • Observation: Applications can “register interest in events that describe changes to a workspace, and then monitor and respond” to them • Locking: Allow temporary locking of Nodes to prevent changes • Search via SQL: Use SQL to query in addition to XPath
  9. Demo! • Follow Jackrabbit First Hops • Add in some Versioning • Do some Querying
  10. Demo - Jackrabbit Hops • FirstHop.java Access the Repository Find and display features of this implementation • SecondHop.java Add Nodes Add a Property Get a Node and Property Navigate over the Repository
  11. JCR Demo - Versioning • VersionDemo.java Try to find a Node If not found, add it Once have Node, modify a Property • Execute this with the following arguments to see the Node change 1: default versioning versionThis \"this is my first value\" 2: default versioning versionThis \"I have been changed!\" • Look at final line of ouput, should see 1: versionThis = this is my first value 2: versionThis = I have been changed!
  12. JCR Demo - Fun with Queries • QueryDemo.java Run an XPath query on a Workspace Display the results • After executing the VersionDemo, the workspace has Nodes to query • Run this with the following arguments 1: default \"//versioning\" • This will display 2 results: A table like below, & all properties of the Node | jcr:primaryType || jcr:path || jcr:score | ________________________________________________________________________ | nt:unstructured || /versioning || 1000 |
  13. Other Cool Stuff • Apache Sling: JCR + REST = something that \"is almost painfully hip, in a way only a dedicated nerd could appreciate\" Home: http://incubator.apache.org/sling/ Overview: http://www.unc.edu/home/adamc/sling-overview.html • JCROM/Jackrabbit OCM: Object-content mapping, like JPA for the JCR http://jackrabbit.apache.org/jackrabbit-ocm.html http://code.google.com/p/jcrom/ • JSR-283: JCR 2.0 - adding enhancements like federation, remoting, more standard node types, and better access control. Spec: http://jcp.org/en/jsr/detail?id=283
  14. Resources • JSR-170 Specification: Defines JCR 1.0 Spec: http://jcp.org/en/jsr/detail?id=170 API: http://www.day.com/maven/jsr170/javadocs/jcr-1.0/ • Apache Jackrabbit: Reference Implementation for JSR-170 Home: http://jackrabbit.apache.org/ API: http://jackrabbit.apache.org/api/1.5/ (as of last night, Dec 8) • Introducing the Java Content Repository API http://www.ibm.com/developerworks/java/library/j-jcr/ • Catch Jackrabbit and the Java Content Repository API http://www.artima.com/lejava/articles/contentrepository.html
  15. More Resources • What is Java Content Repository? http://www.onjava.com/pub/a/onjava/2006/10/04/what-is-java-content- repository.html • Advanced Java Content Repository API http://www.onjava.com/pub/a/onjava/2006/11/08/advanced-java- content-repository.html • Day Dev Blog: Lead contributors to Jackrabbit, Sling and all things JCR http://dev.day.com/ • Post: http://paul.heaberlin.net/2008/12/ojug-presentation-on-jcr.html Slides: http://www.slideshare.net/lobsterboy1980 Demo Code: http://cid-61cb9c642b07d62e.skydrive.live.com/ browse.aspx/OJUG

+ Paul HeaberlinPaul Heaberlin, 12 months ago

custom

1045 views, 4 favs, 1 embeds more stats

The December 2008 Omaha Java Users Group (OJUG) pre more

More info about this document

© All Rights Reserved

Go to text version

  • Total Views 1045
    • 1044 on SlideShare
    • 1 from embeds
  • Comments 1
  • Favorites 4
  • Downloads 42
Most viewed embeds
  • 1 views on file://

more

All embeds
  • 1 views on file://

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories