You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by tr...@apache.org on 2015/04/08 22:27:20 UTC

svn commit: r1672164 [13/43] - in /jackrabbit/site/staging/jcr: ./ a-simple-ocm-project-with-maven-eclipse.data/ components/ concurrency-control.data/ css/ deployment-models.data/ how-jackrabbit-works.data/ how-to-map-associations-between-objects.data/...

Modified: jackrabbit/site/staging/jcr/first-hops.html
URL: http://svn.apache.org/viewvc/jackrabbit/site/staging/jcr/first-hops.html?rev=1672164&r1=1672163&r2=1672164&view=diff
==============================================================================
--- jackrabbit/site/staging/jcr/first-hops.html (original)
+++ jackrabbit/site/staging/jcr/first-hops.html Wed Apr  8 20:27:17 2015
@@ -1,457 +1,723 @@
-
-<!-- 
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE- 2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License. 
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia at 2015-04-08 
+ | Rendered using Apache Maven Fluido Skin 1.3.1
 -->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<HTML>
-  <HEAD>
-    <TITLE>First Hops</TITLE>
-    <LINK type="text/css" rel="stylesheet" href="http://jackrabbit.apache.org/style/site.css">
-  <META http-equiv="Content-Type" content="text/html;charset=UTF-8"></HEAD>
-  <BODY>
-    <DIV id="page">
-      <DIV id="header">
-        <P id="jcr"><A href="http://jackrabbit.apache.org/"><IMG src="http://jackrabbit.apache.org/style/jlogo.gif" alt="Apache Jackrabbit" height="100" width="336"></A></P>
-        <P id="asf"><A href="http://www.apache.org/"><IMG src="http://jackrabbit.apache.org/style/asf-logo.gif" alt="Apache Software Foundation" height="100" width="387"></A></P>
-      </DIV>
-      <DIV id="body">
-        <DIV id="navigation">
-  <UL>
-	<LI>Apache Jackrabbit
-	<UL>
-		<LI><A href="welcome-to-apache-jackrabbit.html" title="Welcome to Apache Jackrabbit">Welcome</A></LI>
-		<LI><A href="downloads.html" title="Downloads">Downloads</A></LI>
-		<LI><A href="frequently-asked-questions.html" title="Frequently Asked Questions">FAQ</A></LI>
-		<LI><A href="http://wiki.apache.org/jackrabbit/FrontPage" class="external-link">Jackrabbit Wiki</A></LI>
-		<LI><A href="jackrabbit-history.html" title="Jackrabbit History">Jackrabbit History</A></LI>
-	</UL>
-	</LI>
-	<LI>Documentation
-	<UL>
-		<LI><A href="getting-started-with-apache-jackrabbit.html" title="Getting Started with Apache Jackrabbit">Getting Started</A></LI>
-		<LI><A href="standalone-server.html" title="Standalone Server">Standalone Server</A></LI>
-		<LI><A href="jackrabbit-components.html" title="Jackrabbit Components">Jackrabbit Components</A></LI>
-		<LI><A href="" title="First Hops">First Hops</A></LI>
-		<LI><A href="jcr-api.html" title="JCR & API">JCR &amp; API</A></LI>
-		<LI><A href="jackrabbit-architecture.html" title="Jackrabbit Architecture">Jackrabbit Architecture</A></LI>
-		<LI><A href="deployment-models.html" title="Deployment Models">Deployment Models</A></LI>
-		<LI><A href="jackrabbit-configuration.html" title="Jackrabbit Configuration">Jackrabbit Configuration</A></LI>
-		<LI><A href="node-types.html" title="Node Types">Node Types</A></LI>
-		<LI><A href="object-content-mapping.html" title="Object Content Mapping">Object Content Mapping</A></LI>
-	</UL>
-	</LI>
-	<LI>Development
-	<UL>
-		<LI><A href="jackrabbit-team.html" title="Jackrabbit Team">Jackrabbit Team</A></LI>
-		<LI><A href="jackrabbit-roadmap.html" title="Jackrabbit Roadmap">Jackrabbit Roadmap</A></LI>
-		<LI><A href="building-jackrabbit.html" title="Building Jackrabbit">Building Jackrabbit</A></LI>
-		<LI><A href="mailing-lists.html" title="Mailing Lists">Mailing Lists</A></LI>
-		<LI><A href="issue-tracker.html" title="Issue Tracker">Issue Tracker</A></LI>
-		<LI><A href="source-repository.html" title="Source Repository">Source Repository</A></LI>
-		<LI><A href="continuous-integration.html" title="Continuous Integration">Continuous Integration</A></LI>
-		<LI><A href="website.html" title="Website">Website</A></LI>
-		<LI><A href="creating-releases.html" title="Creating Releases">Creating Releases</A></LI>
-		<LI><A href="supporting-software-attribution.html" title="Supporting software attribution">Attribution</A></LI>
-	</UL>
-	</LI>
-	<LI>Apache Software Foundation
-	<UL>
-		<LI><A href="http://www.apache.org/foundation/how-it-works.html" class="external-link">Introduction</A></LI>
-		<LI><A href="http://www.apache.org/foundation/sponsorship.html" class="external-link">Sponsorship</A></LI>
-		<LI><A href="http://www.apache.org/foundation/thanks.html" class="external-link">Current Sponsors</A></LI>
-	</UL>
-	</LI>
-</UL>
-        </DIV>
-        <DIV id="content">
-          <H1>First Hops</H1>
-  <P>Welcome to your first hops into the world of Jackrabbit! This introduction gives you a hands-on experience with Jackrabbit and the JCR API. Once you have finished hopping through this document, you should be all set to continue on your own with the official JCR specification and the documentation on this site. </P>
-
-<H2><A name="FirstHops-Hop0%3AGettingstarted"></A>Hop 0: Getting started </H2>
-
-<P>The easiest way to get started with Jackrabbit is to <A href="downloads.html" title="Downloads">download</A> the runnable <A href="standalone-server.html" title="Standalone Server">Standalone Server</A> jar. In addition to running it, you can also put it in your classpath to quickly access all the classes and interfaces you need below. Alternatively, if you use the <A href="http://maven.apache.org/" class="external-link">Apache Maven</A> build system (which we recommend), you can set up your first hops project with the following dependenecies. </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-xml"> 
-<SPAN class="code-tag">&lt;dependencies&gt;</SPAN> 
-<SPAN class="code-tag"><SPAN class="code-comment">&lt;!-- The JCR API --&gt;</SPAN></SPAN> 
-<SPAN class="code-tag">&lt;dependency&gt;</SPAN> 
-<SPAN class="code-tag">&lt;groupId&gt;</SPAN>javax.jcr<SPAN class="code-tag">&lt;/groupId&gt;</SPAN> 
-<SPAN class="code-tag">&lt;artifactId&gt;</SPAN>jcr<SPAN class="code-tag">&lt;/artifactId&gt;</SPAN> 
-<SPAN class="code-tag">&lt;version&gt;</SPAN>2.0<SPAN class="code-tag">&lt;/version&gt;</SPAN> 
-<SPAN class="code-tag">&lt;/dependency&gt;</SPAN> 
-
-<SPAN class="code-tag"><SPAN class="code-comment">&lt;!-- Jackrabbit content repository --&gt;</SPAN></SPAN> 
-<SPAN class="code-tag">&lt;dependency&gt;</SPAN> 
-<SPAN class="code-tag">&lt;groupId&gt;</SPAN>org.apache.jackrabbit<SPAN class="code-tag">&lt;/groupId&gt;</SPAN> 
-<SPAN class="code-tag">&lt;artifactId&gt;</SPAN>jackrabbit-core<SPAN class="code-tag">&lt;/artifactId&gt;</SPAN> 
-<SPAN class="code-tag">&lt;version&gt;</SPAN>2.9.0<SPAN class="code-tag">&lt;/version&gt;</SPAN> 
-<SPAN class="code-tag">&lt;/dependency&gt;</SPAN> 
-
-<SPAN class="code-tag"><SPAN class="code-comment">&lt;!-- Use Log4J for logging --&gt;</SPAN></SPAN> 
-<SPAN class="code-tag">&lt;dependency&gt;</SPAN> 
-<SPAN class="code-tag">&lt;groupId&gt;</SPAN>org.slf4j<SPAN class="code-tag">&lt;/groupId&gt;</SPAN> 
-<SPAN class="code-tag">&lt;artifactId&gt;</SPAN>slf4j-log4j12<SPAN class="code-tag">&lt;/artifactId&gt;</SPAN> 
-<SPAN class="code-tag">&lt;version&gt;</SPAN>1.7.5<SPAN class="code-tag">&lt;/version&gt;</SPAN> 
-<SPAN class="code-tag">&lt;/dependency&gt;</SPAN> 
-<SPAN class="code-tag">&lt;/dependencies&gt;</SPAN> 
-</PRE>
-</DIV></DIV> 
-
-<DIV class="panelMacro"><TABLE class="noteMacro"><COLGROUP><COL width="24"><COL></COLGROUP><TR><TD valign="top"><IMG src="https://cwiki.apache.org/confluence/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></TD><TD>You probably have an error in your classpath settings if you get a <TT>ClassNotFoundException</TT> message when trying to compile or run the examples below.</TD></TR></TABLE></DIV> 
-
-<H2><A name="FirstHops-Hop1%3ALoggingintoJackrabbit"></A>Hop 1: Logging in to Jackrabbit </H2>
-
-<P>So let's get started. As a warm-up we'll create a Jackrabbit content repository and start a login session for accessing it. The full example application that does this is shown below, with line-by-line explanations following shortly after. </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;"><B>FirstHop.java</B></DIV><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-<SPAN class="code-keyword">import</SPAN> javax.jcr.GuestCredentials; 
-<SPAN class="code-keyword">import</SPAN> javax.jcr.Repository; 
-<SPAN class="code-keyword">import</SPAN> javax.jcr.Session; 
-<SPAN class="code-keyword">import</SPAN> org.apache.jackrabbit.commons.JcrUtils; 
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20150408" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Apache Jackrabbit - First Hops</title>
+    <link rel="stylesheet" href="./css/apache-maven-fluido-1.3.1.min.css" />
+    <link rel="stylesheet" href="./css/site.css" />
+    <link rel="stylesheet" href="./css/print.css" media="print" />
+
+      
+    <script type="text/javascript" src="./js/apache-maven-fluido-1.3.1.min.js"></script>
+
+    
+                  </head>
+        <body class="topBarEnabled">
+          
+    
+    
+            
+    
+    
+    <a href="http://github.com/apache/jackrabbit">
+      <img style="position: absolute; top: 0; right: 0; border: 0; z-index: 10000;"
+        src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"
+        alt="Fork me on GitHub">
+    </a>
+  
+                
+                    
+                
+
+    <div id="topbar" class="navbar navbar-fixed-top ">
+      <div class="navbar-inner">
+                <div class="container-fluid">
+        <a data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </a>
+                
+                                                                                <a class="brand" href="index.html"  title="Apache Jackrabbit">
+
+                                
+                                                                                                                    <img src="images/logos/jlogo.gif" alt="Apache Jackrabbit" />
+                
+                </a>
+                    
+                                <ul class="nav">
+                          <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Apache Jackrabbit <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="index.html"  title="Welcome">Welcome</a>
+</li>
+                  
+                      <li>      <a href="downloads.html"  title="Downloads">Downloads</a>
+</li>
+                  
+                      <li>      <a href="articles.html"  title="Articles">Articles</a>
+</li>
+                  
+                      <li>      <a href="frequently-asked-questions.html"  title="FAQ">FAQ</a>
+</li>
+                  
+                      <li>      <a href="http://wiki.apache.org/jackrabbit/FrontPage"  title="Jackrabbit Wiki">Jackrabbit Wiki</a>
+</li>
+                  
+                      <li>      <a href="jackrabbit-history.html"  title="Jackrabbit History">Jackrabbit History</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="getting-started-with-apache-jackrabbit.html"  title="Getting Started">Getting Started</a>
+</li>
+                  
+                      <li>      <a href="standalone-server.html"  title="Standalone Server">Standalone Server</a>
+</li>
+                  
+                      <li>      <a href="jackrabbit-components.html"  title="Jackrabbit Components">Jackrabbit Components</a>
+</li>
+                  
+                      <li>      <a href="first-hops.html"  title="First Hops">First Hops</a>
+</li>
+                  
+                      <li>      <a href="jcr-api.html"  title="JCR & API">JCR & API</a>
+</li>
+                  
+                      <li>      <a href="jackrabbit-architecture.html"  title="Jackrabbit Architecture">Jackrabbit Architecture</a>
+</li>
+                  
+                      <li>      <a href="deployment-models.html"  title="Deployment Models">Deployment Models</a>
+</li>
+                  
+                      <li>      <a href="jackrabbit-configuration.html"  title="Jackrabbit Configuration">Jackrabbit Configuration</a>
+</li>
+                  
+                      <li>      <a href="node-types.html"  title="Node Types">Node Types</a>
+</li>
+                  
+                      <li>      <a href="object-content-mapping.html"  title="Object Content Mapping">Object Content Mapping</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Development <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="jackrabbit-team.html"  title="Jackrabbit Team">Jackrabbit Team</a>
+</li>
+                  
+                      <li>      <a href="jackrabbit-roadmap.html"  title="Jackrabbit Roadmap">Jackrabbit Roadmap</a>
+</li>
+                  
+                      <li>      <a href="building-jackrabbit.html"  title="Building Jackrabbit">Building Jackrabbit</a>
+</li>
+                  
+                      <li>      <a href="mailing-lists.html"  title="Mailing Lists">Mailing Lists</a>
+</li>
+                  
+                      <li>      <a href="issue-tracker.html"  title="Issue Tracker">Issue Tracker</a>
+</li>
+                  
+                      <li>      <a href="source-repository.html"  title="Source Repository">Source Repository</a>
+</li>
+                  
+                      <li>      <a href="continuous-integration.html"  title="Continuous Integration">Continuous Integration</a>
+</li>
+                  
+                      <li>      <a href="website.html"  title="Website">Website</a>
+</li>
+                  
+                      <li>      <a href="creating-releases.html"  title="Creating Releases">Creating Releases</a>
+</li>
+                  
+                      <li>      <a href="supporting-software-attribution.html"  title="Attribution">Attribution</a>
+</li>
+                  
+                      <li>      <a href="privacy-policy.html"  title="Privacy">Privacy</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Apache Software Foundation <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="http://www.apache.org/foundation/how-it-works.html"  title="Introduction">Introduction</a>
+</li>
+                  
+                      <li>      <a href="http://www.apache.org/foundation/sponsorship.html"  title="Sponsorship">Sponsorship</a>
+</li>
+                  
+                      <li>      <a href="http://www.apache.org/foundation/thanks.html"  title="Current Sponsors">Current Sponsors</a>
+</li>
+                          </ul>
+      </li>
+                  </ul>
+          
+          
+          
+                   
+                      </div>
+          
+        </div>
+      </div>
+    </div>
+    
+        <div class="container-fluid">
+          <div id="banner">
+        <div class="pull-left">
+                                <div id="bannerLeft">
+                <h2>Apache Jackrabbit Site</h2>
+                </div>
+                      </div>
+        <div class="pull-right">  </div>
+        <div class="clear"><hr/></div>
+      </div>
+
+      <div id="breadcrumbs">
+        <ul class="breadcrumb">
+                
+                    
+                  <li id="publishDate">Last Published: 2015-04-08
+                   </li>
+                      
+                
+                    
+      
+                            </ul>
+      </div>
+
+            
+      <div class="row-fluid">
+        <div id="leftColumn" class="span3">
+          <div class="well sidebar-nav">
+                
+                    
+                <ul class="nav nav-list">
+                    <li class="nav-header">Apache Jackrabbit</li>
+                              
+      <li>
+  
+                          <a href="index.html" title="Welcome">
+          <i class="none"></i>
+        Welcome</a>
+            </li>
+                
+      <li>
+  
+                          <a href="downloads.html" title="Downloads">
+          <i class="none"></i>
+        Downloads</a>
+            </li>
+                
+      <li>
+  
+                          <a href="articles.html" title="Articles">
+          <i class="none"></i>
+        Articles</a>
+            </li>
+                
+      <li>
+  
+                          <a href="frequently-asked-questions.html" title="FAQ">
+          <i class="none"></i>
+        FAQ</a>
+            </li>
+                
+      <li>
+  
+                          <a href="http://wiki.apache.org/jackrabbit/FrontPage" class="externalLink" title="Jackrabbit Wiki">
+          <i class="none"></i>
+        Jackrabbit Wiki</a>
+            </li>
+                
+      <li>
+  
+                          <a href="jackrabbit-history.html" title="Jackrabbit History">
+          <i class="none"></i>
+        Jackrabbit History</a>
+            </li>
+                              <li class="nav-header">Documentation</li>
+                              
+      <li>
+  
+                          <a href="getting-started-with-apache-jackrabbit.html" title="Getting Started">
+          <i class="none"></i>
+        Getting Started</a>
+            </li>
+                
+      <li>
+  
+                          <a href="standalone-server.html" title="Standalone Server">
+          <i class="none"></i>
+        Standalone Server</a>
+            </li>
+                
+      <li>
+  
+                          <a href="jackrabbit-components.html" title="Jackrabbit Components">
+          <i class="none"></i>
+        Jackrabbit Components</a>
+            </li>
+                
+      <li class="active">
+  
+            <a href="#"><i class="none"></i>First Hops</a>
+          </li>
+                
+      <li>
+  
+                          <a href="jcr-api.html" title="JCR & API">
+          <i class="none"></i>
+        JCR & API</a>
+            </li>
+                
+      <li>
+  
+                          <a href="jackrabbit-architecture.html" title="Jackrabbit Architecture">
+          <i class="none"></i>
+        Jackrabbit Architecture</a>
+            </li>
+                
+      <li>
+  
+                          <a href="deployment-models.html" title="Deployment Models">
+          <i class="none"></i>
+        Deployment Models</a>
+            </li>
+                
+      <li>
+  
+                          <a href="jackrabbit-configuration.html" title="Jackrabbit Configuration">
+          <i class="none"></i>
+        Jackrabbit Configuration</a>
+            </li>
+                
+      <li>
+  
+                          <a href="node-types.html" title="Node Types">
+          <i class="none"></i>
+        Node Types</a>
+            </li>
+                
+      <li>
+  
+                          <a href="object-content-mapping.html" title="Object Content Mapping">
+          <i class="none"></i>
+        Object Content Mapping</a>
+            </li>
+                              <li class="nav-header">Development</li>
+                              
+      <li>
+  
+                          <a href="jackrabbit-team.html" title="Jackrabbit Team">
+          <i class="none"></i>
+        Jackrabbit Team</a>
+            </li>
+                
+      <li>
+  
+                          <a href="jackrabbit-roadmap.html" title="Jackrabbit Roadmap">
+          <i class="none"></i>
+        Jackrabbit Roadmap</a>
+            </li>
+                
+      <li>
+  
+                          <a href="building-jackrabbit.html" title="Building Jackrabbit">
+          <i class="none"></i>
+        Building Jackrabbit</a>
+            </li>
+                
+      <li>
+  
+                          <a href="mailing-lists.html" title="Mailing Lists">
+          <i class="none"></i>
+        Mailing Lists</a>
+            </li>
+                
+      <li>
+  
+                          <a href="issue-tracker.html" title="Issue Tracker">
+          <i class="none"></i>
+        Issue Tracker</a>
+            </li>
+                
+      <li>
+  
+                          <a href="source-repository.html" title="Source Repository">
+          <i class="none"></i>
+        Source Repository</a>
+            </li>
+                
+      <li>
+  
+                          <a href="continuous-integration.html" title="Continuous Integration">
+          <i class="none"></i>
+        Continuous Integration</a>
+            </li>
+                
+      <li>
+  
+                          <a href="website.html" title="Website">
+          <i class="none"></i>
+        Website</a>
+            </li>
+                
+      <li>
+  
+                          <a href="creating-releases.html" title="Creating Releases">
+          <i class="none"></i>
+        Creating Releases</a>
+            </li>
+                
+      <li>
+  
+                          <a href="supporting-software-attribution.html" title="Attribution">
+          <i class="none"></i>
+        Attribution</a>
+            </li>
+                
+      <li>
+  
+                          <a href="privacy-policy.html" title="Privacy">
+          <i class="none"></i>
+        Privacy</a>
+            </li>
+                              <li class="nav-header">Apache Software Foundation</li>
+                              
+      <li>
+  
+                          <a href="http://www.apache.org/foundation/how-it-works.html" class="externalLink" title="Introduction">
+          <i class="none"></i>
+        Introduction</a>
+            </li>
+                
+      <li>
+  
+                          <a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsorship">
+          <i class="none"></i>
+        Sponsorship</a>
+            </li>
+                
+      <li>
+  
+                          <a href="http://www.apache.org/foundation/thanks.html" class="externalLink" title="Current Sponsors">
+          <i class="none"></i>
+        Current Sponsors</a>
+            </li>
+            </ul>
+                
+                    
+                
+          <hr />
+
+           <div id="poweredBy">
+                   
+    <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
+
+    
+    <div class="g-plusone" data-href="http://www.apache.org/jackrabbit-site/" data-size="tall" ></div>
+
+                   <div class="clear"></div>
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                             <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
+        <img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
+      </a>
+                  </div>
+          </div>
+        </div>
+        
+                
+        <div id="bodyColumn"  class="span9" >
+                                  
+            <!-- Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License. --><h1>First Hops</h1>
+<p>Welcome to your first hops into the world of Jackrabbit! This introduction gives you a hands-on experience with Jackrabbit and the JCR API. Once you have finished hopping through this document, you should be all set to continue on your own with the official JCR specification and the documentation on this site. </p>
+<div class="section">
+<h2>Hop 0: Getting started<a name="Hop_0:_Getting_started"></a></h2>
+<p>The easiest way to get started with Jackrabbit is to <a href="downloads.html">download</a> the runnable <a href="standalone-server.html">Standalone Server</a> jar. In addition to running it, you can also put it in your classpath to quickly access all the classes and interfaces you need below. Alternatively, if you use the <a class="externalLink" href="http://maven.apache.org/">Apache Maven</a> build system (which we recommend), you can set up your first hops project with the following dependencies. </p>
+
+<div class="source">
+<pre>&lt;dependencies&gt; 
+    &lt;!-- The JCR API --&gt; 
+    &lt;dependency&gt; 
+        &lt;groupId&gt;javax.jcr&lt;/groupId&gt; 
+        &lt;artifactId&gt;jcr&lt;/artifactId&gt; 
+        &lt;version&gt;2.0&lt;/version&gt; 
+    &lt;/dependency&gt; 
+
+    &lt;!-- Jackrabbit content repository --&gt; 
+    &lt;dependency&gt; 
+        &lt;groupId&gt;org.apache.jackrabbit&lt;/groupId&gt; 
+        &lt;artifactId&gt;jackrabbit-core&lt;/artifactId&gt; 
+        &lt;version&gt;2.2.4&lt;/version&gt; 
+    &lt;/dependency&gt; 
+
+    &lt;!-- Use Log4J for logging --&gt; 
+    &lt;dependency&gt; 
+        &lt;groupId&gt;org.slf4j&lt;/groupId&gt; 
+        &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt; 
+        &lt;version&gt;1.5.11&lt;/version&gt; 
+    &lt;/dependency&gt; 
+&lt;/dependencies&gt; 
+</pre></div>
+<p>You probably have an error in your classpath settings if you get a <tt>ClassNotFoundException</tt> message when trying to compile or run the examples below. </p></div>
+<div class="section">
+<h2>Hop 1: Logging in to Jackrabbit<a name="Hop_1:_Logging_in_to_Jackrabbit"></a></h2>
+<p>So let&#x2019;s get started. As a warm-up we&#x2019;ll create a Jackrabbit content repository and start a login session for accessing it. The full example application that does this is shown below, with line-by-line explanations following shortly after. </p>
+
+<div class="source">
+<pre>import javax.jcr.Repository; 
+import javax.jcr.Session; 
+import org.apache.jackrabbit.core.TransientRepository; 
 
 /** 
 * First hop example. Logs in to a content repository and prints a 
 * status message. 
 */ 
-<SPAN class="code-keyword">public</SPAN> class FirstHop { 
-
-/** 
-* The main entry point of the example application. 
-* 
-* @param args command line arguments (ignored) 
-* @<SPAN class="code-keyword">throws</SPAN> Exception <SPAN class="code-keyword">if</SPAN> an error occurs 
-*/ 
-<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">static</SPAN> void main(<SPAN class="code-object">String</SPAN>[] args) <SPAN class="code-keyword">throws</SPAN> Exception { 
-Repository repository = JcrUtils.getRepository(); 
-Session session = repository.login(<SPAN class="code-object">new</SPAN> GuestCredentials()); 
-<SPAN class="code-keyword">try</SPAN> { 
-<SPAN class="code-object">String</SPAN> user = session.getUserID(); 
-<SPAN class="code-object">String</SPAN> name = repository.getDescriptor(Repository.REP_NAME_DESC); 
-<SPAN class="code-object">System</SPAN>.out.println( 
-<SPAN class="code-quote">&quot;Logged in as &quot;</SPAN> + user + <SPAN class="code-quote">&quot; to a &quot;</SPAN> + name + <SPAN class="code-quote">&quot; repository.&quot;</SPAN>); 
-} <SPAN class="code-keyword">finally</SPAN> { 
-session.logout(); 
-} 
-} 
-
-} 
-</PRE>
-</DIV></DIV> 
-
-<P>You can also download the source file as FirstHop.java. If you have your classpath set up, you can compile the application with javac FirstHop.java and run it with java FirstHop to get the following output. </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-Logged in as anonymous to a Jackrabbit repository. 
-</PRE>
-</DIV></DIV> 
-
-<P>In addition to producing the above status line the application copies a default repository configuration file to repository.xml and creates an initial Jackrabbit content repository in the repository subdirectory. You can use the system properties <TT>org.apache.jackrabbit.repository.conf</TT> and <TT>org.apache.jackrabbit.repository.home</TT> to set alternative configuration file and repository directory locations. </P>
-
-<P>Read on for a detailed breakdown of the FirstHop application: </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-<SPAN class="code-keyword">import</SPAN> javax.jcr.GuestCredentials; 
-<SPAN class="code-keyword">import</SPAN> javax.jcr.Repository; 
-<SPAN class="code-keyword">import</SPAN> javax.jcr.Session; 
-</PRE>
-</DIV></DIV> 
-
-<P>The JCR API interfaces are located in the javax.jcr package found in the jcr-2.0.jar library. The promise of the JCR API is that if you only use these interfaces in your content application, it should remain mostly independent of the underlying content repository implementation. </P>
-
-<P>The <A href="http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Repository.html?is-external=true" class="external-link">Repository</A> interface represents a given content repository instance and the <A href="http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Session.html?is-external=true" class="external-link">Session</A> interface represents a single login session for accessing the repository. A session is needed to access any content within a repository. </P>
-
-<P>Note that a Session instance is not guaranteed to be thread-safe so you should start multiple sessions if you need to access repository content simultaneously from different threads. This is especially important for things like web applications. </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-<SPAN class="code-keyword">import</SPAN> org.apache.jackrabbit.commons.JcrUtils; 
-</PRE>
-</DIV></DIV> 
-
-<P>The best practice for deploying Jackrabbit is to use JNDI or some other configuration mechanism in a container environment to keep the application code free of direct Jackrabbit dependencies. In our simple standalone application we take a shortcut and use a utility class from the jackrabbit-commons module.</P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-<SPAN class="code-keyword">public</SPAN> class FirstHop 
-<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">static</SPAN> void main(<SPAN class="code-object">String</SPAN>[] args) <SPAN class="code-keyword">throws</SPAN> Exception 
-</PRE>
-</DIV></DIV> 
-
-<P>The FirstHop example is a simple standalone application that fits nicely in the main() method and lets the JVM take care of the possible exceptions. More substantial content applications could also be written as web application or EJB components with different setup and error handling patterns. </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-Repository repository = JcrUtils.getRepository(); 
-</PRE>
-</DIV></DIV> 
-
-<P>The getRepository() method internally uses the JCR 
-<A href="http://www.day.com/specs/jsr170/javadocs/jcr-2.0/javax/jcr/RepositoryFactory.html" class="external-link">RepositoryFactory</A> 
-mechanism to provide a Repository instance. The actual Repository class is implementation specific and Jackrabbit will return an
-instance of <A href="http://jackrabbit.apache.org/api/2.2/org/apache/jackrabbit/core/TransientRepository.html" class="external-link">TransientRepository</A>.
-This implementation contains a utility feature that will take care of the initial configuration and
-repository construction when the first session is started. Thus there is no need for manual configuration for now unless you want
-direct control over the repository setup. </P>
-
-<P>The TransientRepository implementation will automatically initialize the content repository when the first session is started and shut it down when the last session is closed. Thus there is no need for explicit repository shutdown as long as all sessions are properly closed. Note that a Jackrabbit repository directory contains a lock file that prevents it from being accessed simultaneously by multiple processes. You will see repository startup exceptions caused by the lock file if you fail to properly close all sessions or otherwise shut down the repository before leaving the process that accesses a repository. Normally you can just manually remove the lock file in such cases but such cases always present a chance of repository corruption especially if you use a non-transactional persistence manager. </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-Session session = repository.login(<SPAN class="code-keyword">new</SPAN> GuestCredentials()); 
-</PRE>
-</DIV></DIV> 
+public class FirstHop { 
 
-<P>The Repository.login(Credentials) method starts a repository session using the default workspace and guest credentials. Jackrabbit will default to the anonymous user when guest credentials are passed on login.</P>
-
-<P>Since we use the TransientRepository class as the Repository implementation, this step will also cause the repository to be initialized. </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-<SPAN class="code-keyword">try</SPAN> { ... } <SPAN class="code-keyword">finally</SPAN> { session.logout(); } 
-</PRE>
-</DIV></DIV> 
-
-<P>It is a good practice to properly release all acquired resources, and the JCR sessions are no exception. The try-finally idiom is a good way to ensure that a resource really gets released, as the release method gets called even if the intervening code throws an exception or otherwise jumps outside the scope (for example using a return, break, or continue statement). </P>
-
-<P>The Session.logout() method in the finally branch closes the session and since this is the only session we have started, the TransientRepository is automatically shut down. </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-<SPAN class="code-object">String</SPAN> user = session.getUserID(); 
-</PRE>
-</DIV></DIV> 
-
-<P>The username or identifier of the user associated with a session is available using the Session.getUserID() method. Jackrabbit returns &quot;anonymous&quot; by default. </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-<SPAN class="code-object">String</SPAN> name = repository.getDescriptor(Repository.REP_NAME_DESC); 
-</PRE>
-</DIV></DIV> 
-
-<P>Each content repository implementation publishes a number of string descriptors that describe the various implementation properties, like the implementation level and the supported optional JCR features. See the <A href="http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Repository.html?is-external=true" class="external-link">Repository</A> interface for a list of the standard repository descriptors. The REP_NAME_DESC descriptor contains the name of the repository implementation, in this case &quot;Jackrabbit&quot;. </P>
-
-<H2><A name="FirstHops-Hop2%3AWorkingwithcontent"></A>Hop 2: Working with content </H2>
-
-<P>The main function of a content repository is allow applications to store and retrieve content. The content in a JCR content repository consists of structured or unstructured data modeled as a hierarchy of nodes with properties that contain the actual data. </P>
-
-<P>The following example application first stores some content to the initially empty content repository, then retrieves the stored content and outputs it, and finally removes the stored content. </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;"><B>SecondHop.java</B></DIV><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-<SPAN class="code-keyword">import</SPAN> javax.jcr.Repository; 
-<SPAN class="code-keyword">import</SPAN> javax.jcr.Session; 
-<SPAN class="code-keyword">import</SPAN> javax.jcr.SimpleCredentials; 
-<SPAN class="code-keyword">import</SPAN> javax.jcr.Node; 
-<SPAN class="code-keyword">import</SPAN> org.apache.jackrabbit.commons.JcrUtils; 
+    /** 
+    * The main entry point of the example application. 
+    * 
+    * @param args command line arguments (ignored) 
+    * @throws Exception if an error occurs 
+    */ 
+    public static void main(String[] args) throws Exception { 
+        Repository repository = new TransientRepository(); 
+        Session session = repository.login(); 
+        try { 
+            String user = session.getUserID(); 
+            String name = repository.getDescriptor(Repository.REP_NAME_DESC); 
+            System.out.println( 
+            &quot;Logged in as &quot; + user + &quot; to a &quot; + name + &quot; repository.&quot;); 
+        } finally { 
+            session.logout(); 
+        } 
+    } 
+} 
+</pre></div>
+<p>You can also download the source file as <tt>FirstHop.java</tt>. If you have your classpath set up, you can compile the application with javac <tt>FirstHop.java</tt> and run it with java FirstHop to get the following output. </p>
+
+<div class="source">
+<pre>Logged in as anonymous to a Jackrabbit repository. 
+</pre></div>
+<p>In addition to producing the above status line the application copies a default repository configuration file to <tt>repository.xml</tt> and creates an initial Jackrabbit content repository in the repository subdirectory. You can use the system properties <tt>org.apache.jackrabbit.repository.conf</tt> and <tt>org.apache.jackrabbit.repository.home</tt> to set alternative configuration file and repository directory locations. </p>
+<p>Read on for a detailed breakdown of the FirstHop application: </p>
+
+<div class="source">
+<pre>import javax.jcr.Repository; 
+import javax.jcr.Session; 
+</pre></div>
+<p>The JCR API interfaces are located in the javax.jcr package found in the jcr-1.0.jar library. The promise of the JCR API is that if you only use these interfaces in your content application, it should remain mostly independent of the underlying content repository implementation. </p>
+<p>The <a class="externalLink" href="http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Repository.html?is-external=true">Repository</a> interface represents a given content repository instance and the <a class="externalLink" href="http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Session.html?is-external=true">Session</a> interface represents a single login session for accessing the repository. A session is needed to access any content within a repository. </p>
+<p>Note that a Session instance is not guaranteed to be thread-safe so you should start multiple sessions if you need to access repository content simultaneously from different threads. This is especially important for things like web applications. </p>
+
+<div class="source">
+<pre>import org.apache.jackrabbit.core.TransientRepository; 
+</pre></div>
+<p>The best practice for deploying Jackrabbit is to use JNDI or some other configuration mechanism in a container environment to keep the application code free of direct Jackrabbit dependencies, but since we are creating a simple standalone application we can take a shortcut by using the <a class="externalLink" href="http://jackrabbit.apache.org/api/2.2/org/apache/jackrabbit/core/TransientRepository.html">TransientRepository</a> class from Jackrabbit core. </p>
+
+<div class="source">
+<pre>public class FirstHop 
+public static void main(String[] args) throws Exception 
+</pre></div>
+<p>The FirstHop example is a simple standalone application that fits nicely in the <tt>main()</tt> method and lets the JVM take care of the possible exceptions. More substantial content applications could also be written as web application or EJB components with different setup and error handling patterns. </p>
+
+<div class="source">
+<pre>Repository repository = new TransientRepository(); 
+</pre></div>
+<p>The <tt>TransientRepository</tt> class implements the JCR Repository interface, so you can simply assign a <tt>TransientRepository</tt> instance to a Repository variable. The default constructor contains a utility feature that will take care of the initial configuration and repository construction when the first session is started. Thus there is no need for manual configuration for now unless you want direct control over the repository setup. </p>
+<p>The <tt>TransientRepository</tt> implementation will automatically initialize the content repository when the first session is started and shut it down when the last session is closed. Thus there is no need for explicit repository shutdown as long as all sessions are properly closed. Note that a Jackrabbit repository directory contains a lock file that prevents it from being accessed simultaneously by multiple processes. You will see repository startup exceptions caused by the lock file if you fail to properly close all sessions or otherwise shut down the repository before leaving the process that accesses a repository. Normally you can just manually remove the lock file in such cases but such cases always present a chance of repository corruption especially if you use a non-transactional persistence manager. </p>
+
+<div class="source">
+<pre>Session session = repository.login(); 
+</pre></div>
+<p>The default <tt>Repository.login()</tt> method starts a repository session using the default workspace and no user credentials. Jackrabbit tries to use the Java Authentication and Authorization Service (JAAS) configuration in such cases, but defaults to the anonymous user if a JAAS Subject is not found. </p>
+<p>Since we use the <tt>TransientRepository</tt> class as the Repository implementation, this step will also cause the repository to be initialized. </p>
+
+<div class="source">
+<pre>try { ... } finally { session.logout(); } 
+</pre></div>
+<p>It is a good practice to properly release all acquired resources, and the JCR sessions are no exception. The try-finally idiom is a good way to ensure that a resource really gets released, as the release method gets called even if the intervening code throws an exception or otherwise jumps outside the scope (for example using a return, break, or continue statement). </p>
+<p>The <tt>Session.logout()</tt> method in the finally branch closes the session and since this is the only session we have started, the TransientRepository is automatically shut down. </p>
+
+<div class="source">
+<pre>String user = session.getUserID(); 
+</pre></div>
+<p>The username or identifier of the user associated with a session is available using the <tt>Session.getUserID()</tt> method. Jackrabbit returns <tt>&quot;anonymous&quot;</tt> by default. </p>
+
+<div class="source">
+<pre>String name = repository.getDescriptor(Repository.REP_NAME_DESC); 
+</pre></div>
+<p>Each content repository implementation publishes a number of string descriptors that describe the various implementation properties, like the implementation level and the supported optional JCR features. See the <a class="externalLink" href="http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Repository.html?is-external=true">Repository</a> interface for a list of the standard repository descriptors. The <tt>REP_NAME_DESC</tt> descriptor contains the name of the repository implementation, in this case <tt>&quot;Jackrabbit&quot;</tt>. </p></div>
+<div class="section">
+<h2>Hop 2: Working with content<a name="Hop_2:_Working_with_content"></a></h2>
+<p>The main function of a content repository is allow applications to store and retrieve content. The content in a JCR content repository consists of structured or unstructured data modeled as a hierarchy of nodes with properties that contain the actual data. </p>
+<p>The following example application first stores some content to the initially empty content repository, then retrieves the stored content and outputs it, and finally removes the stored content. </p>
+
+<div class="source">
+<pre>import javax.jcr.Repository; 
+import javax.jcr.Session; 
+import javax.jcr.SimpleCredentials; 
+import javax.jcr.Node; 
+import org.apache.jackrabbit.core.TransientRepository; 
 
 /** 
 * Second hop example. Stores, retrieves, and removes example content. 
 */ 
-<SPAN class="code-keyword">public</SPAN> class SecondHop { 
+public class SecondHop { 
 
-/** 
-* The main entry point of the example application. 
-* 
-* @param args command line arguments (ignored) 
-* @<SPAN class="code-keyword">throws</SPAN> Exception <SPAN class="code-keyword">if</SPAN> an error occurs 
-*/ 
-<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">static</SPAN> void main(<SPAN class="code-object">String</SPAN>[] args) <SPAN class="code-keyword">throws</SPAN> Exception { 
-Repository repository = JcrUtils.getRepository(); 
-Session session = repository.login( 
-<SPAN class="code-keyword">new</SPAN> SimpleCredentials(<SPAN class="code-quote">&quot;admin&quot;</SPAN>, <SPAN class="code-quote">&quot;admin&quot;</SPAN>.toCharArray())); 
-<SPAN class="code-keyword">try</SPAN> { 
-Node root = session.getRootNode(); 
-
-<SPAN class="code-comment">// Store content 
-</SPAN>Node hello = root.addNode(<SPAN class="code-quote">&quot;hello&quot;</SPAN>); 
-Node world = hello.addNode(<SPAN class="code-quote">&quot;world&quot;</SPAN>); 
-world.setProperty(<SPAN class="code-quote">&quot;message&quot;</SPAN>, <SPAN class="code-quote">&quot;Hello, World!&quot;</SPAN>); 
-session.save(); 
-
-<SPAN class="code-comment">// Retrieve content 
-</SPAN>Node node = root.getNode(<SPAN class="code-quote">&quot;hello/world&quot;</SPAN>); 
-<SPAN class="code-object">System</SPAN>.out.println(node.getPath()); 
-<SPAN class="code-object">System</SPAN>.out.println(node.getProperty(<SPAN class="code-quote">&quot;message&quot;</SPAN>).getString()); 
-
-<SPAN class="code-comment">// Remove content 
-</SPAN>root.getNode(<SPAN class="code-quote">&quot;hello&quot;</SPAN>).remove(); 
-session.save(); 
-} <SPAN class="code-keyword">finally</SPAN> { 
-session.logout(); 
-} 
-} 
+    /** 
+    * The main entry point of the example application. 
+    * 
+    * @param args command line arguments (ignored) 
+    * @throws Exception if an error occurs 
+    */ 
+    public static void main(String[] args) throws Exception { 
+    Repository repository = new TransientRepository(); 
+        Session session = repository.login( 
+        new SimpleCredentials(&quot;username&quot;, &quot;password&quot;.toCharArray())); 
+        try { 
+            Node root = session.getRootNode(); 
+
+            // Store content 
+            Node hello = root.addNode(&quot;hello&quot;); 
+            Node world = hello.addNode(&quot;world&quot;); 
+            world.setProperty(&quot;message&quot;, &quot;Hello, World!&quot;); 
+            session.save(); 
+
+            // Retrieve content 
+            Node node = root.getNode(&quot;hello/world&quot;); 
+            System.out.println(node.getPath()); 
+            System.out.println(node.getProperty(&quot;message&quot;).getString()); 
+
+            // Remove content 
+            root.getNode(&quot;hello&quot;).remove(); 
+            session.save(); 
+        } finally { 
+            session.logout(); 
+        } 
+    } 
 
 } 
-</PRE>
-</DIV></DIV> 
-
-<P>Like in the first hop, this example source is also available as SecondHop.java. You can also compile and run this class just like you did in the first hop example. Running this example should produce the following output: </P>
+</pre></div>
+<p>Like in the first hop, this example source is also available as SecondHop.java. You can also compile and run this class just like you did in the first hop example. Running this example should produce the following output: </p>
 
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-/hello/world 
+<div class="source">
+<pre>/hello/world 
 Hello, World! 
-</PRE>
-</DIV></DIV> 
-
-<P>The basic structure of this example application is the same as in the First Hop example, so let's just walk through the differences: </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-<SPAN class="code-keyword">import</SPAN> javax.jcr.SimpleCredentials; 
-<SPAN class="code-keyword">import</SPAN> javax.jcr.Node; 
-</PRE>
-</DIV></DIV> 
-
-<P>These are two new classes we need for this example. 
-The <A href="http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/SimpleCredentials.html?is-external=true" class="external-link">SimpleCredentials</A> 
-class is a simple implementation of the <A href="http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Credentials.html?is-external=true" class="external-link">Credentials</A> 
-interface used for passing explicit user credentials to the Repository.login(Credentials) method. </P>
-
-<P>The <A href="http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Node.html?is-external=true" class="external-link">Node</A> interface 
-is used to manage the content nodes in a repository. There is a related interface called 
-<A href="http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Property.html?is-external=true" class="external-link">Property</A> for 
-managing content properties, but in this example we use the Property interface only indirectly. </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-<SPAN class="code-keyword">new</SPAN> SimpleCredentials(<SPAN class="code-quote">&quot;admin&quot;</SPAN>, <SPAN class="code-quote">&quot;admin&quot;</SPAN>.toCharArray()) 
-</PRE>
-</DIV></DIV> 
-
-<P>As discussed in the First Hop example, the Repository.login(Credentials) method with guest credentials returns an anonymous read-only session in the Jackrabbit default configuration. To be able to store and remove content we need to create a session with write access, and to do that we need to pass some credentials to the </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-Repository.login(Credentials credentials) method. 
-</PRE>
-</DIV></DIV> 
+</pre></div>
+<p>The basic structure of this example application is the same as in the First Hop example, so let&#x2019;s just walk through the differences: </p>
 
-<P>The default Jackrabbit setup has a built in 'admin' user with full write access. Thus we only need to construct and use a SimpleCredentials instance with username &quot;admin&quot; and the default password &quot;admin&quot;. </P>
-
-<P>The SimpleCredentials constructor follows the JAAS convention of representing the username as a normal String, but the password as a character array, so we need to use the String.toCharArray() method to satisfy the constructor. </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-Node root = session.getRootNode(); 
-</PRE>
-</DIV></DIV> 
-
-<P>Each JCR session is associated with a workspace that contains a single node tree. A simple way to access the root node is to call the Session.getRootNode() method. Having a reference to the root node allows us to easily store and retrieve content in the current workspace. </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-Node hello = root.addNode(<SPAN class="code-quote">&quot;hello&quot;</SPAN>); 
-Node world = hello.addNode(<SPAN class="code-quote">&quot;world&quot;</SPAN>); 
-</PRE>
-</DIV></DIV> 
-
-<P>New content nodes can be added using the Node.addNode(String relPath) method. The method takes the name (or relative path) of the node to be added and creates the named node in the transient storage associated with the current session. Until the transient storage is persisted, the added node is only visible within the current session and not within any other session that is concurrently accessing the content repository. </P>
-
-<P>This code snippet creates two new nodes, called &quot;hello&quot; and &quot;world&quot;, with &quot;hello&quot; being a child of the root node and &quot;world&quot; a child of the &quot;hello&quot; node. </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-world.setProperty(<SPAN class="code-quote">&quot;message&quot;</SPAN>, <SPAN class="code-quote">&quot;Hello, World!&quot;</SPAN>); 
-</PRE>
-</DIV></DIV> 
-
-<P>To add some content to the structure created using the &quot;hello&quot; and &quot;world&quot; nodes, we use the Node.setProperty(String name, String value) method to add a string property called &quot;message&quot; to the &quot;world&quot; node. The value of the property is the string &quot;Hello, World!&quot;. </P>
-
-<P>Like the added nodes, also the property is first created in the transient storage associated with the current session. If the named property already exists, then this method will change the value of that property. </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-session.save(); 
-</PRE>
-</DIV></DIV> 
-
-<P>Even though the rest of our example would work just fine using only the transient storage of the single session, we'd like to persist the changes we've made so far. This way other sessions could also access the example content we just created. If you like, you could even split the example application into three pieces for respectively storing, retrieving, and removing the example content. Such a split would not work unless we persisted the changes we make. </P>
-
-<P>The Session.save() method persists all pending changes in the transient storage. The changes are written to the persistent repository storage and they become visible to all sessions accessing the same workspace. Without this call all changes will be lost forever when the session is closed. </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-Node node = root.getNode(<SPAN class="code-quote">&quot;hello/world&quot;</SPAN>); 
-</PRE>
-</DIV></DIV> 
-
-<P>Since we are still using the same session, we could use the existing hello and world node references to access the stored content, but let's pretend that we've started another session and want to retrieve the content that was previously stored. </P>
-
-<P>The Node.getNode(String relPath) method returns a reference to the node at the given path relative to this node. The path syntax follows common file system conventions: a forward slash separates node names, a single dot represents the current node, and a double dot the parent node. Thus the path &quot;hello/world&quot; identifies the &quot;world&quot; child node of the &quot;hello&quot; child node of the current node - in this case the root node. The end result is that the method returns a node instance that represents the same content node as the world instance created a few lines earlier. </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-<SPAN class="code-object">System</SPAN>.out.println(node.getPath()); 
-</PRE>
-</DIV></DIV> 
-
-<P>Each content node and property is uniquely identified by its absolute path within the workspace. The absolute path starts with a forward slash and contains all the names of the ancestor nodes in order before the name of the current node or property. </P>
-
-<P>The path of a node or property can be retrieved using the Item.getPath() method. The <A href="http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Item.html?is-external=true" class="external-link">Item</A> inteface is a superinterface of Node and Property, and contains all the functionality shared by nodes and properties. </P>
-
-<P>The node variable references the &quot;world&quot; node, so this statement will output the line &quot;/hello/world&quot;. </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-<SPAN class="code-object">System</SPAN>.out.println(node.getProperty(<SPAN class="code-quote">&quot;message&quot;</SPAN>).getString()); 
-</PRE>
-</DIV></DIV> 
-
-<P>Properties can be accessed using the Node.getProperty(String relPath) method that returns an instance of the <A href="http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Property.html?is-external=true" class="external-link">Property</A> interface that represents the property at the given path relative to the current node. In this case the &quot;message&quot; property is the one we created a few lines earlier. </P>
-
-<P>A JCR property can contain either a single or multiple values of a given type. There are property types for storing strings, numbers, dates, binary streams, node references, etc. We just want the single string value, so we use the Property.getString() method. The result of this statement is the line &quot;Hello, World!&quot; being outputted. </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-root.getNode(<SPAN class="code-quote">&quot;hello&quot;</SPAN>).remove(); 
-</PRE>
-</DIV></DIV> 
-
-<P>Nodes and properties can be removed using the Item.remove() method. The method removes the entire content subtree, so we only need to remove the topmost &quot;hello&quot; node to get rid of all the content we added before. </P>
-
-<P>Removals are first stored in the session-local transient storage, just like added and changed content. Like before, the transient changes need to be explicitly saved for the content to be removed from the persistent storage. </P>
-
-<H2><A name="FirstHops-Hop3%3AImportingcontent"></A>Hop 3: Importing content </H2>
-
-<P>TODO: Update to match the style of previous hops. </P>
-
-<P>To add content a bit more efficiently, you may want to try JCR's import facilities, such as Session.importXML. The following XML document by Elliotte Rusty Harold provides an interesting example that demonstrates a repository's namespace capabilities: </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;"><B>test.xml</B></DIV><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-&lt;xhtml:html xmlns:xhtml=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//www.w3.org/1999/xhtml&quot;</SPAN> 
-</SPAN>xmlns:mathml=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//www.w3.org/1998/<SPAN class="code-object">Math</SPAN>/MathML&quot;</SPAN>&gt; 
-</SPAN>&lt;xhtml:head&gt;&lt;xhtml:title&gt;Three Namespaces&lt;/xhtml:title&gt;&lt;/xhtml:head&gt; 
+<div class="source">
+<pre>import javax.jcr.SimpleCredentials; 
+import javax.jcr.Node; 
+</pre></div>
+<p>These are two new classes we need for this example. The <a class="externalLink" href="http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/SimpleCredentials.html?is-external=true">SimpleCredentials</a> class is a simple implementation of the <a class="externalLink" href="http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Credentials.html?is-external=true">Credentials</a> interface used for passing explicit user credentials to the <tt>Repository.login(Credentials)</tt> method. </p>
+<p>The <a class="externalLink" href="http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Node.html?is-external=true">Node</a> interface is used to manage the content nodes in a repository. There is a related interface called <a class="externalLink" href="http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Property.html?is-external=true">Property</a> for managing content properties, but in this example we use the Property interface only indirectly. </p>
+
+<div class="source">
+<pre>new SimpleCredentials(&quot;username&quot;, &quot;password&quot;.toCharArray()) 
+</pre></div>
+<p>As discussed in the First Hop example, the default <tt>Repository.login()</tt> method returns an anonymous read-only session in the Jackrabbit default configuration. To be able to store and remove content we need to create a session with write access, and to do that we need to pass some credentials to the </p>
+
+<div class="source">
+<pre>Repository.login(Credentials credentials) method. 
+</pre></div>
+<p>The default Jackrabbit login mechanism accepts any username and password as valid credentials and returns a session with full write access. Thus we only need to construct and use a SimpleCredentials instance with some dummy username and password, in this case <tt>&quot;username&quot;</tt> and <tt>&quot;password&quot;</tt>. </p>
+<p>The SimpleCredentials constructor follows the JAAS convention of representing the username as a normal String, but the password as a character array, so we need to use the <tt>String.toCharArray()</tt> method to satisfy the constructor. </p>
+
+<div class="source">
+<pre>Node root = session.getRootNode(); 
+</pre></div>
+<p>Each JCR session is associated with a workspace that contains a single node tree. A simple way to access the root node is to call the <tt>Session.getRootNode()</tt> method. Having a reference to the root node allows us to easily store and retrieve content in the current workspace. </p>
+
+<div class="source">
+<pre>Node hello = root.addNode(&quot;hello&quot;); 
+Node world = hello.addNode(&quot;world&quot;); 
+</pre></div>
+<p>New content nodes can be added using the <tt>Node.addNode(String relPath)</tt> method. The method takes the name (or relative path) of the node to be added and creates the named node in the transient storage associated with the current session. Until the transient storage is persisted, the added node is only visible within the current session and not within any other session that is concurrently accessing the content repository. </p>
+<p>This code snippet creates two new nodes, called <tt>&quot;hello&quot;</tt> and <tt>&quot;world&quot;</tt>, with <tt>&quot;hello&quot;</tt> being a child of the root node and <tt>&quot;world&quot;</tt> a child of the <tt>&quot;hello&quot;</tt> node. </p>
+
+<div class="source">
+<pre>world.setProperty(&quot;message&quot;, &quot;Hello, World!&quot;); 
+</pre></div>
+<p>To add some content to the structure created using the <tt>&quot;hello&quot;</tt> and <tt>&quot;world&quot;</tt> nodes, we use the <tt>Node.setProperty(String name, String value)</tt> method to add a string property called <tt>&quot;message&quot;</tt> to the <tt>&quot;world&quot;</tt> node. The value of the property is the string <tt>&quot;Hello, World!&quot;</tt>. </p>
+<p>Like the added nodes, also the property is first created in the transient storage associated with the current session. If the named property already exists, then this method will change the value of that property. </p>
+
+<div class="source">
+<pre>session.save(); 
+</pre></div>
+<p>Even though the rest of our example would work just fine using only the transient storage of the single session, we&#x2019;d like to persist the changes we&#x2019;ve made so far. This way other sessions could also access the example content we just created. If you like, you could even split the example application into three pieces for respectively storing, retrieving, and removing the example content. Such a split would not work unless we persisted the changes we make. </p>
+<p>The <tt>Session.save()</tt> method persists all pending changes in the transient storage. The changes are written to the persistent repository storage and they become visible to all sessions accessing the same workspace. Without this call all changes will be lost forever when the session is closed. </p>
+
+<div class="source">
+<pre>Node node = root.getNode(&quot;hello/world&quot;); 
+</pre></div>
+<p>Since we are still using the same session, we could use the existing hello and world node references to access the stored content, but let&#x2019;s pretend that we&#x2019;ve started another session and want to retrieve the content that was previously stored. </p>
+<p>The <tt>Node.getNode(String relPath)</tt> method returns a reference to the node at the given path relative to this node. The path syntax follows common file system conventions: a forward slash separates node names, a single dot represents the current node, and a double dot the parent node. Thus the path <tt>&quot;hello/world&quot;</tt> identifies the <tt>&quot;world&quot;</tt> child node of the <tt>&quot;hello&quot;</tt> child node of the current node - in this case the root node. The end result is that the method returns a node instance that represents the same content node as the world instance created a few lines earlier. </p>
+
+<div class="source">
+<pre>System.out.println(node.getPath()); 
+</pre></div>
+<p>Each content node and property is uniquely identified by its absolute path within the workspace. The absolute path starts with a forward slash and contains all the names of the ancestor nodes in order before the name of the current node or property. </p>
+<p>The path of a node or property can be retrieved using the Item.getPath() method. The <a class="externalLink" href="http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Item.html?is-external=true">Item</a> interface is a superinterface of Node and Property, and contains all the functionality shared by nodes and properties. </p>
+<p>The node variable references the <tt>&quot;world&quot;</tt> node, so this statement will output the line <tt>&quot;/hello/world&quot;</tt>. </p>
+
+<div class="source">
+<pre>System.out.println(node.getProperty(&quot;message&quot;).getString()); 
+</pre></div>
+<p>Properties can be accessed using the <tt>Node.getProperty(String relPath)</tt> method that returns an instance of the <a class="externalLink" href="http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Property.html?is-external=true">Property</a> interface that represents the property at the given path relative to the current node. In this case the &#x201c;message&#x201d; property is the one we created a few lines earlier. </p>
+<p>A JCR property can contain either a single or multiple values of a given type. There are property types for storing strings, numbers, dates, binary streams, node references, etc. We just want the single string value, so we use the <tt>Property.getString()</tt> method. The result of this statement is the line <tt>&quot;Hello, World!&quot;</tt> being outputted. </p>
+
+<div class="source">
+<pre>root.getNode(&quot;hello&quot;).remove(); 
+</pre></div>
+<p>Nodes and properties can be removed using the<tt>Item.remove()</tt> method. The method removes the entire content subtree, so we only need to remove the topmost <tt>&quot;hello&quot;</tt> node to get rid of all the content we added before. </p>
+<p>Removals are first stored in the session-local transient storage, just like added and changed content. Like before, the transient changes need to be explicitly saved for the content to be removed from the persistent storage. </p>
+<p>Hop 3: Importing content &#x2014;&#x2014;&#x2014;&#x2014;&#x2014;&#x2014;&#x2014;&#x2014; TODO: Update to match the style of previous hops. </p>
+<p>To add content a bit more efficiently, you may want to try JCR&#x2019;s import facilities, such as Session.importXML. The following XML document by Elliotte Rusty Harold provides an interesting example that demonstrates a repository&#x2019;s namespace capabilities: </p>
+<p><b>test.xml</b></p>
+
+<div class="source">
+<pre>&lt;xhtml:html xmlns:xhtml=&quot;http://www.w3.org/1999/xhtml&quot; 
+xmlns:mathml=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt; 
+&lt;xhtml:head&gt;&lt;xhtml:title&gt;Three Namespaces&lt;/xhtml:title&gt;&lt;/xhtml:head&gt; 
 &lt;xhtml:body&gt; 
-&lt;xhtml:h1 align=<SPAN class="code-quote">&quot;center&quot;</SPAN>&gt;An Ellipse and a Rectangle&lt;/xhtml:h1&gt; 
-&lt;svg:svg xmlns:svg=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//www.w3.org/2000/svg&quot;</SPAN> 
-</SPAN>width=<SPAN class="code-quote">&quot;12cm&quot;</SPAN> height=<SPAN class="code-quote">&quot;10cm&quot;</SPAN>&gt; 
-&lt;svg:ellipse rx=<SPAN class="code-quote">&quot;110&quot;</SPAN> ry=<SPAN class="code-quote">&quot;130&quot;</SPAN> /&gt; 
-&lt;svg:rect x=<SPAN class="code-quote">&quot;4cm&quot;</SPAN> y=<SPAN class="code-quote">&quot;1cm&quot;</SPAN> width=<SPAN class="code-quote">&quot;3cm&quot;</SPAN> height=<SPAN class="code-quote">&quot;6cm&quot;</SPAN> /&gt; 
+&lt;xhtml:h1 align=&quot;center&quot;&gt;An Ellipse and a Rectangle&lt;/xhtml:h1&gt; 
+&lt;svg:svg xmlns:svg=&quot;http://www.w3.org/2000/svg&quot; 
+width=&quot;12cm&quot; height=&quot;10cm&quot;&gt; 
+&lt;svg:ellipse rx=&quot;110&quot; ry=&quot;130&quot; /&gt; 
+&lt;svg:rect x=&quot;4cm&quot; y=&quot;1cm&quot; width=&quot;3cm&quot; height=&quot;6cm&quot; /&gt; 
 &lt;/svg:svg&gt; 
-&lt;xhtml:p&gt;The equation <SPAN class="code-keyword">for</SPAN> ellipses&lt;/xhtml:p&gt; 
+&lt;xhtml:p&gt;The equation for ellipses&lt;/xhtml:p&gt; 
 &lt;mathml:math&gt; 
 &lt;mathml:apply&gt; 
 &lt;mathml:eq/&gt; 
@@ -491,102 +757,95 @@ root.getNode(<SPAN class="code-quote">&q
 &lt;xhtml:p&gt;Last Modified January 10, 2002&lt;/xhtml:p&gt; 
 &lt;/xhtml:body&gt; 
 &lt;/xhtml:html&gt; 
-</PRE>
-</DIV></DIV> 
-
-<P>The third example application shown below will import the XML file called test.xml from the current directory into a new content repository node called importxml. Once the XML content is imported, the application recursively dumps the contents of the entire workspace using the simple dump() method. </P>
+</pre></div>
+<p>The third example application shown below will import the XML file called <tt>test.xml</tt> from the current directory into a new content repository node called <tt>importxml</tt>. Once the XML content is imported, the application recursively dumps the contents of the entire workspace using the simple <tt>dump()</tt> method. </p>
 
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;"><B>ThirdHop.java</B></DIV><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-<SPAN class="code-keyword">import</SPAN> javax.jcr.*; 
-<SPAN class="code-keyword">import</SPAN> org.apache.jackrabbit.commons.JcrUtils; 
-<SPAN class="code-keyword">import</SPAN> java.io.FileInputStream; 
+<div class="source">
+<pre>import javax.jcr.*; 
+import org.apache.jackrabbit.core.TransientRepository; 
+import java.io.FileInputStream; 
 
 /** 
 * Third Jackrabbit example application. Imports an example XML file 
 * and outputs the contents of the entire workspace. 
 */ 
-<SPAN class="code-keyword">public</SPAN> class ThirdHop { 
-
-/**
-* The main entry point of the example application.
-*
-* @param args command line arguments (ignored)
-* @<SPAN class="code-keyword">throws</SPAN> Exception <SPAN class="code-keyword">if</SPAN> an error occurs
-*/
-<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">static</SPAN> void main(<SPAN class="code-object">String</SPAN>[] args) <SPAN class="code-keyword">throws</SPAN> Exception { 
-Repository repository = JcrUtils.getRepository(); 
-Session session = repository.login( 
-<SPAN class="code-keyword">new</SPAN> SimpleCredentials(<SPAN class="code-quote">&quot;admin&quot;</SPAN>, <SPAN class="code-quote">&quot;admin&quot;</SPAN>.toCharArray())); 
-<SPAN class="code-keyword">try</SPAN> { 
-Node root = session.getRootNode(); 
-
-<SPAN class="code-comment">// Import the XML file unless already imported 
-</SPAN><SPAN class="code-keyword">if</SPAN> (!root.hasNode(<SPAN class="code-quote">&quot;importxml&quot;</SPAN>)) { 
-<SPAN class="code-object">System</SPAN>.out.print(<SPAN class="code-quote">&quot;Importing xml... &quot;</SPAN>); 
-
-<SPAN class="code-comment">// Create an unstructured node under which to <SPAN class="code-keyword">import</SPAN> the XML 
-</SPAN>Node node = root.addNode(<SPAN class="code-quote">&quot;importxml&quot;</SPAN>, <SPAN class="code-quote">&quot;nt:unstructured&quot;</SPAN>); 
-
-<SPAN class="code-comment">// Import the file <SPAN class="code-quote">&quot;test.xml&quot;</SPAN> under the created node 
-</SPAN>FileInputStream xml = <SPAN class="code-keyword">new</SPAN> FileInputStream(<SPAN class="code-quote">&quot;test.xml&quot;</SPAN>);
-session.importXML( 
-node.getPath(), xml, ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW); 
-xml.close();
-session.save(); 
-<SPAN class="code-object">System</SPAN>.out.println(<SPAN class="code-quote">&quot;done.&quot;</SPAN>); 
-} 
-
-<SPAN class="code-comment">//output the repository content
-</SPAN>dump(root); 
-} <SPAN class="code-keyword">finally</SPAN> { 
-session.logout(); 
-} 
-} 
-
-/** Recursively outputs the contents of the given node. */ 
-<SPAN class="code-keyword">private</SPAN> <SPAN class="code-keyword">static</SPAN> void dump(Node node) <SPAN class="code-keyword">throws</SPAN> RepositoryException { 
-<SPAN class="code-comment">// First output the node path 
-</SPAN><SPAN class="code-object">System</SPAN>.out.println(node.getPath()); 
-<SPAN class="code-comment">// Skip the virtual (and large!) jcr:system subtree 
-</SPAN><SPAN class="code-keyword">if</SPAN> (node.getName().equals(<SPAN class="code-quote">&quot;jcr:system&quot;</SPAN>)) { 
-<SPAN class="code-keyword">return</SPAN>; 
-} 
+public class ThirdHop { 
 
-<SPAN class="code-comment">// Then output the properties 
-</SPAN>PropertyIterator properties = node.getProperties(); 
-<SPAN class="code-keyword">while</SPAN> (properties.hasNext()) { 
-Property property = properties.nextProperty(); 
-<SPAN class="code-keyword">if</SPAN> (property.getDefinition().isMultiple()) { 
-<SPAN class="code-comment">// A multi-valued property, print all values 
-</SPAN>Value[] values = property.getValues(); 
-<SPAN class="code-keyword">for</SPAN> (<SPAN class="code-object">int</SPAN> i = 0; i &lt; values.length; i++) { 
-<SPAN class="code-object">System</SPAN>.out.println( 
-property.getPath() + <SPAN class="code-quote">&quot; = &quot;</SPAN> + values[i].getString()); 
+    /**
+    * The main entry point of the example application.
+    *
+    * @param args command line arguments (ignored)
+    * @throws Exception if an error occurs
+    */
+    public static void main(String[] args) throws Exception { 
+        Repository repository = new TransientRepository(); 
+            Session session = repository.login( 
+            new SimpleCredentials(&quot;username&quot;, &quot;password&quot;.toCharArray())); 
+            try { 
+                Node root = session.getRootNode(); 
+
+                // Import the XML file unless already imported 
+                if (!root.hasNode(&quot;importxml&quot;)) { 
+                    System.out.print(&quot;Importing xml... &quot;); 
+
+                    // Create an unstructured node under which to import the XML 
+                    Node node = root.addNode(&quot;importxml&quot;, &quot;nt:unstructured&quot;); 
+
+                    // Import the file &quot;test.xml&quot; under the created node 
+                    FileInputStream xml = new FileInputStream(&quot;test.xml&quot;);
+                    session.importXML( 
+                    node.getPath(), xml, ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW); 
+                    xml.close();
+                    session.save(); 
+                    System.out.println(&quot;done.&quot;); 
+                } 
+
+                //output the repository content
+                dump(root); 
+            } finally { 
+                session.logout(); 
+            } 
+        } 
+
+    /** Recursively outputs the contents of the given node. */ 
+    private static void dump(Node node) throws RepositoryException { 
+        // First output the node path 
+        System.out.println(node.getPath()); 
+        // Skip the virtual (and large!) jcr:system subtree 
+        if (node.getName().equals(&quot;jcr:system&quot;)) { 
+            return; 
+        } 
+
+        // Then output the properties 
+        PropertyIterator properties = node.getProperties(); 
+        while (properties.hasNext()) { 
+            Property property = properties.nextProperty(); 
+            if (property.getDefinition().isMultiple()) { 
+                // A multi-valued property, print all values 
+                Value[] values = property.getValues(); 
+                for (int i = 0; i &lt; values.length; i++) { 
+                    System.out.println( 
+                    property.getPath() + &quot; = &quot; + values[i] .getString()); 
+                } 
+            } else { 
+                // A single-valued property 
+                System.out.println( 
+                property.getPath() + &quot; = &quot; + property.getString()); 
+            } 
+        } 
+
+        // Finally output all the child nodes recursively 
+        NodeIterator nodes = node.getNodes(); 
+        while (nodes.hasNext()) { 
+            dump(nodes.nextNode()); 
+        } 
+    } 
 } 
-} <SPAN class="code-keyword">else</SPAN> { 
-<SPAN class="code-comment">// A single-valued property 
-</SPAN><SPAN class="code-object">System</SPAN>.out.println( 
-property.getPath() + <SPAN class="code-quote">&quot; = &quot;</SPAN> + property.getString()); 
-} 
-} 
-
-<SPAN class="code-comment">// Finally output all the child nodes recursively 
-</SPAN>NodeIterator nodes = node.getNodes(); 
-<SPAN class="code-keyword">while</SPAN> (nodes.hasNext()) { 
-dump(nodes.nextNode()); 
-} 
-} 
-
-} 
-</PRE>
-</DIV></DIV> 
-
-<P>Running the ThirdHop class should produce output like the following: </P>
+</pre></div>
+<p>Running the ThirdHop class should produce output like the following: </p>
 
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-Importing XML... done. 
+<div class="source">
+<pre>Importing XML... done. 
 / 
 /jcr:primaryType=rep:root 
 /jcr:system 
@@ -616,111 +875,84 @@ Importing XML... done.
 . 
 . 
 . 
-</PRE>
-</DIV></DIV> 
-
-<P>This hop has a lot of similarities with the Second Hop example: we create a new session with write access by loggin in, next we insert data into the repository, this time by importing an xml file and finally we output the entire repository content.</P>
-
-<P>By now you should be familiar with loggin into a repository (Repository.login), creating a new node (Node.addNode) under the repository root (Session.getRootNode) and saving the session so that our changes are persisted (Session.save).</P>
-
-<P>Let us look at the new methods used in this example, how to import xml content:</P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-session.importXML(node.getPath(), xml, ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
-</PRE>
-</DIV></DIV> 
-
-<P>This deserializes an XML document and adds the resulting item subgraph as a child of the node at the provided path.</P>
-
-<P>The flag <A href="http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/ImportUUIDBehavior.html?is-external=true" class="external-link">ImportUUIDBehavior</A> governs how the identifiers of incoming nodes are handled. There are four options: </P>
-<UL>
-	<LI>ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW: Incoming nodes are added in the same way that new node is added with Node.addNode. That is, they are either assigned newly created identifiers upon addition or upon save. In either case, identifier collisions will not occur.</LI>
-</UL>
-
-
-<UL>
-	<LI>ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING: If an incoming node has the same identifier as a node already existing in the workspace then the already existing node (and its subgraph) is removed from wherever it may be in the workspace before the incoming node is added. Note that this can result in nodes &quot;disappearing&quot; from locations in the workspace that are remote from the location to which the incoming subgraph is being written. Both the removal and the new addition will be dispatched on save.</LI>
-</UL>
-
-
-<UL>
-	<LI>ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING: If an incoming node has the same identifier as a node already existing in the workspace, then the already-existing node is replaced by the incoming node in the same position as the existing node. Note that this may result in the incoming subgraph being disaggregated and &quot;spread around&quot; to different locations in the workspace. In the most extreme case this behavior may result in no node at all being added as child of parentAbsPath. This will occur if the topmost element of the incoming XML has the same identifier as an existing node elsewhere in the workspace. The change will be dispatched on save.</LI>
-</UL>
-
-
-<UL>
-	<LI>ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW: If an incoming node has the same identifier as a node already existing in the workspace then an ItemExistsException is thrown.</LI>
-</UL>
-
-
-
-<P>Another interesting method is </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-void dump(Node node)
-</PRE>
-</DIV></DIV> 
-
-<P>This can be used as an example of how to do a recursive traversal of all the repository, and check the properties of each node. </P>
-
-<P>Notice how we have to pay special attention to the multi-value properties, beacuse that impacts the way we use them:</P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-property.getDefinition().isMultiple()
-</PRE>
-</DIV></DIV> 
-
-<P>if this yelds true, then we are dealing with an array of values:</P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-Value[] values = property.getValues();
-</PRE>
-</DIV></DIV> 
-
-<P>or else, we can use the provided api shortcuts, to get the desired value:</P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-property.getString()
-</PRE>
-</DIV></DIV> 
-
-<P>which is equivalent to </P>
-
-<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
-<PRE class="code-java"> 
-property.getValue().getString()
-</PRE>
-</DIV></DIV> 
-
-<P>A very good entry point for utilities related code examples is <A href="http://jackrabbit.apache.org/api/2.2/org/apache/jackrabbit/commons/JcrUtils.html" class="external-link">JcrUtils</A>.</P>
-        </DIV>
-        <DIV id="end"></DIV>
-      </DIV>
-      <DIV id="footer">
-        <P>
-          &copy; 2004-2010 The Apache Software Foundation.
-          - <A href="http://jackrabbit.apache.org/privacy-policy.html">Privacy Policy</A> -
-          [<A href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=75343">edit this page</A>]
-          <BR>
-          Apache Jackrabbit, Jackrabbit, Apache, the Apache feather logo, and the Apache
-          Jackrabbit project logo are trademarks of The Apache Software Foundation.
-        </P>
-      </DIV>
-    </DIV>
-<!-- JCR- 1315: Add Google Analytics to Jackrabbit web site -->
-<SCRIPT type="text/javascript">
-var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
-document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
-</SCRIPT>
-<SCRIPT type="text/javascript">
-var pageTracker = _gat._getTracker("UA-837900-2");
-pageTracker._initData();
-pageTracker._trackPageview();
-</SCRIPT>
-  </BODY>
-</HTML>
+</pre></div>
+<p>This hop has a lot of similarities with the Second Hop example: we create a new session with write access by loggin in, next we insert data into the repository, this time by importing an xml file and finally we output the entire repository content.</p>
+<p>By now you should be familiar with loggin into a repository (Repository.login), creating a new node (Node.addNode) under the repository root (Session.getRootNode) and saving the session so that our changes are persisted (Session.save).</p>
+<p>Let us look at the new methods used in this example, how to import xml content:</p>
+
+<div class="source">
+<pre>session.importXML(node.getPath(), xml, ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
+</pre></div>
+<p>This deserializes an XML document and adds the resulting item subgraph as a child of the node at the provided path.</p>
+<p>The flag <a class="externalLink" href="http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/ImportUUIDBehavior.html?is-external=true">ImportUUIDBehavior</a> governs how the identifiers of incoming nodes are handled. </p>
+<p>There are four options: </p>
+
+<ul>
+  
+<li>
+<p><tt>ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW</tt>:<br />Incoming nodes are added in the same way that new node is added with Node.addNode. That is, they are either assigned newly created identifiers upon addition or upon save. In either case, identifier collisions will not occur.</p></li>
+  
+<li>
+<p><tt>ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING</tt>:<br />If an incoming node has the same identifier as a node already existing in the workspace then the already existing node (and its subgraph) is removed from wherever it may be in the workspace before the incoming node is added. Note that this can result in nodes &#x201c;disappearing&#x201d; from locations in the workspace that are remote from the location to which the incoming subgraph is being written. Both the removal and the new addition will be dispatched on save.</p></li>
+  
+<li>
+<p><tt>ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING</tt>:<br />If an incoming node has the same identifier as a node already existing in the workspace, then the already-existing node is replaced by the incoming node in the same position as the existing node. Note that this may result in the incoming subgraph being disaggregated and &#x201c;spread around&#x201d; to different locations in the workspace. In the most extreme case this behavior may result in no node at all being added as child of parentAbsPath. This will occur if the topmost element of the incoming XML has the same identifier as an existing node elsewhere in the workspace. The change will be dispatched on save.</p></li>
+  
+<li>
+<p><tt>ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW</tt>:<br />If an incoming node has the same identifier as a node already existing in the workspace then an ItemExistsException is thrown.</p></li>
+</ul>
+<p>Another interesting method is </p>
+
+<div class="source">
+<pre>void dump(Node node)
+</pre></div>
+<p>This can be used as an example of how to do a recursive traversal of all the repository, and check the properties of each node. </p>
+<p>Notice how we have to pay special attention to the multi-value properties, because that impacts the way we use them:</p>
+
+<div class="source">
+<pre>property.getDefinition().isMultiple()
+</pre></div>
+<p>if this yields true, then we are dealing with an array of values:</p>
+
+<div class="source">
+<pre>Value[] values = property.getValues();
+</pre></div>
+<p>or else, we can use the provided api shortcuts, to get the desired value:</p>
+
+<div class="source">
+<pre>property.getString()
+</pre></div>
+<p>which is equivalent to </p>
+
+<div class="source">
+<pre>property.getValue().getString()
+</pre></div>
+<p>A very good entry point for utilities related code examples is <a class="externalLink" href="http://jackrabbit.apache.org/api/2.2/org/apache/jackrabbit/commons/JcrUtils.html">JcrUtils</a>.</p></div>

[... 30 lines stripped ...]