Introduction to JCR and Apache Jackrabbi

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.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Group

    Introduction to JCR and Apache Jackrabbi - Presentation Transcript

    1. Introduction to JCR and Apache Jackrabbit Jukka Zitting ApacheCon US 2008
    2. JCR Crash Course!
        import javax.jcr.*; import org.apache.jackrabbit.core.TransientRepository; repository = new TransientRepository (); println repository. getDescriptor (Repository.REP_NAME_DESC);
        • Jackrabbit
    3. Sessions and Workspaces
        credentials = new SimpleCredentials( “username”, “password”. toCharArray ()); session = repository. login (credentials) workspace = session. getWorkspace () println workspace. getName ()
        • default
        println workspace. getAccessibleWorkspaceNames ()
        • { “default” }
    4. Node Hierarchy
        root = session. getRootNode (); foo = root. addNode ("foo"); bar = root. addNode ("bar"); baz = bar. addNode ("baz"); println baz. getPath ();
        • /bar/baz
    5. Properties
        a = foo. setProperty ("A", "abc"); b = foo. setProperty ("B", "123"); println b. getPath ();
        • /foo/B
        println b. getLong () + 321;
        • 444
    6. Transient State
        other = repository. login (); println other. itemExists ("/foo");
        • false
        session. save (); println other. itemExists ("/foo");
        • true
    7. XPath Query
        qm = workspace. getQueryManager (); query = qm. createQuery ( "//*[A = 'abc']", "xpath"); nodes = query. execute (). getNodes (); println nodes. nextNode (). getPath ();
        • /foo
    8. SQL Query
        query = qm. createQuery ( "SELECT * FROM nt:base” + “ WHERE A = 'abc'", "sql"); rows = query. execute (). getRows (); println rows. nextRow () . getValue ("jcr:path"). getString ()
        • /foo
    9. And Remember!
        session. logout () other. logout ()
    10. Content Modeling nt:hierarchyNode nt:folder nt:file nt:linkedFile nt:resource
    11. Bottom-Up Modeling my:resource > nt:resource
      • codec (string)
      • bitrate (long)
      my:tune > nt:file
      • artist (string)
      • release date (date)
      my:album > nt:folder
      • artist (string)
      • release date (date)
      my:review > nt:file
      • author (string)
      • star rating (long)
    12. Top-Down Modeling Album Images Tune Band Label Label Tune Album Reviews Label Band Reviews Tune Images
    13. Finding Content by Reference Rock tags tunes Tune Tune Classic Top 10 playlists Picks link link link
    14. Finding Content by Search Looking for XPath SQL Latest releases /jcr:root/my:tunes//element(*,my:tune) [@released > xs:dateTime(‘…’)] SELECT * FROM my:tune WHERE jcr:path LIKE ‘/my:tunes/%’ AND released > DATE ‘…’ Reviews with keywords /jcr:root/my:tunes//element(*,my:review) /jcr:content[jcr:contains(.,’…’)] SELECT * FROM my:review WHERE jcr:path LIKE ‘/my:tunes/%’ AND CONTAINS(*,‘…’)
    15. Versioning and Publishing Version store Live Staging
    16. http://jackrabbit.apache.org/

    + Jukka ZittingJukka Zitting, 2 years ago

    custom

    1213 views, 0 favs, 0 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1213
      • 1213 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 38
    Most viewed embeds

    more

    All embeds

    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

    Groups / Events