chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r791441 [2/2] - /websites/staging/chemistry/trunk/content/java/developing/guide.html
Date Thu, 23 Jun 2011 15:13:00 GMT

Modified: websites/staging/chemistry/trunk/content/java/developing/guide.html
==============================================================================
--- websites/staging/chemistry/trunk/content/java/developing/guide.html (original)
+++ websites/staging/chemistry/trunk/content/java/developing/guide.html Thu Jun 23 15:12:59 2011
@@ -185,7 +185,7 @@ Apache Chemistry - OpenCMIS Client API D
              <!-- Content -->
              <div class="wiki-content"><h1 id="opencmis_client_api_developers_guide">OpenCMIS Client API Developer's Guide</h1>
 <h2 id="audience">Audience</h2>
-<p>This guide is for software engineers who want to use the Apache Chemistry OpenCMIS client to access CMIS-complaint
+<p>This guide is for software engineers who want to use the Apache Chemistry OpenCMIS client to access CMIS-compliant
 content repositories from java code. The examples included in the guide assume the code is running in
 a standalone Java application, but the OpenCMIS client can be used by on any Java platform, 
 such as Web applications and phone apps.</p>
@@ -201,7 +201,7 @@ such as Web applications and phone apps.
 <h3 id="assumptions">Assumptions</h3>
 <p>The guide assumes you are using the Eclipse IDE for code development, and have Maven and SVN installed.</p>
 <ul>
-<li>You can download and install Eclipse <a href="http://eclipse.org/downloads.html">here</a>.</li>
+<li>You can download and install Eclipse <a href="http://www.eclipse.org/downloads.html">here</a>.</li>
 <li>You can download and install Maven <a href="http://maven.apache.org/download.html">here</a>.</li>
 <li>You can download and install SVN for your platform <a href="http://subversion.apache.org/packages.html">here</a>.</li>
 </ul>
@@ -209,7 +209,7 @@ such as Web applications and phone apps.
 <p>This section gives a high-level overview of the OpenCMIS library, and introduces a supplied "Hello World" sample to
 get an OpenCMIS client up and running against a repository and accessing CMIS objects.</p>
 <h3 id="what_is_opencmis">What is OpenCMIS?</h3>
-<p>CMIS (Content Management Interoperability Services) is vendor-neutral <a href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=cmis">OASIS Web services interface specification</a> 
+<p>CMIS (Content Management Interoperability Services) is a vendor-neutral <a href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=cmis">OASIS Web services interface specification</a> 
 that enables interoperability between Enterprise Content Management (ECM) systems. 
 CMIS allows rich information to be shared across Internet protocols in vendor-neutral formats, 
 among document systems, publishers and repositories, in a single enterprise and between companies.</p>
@@ -248,7 +248,7 @@ CMIS services are provided for the disco
 folders and documents are the main objects you will be concerned with for the first 2 parts of this document.</p>
 <h4 id="cmis_services">CMIS Services</h4>
 <p>The CMIS specification describes a set of services that act on repositories. The OpenCMIS client API uses these services, but by using a client binding,
-presents the user of the API simple set of classes rather than the services described by CMIS. If you want to access a CMIS repository at the service level, you can do that
+presents the user of the API a simple set of classes rather than the services described by CMIS. If you want to access a CMIS repository at the service level, you can do that
 by using the <a href="http://chemistry.apache.org/java/developing/client/dev-client-bindings.html">OpenCMIS client bindings layer</a> directly.
 The CMIS services are:-</p>
 <ul>
@@ -265,38 +265,37 @@ The CMIS services are:-</p>
 </ul>
 <h4 id="cmis_bindings">CMIS Bindings</h4>
 <p>How does an OpenCMIS client communicate over the wire with a CMIS service endpoint? A CMIS repository can communicate over two protocols,
-SOAP and <a href="http://tools.ietf.org/html/rfc5023">AtomPub</a>, and provide  tow corresponding bindings, a web services binding, and an AtomPub binding. A CMIS service endpoint will 
-provide a URL for both types of binding, and in an OpenCMIS you specify the binding type when calling the <code>getRepositories()</code> method on 
-the <code>SessionFactory</code> object.</p>
+SOAP and <a href="http://tools.ietf.org/html/rfc5023">AtomPub</a>, and provide two corresponding bindings, a web services binding, and an AtomPub binding. A CMIS service endpoint will 
+provide a URL for both types of binding, and in OpenCMIS you specify the binding type when calling the <code>getRepositories()</code> method on 
+the <a href="http://incubator.apache.org/chemistry/javadoc/org/apache/chemistry/opencmis/client/api/SessionFactory.html"><code>SessionFactory</code></a> object.</p>
 <h4 id="the_opencmis_workbench">The OpenCMIS Workbench</h4>
 <p>The workbench is a GUI repository browser that lets you quickly view the contents of a repository, create documents and folders, look at metadata, and 
 perform queries. It's really useful for debugging your applications, and for quickly testing out queries before you commit them to code. You can
-download the latest version <a href="http://incubator.apache.org/chemistry/cmis-workbench.html">here</a>. The workbench is a Java Swing application, and comes 
+download the latest version <a href="http://chemistry.apache.org/java/developing/tools/dev-tools-workbench.html">here</a>. The workbench is a Java Swing application, and comes 
 with both Windows and UNIX starter scripts.</p>
 <h3 id="hello_world">Hello World</h3>
-<p>You can download, install, and test the Apache Chemistry client code using the <code>Hello World</code> sample. On a command line, type the following command :-
-<p class="todo"> Need a full URL here</p></p>
-<div class="codehilite"><pre><span class="n">svn</span> <span class="n">co</span> <span class="n">https:</span><span class="sr">//s</span><span class="n">vn</span><span class="o">.</span><span class="n">apache</span><span class="o">.</span><span class="n">org</span><span class="sr">/repos/</span><span class="n">asf</span><span class="sr">/chemistry/o</span><span class="n">pencmis</span><span class="sr">/trunk/c</span><span class="n">hemistry</span><span class="o">-</span><span class="n">opencmis</span><span class="o">-</span><span class="n">samples</span><span class="o">/</span><span class="n">chemistry</span><span class="o">-</span><span class="n">opencmis</span><span class="o">-</span><span class="n">hello</span>
+<p>You can download, install, and test the Apache Chemistry client code using the <code>Hello World</code> sample. On a command line, type the following command :-</p>
+<div class="codehilite"><pre>svn co https://svn.apache.org/repos/asf/chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-hello
 </pre></div>
 
 
 <p>You can then build the sample and run the <code>org.apache.chemistry.opencmis.doc.Hello</code> sample using maven, by typing the following command</p>
-<div class="codehilite"><pre><span class="n">mvn</span> <span class="n">clean</span> <span class="n">install</span>
+<div class="codehilite"><pre>mvn clean install
 </pre></div>
 
 
 <p>You will see some output towards the end of the build that looks similar to the following lines:-</p>
-<div class="codehilite"><pre><span class="s-Atom">org</span><span class="p">.</span><span class="s-Atom">apache</span><span class="p">.</span><span class="s-Atom">chemistry</span><span class="p">.</span><span class="s-Atom">opencmis</span><span class="p">.</span><span class="s-Atom">doc</span><span class="p">.</span><span class="nv">Hello</span> <span class="s-Atom">started</span>
-<span class="nv">Found</span> <span class="nn">repository</span><span class="p">:</span> <span class="nv">InMemory</span> <span class="nv">Repository</span>
-<span class="nv">Got</span> <span class="s-Atom">a</span> <span class="s-Atom">connection</span> <span class="s-Atom">to</span> <span class="nn">repository</span><span class="p">:</span> <span class="nv">InMemory</span> <span class="nv">Repository</span><span class="p">,</span> <span class="s-Atom">with</span> <span class="nn">id</span><span class="p">:</span> <span class="nv">A1</span>
-<span class="nv">Found</span> <span class="s-Atom">the</span> <span class="s-Atom">following</span> <span class="s-Atom">objects</span> <span class="s-Atom">in</span> <span class="s-Atom">the</span> <span class="s-Atom">root</span> <span class="nn">folder</span><span class="p">:</span><span class="o">-</span>
-<span class="nv">MasterClass</span>
-<span class="nv">My_Document</span><span class="o">-</span><span class="m">0</span><span class="o">-</span><span class="m">0</span>
-<span class="nv">My_Document</span><span class="o">-</span><span class="m">0</span><span class="o">-</span><span class="m">1</span>
-<span class="nv">My_Document</span><span class="o">-</span><span class="m">0</span><span class="o">-</span><span class="m">2</span>
-<span class="nv">My_Folder</span><span class="o">-</span><span class="m">0</span><span class="o">-</span><span class="m">0</span>
-<span class="nv">My_Folder</span><span class="o">-</span><span class="m">0</span><span class="o">-</span><span class="m">1</span>
-<span class="s-Atom">org</span><span class="p">.</span><span class="s-Atom">apache</span><span class="p">.</span><span class="s-Atom">chemistry</span><span class="p">.</span><span class="s-Atom">opencmis</span><span class="p">.</span><span class="s-Atom">doc</span><span class="p">.</span><span class="nv">Hello</span> <span class="s-Atom">ended</span>
+<div class="codehilite"><pre>org.apache.chemistry.opencmis.doc.Hello started
+Found repository: InMemory Repository
+Got a connection to repository: InMemory Repository, with id: A1
+Found the following objects in the root folder:-
+MasterClass
+My_Document-0-0
+My_Document-0-1
+My_Document-0-2
+My_Folder-0-0
+My_Folder-0-1
+org.apache.chemistry.opencmis.doc.Hello ended
 </pre></div>
 
 
@@ -305,19 +304,25 @@ The simplest way to view the sample code
 <ol>
 <li>
 <p>Add the maven repository to your eclipse workspace classpath with the following command. You only need to perform this step once.</p>
-<p><code>mvn eclipse:configure-workspace -Declipse.workspace=&lt;path-to-your-eclipse-workspace&gt;</code></p>
+<div class="codehilite"><pre>mvn eclipse:configure-workspace -Declipse.workspace=&lt;path-to-your-eclipse-workspace&gt;
+</pre></div>
+
+
 </li>
 <li>
 <p>Create a an eclipse project from the code, and import it into your eclipse.
 Type the following command :-</p>
-<p><code>mvn eclipse:eclipse</code></p>
+<div class="codehilite"><pre>mvn eclipse:eclipse
+</pre></div>
+
+
 </li>
 <li>
 <p>Import the project into eclipse:-</p>
 <ol>
 <li>click <code>File-&gt;Import</code> and choose <code>General-&gt;Existing projects into workspace</code> in the 
 Import wizard.</li>
-<li>Click <code>Next</code> and  browse to the folder you extracted the project to.</li>
+<li>Click <code>Next</code> and  browse to the folder you checked out the project to.</li>
 <li>Click the checkbox next to <code>chemistry-opencmis-hello</code> project. The project will be imported into your workspace.</li>
 </ol>
 </li>
@@ -328,21 +333,20 @@ OpenCMIS API in the next section.</p>
 <h2 id="getting_started_with_opencmis">Getting Started with OpenCMIS</h2>
 <p>This section introduces the most commonly used parts of the OpenCMIS client API. The code snippets are taken from the GettingStarted sample class supplied with Apache chemistry.</p>
 <h3 id="installing_the_getting_started_sample">Installing the getting started sample</h3>
-<p>On a command line, type the following command :-
-<p class="todo"> Need a full URL here</p></p>
-<div class="codehilite"><pre><span class="n">svn</span> <span class="n">co</span> <span class="n">https:</span><span class="sr">//s</span><span class="n">vn</span><span class="o">.</span><span class="n">apache</span><span class="o">.</span><span class="n">org</span><span class="sr">/repos/</span><span class="n">asf</span><span class="sr">/chemistry/o</span><span class="n">pencmis</span><span class="sr">/trunk/c</span><span class="n">hemistry</span><span class="o">-</span><span class="n">opencmis</span><span class="o">-</span><span class="n">samples</span><span class="o">/</span><span class="n">chemistry</span><span class="o">-</span><span class="n">opencmis</span><span class="o">-</span><span class="n">getting</span><span class="o">-</span><span class="n">started</span>
+<p>On a command line, type the following command :-</p>
+<div class="codehilite"><pre>svn co https://svn.apache.org/repos/asf/chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-getting-started
 </pre></div>
 
 
 <p>You can then build the sample and run the <code>org.apache.chemistry.opencmis.doc.GettingStarted</code> sample using maven, by typing the following command</p>
-<div class="codehilite"><pre><span class="n">mvn</span> <span class="n">clean</span> <span class="n">install</span>
+<div class="codehilite"><pre>mvn clean install
 </pre></div>
 
 
 <p>This will pull in any dependencies for the sample, build it, and run it against a public repository.</p>
 <p>The simplest way to work with the getting started sample is to use Maven to create an eclipse project from the code, and import it into your eclipse.
 To create the eclipse project type the following command :-</p>
-<div class="codehilite"><pre><span class="n">mvn</span> <span class="n">eclipse:eclipse</span>
+<div class="codehilite"><pre>mvn eclipse:eclipse
 </pre></div>
 
 
@@ -350,7 +354,7 @@ To create the eclipse project type the f
 <ol>
 <li>click <code>File-&gt;Import</code> and choose <code>General-&gt;Existing projects into workspace</code> in the 
 Import wizard.</li>
-<li>Click <code>Next</code> and  browse to the folder you extracted the project to.</li>
+<li>Click <code>Next</code> and  browse to the folder you checked out the project to.</li>
 <li>Click the checkbox next to <code>chemistry-opencmis-gettingstarted</code> project. The project will be imported into your workspace.</li>
 </ol>
 <p>You can run the <code>main</code> method in the <code>GettingStarted</code> class as a Java application.</p>
@@ -365,23 +369,23 @@ Note that:-</p>
 <li>This repository does not require credentials, but the code snippet sets a user id and password to show how this is done</li>
 <li>
 <p>The code uses the <code>ATOMPUB</code> binding for connection. </p>
-<div class="codehilite"><pre><span class="n">SessionFactory</span> <span class="n">sessionFactory</span> <span class="o">=</span> <span class="n">SessionFactoryImpl</span><span class="o">.</span><span class="n">newInstance</span><span class="p">();</span>
-<span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span> <span class="n">String</span><span class="o">&gt;</span> <span class="n">parameter</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span> <span class="n">String</span><span class="o">&gt;</span><span class="p">();</span>
-<span class="n">parameter</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">SessionParameter</span><span class="o">.</span><span class="n">USER</span><span class="p">,</span> <span class="s">&quot;admin&quot;</span><span class="p">);</span>
-<span class="n">parameter</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">SessionParameter</span><span class="o">.</span><span class="n">PASSWORD</span><span class="p">,</span> <span class="s">&quot;admin&quot;</span><span class="p">);</span>
-<span class="n">parameter</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">SessionParameter</span><span class="o">.</span><span class="n">ATOMPUB_URL</span><span class="p">,</span>
- <span class="s">&quot;http://opencmis.cloudapp.net/inmemory/atom/&quot;</span><span class="p">);</span>
-<span class="n">parameter</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">SessionParameter</span><span class="o">.</span><span class="n">BINDING_TYPE</span><span class="p">,</span> <span class="n">BindingType</span><span class="o">.</span><span class="n">ATOMPUB</span><span class="o">.</span><span class="n">value</span><span class="p">());</span>
+<div class="codehilite"><pre><span class="n">SessionFactory</span> <span class="n">sessionFactory</span> <span class="o">=</span> <span class="n">SessionFactoryImpl</span><span class="o">.</span><span class="na">newInstance</span><span class="o">();</span>
+<span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">&gt;</span> <span class="n">parameter</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">&gt;();</span>
+<span class="n">parameter</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">SessionParameter</span><span class="o">.</span><span class="na">USER</span><span class="o">,</span> <span class="s">&quot;admin&quot;</span><span class="o">);</span>
+<span class="n">parameter</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">SessionParameter</span><span class="o">.</span><span class="na">PASSWORD</span><span class="o">,</span> <span class="s">&quot;admin&quot;</span><span class="o">);</span>
+<span class="n">parameter</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">SessionParameter</span><span class="o">.</span><span class="na">ATOMPUB_URL</span><span class="o">,</span>
+ <span class="s">&quot;http://opencmis.cloudapp.net/inmemory/atom/&quot;</span><span class="o">);</span>
+<span class="n">parameter</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">SessionParameter</span><span class="o">.</span><span class="na">BINDING_TYPE</span><span class="o">,</span> <span class="n">BindingType</span><span class="o">.</span><span class="na">ATOMPUB</span><span class="o">.</span><span class="na">value</span><span class="o">());</span>
 </pre></div>
 
 
 </li>
 </ol>
 <h4 id="connecting_to_a_repository_by_id">Connecting to a repository by id</h4>
-<p>In a production environment, the client code will probably know the ID of the repository that it wants to connnect to.
+<p>In a production environment, the client code will probably know the ID of the repository that it wants to connect to.
 The following code snippet shows how to connect to a repository using its ID.</p>
-<div class="codehilite"><pre>    <span class="n">parameter</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">SessionParameter</span><span class="o">.</span><span class="n">REPOSITORY_ID</span><span class="p">,</span> <span class="s">&quot;A1&quot;</span><span class="p">);</span>
-    <span class="n">Session</span> <span class="n">session</span> <span class="o">=</span> <span class="n">sessionFactory</span><span class="o">.</span><span class="n">createSession</span><span class="p">(</span><span class="n">parameter</span><span class="p">);</span>
+<div class="codehilite"><pre>    <span class="n">parameter</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">SessionParameter</span><span class="o">.</span><span class="na">REPOSITORY_ID</span><span class="o">,</span> <span class="s">&quot;A1&quot;</span><span class="o">);</span>
+    <span class="n">Session</span> <span class="n">session</span> <span class="o">=</span> <span class="n">sessionFactory</span><span class="o">.</span><span class="na">createSession</span><span class="o">(</span><span class="n">parameter</span><span class="o">);</span>
 </pre></div>
 
 
@@ -389,42 +393,42 @@ The following code snippet shows how to 
 <h4 id="connecting_to_one_of_a_list_of_repositories">Connecting to one of a list of repositories</h4>
 <p>The CMIS specification allows a CMIS service endpoint to advertise one or more repositories, so this code snippet retrieves a list of repositories. In this 
 case there the code chooses the first repository in list:-</p>
-<div class="codehilite"><pre>    <span class="n">List</span><span class="sr">&lt;Repository&gt;</span> <span class="n">repositories</span> <span class="o">=</span> <span class="k">new</span> <span class="n">ArrayList</span><span class="sr">&lt;Repository&gt;</span><span class="p">();</span>
-    <span class="n">repositories</span> <span class="o">=</span> <span class="n">sessionFactory</span><span class="o">.</span><span class="n">getRepositories</span><span class="p">(</span><span class="n">parameter</span><span class="p">);</span>
-    <span class="k">for</span> <span class="p">(</span><span class="n">Repository</span> <span class="n">r</span> <span class="p">:</span> <span class="n">repositories</span><span class="p">)</span> <span class="p">{</span>
-        <span class="n">System</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;Found repository: &quot;</span> <span class="o">+</span> <span class="n">r</span><span class="o">.</span><span class="n">getName</span><span class="p">());</span>
-    <span class="p">}</span>
+<div class="codehilite"><pre>    <span class="n">List</span><span class="o">&lt;</span><span class="n">Repository</span><span class="o">&gt;</span> <span class="n">repositories</span> <span class="o">=</span> <span class="k">new</span> <span class="n">ArrayList</span><span class="o">&lt;</span><span class="n">Repository</span><span class="o">&gt;();</span>
+    <span class="n">repositories</span> <span class="o">=</span> <span class="n">sessionFactory</span><span class="o">.</span><span class="na">getRepositories</span><span class="o">(</span><span class="n">parameter</span><span class="o">);</span>
+    <span class="k">for</span> <span class="o">(</span><span class="n">Repository</span> <span class="n">r</span> <span class="o">:</span> <span class="n">repositories</span><span class="o">)</span> <span class="o">{</span>
+        <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Found repository: &quot;</span> <span class="o">+</span> <span class="n">r</span><span class="o">.</span><span class="na">getName</span><span class="o">());</span>
+    <span class="o">}</span>
 </pre></div>
 
 
 <p>Now you can create your session with the first and only repository:-</p>
-<div class="codehilite"><pre>    <span class="n">Repository</span> <span class="n">repository</span> <span class="o">=</span> <span class="n">repositories</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
-    <span class="n">parameter</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">SessionParameter</span><span class="o">.</span><span class="n">REPOSITORY_ID</span><span class="p">,</span> <span class="n">repository</span><span class="o">.</span><span class="n">getId</span><span class="p">());</span>
-    <span class="n">Session</span> <span class="n">session</span> <span class="o">=</span> <span class="n">sessionFactory</span><span class="o">.</span><span class="n">createSession</span><span class="p">(</span><span class="n">parameter</span><span class="p">);</span>
-
-    <span class="n">System</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;Got a connection to repository: &quot;</span> 
-            <span class="o">+</span> <span class="n">repository</span><span class="o">.</span><span class="n">getName</span><span class="p">()</span> <span class="o">+</span> <span class="s">&quot;, with id: &quot;</span>
-            <span class="o">+</span> <span class="n">repository</span><span class="o">.</span><span class="n">getId</span><span class="p">());</span>
+<div class="codehilite"><pre>    <span class="n">Repository</span> <span class="n">repository</span> <span class="o">=</span> <span class="n">repositories</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">0</span><span class="o">);</span>
+    <span class="n">parameter</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">SessionParameter</span><span class="o">.</span><span class="na">REPOSITORY_ID</span><span class="o">,</span> <span class="n">repository</span><span class="o">.</span><span class="na">getId</span><span class="o">());</span>
+    <span class="n">Session</span> <span class="n">session</span> <span class="o">=</span> <span class="n">sessionFactory</span><span class="o">.</span><span class="na">createSession</span><span class="o">(</span><span class="n">parameter</span><span class="o">);</span>
+
+    <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Got a connection to repository: &quot;</span> 
+            <span class="o">+</span> <span class="n">repository</span><span class="o">.</span><span class="na">getName</span><span class="o">()</span> <span class="o">+</span> <span class="s">&quot;, with id: &quot;</span>
+            <span class="o">+</span> <span class="n">repository</span><span class="o">.</span><span class="na">getId</span><span class="o">());</span>
 </pre></div>
 
 
 <p>That's it. Any work you want to do against the repository uses this session.</p>
 <h3 id="working_with_folders_and_documents">Working with Folders and Documents</h3>
-<p>Of the  for base objects described by the CMIS domain model, the most commonly used are the folder and the document.</p>
+<p>Of the four base objects described by the CMIS domain model, the most commonly used are the folder and the document.</p>
 <p>A folder is a container for other objects. Folders exist in a  hierarchical structure as you would expect, but 
 a CMIS repository can optionally store objects in multiple folders, and an object can exist but not be contained in a folder. 
 CMIS uses the terminology multifiling and unfiling for these
 capabilities.</p>
 <p>The Document is the only object that can have content, described by a content stream, and has properties such as the author and modification date. </p>
 <h4 id="finding_the_contents_of_the_root_folder">Finding the contents of the root folder</h4>
-<p>Now you have a session you can start examining the repository. All CMIS repositories have a root folder, which is the single top level folder in the heirarchy.
+<p>Now you have a session you can start examining the repository. All CMIS repositories have a root folder, which is the single top level folder in the hierarchy.
 To list the objects in the root folder of your repository you use the <code>getRootFolder()</code> method on the session.</p>
-<div class="codehilite"><pre>    <span class="nv">Folder</span> <span class="s-Atom">root</span> <span class="o">=</span> <span class="s-Atom">session</span><span class="p">.</span><span class="nf">getRootFolder</span><span class="p">();</span>
-    <span class="nv">ItemIterable</span><span class="o">&lt;</span><span class="nv">CmisObject</span><span class="o">&gt;</span> <span class="s-Atom">children</span> <span class="o">=</span> <span class="s-Atom">root</span><span class="p">.</span><span class="nf">getChildren</span><span class="p">();</span>
-    <span class="nv">System</span><span class="p">.</span><span class="s-Atom">out</span><span class="p">.</span><span class="nf">println</span><span class="p">(</span><span class="s2">&quot;Found the following objects in the root folder:-&quot;</span><span class="p">);</span>
-    <span class="nf">for</span> <span class="p">(</span><span class="nv">CmisObject</span> <span class="s-Atom">o</span> <span class="s-Atom">:</span> <span class="s-Atom">children</span><span class="p">)</span> <span class="p">{</span>
-        <span class="nv">System</span><span class="p">.</span><span class="s-Atom">out</span><span class="p">.</span><span class="nf">println</span><span class="p">(</span><span class="s-Atom">o</span><span class="p">.</span><span class="nf">getName</span><span class="p">()</span> <span class="o">+</span> <span class="s2">&quot; which is of type &quot;</span> <span class="o">+</span> <span class="s-Atom">o</span><span class="p">.</span><span class="nf">getType</span><span class="p">().</span><span class="nf">getDisplayName</span><span class="p">());</span>
-    <span class="p">}</span>
+<div class="codehilite"><pre>    <span class="n">Folder</span> <span class="n">root</span> <span class="o">=</span> <span class="n">session</span><span class="o">.</span><span class="na">getRootFolder</span><span class="o">();</span>
+    <span class="n">ItemIterable</span><span class="o">&lt;</span><span class="n">CmisObject</span><span class="o">&gt;</span> <span class="n">children</span> <span class="o">=</span> <span class="n">root</span><span class="o">.</span><span class="na">getChildren</span><span class="o">();</span>
+    <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Found the following objects in the root folder:-&quot;</span><span class="o">);</span>
+    <span class="k">for</span> <span class="o">(</span><span class="n">CmisObject</span> <span class="n">o</span> <span class="o">:</span> <span class="n">children</span><span class="o">)</span> <span class="o">{</span>
+        <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">o</span><span class="o">.</span><span class="na">getName</span><span class="o">()</span> <span class="o">+</span> <span class="s">&quot; which is of type &quot;</span> <span class="o">+</span> <span class="n">o</span><span class="o">.</span><span class="na">getType</span><span class="o">().</span><span class="na">getDisplayName</span><span class="o">());</span>
+    <span class="o">}</span>
 </pre></div>
 
 
@@ -432,18 +436,18 @@ To list the objects in the root folder o
 <p>To create a folder, you use the  <code>createFolder()</code> method on the parent folder.
 As with most CMIS methods, it takes a map of properties which define the Object to be created.
 In this code snippet a folder with the name <code>ADGNewFolder</code> is created in the root folder:-</p>
-<div class="codehilite"><pre>    <span class="nv">System</span><span class="p">.</span><span class="s-Atom">out</span><span class="p">.</span><span class="nf">println</span><span class="p">(</span><span class="s2">&quot;Creating &#39;ADGNewFolder&#39; in the root folder&quot;</span><span class="p">);</span>
-    <span class="nv">Map</span><span class="o">&lt;</span><span class="nv">String</span><span class="p">,</span> <span class="nv">String</span><span class="o">&gt;</span> <span class="s-Atom">newFolderProps</span> <span class="o">=</span> <span class="s-Atom">new</span> <span class="nv">HashMap</span><span class="o">&lt;</span><span class="nv">String</span><span class="p">,</span> <span class="nv">String</span><span class="s-Atom">&gt;</span><span class="p">();</span>
-    <span class="s-Atom">newFolderProps</span><span class="p">.</span><span class="nf">put</span><span class="p">(</span><span class="nv">PropertyIds</span><span class="p">.</span><span class="nv">OBJECT_TYPE_ID</span><span class="p">,</span> <span class="s2">&quot;cmis:folder&quot;</span><span class="p">);</span>
-    <span class="s-Atom">newFolderProps</span><span class="p">.</span><span class="nf">put</span><span class="p">(</span><span class="nv">PropertyIds</span><span class="p">.</span><span class="nv">NAME</span><span class="p">,</span> <span class="s2">&quot;ADGNewFolder&quot;</span><span class="p">);</span>
-    <span class="nv">Folder</span> <span class="s-Atom">newFolder</span> <span class="o">=</span> <span class="s-Atom">root</span><span class="p">.</span><span class="nf">createFolder</span><span class="p">(</span><span class="s-Atom">newFolderProps</span><span class="p">);</span>
-
-    <span class="o">//</span> <span class="nv">Did</span> <span class="s-Atom">it</span> <span class="s-Atom">work?</span>
-    <span class="s-Atom">children</span> <span class="o">=</span> <span class="s-Atom">root</span><span class="p">.</span><span class="nf">getChildren</span><span class="p">();</span>
-    <span class="nv">System</span><span class="p">.</span><span class="s-Atom">out</span><span class="p">.</span><span class="nf">println</span><span class="p">(</span><span class="s2">&quot;Now finding the following objects in the root folder:-&quot;</span><span class="p">);</span>
-    <span class="nf">for</span> <span class="p">(</span><span class="nv">CmisObject</span> <span class="s-Atom">o</span> <span class="s-Atom">:</span> <span class="s-Atom">children</span><span class="p">)</span> <span class="p">{</span>
-        <span class="nv">System</span><span class="p">.</span><span class="s-Atom">out</span><span class="p">.</span><span class="nf">println</span><span class="p">(</span><span class="s-Atom">o</span><span class="p">.</span><span class="nf">getName</span><span class="p">());</span>
-    <span class="p">}</span>
+<div class="codehilite"><pre>    <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Creating &#39;ADGNewFolder&#39; in the root folder&quot;</span><span class="o">);</span>
+    <span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">&gt;</span> <span class="n">newFolderProps</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">&gt;();</span>
+    <span class="n">newFolderProps</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">PropertyIds</span><span class="o">.</span><span class="na">OBJECT_TYPE_ID</span><span class="o">,</span> <span class="s">&quot;cmis:folder&quot;</span><span class="o">);</span>
+    <span class="n">newFolderProps</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">PropertyIds</span><span class="o">.</span><span class="na">NAME</span><span class="o">,</span> <span class="s">&quot;ADGNewFolder&quot;</span><span class="o">);</span>
+    <span class="n">Folder</span> <span class="n">newFolder</span> <span class="o">=</span> <span class="n">root</span><span class="o">.</span><span class="na">createFolder</span><span class="o">(</span><span class="n">newFolderProps</span><span class="o">);</span>
+
+    <span class="c1">// Did it work?</span>
+    <span class="n">children</span> <span class="o">=</span> <span class="n">root</span><span class="o">.</span><span class="na">getChildren</span><span class="o">();</span>
+    <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Now finding the following objects in the root folder:-&quot;</span><span class="o">);</span>
+    <span class="k">for</span> <span class="o">(</span><span class="n">CmisObject</span> <span class="n">o</span> <span class="o">:</span> <span class="n">children</span><span class="o">)</span> <span class="o">{</span>
+        <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">o</span><span class="o">.</span><span class="na">getName</span><span class="o">());</span>
+    <span class="o">}</span>
 </pre></div>
 
 
@@ -451,31 +455,32 @@ In this code snippet a folder with the n
 There are many other properties you can set on creation, depending on the object type.</p>
 <h4 id="creating_a_a_simple_document_object">Creating a a simple document object</h4>
 <p>Document objects describe entities in the CMIS repository. A document object with content
-contains a content stream that is the actual file contents, and a mimetype for the content stream. So, to create Document Object, first you need a content stream</p>
-<div class="codehilite"><pre>     <span class="n">final</span> <span class="n">String</span> <span class="n">textFileName</span> <span class="o">=</span> <span class="s">&quot;test.txt&quot;</span><span class="p">;</span>
-     <span class="n">System</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;creating a simple text file, &quot;</span> <span class="o">+</span> <span class="n">textFileName</span><span class="p">);</span>
-     <span class="n">String</span> <span class="n">mimetype</span> <span class="o">=</span> <span class="s">&quot;text/plain; charset=UTF-8&quot;</span><span class="p">;</span>
-     <span class="n">String</span> <span class="n">content</span> <span class="o">=</span> <span class="s">&quot;This is some test content.&quot;</span><span class="p">;</span>
-     <span class="n">String</span> <span class="n">filename</span> <span class="o">=</span> <span class="n">textFileName</span><span class="p">;</span>
-
-     <span class="n">byte</span><span class="o">[]</span> <span class="n">buf</span> <span class="o">=</span> <span class="n">null</span><span class="p">;</span>
-     <span class="n">try</span> <span class="p">{</span>
-         <span class="n">buf</span> <span class="o">=</span> <span class="n">content</span><span class="o">.</span><span class="n">getBytes</span><span class="p">(</span><span class="s">&quot;UTF-8&quot;</span><span class="p">);</span>
-     <span class="p">}</span> <span class="n">catch</span> <span class="p">(</span><span class="n">UnsupportedEncodingException</span> <span class="n">e</span><span class="p">)</span> <span class="p">{</span>
-         <span class="n">e</span><span class="o">.</span><span class="n">printStackTrace</span><span class="p">();</span>
-     <span class="p">}</span>
-     <span class="n">ByteArrayInputStream</span> <span class="n">input</span> <span class="o">=</span> <span class="k">new</span> <span class="n">ByteArrayInputStream</span><span class="p">(</span><span class="n">buf</span><span class="p">);</span>
-     <span class="n">ContentStream</span> <span class="n">contentStream</span> <span class="o">=</span> <span class="n">session</span><span class="o">.</span><span class="n">getObjectFactory</span><span class="p">()</span><span class="o">.</span><span class="n">createContentStream</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span>
-             <span class="n">buf</span><span class="o">.</span><span class="nb">length</span><span class="p">,</span> <span class="n">mimetype</span><span class="p">,</span> <span class="n">input</span><span class="p">);</span>
+contains a content stream that is the actual file contents, and a mimetype for the content stream. 
+So, to create a document Object, first you need a content stream</p>
+<div class="codehilite"><pre>     <span class="kd">final</span> <span class="n">String</span> <span class="n">textFileName</span> <span class="o">=</span> <span class="s">&quot;test.txt&quot;</span><span class="o">;</span>
+     <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;creating a simple text file, &quot;</span> <span class="o">+</span> <span class="n">textFileName</span><span class="o">);</span>
+     <span class="n">String</span> <span class="n">mimetype</span> <span class="o">=</span> <span class="s">&quot;text/plain; charset=UTF-8&quot;</span><span class="o">;</span>
+     <span class="n">String</span> <span class="n">content</span> <span class="o">=</span> <span class="s">&quot;This is some test content.&quot;</span><span class="o">;</span>
+     <span class="n">String</span> <span class="n">filename</span> <span class="o">=</span> <span class="n">textFileName</span><span class="o">;</span>
+
+     <span class="kt">byte</span><span class="o">[]</span> <span class="n">buf</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
+     <span class="k">try</span> <span class="o">{</span>
+         <span class="n">buf</span> <span class="o">=</span> <span class="n">content</span><span class="o">.</span><span class="na">getBytes</span><span class="o">(</span><span class="s">&quot;UTF-8&quot;</span><span class="o">);</span>
+     <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">UnsupportedEncodingException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
+         <span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span>
+     <span class="o">}</span>
+     <span class="n">ByteArrayInputStream</span> <span class="n">input</span> <span class="o">=</span> <span class="k">new</span> <span class="n">ByteArrayInputStream</span><span class="o">(</span><span class="n">buf</span><span class="o">);</span>
+     <span class="n">ContentStream</span> <span class="n">contentStream</span> <span class="o">=</span> <span class="n">session</span><span class="o">.</span><span class="na">getObjectFactory</span><span class="o">().</span><span class="na">createContentStream</span><span class="o">(</span><span class="n">filename</span><span class="o">,</span>
+             <span class="n">buf</span><span class="o">.</span><span class="na">length</span><span class="o">,</span> <span class="n">mimetype</span><span class="o">,</span> <span class="n">input</span><span class="o">);</span>
 </pre></div>
 
 
 <p>To add a document with some content to the repository, you use the <code>createDocument()</code> method on the parent folder, and provide the content stream
 and a map of properties which define the object to be created.</p>
-<div class="codehilite"><pre>    <span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span> <span class="n">Object</span><span class="o">&gt;</span> <span class="n">properties</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span> <span class="n">Object</span><span class="o">&gt;</span><span class="p">();</span>
-    <span class="n">properties</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">PropertyIds</span><span class="o">.</span><span class="n">OBJECT_TYPE_ID</span><span class="p">,</span> <span class="s">&quot;cmis:document&quot;</span><span class="p">);</span>
-    <span class="n">properties</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">PropertyIds</span><span class="o">.</span><span class="n">NAME</span><span class="p">,</span> <span class="n">filename</span><span class="p">);</span>
-    <span class="n">ObjectId</span> <span class="n">id</span> <span class="o">=</span> <span class="n">newFolder</span><span class="o">.</span><span class="n">createDocument</span><span class="p">(</span><span class="n">properties</span><span class="p">,</span> <span class="n">contentStream</span><span class="p">,</span> <span class="n">VersioningState</span><span class="o">.</span><span class="n">MAJOR</span><span class="p">);</span>
+<div class="codehilite"><pre>    <span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Object</span><span class="o">&gt;</span> <span class="n">properties</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Object</span><span class="o">&gt;();</span>
+    <span class="n">properties</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">PropertyIds</span><span class="o">.</span><span class="na">OBJECT_TYPE_ID</span><span class="o">,</span> <span class="s">&quot;cmis:document&quot;</span><span class="o">);</span>
+    <span class="n">properties</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">PropertyIds</span><span class="o">.</span><span class="na">NAME</span><span class="o">,</span> <span class="n">filename</span><span class="o">);</span>
+    <span class="n">ObjectId</span> <span class="n">id</span> <span class="o">=</span> <span class="n">newFolder</span><span class="o">.</span><span class="na">createDocument</span><span class="o">(</span><span class="n">properties</span><span class="o">,</span> <span class="n">contentStream</span><span class="o">,</span> <span class="n">VersioningState</span><span class="o">.</span><span class="na">MAJOR</span><span class="o">);</span>
 </pre></div>
 
 
@@ -483,102 +488,105 @@ and a map of properties which define the
 <ul>
 <li>The <code>createDocument()</code> method returns the Object ID of the newly created document object. </li>
 <li>Each version of a document object has its own object ID.</li>
-<li>You can create a document without an associated content stream.</li>
+<li>You can create a document without an associated content stream, by passing null as the contentStream Parameter.</li>
 </ul>
 <h4 id="reading_the_contents_of_a_document_object">Reading the contents of a document object</h4>
 <p>You can retrieve a CMIS object by path, or by using the object ID.</p>
 <p>The following code snippet retrieves the newly created object using the object ID:-</p>
-<div class="codehilite"><pre>    <span class="sr">//</span> <span class="n">Get</span> <span class="n">the</span> <span class="n">contents</span> <span class="n">of</span> <span class="n">the</span> <span class="n">file</span>
-    <span class="n">doc</span> <span class="o">=</span> <span class="p">(</span><span class="n">Document</span><span class="p">)</span> <span class="n">session</span><span class="o">.</span><span class="n">getObject</span><span class="p">(</span><span class="n">id</span><span class="p">);</span>
-    <span class="n">try</span> <span class="p">{</span>
-        <span class="n">content</span> <span class="o">=</span> <span class="n">getContentAsString</span><span class="p">(</span><span class="n">doc</span><span class="o">.</span><span class="n">getContentStream</span><span class="p">());</span>
-    <span class="p">}</span> <span class="n">catch</span> <span class="p">(</span><span class="n">IOException</span> <span class="n">e</span><span class="p">)</span> <span class="p">{</span>
-        <span class="sr">//</span> <span class="n">TODO</span> <span class="n">Auto</span><span class="o">-</span><span class="n">generated</span> <span class="n">catch</span> <span class="n">block</span>
-        <span class="n">e</span><span class="o">.</span><span class="n">printStackTrace</span><span class="p">();</span>
-    <span class="p">}</span>
-
-    <span class="n">System</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;Contents of &quot;</span> <span class="o">+</span> <span class="n">filename</span> <span class="o">+</span> <span class="s">&quot; are: &quot;</span> <span class="o">+</span> <span class="n">content</span><span class="p">);</span>
-
-    <span class="o">...</span>
-
- <span class="o">/**</span>
- <span class="o">*</span> <span class="n">Helper</span> <span class="n">method</span> <span class="n">to</span> <span class="n">get</span> <span class="n">the</span> 
- <span class="o">*</span> <span class="nv">@param</span> <span class="n">stream</span>
- <span class="o">*</span> <span class="nv">@return</span>
- <span class="o">*</span> <span class="nv">@throws</span> <span class="n">IOException</span>
- <span class="o">*/</span>
-<span class="n">private</span> <span class="n">static</span> <span class="n">String</span> <span class="n">getContentAsString</span><span class="p">(</span><span class="n">ContentStream</span> <span class="n">stream</span><span class="p">)</span> <span class="n">throws</span> <span class="n">IOException</span> <span class="p">{</span>
-    <span class="n">InputStream</span> <span class="n">in2</span> <span class="o">=</span> <span class="n">stream</span><span class="o">.</span><span class="n">getStream</span><span class="p">();</span>
-    <span class="n">StringBuffer</span> <span class="n">sbuf</span> <span class="o">=</span> <span class="n">null</span><span class="p">;</span>
-    <span class="n">sbuf</span> <span class="o">=</span> <span class="k">new</span> <span class="n">StringBuffer</span><span class="p">(</span><span class="n">in2</span><span class="o">.</span><span class="n">available</span><span class="p">());</span>
-    <span class="nb">int</span> <span class="n">count</span><span class="p">;</span>
-    <span class="n">byte</span><span class="o">[]</span> <span class="n">buf2</span> <span class="o">=</span> <span class="k">new</span> <span class="n">byte</span><span class="p">[</span><span class="mi">100</span><span class="p">];</span>
-    <span class="k">while</span> <span class="p">((</span><span class="n">count</span> <span class="o">=</span> <span class="n">in2</span><span class="o">.</span><span class="nb">read</span><span class="p">(</span><span class="n">buf2</span><span class="p">))</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
-        <span class="k">for</span> <span class="p">(</span><span class="nb">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">count</span><span class="p">;</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
-            <span class="n">sbuf</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">char</span><span class="p">)</span> <span class="n">buf2</span><span class="p">[</span><span class="n">i</span><span class="p">]);</span>
-        <span class="p">}</span>
-    <span class="p">}</span>
-    <span class="n">in2</span><span class="o">.</span><span class="nb">close</span><span class="p">();</span>
-    <span class="k">return</span> <span class="n">sbuf</span><span class="o">.</span><span class="n">toString</span><span class="p">();</span>
-<span class="p">}</span>
+<div class="codehilite"><pre><span class="c1">// Get the contents of the file</span>
+<span class="n">doc</span> <span class="o">=</span> <span class="o">(</span><span class="n">Document</span><span class="o">)</span> <span class="n">session</span><span class="o">.</span><span class="na">getObject</span><span class="o">(</span><span class="n">id</span><span class="o">);</span>
+<span class="k">try</span> <span class="o">{</span>
+    <span class="n">content</span> <span class="o">=</span> <span class="n">getContentAsString</span><span class="o">(</span><span class="n">doc</span><span class="o">.</span><span class="na">getContentStream</span><span class="o">());</span>
+<span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">IOException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
+    <span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span>
+<span class="o">}</span>
+
+<span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Contents of &quot;</span> <span class="o">+</span> <span class="n">filename</span> <span class="o">+</span> <span class="s">&quot; are: &quot;</span> <span class="o">+</span> <span class="n">content</span><span class="o">);</span>
+
+<span class="o">...</span>
+
+<span class="cm">/**</span>
+<span class="cm"> * Helper method to get the contents of a stream</span>
+<span class="cm"> * </span>
+<span class="cm"> * @param stream</span>
+<span class="cm"> * @return</span>
+<span class="cm"> * @throws IOException</span>
+<span class="cm"> */</span>
+<span class="kd">private</span> <span class="kd">static</span> <span class="n">String</span> <span class="nf">getContentAsString</span><span class="o">(</span><span class="n">ContentStream</span> <span class="n">stream</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">IOException</span> <span class="o">{</span>
+    <span class="n">InputStream</span> <span class="n">in2</span> <span class="o">=</span> <span class="n">stream</span><span class="o">.</span><span class="na">getStream</span><span class="o">();</span>
+    <span class="n">StringBuffer</span> <span class="n">sbuf</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
+    <span class="n">sbuf</span> <span class="o">=</span> <span class="k">new</span> <span class="n">StringBuffer</span><span class="o">(</span><span class="n">in2</span><span class="o">.</span><span class="na">available</span><span class="o">());</span>
+    <span class="kt">int</span> <span class="n">count</span><span class="o">;</span>
+    <span class="kt">byte</span><span class="o">[]</span> <span class="n">buf2</span> <span class="o">=</span> <span class="k">new</span> <span class="kt">byte</span><span class="o">[</span><span class="mi">100</span><span class="o">];</span>
+    <span class="k">while</span> <span class="o">((</span><span class="n">count</span> <span class="o">=</span> <span class="n">in2</span><span class="o">.</span><span class="na">read</span><span class="o">(</span><span class="n">buf2</span><span class="o">))</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span><span class="o">)</span> <span class="o">{</span>
+        <span class="k">for</span> <span class="o">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">count</span><span class="o">;</span> <span class="n">i</span><span class="o">++)</span> <span class="o">{</span>
+            <span class="n">sbuf</span><span class="o">.</span><span class="na">append</span><span class="o">((</span><span class="kt">char</span><span class="o">)</span> <span class="n">buf2</span><span class="o">[</span><span class="n">i</span><span class="o">]);</span>
+        <span class="o">}</span>
+    <span class="o">}</span>
+    <span class="n">in2</span><span class="o">.</span><span class="na">close</span><span class="o">();</span>
+    <span class="k">return</span> <span class="n">sbuf</span><span class="o">.</span><span class="na">toString</span><span class="o">();</span>
+<span class="o">}</span>
 </pre></div>
 
 
 <p>The following code snippet retrieves the newly created object using a path:-</p>
-<div class="codehilite"><pre>    <span class="n">String</span> <span class="n">path</span> <span class="o">=</span> <span class="n">newFolder</span><span class="o">.</span><span class="n">getPath</span><span class="p">()</span> <span class="o">+</span> <span class="s">&quot;/&quot;</span> <span class="o">+</span> <span class="n">textFileName</span><span class="p">;</span>
-    <span class="n">System</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;Getting object by path &quot;</span> <span class="o">+</span> <span class="n">path</span><span class="p">);</span>
-    <span class="n">doc</span> <span class="o">=</span> <span class="p">(</span><span class="n">Document</span><span class="p">)</span> <span class="n">session</span><span class="o">.</span><span class="n">getObjectByPath</span><span class="p">(</span><span class="n">path</span><span class="p">);</span>
-    <span class="n">try</span> <span class="p">{</span>
-        <span class="n">content</span> <span class="o">=</span> <span class="n">getContentAsString</span><span class="p">(</span><span class="n">doc</span><span class="o">.</span><span class="n">getContentStream</span><span class="p">());</span>
-    <span class="p">}</span> <span class="n">catch</span> <span class="p">(</span><span class="n">IOException</span> <span class="n">e</span><span class="p">)</span> <span class="p">{</span>
-        <span class="n">e</span><span class="o">.</span><span class="n">printStackTrace</span><span class="p">();</span>
-    <span class="p">}</span>
+<div class="codehilite"><pre><span class="n">String</span> <span class="n">path</span> <span class="o">=</span> <span class="n">newFolder</span><span class="o">.</span><span class="na">getPath</span><span class="o">()</span> <span class="o">+</span> <span class="s">&quot;/&quot;</span> <span class="o">+</span> <span class="n">textFileName</span><span class="o">;</span>
+<span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Getting object by path &quot;</span> <span class="o">+</span> <span class="n">path</span><span class="o">);</span>
+<span class="n">doc</span> <span class="o">=</span> <span class="o">(</span><span class="n">Document</span><span class="o">)</span> <span class="n">session</span><span class="o">.</span><span class="na">getObjectByPath</span><span class="o">(</span><span class="n">path</span><span class="o">);</span>
+<span class="k">try</span> <span class="o">{</span>
+    <span class="n">content</span> <span class="o">=</span> <span class="n">getContentAsString</span><span class="o">(</span><span class="n">doc</span><span class="o">.</span><span class="na">getContentStream</span><span class="o">());</span>
+<span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">IOException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
+    <span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span>
+<span class="o">}</span>
 </pre></div>
 
 
 <p>Note the following points :-</p>
 <ul>
 <li>All paths start with the root folder <code>/</code>. </li>
-<li>The <code>Document</code> class does not have a <code>getPath()</code> method, since multifiling means a document can have more than one parent folder. It does implement the 
-<code>getPaths()</code> method from the <code>FileableCmisObject</code> interface. This returns a list of the current paths to the document object. </li>
+<li>The <a href="http://incubator.apache.org/chemistry/javadoc/org/apache/chemistry/opencmis/client/api/Document.html"><code>Document</code></a> 
+class does not have a <code>getPath()</code> method, since multifiling means a document can have more than one parent folder. It does implement the 
+<code>getPaths()</code> method from the <a href="http://incubator.apache.org/chemistry/javadoc/org/apache/chemistry/opencmis/client/api/FileableCmisObject.html"><code>FileableCmisObject</code></a> interface. 
+This returns a list of the current paths to the document object. </li>
 </ul>
 <h4 id="updating_a_document">Updating a document.</h4>
-<p>You can update the properties of a Document object, and you update the contents of the document by overwriting the document's content stream with a new content stream.
+<p>You can update the properties of a document object, and you update the contents of the document by overwriting the document's content stream with a new content stream.
 Note that the object ID returned when updating a document is not guaranteed to remain the same, some repository implementations return the same object ID, and some may not.</p>
 <p>The following code snippet updates the name property of the <code>test2.txt</code> document:-</p>
-<div class="codehilite"><pre>    <span class="n">Document</span> <span class="n">doc2</span> <span class="o">=</span> <span class="p">(</span><span class="n">Document</span><span class="p">)</span> <span class="n">session</span><span class="o">.</span><span class="n">getObject</span><span class="p">(</span><span class="n">id2</span><span class="p">);</span>        
-    <span class="n">System</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;renaming &quot;</span> <span class="o">+</span> <span class="n">doc2</span><span class="o">.</span><span class="n">getName</span><span class="p">()</span> <span class="o">+</span> <span class="s">&quot; to test3.txt&quot;</span><span class="p">);</span>
-    <span class="n">properties</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span> <span class="n">Object</span><span class="o">&gt;</span><span class="p">();</span>
-    <span class="n">properties</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">PropertyIds</span><span class="o">.</span><span class="n">NAME</span><span class="p">,</span> <span class="s">&quot;test3.txt&quot;</span><span class="p">);</span>
-    <span class="n">id2</span> <span class="o">=</span> <span class="n">doc2</span><span class="o">.</span><span class="n">updateProperties</span><span class="p">(</span><span class="n">properties</span><span class="p">);</span>
-    <span class="n">System</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;renamed to &quot;</span> <span class="o">+</span> <span class="n">doc2</span><span class="o">.</span><span class="n">getName</span><span class="p">());</span>
+<div class="codehilite"><pre><span class="n">Document</span> <span class="n">doc2</span> <span class="o">=</span> <span class="o">(</span><span class="n">Document</span><span class="o">)</span> <span class="n">session</span><span class="o">.</span><span class="na">getObject</span><span class="o">(</span><span class="n">id2</span><span class="o">);</span>        
+<span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;renaming &quot;</span> <span class="o">+</span> <span class="n">doc2</span><span class="o">.</span><span class="na">getName</span><span class="o">()</span> <span class="o">+</span> <span class="s">&quot; to test3.txt&quot;</span><span class="o">);</span>
+<span class="n">properties</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Object</span><span class="o">&gt;();</span>
+<span class="n">properties</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">PropertyIds</span><span class="o">.</span><span class="na">NAME</span><span class="o">,</span> <span class="s">&quot;test3.txt&quot;</span><span class="o">);</span>
+<span class="n">id2</span> <span class="o">=</span> <span class="n">doc2</span><span class="o">.</span><span class="na">updateProperties</span><span class="o">(</span><span class="n">properties</span><span class="o">);</span>
+<span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;renamed to &quot;</span> <span class="o">+</span> <span class="n">doc2</span><span class="o">.</span><span class="na">getName</span><span class="o">());</span>
 </pre></div>
 
 
-<p>You can update the contents of a document by setting a new content stream using the <code>setContentStream()</code> method.
+<p>You can update the contents of a document by setting a new <a href="http://incubator.apache.org/chemistry/javadoc/org/apache/chemistry/opencmis/commons/data/ContentStream.html">ContentStream</a> 
+using the <code>setContentStream()</code> method.
 You must set the overwrite flag if the document has existing content, otherwise an exception will be thrown. The following code snippet updated the content of the <code>test3.txt</code> document:-</p>
-<div class="codehilite"><pre>    <span class="n">content</span> <span class="o">=</span> <span class="s">&quot;This is some updated test content for our renamed second document.&quot;</span><span class="p">;</span>
-    <span class="n">buf</span> <span class="o">=</span> <span class="n">null</span><span class="p">;</span>
-    <span class="n">try</span> <span class="p">{</span>
-        <span class="n">buf</span> <span class="o">=</span> <span class="n">content</span><span class="o">.</span><span class="n">getBytes</span><span class="p">(</span><span class="s">&quot;UTF-8&quot;</span><span class="p">);</span>
-    <span class="p">}</span> <span class="n">catch</span> <span class="p">(</span><span class="n">UnsupportedEncodingException</span> <span class="n">e</span><span class="p">)</span> <span class="p">{</span>
-        <span class="n">e</span><span class="o">.</span><span class="n">printStackTrace</span><span class="p">();</span>
-    <span class="p">}</span>
-    <span class="n">input</span> <span class="o">=</span> <span class="k">new</span> <span class="n">ByteArrayInputStream</span><span class="p">(</span><span class="n">buf</span><span class="p">);</span>
-    <span class="n">contentStream</span> <span class="o">=</span> <span class="n">session</span><span class="o">.</span><span class="n">getObjectFactory</span><span class="p">()</span><span class="o">.</span><span class="n">createContentStream</span><span class="p">(</span><span class="s">&quot;test3.txt&quot;</span><span class="p">,</span> <span class="n">buf</span><span class="o">.</span><span class="nb">length</span><span class="p">,</span>
-            <span class="n">mimetype</span><span class="p">,</span> <span class="n">input</span><span class="p">);</span>
-    <span class="n">properties</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span> <span class="n">Object</span><span class="o">&gt;</span><span class="p">();</span>
-    <span class="n">properties</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">PropertyIds</span><span class="o">.</span><span class="n">OBJECT_TYPE_ID</span><span class="p">,</span> <span class="s">&quot;cmis:document&quot;</span><span class="p">);</span>
-    <span class="n">properties</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">PropertyIds</span><span class="o">.</span><span class="n">NAME</span><span class="p">,</span> <span class="s">&quot;test3.txt&quot;</span><span class="p">);</span>
-    <span class="n">doc2</span><span class="o">.</span><span class="n">setContentStream</span><span class="p">(</span><span class="n">contentStream</span><span class="p">,</span> <span class="n">true</span><span class="p">);</span>
-
-    <span class="sr">//</span> <span class="n">did</span> <span class="n">it</span> <span class="n">work</span><span class="p">?</span>
-    <span class="n">try</span> <span class="p">{</span>
-        <span class="n">content</span> <span class="o">=</span> <span class="n">getContentAsString</span><span class="p">(</span><span class="n">doc2</span><span class="o">.</span><span class="n">getContentStream</span><span class="p">());</span>
-    <span class="p">}</span> <span class="n">catch</span> <span class="p">(</span><span class="n">IOException</span> <span class="n">e</span><span class="p">)</span> <span class="p">{</span>
-        <span class="n">e</span><span class="o">.</span><span class="n">printStackTrace</span><span class="p">();</span>
-    <span class="p">}</span>
-    <span class="n">System</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;Contents of &quot;</span> <span class="o">+</span> <span class="n">doc2</span><span class="o">.</span><span class="n">getName</span><span class="p">()</span> <span class="o">+</span> <span class="s">&quot; are: &quot;</span> <span class="o">+</span> <span class="n">content</span><span class="p">);</span>
+<div class="codehilite"><pre><span class="n">content</span> <span class="o">=</span> <span class="s">&quot;This is some updated test content for our renamed second document.&quot;</span><span class="o">;</span>
+<span class="n">buf</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
+<span class="k">try</span> <span class="o">{</span>
+    <span class="n">buf</span> <span class="o">=</span> <span class="n">content</span><span class="o">.</span><span class="na">getBytes</span><span class="o">(</span><span class="s">&quot;UTF-8&quot;</span><span class="o">);</span>
+<span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">UnsupportedEncodingException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
+    <span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span>
+<span class="o">}</span>
+<span class="n">input</span> <span class="o">=</span> <span class="k">new</span> <span class="n">ByteArrayInputStream</span><span class="o">(</span><span class="n">buf</span><span class="o">);</span>
+<span class="n">contentStream</span> <span class="o">=</span> <span class="n">session</span><span class="o">.</span><span class="na">getObjectFactory</span><span class="o">().</span><span class="na">createContentStream</span><span class="o">(</span><span class="s">&quot;test3.txt&quot;</span><span class="o">,</span> <span class="n">buf</span><span class="o">.</span><span class="na">length</span><span class="o">,</span>
+        <span class="n">mimetype</span><span class="o">,</span> <span class="n">input</span><span class="o">);</span>
+<span class="n">properties</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Object</span><span class="o">&gt;();</span>
+<span class="n">properties</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">PropertyIds</span><span class="o">.</span><span class="na">OBJECT_TYPE_ID</span><span class="o">,</span> <span class="s">&quot;cmis:document&quot;</span><span class="o">);</span>
+<span class="n">properties</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">PropertyIds</span><span class="o">.</span><span class="na">NAME</span><span class="o">,</span> <span class="s">&quot;test3.txt&quot;</span><span class="o">);</span>
+<span class="n">doc2</span><span class="o">.</span><span class="na">setContentStream</span><span class="o">(</span><span class="n">contentStream</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
+
+<span class="c1">// did it work?</span>
+<span class="k">try</span> <span class="o">{</span>
+    <span class="n">content</span> <span class="o">=</span> <span class="n">getContentAsString</span><span class="o">(</span><span class="n">doc2</span><span class="o">.</span><span class="na">getContentStream</span><span class="o">());</span>
+<span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">IOException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
+    <span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span>
+<span class="o">}</span>
+<span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Contents of &quot;</span> <span class="o">+</span> <span class="n">doc2</span><span class="o">.</span><span class="na">getName</span><span class="o">()</span> <span class="o">+</span> <span class="s">&quot; are: &quot;</span> <span class="o">+</span> <span class="n">content</span><span class="o">);</span>
 </pre></div>
 
 
@@ -586,37 +594,37 @@ You must set the overwrite flag if the d
 <p>You can delete any CMIS object using the <code>delete</code> method. The following code snippet lists the 
 contents of the test folder before and after a delete of one of the two documents
 in the folder.</p>
-<div class="codehilite"><pre>    <span class="s-Atom">children</span> <span class="o">=</span> <span class="s-Atom">newFolder</span><span class="p">.</span><span class="nf">getChildren</span><span class="p">();</span>
-    <span class="nv">System</span><span class="p">.</span><span class="s-Atom">out</span><span class="p">.</span><span class="nf">println</span><span class="p">(</span><span class="s2">&quot;Now finding the following objects in our folder:-&quot;</span><span class="p">);</span>
-    <span class="nf">for</span> <span class="p">(</span><span class="nv">CmisObject</span> <span class="s-Atom">o</span> <span class="s-Atom">:</span> <span class="s-Atom">children</span><span class="p">)</span> <span class="p">{</span>
-        <span class="nv">System</span><span class="p">.</span><span class="s-Atom">out</span><span class="p">.</span><span class="nf">println</span><span class="p">(</span><span class="s-Atom">o</span><span class="p">.</span><span class="nf">getName</span><span class="p">());</span>
-    <span class="p">}</span>
-    <span class="nv">System</span><span class="p">.</span><span class="s-Atom">out</span><span class="p">.</span><span class="nf">println</span><span class="p">(</span><span class="s2">&quot;Deleting document &quot;</span> <span class="o">+</span> <span class="s-Atom">doc2</span><span class="p">.</span><span class="nf">getName</span><span class="p">());</span>
-    <span class="s-Atom">doc2</span><span class="p">.</span><span class="nf">delete</span><span class="p">(</span><span class="s-Atom">true</span><span class="p">);</span>
-    <span class="nv">System</span><span class="p">.</span><span class="s-Atom">out</span><span class="p">.</span><span class="nf">println</span><span class="p">(</span><span class="s2">&quot;Now finding the following objects in our folder:-&quot;</span><span class="p">);</span>
-    <span class="nf">for</span> <span class="p">(</span><span class="nv">CmisObject</span> <span class="s-Atom">o</span> <span class="s-Atom">:</span> <span class="s-Atom">children</span><span class="p">)</span> <span class="p">{</span>
-        <span class="nv">System</span><span class="p">.</span><span class="s-Atom">out</span><span class="p">.</span><span class="nf">println</span><span class="p">(</span><span class="s-Atom">o</span><span class="p">.</span><span class="nf">getName</span><span class="p">());</span>
-    <span class="p">}</span>
+<div class="codehilite"><pre>    <span class="n">children</span> <span class="o">=</span> <span class="n">newFolder</span><span class="o">.</span><span class="na">getChildren</span><span class="o">();</span>
+    <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Now finding the following objects in our folder:-&quot;</span><span class="o">);</span>
+    <span class="k">for</span> <span class="o">(</span><span class="n">CmisObject</span> <span class="n">o</span> <span class="o">:</span> <span class="n">children</span><span class="o">)</span> <span class="o">{</span>
+        <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">o</span><span class="o">.</span><span class="na">getName</span><span class="o">());</span>
+    <span class="o">}</span>
+    <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Deleting document &quot;</span> <span class="o">+</span> <span class="n">doc2</span><span class="o">.</span><span class="na">getName</span><span class="o">());</span>
+    <span class="n">doc2</span><span class="o">.</span><span class="na">delete</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
+    <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Now finding the following objects in our folder:-&quot;</span><span class="o">);</span>
+    <span class="k">for</span> <span class="o">(</span><span class="n">CmisObject</span> <span class="n">o</span> <span class="o">:</span> <span class="n">children</span><span class="o">)</span> <span class="o">{</span>
+        <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">o</span><span class="o">.</span><span class="na">getName</span><span class="o">());</span>
+    <span class="o">}</span>
 </pre></div>
 
 
-<p>Note that the <code>allVersions</code> flag is set o <code>true</code>. If you set it to false then the delete will
+<p>Note that the <code>allVersions</code> flag is set to <code>true</code>. If you set it to false then the delete will
 be of this version only.</p>
 <h4 id="deleting_a_folder_tree">Deleting a folder tree</h4>
 <p>You can delete a folder and all its contents using just one method. The following code snippet
 creates a new folder tree and then deletes it, ignoring any failures to delete individual objects, and deleting
 all versions of any documents in the tree.</p>
-<div class="codehilite"><pre>    <span class="n">System</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;Creating &#39;ADGFolder1&#39; in the root folder&quot;</span><span class="p">);</span>
-    <span class="n">newFolderProps</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span> <span class="n">String</span><span class="o">&gt;</span><span class="p">();</span>
-    <span class="n">newFolderProps</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">PropertyIds</span><span class="o">.</span><span class="n">OBJECT_TYPE_ID</span><span class="p">,</span> <span class="s">&quot;cmis:folder&quot;</span><span class="p">);</span>
-    <span class="n">newFolderProps</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">PropertyIds</span><span class="o">.</span><span class="n">NAME</span><span class="p">,</span> <span class="s">&quot;ADGFolder1&quot;</span><span class="p">);</span>
-    <span class="n">Folder</span> <span class="n">folder1</span> <span class="o">=</span> <span class="n">root</span><span class="o">.</span><span class="n">createFolder</span><span class="p">(</span><span class="n">newFolderProps</span><span class="p">);</span>
-    <span class="n">newFolderProps</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">PropertyIds</span><span class="o">.</span><span class="n">NAME</span><span class="p">,</span> <span class="s">&quot;ADGFolder11&quot;</span><span class="p">);</span>
-    <span class="n">Folder</span> <span class="n">folder11</span> <span class="o">=</span> <span class="n">folder1</span><span class="o">.</span><span class="n">createFolder</span><span class="p">(</span><span class="n">newFolderProps</span><span class="p">);</span>
-    <span class="n">newFolderProps</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">PropertyIds</span><span class="o">.</span><span class="n">NAME</span><span class="p">,</span> <span class="s">&quot;ADGFolder12&quot;</span><span class="p">);</span>
-    <span class="n">Folder</span> <span class="n">folder12</span> <span class="o">=</span> <span class="n">folder1</span><span class="o">.</span><span class="n">createFolder</span><span class="p">(</span><span class="n">newFolderProps</span><span class="p">);</span>
-    <span class="n">System</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;delete the &#39;ADGFolder1&#39; tree&quot;</span><span class="p">);</span>        
-    <span class="n">folder1</span><span class="o">.</span><span class="n">deleteTree</span><span class="p">(</span><span class="n">true</span><span class="p">,</span> <span class="n">UnfileObject</span><span class="o">.</span><span class="n">DELETE</span><span class="p">,</span> <span class="n">true</span><span class="p">);</span>
+<div class="codehilite"><pre>    <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Creating &#39;ADGFolder1&#39; in the root folder&quot;</span><span class="o">);</span>
+    <span class="n">newFolderProps</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">&gt;();</span>
+    <span class="n">newFolderProps</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">PropertyIds</span><span class="o">.</span><span class="na">OBJECT_TYPE_ID</span><span class="o">,</span> <span class="s">&quot;cmis:folder&quot;</span><span class="o">);</span>
+    <span class="n">newFolderProps</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">PropertyIds</span><span class="o">.</span><span class="na">NAME</span><span class="o">,</span> <span class="s">&quot;ADGFolder1&quot;</span><span class="o">);</span>
+    <span class="n">Folder</span> <span class="n">folder1</span> <span class="o">=</span> <span class="n">root</span><span class="o">.</span><span class="na">createFolder</span><span class="o">(</span><span class="n">newFolderProps</span><span class="o">);</span>
+    <span class="n">newFolderProps</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">PropertyIds</span><span class="o">.</span><span class="na">NAME</span><span class="o">,</span> <span class="s">&quot;ADGFolder11&quot;</span><span class="o">);</span>
+    <span class="n">Folder</span> <span class="n">folder11</span> <span class="o">=</span> <span class="n">folder1</span><span class="o">.</span><span class="na">createFolder</span><span class="o">(</span><span class="n">newFolderProps</span><span class="o">);</span>
+    <span class="n">newFolderProps</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">PropertyIds</span><span class="o">.</span><span class="na">NAME</span><span class="o">,</span> <span class="s">&quot;ADGFolder12&quot;</span><span class="o">);</span>
+    <span class="n">Folder</span> <span class="n">folder12</span> <span class="o">=</span> <span class="n">folder1</span><span class="o">.</span><span class="na">createFolder</span><span class="o">(</span><span class="n">newFolderProps</span><span class="o">);</span>
+    <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;delete the &#39;ADGFolder1&#39; tree&quot;</span><span class="o">);</span>        
+    <span class="n">folder1</span><span class="o">.</span><span class="na">deleteTree</span><span class="o">(</span><span class="kc">true</span><span class="o">,</span> <span class="n">UnfileObject</span><span class="o">.</span><span class="na">DELETE</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
 </pre></div>
 
 
@@ -630,100 +638,99 @@ no objects are deleted. In other reposit
 <h4 id="navigating_through_a_folder_tree">Navigating through a folder tree</h4>
 <p>CMIS provides several concepts for navigating through the tree of objects in the repository. For any folder, 
 you can get its children, get its descendants, and get the folder tree. The getting started sample application sets
-up a tree in the repository that looks like this:-</p>
-<img src="images/FileTree.png" />
-
+up a tree in the repository that looks like this:-
+<img src="images/FileTree.png" /></p>
 <p>The following snippet from the getting started sample will print out the children of a folder :-</p>
-<div class="codehilite"><pre>    <span class="s-Atom">children</span> <span class="o">=</span> <span class="s-Atom">folder1</span><span class="p">.</span><span class="nf">getChildren</span><span class="p">();</span>
-    <span class="nv">System</span><span class="p">.</span><span class="s-Atom">out</span><span class="p">.</span><span class="nf">println</span><span class="p">(</span><span class="s2">&quot;Children of &quot;</span> <span class="o">+</span> <span class="s-Atom">folder1</span><span class="p">.</span><span class="nf">getName</span><span class="p">()</span> <span class="o">+</span> <span class="s2">&quot;:-&quot;</span><span class="p">);</span>
-    <span class="nf">for</span> <span class="p">(</span><span class="nv">CmisObject</span> <span class="s-Atom">o</span> <span class="s-Atom">:</span> <span class="s-Atom">children</span><span class="p">)</span> <span class="p">{</span>
-        <span class="nv">System</span><span class="p">.</span><span class="s-Atom">out</span><span class="p">.</span><span class="nf">println</span><span class="p">(</span><span class="s-Atom">o</span><span class="p">.</span><span class="nf">getName</span><span class="p">());</span>
-    <span class="p">}</span>
+<div class="codehilite"><pre>    <span class="n">children</span> <span class="o">=</span> <span class="n">folder1</span><span class="o">.</span><span class="na">getChildren</span><span class="o">();</span>
+    <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Children of &quot;</span> <span class="o">+</span> <span class="n">folder1</span><span class="o">.</span><span class="na">getName</span><span class="o">()</span> <span class="o">+</span> <span class="s">&quot;:-&quot;</span><span class="o">);</span>
+    <span class="k">for</span> <span class="o">(</span><span class="n">CmisObject</span> <span class="n">o</span> <span class="o">:</span> <span class="n">children</span><span class="o">)</span> <span class="o">{</span>
+        <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">o</span><span class="o">.</span><span class="na">getName</span><span class="o">());</span>
+    <span class="o">}</span>
 </pre></div>
 
 
 <p>Note that the children of a Folder object can be of any type supported by the repository. 
 Running the sample produces the following output :-</p>
-<div class="codehilite"><pre><span class="nv">Children</span> <span class="s-Atom">of</span> <span class="nv">ADGFolder1</span><span class="p">:-</span>
-<span class="nv">ADGFolder11</span>
-<span class="nv">ADGFolder12</span>
-<span class="nv">ADGFile1f1</span>
+<div class="codehilite"><pre>Children of ADGFolder1:-
+ADGFolder11
+ADGFolder12
+ADGFile1f1
 </pre></div>
 
 
 <p>If your repository supports <code>getDescendants</code>, you can navigate the whole subtree of descendants of any folder. 
 This code snippet uses a recursive method to print out the entire folder subtree:-</p>
-<div class="codehilite"><pre><span class="nf">if</span> <span class="p">(!</span><span class="s-Atom">session</span><span class="p">.</span><span class="nf">getRepositoryInfo</span><span class="p">().</span><span class="nf">getCapabilities</span><span class="p">().</span><span class="o">is</span><span class="nv">GetDescendantsSupported</span><span class="p">())</span> <span class="p">{</span>

[... 1021 lines stripped ...]


Mime
View raw message