chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r852943 [2/2] - in /websites/staging/chemistry/trunk/content: ./ java/developing/guide.html
Date Mon, 04 Mar 2013 15:13:40 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 Mon Mar  4 15:13:39 2013
@@ -194,7 +194,7 @@ Apache Chemistry - OpenCMIS Client API D
              <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-compliant
-content repositories from java code. The examples included in the guide assume the code is running in
+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>
 <h3 id="how-to-use-this-guide">How to use this guide</h3>
@@ -225,7 +225,7 @@ among document systems, publishers and r
 It is available under the open source <a href="http://www.apache.org/licenses/">Apache License</a> from the
 <a href="http://chemistry.apache.org/">Apache Chemistry project</a>.
 The OpenCMIS Client API is a Java client-side library that implements the CMIS specification. You can see the Javadoc for the 
-OpenCMIS Client API <a href="http://chemistry.apache.org/java/0.4.0/maven/apidocs/org/apache/chemistry/opencmis/client/api/package-summary.html">here</a>.
+OpenCMIS Client API <a href="http://chemistry.apache.org/java/0.8.0/maven/apidocs/org/apache/chemistry/opencmis/client/api/package-summary.html">here</a>.
 CMIS defines a domain model that describes a vendor-neutral ECM repository and its contents, a set of services to work with the 
 repository and its content, and a set of bindings which a client uses to access the services.</p>
 <h4 id="the-cmis-domain-model">The CMIS Domain Model</h4>
@@ -276,7 +276,7 @@ by using the <a href="http://chemistry.a
 <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 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://chemistry.apache.org/java/0.4.0/maven/apidocs/org/apache/chemistry/opencmis/client/api/SessionFactory.html"><code>SessionFactory</code></a> object.</p>
+the <a href="http://chemistry.apache.org/java/0.8.0/maven/apidocs/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
@@ -313,18 +313,14 @@ 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>
-<div class="codehilite"><pre>mvn eclipse:configure-workspace -Declipse.workspace=&lt;path-to-your-eclipse-workspace&gt;
-</pre></div>
-
-
+<p>:::text
+mvn eclipse:configure-workspace -Declipse.workspace=<path-to-your-eclipse-workspace></p>
 </li>
 <li>
-<p>Create a an eclipse project from the code, and import it into your eclipse.
+<p>Create an Eclipse project from the code, and import it into your eclipse.
 Type the following command :-</p>
-<div class="codehilite"><pre>mvn eclipse:eclipse
-</pre></div>
-
-
+<p>:::text
+mvn eclipse:eclipse</p>
 </li>
 <li>
 <p>Import the project into eclipse:-</p>
@@ -343,8 +339,7 @@ OpenCMIS API in the next section.</p>
 <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>
-<div class="codehilite"><pre>svn co \
-https://svn.apache.org/repos/asf/chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-getting-started
+<div class="codehilite"><pre>svn co https://svn.apache.org/repos/asf/chemistry/opencmis/trunk/chemistry-opencmis-samples/chemistry-opencmis-getting-started
 </pre></div>
 
 
@@ -379,23 +374,20 @@ 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="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://repo.opencmis.org/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>
-
-
+<p>:::java
+SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
+Map<String, String> parameter = new HashMap<String, String>();
+parameter.put(SessionParameter.USER, "admin");
+parameter.put(SessionParameter.PASSWORD, "admin");
+parameter.put(SessionParameter.ATOMPUB_URL, "http://repo.opencmis.org/inmemory/atom/");
+parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());</p>
 </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 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="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>
+<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>
 
 
@@ -403,22 +395,20 @@ 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="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>
+<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="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="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>
+<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">Session</span> <span class="n">session</span> <span class="o">=</span> <span class="n">repository</span><span class="o">.</span><span class="na">createSession</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>
 
 
@@ -433,12 +423,13 @@ capabilities.</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 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="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>
+<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>
 
 
@@ -446,57 +437,57 @@ 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="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>
+<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">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;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>
 
 
 <p>Note that the properties set for in the above code snippet are the minimum set of name and object type id. 
 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>
+<h4 id="creating-a-simple-document-object">Creating 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 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>
+<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="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="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="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>
+<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">Document</span> <span class="n">doc</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>
+
+<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;Document ID: &quot;</span> <span class="o">+</span> <span class="n">doc</span><span class="o">.</span><span class="na">getId</span><span class="o">());</span>
 </pre></div>
 
 
 <p>Note the following points :-</p>
 <ul>
-<li>The <code>createDocument()</code> method returns the Object ID of the newly created document object. </li>
+<li>The <code>createDocument()</code> method returns 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, by passing null as the contentStream Parameter.</li>
 </ul>
@@ -504,15 +495,15 @@ and a map of properties which define the
 <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="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="n">Document</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="n">ContentStream</span> <span class="n">contentStream</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="c1">// returns null if the document has no content</span>
+<span class="k">if</span> <span class="o">(</span><span class="n">contentStream</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
+    <span class="n">String</span> <span class="n">content</span> <span class="o">=</span> <span class="n">getContentAsString</span><span class="o">(</span><span class="n">contentStream</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="k">else</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;No content.&quot;</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>
@@ -549,11 +540,11 @@ and a map of properties which define the
 <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="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="n">Document</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="n">ContentStream</span> <span class="n">contentStream</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="k">if</span> <span class="o">(</span><span class="n">contentStream</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
+    <span class="n">String</span> <span class="n">content</span> <span class="o">=</span> <span class="n">getContentAsString</span><span class="o">(</span><span class="n">contentStream</span><span class="o">);</span>
 <span class="o">}</span>
 </pre></div>
 
@@ -561,9 +552,9 @@ and a map of properties which define the
 <p>Note the following points :-</p>
 <ul>
 <li>All paths start with the root folder <code>/</code>. </li>
-<li>The <a href="http://chemistry.apache.org/java/0.4.0/maven/apidocs/org/apache/chemistry/opencmis/client/api/Document.html"><code>Document</code></a> 
+<li>The <a href="http://chemistry.apache.org/java/0.8.0/maven/apidocs/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://chemistry.apache.org/java/0.4.0/maven/apidocs/org/apache/chemistry/opencmis/client/api/FileableCmisObject.html"><code>FileableCmisObject</code></a> interface. 
+<code>getPaths()</code> method from the <a href="http://chemistry.apache.org/java/0.8.0/maven/apidocs/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>
@@ -572,14 +563,17 @@ Note that the object ID returned when up
 <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="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">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">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">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="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;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 <a href="http://chemistry.apache.org/java/0.4.0/maven/apidocs/org/apache/chemistry/opencmis/commons/data/ContentStream.html">ContentStream</a> 
+<p>You can update the contents of a document by setting a new <a href="http://chemistry.apache.org/java/0.8.0/maven/apidocs/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="k">if</span> <span class="o">(!</span><span class="n">session</span><span class="o">.</span><span class="na">getRepositoryInfo</span><span class="o">().</span><span class="na">getCapabilities</span><span class="o">().</span><span class="na">getContentStreamUpdatesCapability</span><span class="o">()</span>
@@ -587,28 +581,25 @@ You must set the overwrite flag if the d
     <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;update without checkout not supported in this repository&quot;</span><span class="o">);</span>
 <span class="o">}</span> <span class="k">else</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;updating content stream&quot;</span><span class="o">);</span>
-    <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">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 updated test content for our renamed second document.&quot;</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="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="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">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="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">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="n">contentStream</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="k">if</span> <span class="o">(</span><span class="n">contentStream</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</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">contentStream</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>
+    <span class="o">}</span> <span class="k">else</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;Something went wrong.&quot;</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>
 <span class="o">}</span>
 </pre></div>
 
@@ -619,17 +610,20 @@ For more information on checkout see the
 <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="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>
+<div class="codehilite"><pre><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">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>
 
 
@@ -640,14 +634,17 @@ be of this version only.</p>
 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="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">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;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>
@@ -666,11 +663,11 @@ you can get its children, get its descen
 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="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>
+<div class="codehilite"><pre><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">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>
 
 
@@ -707,7 +704,7 @@ This code snippet uses a recursive metho
 
 <p>Note the following points:-</p>
 <ol>
-<li>The children of a <a href="http://chemistry.apache.org/java/0.4.0/maven/apidocs/org/apache/chemistry/opencmis/client/api/Tree.html"><code>Tree</code></a> are themselves of type <code>Tree</code>. </li>
+<li>The children of a <a href="http://chemistry.apache.org/java/0.8.0/maven/apidocs/org/apache/chemistry/opencmis/client/api/Tree.html"><code>Tree</code></a> are themselves of type <code>Tree</code>. </li>
 <li>The single argument of <code>getDescendants</code> is the depth or level of the tree that you want to go to. A depth of 1 will give you just the root of the tree. 
 A depth of -1 will return the full tree.</li>
 </ol>
@@ -783,22 +780,26 @@ and a property schema that will apply to
 <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;Getting type definition for doc type&quot;</span><span class="o">);</span>
     <span class="n">ObjectType</span> <span class="n">objectType</span> <span class="o">=</span> <span class="n">session</span><span class="o">.</span><span class="na">getTypeDefinition</span><span class="o">(</span><span class="n">doc</span><span class="o">.</span><span class="na">getType</span><span class="o">().</span><span class="na">getId</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;isBaseType() returns &quot;</span> <span class="o">+</span> <span class="o">(</span><span class="n">objectType</span><span class="o">.</span><span class="na">isBaseType</span><span class="o">()</span> <span class="o">?</span> <span class="s">&quot;true&quot;</span> <span class="o">:</span> <span class="s">&quot;false&quot;</span><span class="o">));</span>
+
     <span class="n">ObjectType</span> <span class="n">baseType</span> <span class="o">=</span> <span class="n">objectType</span><span class="o">.</span><span class="na">getBaseType</span><span class="o">();</span>
     <span class="k">if</span> <span class="o">(</span><span class="n">baseType</span> <span class="o">==</span> <span class="kc">null</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;getBaseType() returns null&quot;</span><span class="o">);</span>
     <span class="o">}</span> <span class="k">else</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;getBaseType() returns &quot;</span> <span class="o">+</span> <span class="n">baseType</span><span class="o">.</span><span class="na">getDisplayName</span><span class="o">());</span>
     <span class="o">}</span>
+
     <span class="n">ObjectType</span> <span class="n">parentType</span> <span class="o">=</span> <span class="n">objectType</span><span class="o">.</span><span class="na">getParentType</span><span class="o">();</span>
     <span class="k">if</span> <span class="o">(</span><span class="n">parentType</span> <span class="o">==</span> <span class="kc">null</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;getParentType() returns null&quot;</span><span class="o">);</span>
     <span class="o">}</span> <span class="k">else</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;getParentType() returns &quot;</span> <span class="o">+</span> <span class="n">parentType</span><span class="o">.</span><span class="na">getDisplayName</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;Listing child types of &quot;</span> <span class="o">+</span> <span class="n">objectType</span><span class="o">.</span><span class="na">getDisplayName</span><span class="o">());</span>
     <span class="k">for</span> <span class="o">(</span><span class="n">ObjectType</span> <span class="n">o</span> <span class="o">:</span> <span class="n">objectType</span><span class="o">.</span><span class="na">getChildren</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;\t&quot;</span> <span class="o">+</span> <span class="n">o</span><span class="o">.</span><span class="na">getDisplayName</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;Getting immediate descendant types of &quot;</span> <span class="o">+</span> <span class="n">objectType</span><span class="o">.</span><span class="na">getDisplayName</span><span class="o">());</span>
     <span class="k">for</span> <span class="o">(</span><span class="n">Tree</span><span class="o">&lt;</span><span class="n">ObjectType</span><span class="o">&gt;</span> <span class="n">o</span> <span class="o">:</span> <span class="n">objectType</span><span class="o">.</span><span class="na">getDescendants</span><span class="o">(</span><span class="mi">1</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;\t&quot;</span> <span class="o">+</span> <span class="n">o</span><span class="o">.</span><span class="na">getItem</span><span class="o">().</span><span class="na">getDisplayName</span><span class="o">());</span>
@@ -830,15 +831,13 @@ Getting immediate descendant types of CM
 you are running this code against, there may be a number of children of the <code>Document</code> type, which are types derived from this base type.</p>
 <h3 id="cmis-properties">CMIS Properties</h3>
 <h4 id="displaying-the-properties-of-an-object">Displaying the properties of an Object</h4>
-<p>All objects of the CMIS base types implement the interface <a href="http://chemistry.apache.org/java/0.4.0/maven/apidocs/org/apache/chemistry/opencmis/client/api/CmisObjectProperties.html"><code>CmisObjectProperties</code></a> which provides 
+<p>All objects of the CMIS base types implement the interface <a href="http://chemistry.apache.org/java/0.8.0/maven/apidocs/org/apache/chemistry/opencmis/client/api/CmisObjectProperties.html"><code>CmisObjectProperties</code></a> which provides 
 accessors to CMIS object properties. The following code snippet uses the <code>getProperties()</code> method
 to print out all the available properties on a newly created Document object, doc.</p>
-<div class="codehilite"><pre>     <span class="n">List</span><span class="o">&lt;</span><span class="n">Property</span><span class="o">&lt;?&gt;&gt;</span> <span class="n">props</span> <span class="o">=</span> <span class="n">doc</span><span class="o">.</span><span class="na">getProperties</span><span class="o">();</span>
-     <span class="k">for</span> <span class="o">(</span><span class="n">Property</span><span class="o">&lt;?&gt;</span> <span class="n">p</span> <span class="o">:</span> <span class="n">props</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">p</span><span class="o">.</span><span class="na">getDefinition</span><span class="o">().</span><span class="na">getDisplayName</span><span class="o">()</span> <span class="o">+</span> <span class="s">&quot;=&quot;</span> <span class="o">+</span>
-                 <span class="n">p</span><span class="o">.</span><span class="na">getValuesAsString</span><span class="o">()</span>                     
-                 <span class="o">);</span>
-     <span class="o">}</span>
+<div class="codehilite"><pre><span class="n">List</span><span class="o">&lt;</span><span class="n">Property</span><span class="o">&lt;?&gt;&gt;</span> <span class="n">props</span> <span class="o">=</span> <span class="n">doc</span><span class="o">.</span><span class="na">getProperties</span><span class="o">();</span>
+<span class="k">for</span> <span class="o">(</span><span class="n">Property</span><span class="o">&lt;?&gt;</span> <span class="n">p</span> <span class="o">:</span> <span class="n">props</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">p</span><span class="o">.</span><span class="na">getDefinition</span><span class="o">().</span><span class="na">getDisplayName</span><span class="o">()</span> <span class="o">+</span> <span class="s">&quot;=&quot;</span> <span class="o">+</span> <span class="n">p</span><span class="o">.</span><span class="na">getValuesAsString</span><span class="o">());</span>
+<span class="o">}</span>
 </pre></div>
 
 
@@ -871,24 +870,22 @@ Last Modified Date=[Fri May 20 12:54:47 
 
 <h4 id="getting-a-property-explicitly">Getting a property explicitly</h4>
 <p>Each object type has a known set of properties, and you can retrieve these explicitly. 
-For example, the document type has a set of properties described by the <a href="http://chemistry.apache.org/java/0.4.0/maven/apidocs/org/apache/chemistry/opencmis/client/api/DocumentProperties.html"><code>DocumentProperties</code></a> interface, 
+For example, the document type has a set of properties described by the <a href="http://chemistry.apache.org/java/0.8.0/maven/apidocs/org/apache/chemistry/opencmis/client/api/DocumentProperties.html"><code>DocumentProperties</code></a> interface, 
 and you can use the methods on this interface to retrieve 
 the value a property:-</p>
-<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;VersionLabel property on &quot;</span> <span class="o">+</span> <span class="n">doc</span><span class="o">.</span><span class="na">getName</span><span class="o">()</span> <span class="o">+</span> <span class="s">&quot; is &quot;</span>
-            <span class="o">+</span> <span class="n">doc</span><span class="o">.</span><span class="na">getVersionLabel</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;Is this the latest version of &quot;</span> <span class="o">+</span> <span class="n">doc</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="o">(</span><span class="n">doc</span><span class="o">.</span><span class="na">isLatestVersion</span><span class="o">()</span> <span class="o">?</span> <span class="s">&quot;yes&quot;</span> <span class="o">:</span> <span class="s">&quot;no&quot;</span><span class="o">));</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;VersionLabel property on &quot;</span> <span class="o">+</span> <span class="n">doc</span><span class="o">.</span><span class="na">getName</span><span class="o">()</span> <span class="o">+</span> <span class="s">&quot; is &quot;</span>
+        <span class="o">+</span> <span class="n">doc</span><span class="o">.</span><span class="na">getVersionLabel</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;Is this the latest version of &quot;</span> <span class="o">+</span> <span class="n">doc</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="o">(</span><span class="n">doc</span><span class="o">.</span><span class="na">isLatestVersion</span><span class="o">()</span> <span class="o">?</span> <span class="s">&quot;yes&quot;</span> <span class="o">:</span> <span class="s">&quot;no&quot;</span><span class="o">));</span>
 </pre></div>
 
 
 <p>Note that properties can be of simple types, <code>Boolean</code>, String, long, or more complex types,
 such as <code>GregorianCalendar</code>. The following code snippet prints out the <code>CreationDate</code> property:-</p>
-<div class="codehilite"><pre>    <span class="n">GregorianCalendar</span> <span class="n">calendar</span> <span class="o">=</span> <span class="n">doc</span><span class="o">.</span><span class="na">getCreationDate</span><span class="o">();</span>
-    <span class="n">String</span> <span class="n">DATE_FORMAT</span> <span class="o">=</span> <span class="s">&quot;yyyyMMdd&quot;</span><span class="o">;</span>
-    <span class="n">SimpleDateFormat</span> <span class="n">sdf</span> <span class="o">=</span> <span class="k">new</span> <span class="n">SimpleDateFormat</span><span class="o">(</span><span class="n">DATE_FORMAT</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;Creation date of &quot;</span> <span class="o">+</span> <span class="n">doc</span><span class="o">.</span><span class="na">getName</span><span class="o">()</span> <span class="o">+</span> <span class="s">&quot; is  &quot;</span>
-            <span class="o">+</span> <span class="n">sdf</span><span class="o">.</span><span class="na">format</span><span class="o">(</span><span class="n">calendar</span><span class="o">.</span><span class="na">getTime</span><span class="o">())</span>
-            <span class="o">);</span>
+<div class="codehilite"><pre><span class="n">GregorianCalendar</span> <span class="n">calendar</span> <span class="o">=</span> <span class="n">doc</span><span class="o">.</span><span class="na">getCreationDate</span><span class="o">();</span>
+<span class="n">String</span> <span class="n">DATE_FORMAT</span> <span class="o">=</span> <span class="s">&quot;yyyyMMdd&quot;</span><span class="o">;</span>
+<span class="n">SimpleDateFormat</span> <span class="n">sdf</span> <span class="o">=</span> <span class="k">new</span> <span class="n">SimpleDateFormat</span><span class="o">(</span><span class="n">DATE_FORMAT</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;Creation date of &quot;</span> <span class="o">+</span> <span class="n">doc</span><span class="o">.</span><span class="na">getName</span><span class="o">()</span> <span class="o">+</span> <span class="s">&quot; is  &quot;</span> <span class="o">+</span> <span class="n">sdf</span><span class="o">.</span><span class="na">format</span><span class="o">(</span><span class="n">calendar</span><span class="o">.</span><span class="na">getTime</span><span class="o">()));</span>
 </pre></div>
 
 
@@ -899,10 +896,9 @@ The following code snippet takes a prope
 property's value using the <code>queryName</code>:-</p>
 <div class="codehilite"><pre><span class="n">List</span><span class="o">&lt;</span><span class="n">Property</span><span class="o">&lt;?&gt;&gt;</span> <span class="n">props</span> <span class="o">=</span> <span class="n">doc</span><span class="o">.</span><span class="na">getProperties</span><span class="o">();</span>
 <span class="n">Property</span><span class="o">&lt;?&gt;</span> <span class="n">someProperty</span> <span class="o">=</span> <span class="n">props</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">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">someProperty</span><span class="o">.</span><span class="na">getDisplayName</span><span class="o">()</span> <span class="o">+</span> <span class="s">&quot; property on &quot;</span> <span class="o">+</span> <span class="n">doc</span><span class="o">.</span><span class="na">getName</span><span class="o">()</span>
-                <span class="o">+</span> <span class="s">&quot; (by getPropertValue()) is &quot;</span>
-                <span class="o">+</span> <span class="n">doc</span><span class="o">.</span><span class="na">getPropertyValue</span><span class="o">(</span><span class="n">someProperty</span><span class="o">.</span><span class="na">getId</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">someProperty</span><span class="o">.</span><span class="na">getDisplayName</span><span class="o">()</span> <span class="o">+</span> <span class="s">&quot; property on &quot;</span> <span class="o">+</span> <span class="n">doc</span><span class="o">.</span><span class="na">getName</span><span class="o">()</span>
+    <span class="o">+</span> <span class="s">&quot; (by getPropertValue()) is &quot;</span>
+    <span class="o">+</span> <span class="n">doc</span><span class="o">.</span><span class="na">getPropertyValue</span><span class="o">(</span><span class="n">someProperty</span><span class="o">.</span><span class="na">getId</span><span class="o">()));</span>
 </pre></div>
 
 
@@ -972,21 +968,20 @@ in this particular query. This code snip
 <h3 id="exceptions">Exceptions</h3>
 <p>If something goes wrong in an OpenCMIS method, an exception will be thrown. 
 All OpenCMIS exceptions extend 
-<a href="http://chemistry.apache.org/java/0.4.0/maven/apidocs/org/apache/chemistry/opencmis/commons/exceptions/package-tree.html"><code>CmisBaseException</code></a>
+<a href="http://chemistry.apache.org/java/0.8.0/maven/apidocs/org/apache/chemistry/opencmis/commons/exceptions/package-tree.html"><code>CmisBaseException</code></a>
 which is a Java runtime exception. Because all exceptions are runtime, you do not have to catch or specify the exceptions in your own code. 
 It does make sense to explicitly catch them in robust code. This code snippet forces an 
-<a href="http://chemistry.apache.org/java/0.4.0/maven/apidocs/org/apache/chemistry/opencmis/commons/exceptions/CmisInvalidArgumentException.html"><code>CmisInvalidArgumentException</code></a> 
+<a href="http://chemistry.apache.org/java/0.8.0/maven/apidocs/org/apache/chemistry/opencmis/commons/exceptions/CmisInvalidArgumentException.html"><code>CmisInvalidArgumentException</code></a> 
 by supplying a null content stream.</p>
-<div class="codehilite"><pre>    <span class="k">try</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="kc">null</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span>
-    <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">CmisInvalidArgumentException</span> <span class="n">e1</span><span class="o">)</span> <span class="o">{</span>
-        <span class="n">System</span><span class="o">.</span><span class="na">err</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;caught an &quot;</span> <span class="o">+</span> <span class="n">e1</span><span class="o">.</span><span class="na">getClass</span><span class="o">().</span><span class="na">getName</span><span class="o">()</span> <span class="o">+</span> <span class="s">&quot; exception with message &quot;</span>
-                <span class="o">+</span> <span class="n">e1</span><span class="o">.</span><span class="na">getMessage</span><span class="o">());</span>
-    <span class="o">}</span>
+<div class="codehilite"><pre><span class="k">try</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="kc">null</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span>
+<span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">CmisInvalidArgumentException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
+    <span class="n">System</span><span class="o">.</span><span class="na">err</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;caught an &quot;</span> <span class="o">+</span> <span class="n">e</span><span class="o">.</span><span class="na">getClass</span><span class="o">().</span><span class="na">getName</span><span class="o">()</span> <span class="o">+</span> <span class="s">&quot; exception with message &quot;</span> <span class="o">+</span> <span class="n">e</span><span class="o">.</span><span class="na">getMessage</span><span class="o">());</span>
+<span class="o">}</span>
 </pre></div>
 
 
-<p>If you are using the ATOMPUB binding, <a href="http://chemistry.apache.org/java/0.4.0/maven/apidocs/org/apache/chemistry/opencmis/commons/exceptions/package-tree.html"><code>CmisBaseException</code></a>
+<p>If you are using the ATOMPUB binding, <a href="http://chemistry.apache.org/java/0.8.0/maven/apidocs/org/apache/chemistry/opencmis/commons/exceptions/package-tree.html"><code>CmisBaseException</code></a>
 provides a <code>getErrorContent()</code> method which returns the content of the error page returned from the server, if there is one. This can be extremely useful
 debugging, as the server side is normally able to provide far more information that the client.    <br />
 In the following code snippet, a <code>CmisObjectNotFoundException</code> exception is forced by 
@@ -1005,8 +1000,8 @@ and the client stack trace.</p>
 
     <span class="k">try</span> <span class="o">{</span>
         <span class="n">folderTest</span><span class="o">.</span><span class="na">createDocument</span><span class="o">(</span><span class="n">newFileProps</span><span class="o">,</span> <span class="kc">null</span><span class="o">,</span> <span class="n">VersioningState</span><span class="o">.</span><span class="na">MAJOR</span><span class="o">);</span>
-    <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">CmisObjectNotFoundException</span> <span class="n">e1</span><span class="o">)</span> <span class="o">{</span>
-        <span class="n">System</span><span class="o">.</span><span class="na">err</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;server error page :\n&quot;</span> <span class="o">+</span> <span class="n">e1</span><span class="o">.</span><span class="na">getErrorContent</span><span class="o">());</span>
+    <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">CmisObjectNotFoundException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
+        <span class="n">System</span><span class="o">.</span><span class="na">err</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;server error page :\n&quot;</span> <span class="o">+</span> <span class="n">e</span><span class="o">.</span><span class="na">getErrorContent</span><span class="o">());</span>
         <span class="n">System</span><span class="o">.</span><span class="na">err</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;\nClient stack trace :\n&quot;</span><span class="o">);</span>
         <span class="n">e1</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span>
     <span class="o">}</span>
@@ -1033,7 +1028,7 @@ org.apache.chemistry.opencmis.commons.ex
 <h3 id="operation-context">Operation Context</h3>
 <p>The amount of metadata and associated information retrieved during an OpenCMIS operation could be large, 
 so certain OpenCMIS methods return a sensible subset of the information by default, 
-and provide additional methods that take an <a href="http://chemistry.apache.org/java/0.4.0/maven/apidocs/org/apache/chemistry/opencmis/client/api/OperationContext.html"><code>OperationContext</code></a>.
+and provide additional methods that take an <a href="http://chemistry.apache.org/java/0.8.0/maven/apidocs/org/apache/chemistry/opencmis/client/api/OperationContext.html"><code>OperationContext</code></a>.
 An OperationContext allows you to tune the amount of information returned by setting property filters, renditions filters, or by setting flags to include 
 path segments, ACLs, Allowable Actions, Policies, and Relationships. 
 The OperationContext is also used to control paging and caching in an operation. </p>
@@ -1041,15 +1036,15 @@ The OperationContext is also used to con
 <p>Caching of objects is turned on by default in OpenCMIS, but if you want to guarantee that <code>getObject()</code>

[... 360 lines stripped ...]


Mime
View raw message