chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r785899 [2/2] - /websites/staging/chemistry/trunk/content/java/opencmis-cookbook.html
Date Mon, 21 Feb 2011 17:47:49 GMT

Modified: websites/staging/chemistry/trunk/content/java/opencmis-cookbook.html
==============================================================================
--- websites/staging/chemistry/trunk/content/java/opencmis-cookbook.html (original)
+++ websites/staging/chemistry/trunk/content/java/opencmis-cookbook.html Mon Feb 21 17:47:48 2011
@@ -174,7 +174,7 @@ Apache Chemistry - OpenCMIS Cookbook
              <!-- Content -->
              <div class="wiki-content"><h1 id="opencmis_cookbook">OpenCMIS Cookbook</h1>
 <p><a name="OpenCMISCookbook-OpenCMISCookbook"></a></p>
-<p><em>Find and share OpenCMIS best practices here.</em></p>
+<p><strong>Find and share OpenCMIS best practices here.</strong></p>
 <ul>
 <li><a href="#OpenCMISCookbook-CMISClient">CMIS Client</a><ul>
 <li><a href="#OpenCMISCookbook-ConnectingtoaCMISrepository">Connecting to a CMIS repository</a><ul>
@@ -205,192 +205,172 @@ Apache Chemistry - OpenCMIS Cookbook
 </ul>
 </li>
 </ul>
+<br/>
+
 <p><a name="OpenCMISCookbook-CMISClient"></a></p>
 <h2 id="cmis_client">CMIS Client</h2>
 <p><a name="OpenCMISCookbook-ConnectingtoaCMISrepository"></a></p>
 <h3 id="connecting_to_a_cmis_repository">Connecting to a CMIS repository</h3>
 <p><a name="OpenCMISCookbook-ConnectingtoaCMISrepositorybyAtomPub"></a></p>
 <h4 id="connecting_to_a_cmis_repository_by_atompub">Connecting to a CMIS repository by AtomPub</h4>
-<div class="codehilite"><pre><span class="sr">//</span> <span class="n">Default</span> <span class="n">factory</span> <span class="n">implementation</span> <span class="n">of</span> <span class="n">client</span> <span class="n">runtime</span><span class="o">.</span>
-<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="sr">//</span> <span class="n">User</span> <span class="n">credentials</span><span class="o">.</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;user&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;password&quot;</span><span class="p">);</span>
-
-<span class="sr">//</span> <span class="n">Connection</span> <span class="n">settings</span><span class="o">.</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://localhost:8080/alfresco/service/cmis&quot;</span><span class="p">);</span> <span class="sr">//</span> <span class="n">URL</span> <span class="n">to</span> <span class="n">your</span> <span class="n">CMIS</span> <span class="n">server</span><span class="o">.</span>
-<span class="sr">//</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="s">&quot;myRepository&quot;</span><span class="p">);</span> <span class="sr">//</span> <span class="n">Only</span> <span class="n">necessary</span> <span class="k">if</span> <span class="n">there</span> <span class="n">is</span> <span class="n">more</span> <span class="n">than</span> <span class="n">one</span> <span class="n">repository</span><span class="o">.</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>
-
-<span class="sr">//</span> <span class="n">Session</span> <span class="n">locale</span><span class="o">.</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">LOCALE_ISO3166_COUNTRY</span><span class="p">,</span> <span class="s">&quot;&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">LOCALE_ISO639_LANGUAGE</span><span class="p">,</span> <span class="s">&quot;en&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">LOCALE_VARIANT</span><span class="p">,</span> <span class="s">&quot;US&quot;</span><span class="p">);</span>
-
-<span class="sr">//</span> <span class="n">Create</span> <span class="n">session</span><span class="o">.</span>
-<span class="n">Session</span> <span class="n">session</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="sr">//</span> <span class="n">This</span> <span class="n">supposes</span> <span class="n">only</span> <span class="n">one</span> <span class="n">repository</span> <span class="n">is</span> <span class="n">available</span> <span class="n">at</span> <span class="n">the</span> <span class="n">URL</span><span class="o">.</span>
+<div class="codehilite"><pre><span class="c1">// Default factory implementation of client runtime.</span>
+<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="c1">// User credentials.</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;user&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;password&quot;</span><span class="o">);</span>
+
+<span class="c1">// Connection settings.</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://localhost:8080/alfresco/service/cmis&quot;</span><span class="o">);</span> <span class="c1">// URL to your CMIS server.</span>
+<span class="c1">// parameter.put(SessionParameter.REPOSITORY_ID, &quot;myRepository&quot;); // Only necessary if there is more than one repository.</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>
+
+<span class="c1">// Session locale.</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">LOCALE_ISO3166_COUNTRY</span><span class="o">,</span> <span class="s">&quot;&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">LOCALE_ISO639_LANGUAGE</span><span class="o">,</span> <span class="s">&quot;en&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">LOCALE_VARIANT</span><span class="o">,</span> <span class="s">&quot;US&quot;</span><span class="o">);</span>
+
+<span class="c1">// Create session.</span>
+<span class="n">Session</span> <span class="n">session</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="c1">// This supposes only one repository is available at the URL.</span>
     <span class="n">Repository</span> <span class="n">soleRepository</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="o">.</span><span class="n">get</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
-    <span class="n">session</span> <span class="o">=</span> <span class="n">soleRepository</span><span class="o">.</span><span class="n">createSession</span><span class="p">();</span>
-<span class="p">}</span>
-<span class="n">catch</span><span class="p">(</span><span class="n">CmisConnectionException</span> <span class="n">e</span><span class="p">)</span> <span class="p">{</span> 
-    <span class="sr">//</span> <span class="n">The</span> <span class="n">server</span> <span class="n">is</span> <span class="n">unreachable</span>
-<span class="p">}</span>
-<span class="n">catch</span><span class="p">(</span><span class="n">CmisRuntimeException</span> <span class="n">e</span><span class="p">)</span> <span class="p">{</span>
-    <span class="sr">//</span> <span class="n">The</span> <span class="n">user</span><span class="o">/</span><span class="n">password</span> <span class="n">have</span> <span class="n">probably</span> <span class="n">been</span> <span class="n">rejected</span> <span class="n">by</span> <span class="n">the</span> <span class="n">server</span><span class="o">.</span>
-<span class="p">}</span>
-
-<span class="n">h4</span><span class="o">.</span> <span class="n">Connecting</span> <span class="n">to</span> <span class="n">SharePoint</span> <span class="mi">2010</span>
-
-<span class="n">While</span> <span class="n">connecting</span> <span class="n">via</span> <span class="n">AtomPub</span> <span class="n">is</span> <span class="n">straight</span> <span class="n">forward</span><span class="p">,</span> <span class="n">connecting</span> <span class="n">via</span> <span class="n">Web</span>
-</pre></div>
-
-
-<p>Services is a bit tricky.</p>
-<div class="codehilite"><pre><span class="n">h5</span><span class="o">.</span> <span class="n">AtomPub</span>
-
-<span class="n">The</span> <span class="n">service</span> <span class="n">document</span> <span class="n">URL</span> <span class="n">is</span>
-</pre></div>
-
-
-<p>http://<host>/_vti_bin/cmis/rest/<SPList>?getrepositoryinfo .
-    Since this sends the password as plain text,  HTTPS is strongly
-recommended.</p>
-<div class="codehilite"><pre><span class="n">h5</span><span class="o">.</span> <span class="n">Web</span> <span class="n">Services</span>
-
-<span class="c1"># Download the WSDL with a web browser and store it on your local disk. The</span>
-</pre></div>
-
-
-<p>WSDL URL is http://<host>/_vti_bin/cmissoapwsdl.aspx?wsdl .
-    # Provide file://... URLs to the downloaded WSDL for all OpenCMIS WSDL
-session parameters.
-    # Activate the OpenCMIS NTLM authentication provider.</p>
-<div class="codehilite"><pre><span class="n">parameters</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">AUTHENTICATION_PROVIDER_CLASS</span><span class="p">,</span> <span class="n">CmisBindingFactory</span><span class="o">.</span><span class="n">NTLM_AUTHENTICATION_PROVIDER</span><span class="p">);</span>
-
-<span class="p">(</span><span class="n">The</span> <span class="n">NTLM</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="na">get</span><span class="o">(</span><span class="mi">0</span><span class="o">);</span>
+    <span class="n">session</span> <span class="o">=</span> <span class="n">soleRepository</span><span class="o">.</span><span class="na">createSession</span><span class="o">();</span>
+<span class="o">}</span>
+<span class="k">catch</span><span class="o">(</span><span class="n">CmisConnectionException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span> 
+    <span class="c1">// The server is unreachable</span>
+<span class="o">}</span>
+<span class="k">catch</span><span class="o">(</span><span class="n">CmisRuntimeException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
+    <span class="c1">// The user/password have probably been rejected by the server.</span>
+<span class="o">}</span>
 </pre></div>
 
 
-<p>authentication provider uses [java.net.Authenticator|http://download-llnw.oracle.com/javase/6/docs/api/java/net/Authenticator.html]
- under the hood. If this interferes with your environment, you are on your
-own.)</p>
-<div class="codehilite"><pre><span class="n">h4</span><span class="o">.</span> <span class="n">Using</span> <span class="n">Cookies</span>
-
-<span class="n">Some</span> <span class="n">repositories</span> <span class="n">are</span> <span class="n">sending</span> <span class="n">HTTP</span> <span class="n">cookies</span> <span class="n">to</span> <span class="n">maintain</span> <span class="n">state</span> <span class="p">(</span><span class="n">although</span> <span class="n">CMIS</span>
-</pre></div>
-
-
-<p>is stateless) or accelerate authentication for subsequent calls. OpenCMIS
+<h4 id="connecting_to_sharepoint_2010">Connecting to SharePoint 2010</h4>
+<p>While connecting via AtomPub is straight forward, connecting via Web
+Services is a bit tricky.</p>
+<h5 id="atompub">AtomPub</h5>
+<p>The service document URL is <code>http://</code><host><code>/_vti_bin/cmis/rest/</code><SPList><code>?getrepositoryinfo</code>.
+Since this sends the password as plain text, HTTPS is strongly recommended.</p>
+<h5 id="web_services">Web Services</h5>
+<ol>
+<li>Download the WSDL with a web browser and store it on your local disk. The WSDL URL is <code>http://</code><host><code>/_vti_bin/cmissoapwsdl.aspx?wsdl</code>.</li>
+<li>Provide <code>file://</code>... URLs to the downloaded WSDL for all OpenCMIS WSDL session parameters.</li>
+<li>Activate the OpenCMIS NTLM authentication provider.</li>
+</ol>
+<p><br/>
+    :::java
+    parameters.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS, CmisBindingFactory.NTLM_AUTHENTICATION_PROVIDER);</p>
+<p>(The NTLM authentication provider uses <a href="http://download-llnw.oracle.com/javase/6/docs/api/java/net/Authenticator.html">java.net.Authenticator</a>
+ under the hood. If this interferes with your environment, you are on your own.)</p>
+<h4 id="using_cookies">Using Cookies</h4>
+<p>Some repositories are sending HTTP cookies to maintain state (although CMIS
+is stateless) or accelerate authentication for subsequent calls. OpenCMIS
 ignores these cookies by default. The following code snippet activates
-cookies for your application and OpenCMIS. See [this page|http://java.sun.com/docs/books/tutorial/networking/cookies/cookiemanager.html]
+cookies for your application and OpenCMIS.
+See <a href="http://java.sun.com/docs/books/tutorial/networking/cookies/cookiemanager.html">this page</a>
  for details.</p>
-<div class="codehilite"><pre><span class="p">{</span><span class="n">code:java</span><span class="p">}</span>
-<span class="n">CookieManager</span> <span class="n">cm</span> <span class="o">=</span> <span class="k">new</span> <span class="n">CookieManager</span><span class="p">(</span><span class="n">null</span><span class="p">,</span> <span class="n">CookiePolicy</span><span class="o">.</span><span class="n">ACCEPT_ALL</span><span class="p">);</span>
-<span class="n">CookieHandler</span><span class="o">.</span><span class="n">setDefault</span><span class="p">(</span><span class="n">cm</span><span class="p">);</span>
+<div class="codehilite"><pre><span class="n">CookieManager</span> <span class="n">cm</span> <span class="o">=</span> <span class="k">new</span> <span class="n">CookieManager</span><span class="o">(</span><span class="kc">null</span><span class="o">,</span> <span class="n">CookiePolicy</span><span class="o">.</span><span class="na">ACCEPT_ALL</span><span class="o">);</span>
+<span class="n">CookieHandler</span><span class="o">.</span><span class="na">setDefault</span><span class="o">(</span><span class="n">cm</span><span class="o">);</span>
 </pre></div>
 
 
 <p><a name="OpenCMISCookbook-Understandingtheclientsidecache"></a></p>
 <h3 id="understanding_the_client_side_cache">Understanding the client side cache</h3>
-<p>Client side caching is turned on by default. That is, getObject() will
+<p>Client side caching is turned on by default. That is, <code>getObject()</code> will
 first look into the session cache if the object already exists there. If
 this is the case, it returns the object without talking to the repository.
 So it might return stale objects.<br />
 </p>
-<p>There are multiple ways to deal with that:
-* Refresh the object data that is returned from getObject().
-{code:java}
-CmisObject object = session.getObject(id);</p>
-<p>object.refresh(); // contacts the repository and refreshes the object</p>
-<p>object.refreshIfOld(60 * 1000); // ... or refreshes the object only if the
-data is older than a minute    <br />
-</p>
-<div class="codehilite"><pre><span class="o">*</span> <span class="n">Turn</span> <span class="n">off</span> <span class="n">the</span> <span class="n">session</span> <span class="n">cache</span> <span class="n">completely</span><span class="o">.</span>
-<span class="p">{</span><span class="n">code:java</span><span class="p">}</span>
-<span class="n">session</span><span class="o">.</span><span class="n">getDefaultContext</span><span class="p">()</span><span class="o">.</span><span class="n">setCacheEnabled</span><span class="p">(</span><span class="n">false</span><span class="p">);</span>
-</pre></div>
-
-
+<p>There are multiple ways to deal with that:</p>
 <ul>
-<li>Turn off caching for this getObject() call.
-{code:java}
+<li>
+<p>Refresh the object data that is returned from <code>getObject()</code>.
+<br/></p>
+<p>:::java
+CmisObject object = session.getObject(id);
+object.refresh(); // contacts the repository and refreshes the object
+object.refreshIfOld(60 * 1000); // ... or refreshes the object only if the data is older than a minute</p>
+</li>
+<li>
+<p>Turn off the session cache completely.
+<br/></p>
+<p>:::java
+session.getDefaultContext().setCacheEnabled(false);</p>
+</li>
+<li>
+<p>Turn off caching for this <code>getObject()</code> call.
+<br/></p>
+<p>:::java
 OperationContext oc = session.createOperationContext();
-oc.setCacheEnabled(false);</li>
-</ul>
+oc.setCacheEnabled(false);</p>
 <p>CmisObject object = session.getObject(id, oc);</p>
-<div class="codehilite"><pre><span class="o">*</span> <span class="n">Clear</span> <span class="n">the</span> <span class="n">session</span> <span class="n">cache</span> <span class="p">(</span><span class="ow">not</span> <span class="n">recommended</span><span class="p">)</span><span class="o">.</span>
-<span class="p">{</span><span class="n">code:java</span><span class="p">}</span>
-<span class="n">session</span><span class="o">.</span><span class="n">clear</span><span class="p">();</span>
+</li>
+<li>
+<p>Clear the session cache (not recommended).
+<br/></p>
+<p>:::java
+session.clear();</p>
+</li>
+</ul>
+<p><a name="OpenCMISCookbook-Gettingtheidofanobjectfromitspath"></a></p>
+<h3 id="getting_the_id_of_an_object_from_its_path">Getting the id of an object from its path</h3>
+<div class="codehilite"><pre><span class="n">String</span> <span class="n">path</span> <span class="o">=</span> <span class="s">&quot;/User Homes/customer1/document.odt&quot;</span>
+<span class="n">CmisObject</span> <span class="n">object</span> <span class="o">=</span> <span class="n">getSession</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">String</span> <span class="n">id</span> <span class="o">=</span> <span class="n">object</span><span class="o">.</span><span class="na">getId</span><span class="o">();</span>
 </pre></div>
 
 
-<p><a name="OpenCMISCookbook-Gettingtheidofanobjectfromitspath"></a></p>
-<h3 id="getting_the_id_of_an_object_from_its_path">Getting the id of an object from its path</h3>
-<p>{code:java}
-String path = "/User Homes/customer1/document.odt"
-CmisObject object = getSession().getObjectByPath(path);
-String id = object.getId();</p>
-<div class="codehilite"><pre><span class="n">h3</span><span class="o">.</span> <span class="n">Reading</span> <span class="n">a</span> <span class="n">file</span>
-
-<span class="p">{</span><span class="n">code:java</span><span class="p">}</span>
-<span class="n">CmisObject</span> <span class="n">object</span> <span class="o">=</span> <span class="n">getSession</span><span class="p">()</span><span class="o">.</span><span class="n">getObject</span><span class="p">(</span><span class="n">session</span><span class="o">.</span><span class="n">createObjectId</span><span class="p">(</span><span class="n">fileId</span><span class="p">));</span>
-<span class="n">Document</span> <span class="n">document</span> <span class="o">=</span> <span class="p">(</span><span class="n">Document</span><span class="p">)</span><span class="n">object</span><span class="p">;</span>
-<span class="n">String</span> <span class="n">filename</span> <span class="o">=</span> <span class="n">document</span><span class="o">.</span><span class="n">getName</span><span class="p">();</span>
-<span class="n">InputStream</span> <span class="n">stream</span> <span class="o">=</span> <span class="n">document</span><span class="o">.</span><span class="n">getContentStream</span><span class="p">()</span><span class="o">.</span><span class="n">getStream</span><span class="p">();</span>
+<h3 id="reading_a_file">Reading a file</h3>
+<div class="codehilite"><pre><span class="n">CmisObject</span> <span class="n">object</span> <span class="o">=</span> <span class="n">getSession</span><span class="o">().</span><span class="na">getObject</span><span class="o">(</span><span class="n">session</span><span class="o">.</span><span class="na">createObjectId</span><span class="o">(</span><span class="n">fileId</span><span class="o">));</span>
+<span class="n">Document</span> <span class="n">document</span> <span class="o">=</span> <span class="o">(</span><span class="n">Document</span><span class="o">)</span><span class="n">object</span><span class="o">;</span>
+<span class="n">String</span> <span class="n">filename</span> <span class="o">=</span> <span class="n">document</span><span class="o">.</span><span class="na">getName</span><span class="o">();</span>
+<span class="n">InputStream</span> <span class="n">stream</span> <span class="o">=</span> <span class="n">document</span><span class="o">.</span><span class="na">getContentStream</span><span class="o">().</span><span class="na">getStream</span><span class="o">();</span>
 </pre></div>
 
 
 <p><a name="OpenCMISCookbook-Showingafolder'sitems,withresultspaging"></a></p>
 <h3 id="showing_a_folders_items_with_results_paging">Showing a folder's items, with results paging</h3>
-<p>{code:java}
-int maxItemsPerPage = 5;
-int skipCount = 10;</p>
-<p>CmisObject object = session.getObject(session.createObjectId(folderId));
-Folder folder = (Folder)object;
-OperationContext operationContext = session.createOperationContext();
-operationContext.setMaxItemsPerPage(maxItemsPerPage);</p>
-<p>ItemIterable<CmisObject> children = folder.getChildren(operationContext);
-ItemIterable<CmisObject> page = children.skipTo(skipCount).getPage();</p>
-<p>Iterator<CmisObject> pageItems = page.iterator();
-while(pageItems.hasNext()) {
-       CmisObject item = pageItems.next();
-       // Do something with the item.
-}</p>
-<div class="codehilite"><pre><span class="x">h3. Retrieving Document objects from query results</span>
+<div class="codehilite"><pre><span class="kt">int</span> <span class="n">maxItemsPerPage</span> <span class="o">=</span> <span class="mi">5</span><span class="o">;</span>
+<span class="kt">int</span> <span class="n">skipCount</span> <span class="o">=</span> <span class="mi">10</span><span class="o">;</span>
+
+<span class="n">CmisObject</span> <span class="n">object</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">session</span><span class="o">.</span><span class="na">createObjectId</span><span class="o">(</span><span class="n">folderId</span><span class="o">));</span>
+<span class="n">Folder</span> <span class="n">folder</span> <span class="o">=</span> <span class="o">(</span><span class="n">Folder</span><span class="o">)</span><span class="n">object</span><span class="o">;</span>
+<span class="n">OperationContext</span> <span class="n">operationContext</span> <span class="o">=</span> <span class="n">session</span><span class="o">.</span><span class="na">createOperationContext</span><span class="o">();</span>
+<span class="n">operationContext</span><span class="o">.</span><span class="na">setMaxItemsPerPage</span><span class="o">(</span><span class="n">maxItemsPerPage</span><span class="o">);</span>
 
-<span class="x">{code:java}</span>
-<span class="x">String myType = &quot;my:documentType&quot;;</span>
-<span class="x">String queryString = &quot;SELECT * FROM &quot; + myType;</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">folder</span><span class="o">.</span><span class="na">getChildren</span><span class="o">(</span><span class="n">operationContext</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">page</span> <span class="o">=</span> <span class="n">children</span><span class="o">.</span><span class="na">skipTo</span><span class="o">(</span><span class="n">skipCount</span><span class="o">).</span><span class="na">getPage</span><span class="o">();</span>
 
-<span class="x">// get the query name of cmis:objectId</span>
-<span class="x">ObjectType type = session.getTypeDefinition(myType);</span>
-<span class="x">PropertyDefinition</span><span class="cp">&lt;?</span><span class="o">&gt;</span> <span class="nx">objectIdPropDef</span> <span class="o">=</span>
+<span class="n">Iterator</span><span class="o">&lt;</span><span class="n">CmisObject</span><span class="o">&gt;</span> <span class="n">pageItems</span> <span class="o">=</span> <span class="n">page</span><span class="o">.</span><span class="na">iterator</span><span class="o">();</span>
+<span class="k">while</span><span class="o">(</span><span class="n">pageItems</span><span class="o">.</span><span class="na">hasNext</span><span class="o">())</span> <span class="o">{</span>
+    <span class="n">CmisObject</span> <span class="n">item</span> <span class="o">=</span> <span class="n">pageItems</span><span class="o">.</span><span class="na">next</span><span class="o">();</span>
+    <span class="c1">// Do something with the item.</span>
+<span class="o">}</span>
 </pre></div>
 
 
-<p>type.getPropertyDefinitions().get(PropertyIds.OBJECT_ID);
-    String objectIdQueryName = objectIdPropDef.getQueryName();</p>
-<div class="codehilite"><pre><span class="sr">//</span> <span class="n">execute</span> <span class="n">query</span>
-<span class="n">ItemIterable</span><span class="sr">&lt;QueryResult&gt;</span> <span class="n">results</span> <span class="o">=</span> <span class="n">session</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="n">queryString</span><span class="p">,</span> <span class="n">false</span><span class="p">);</span>
+<h3 id="retrieving_document_objects_from_query_results">Retrieving Document objects from query results</h3>
+<div class="codehilite"><pre><span class="n">String</span> <span class="n">myType</span> <span class="o">=</span> <span class="s">&quot;my:documentType&quot;</span><span class="o">;</span>
+<span class="n">String</span> <span class="n">queryString</span> <span class="o">=</span> <span class="s">&quot;SELECT * FROM &quot;</span> <span class="o">+</span> <span class="n">myType</span><span class="o">;</span>
 
-<span class="k">for</span> <span class="p">(</span><span class="n">QueryResult</span> <span class="n">qResult</span> <span class="p">:</span> <span class="n">results</span><span class="p">)</span> <span class="p">{</span>
-   <span class="n">String</span> <span class="n">objectId</span> <span class="o">=</span>
-</pre></div>
+<span class="c1">// get the query name of cmis:objectId</span>
+<span class="n">ObjectType</span> <span class="n">type</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">myType</span><span class="o">);</span>
+<span class="n">PropertyDefinition</span><span class="o">&lt;?&gt;</span> <span class="n">objectIdPropDef</span> <span class="o">=</span> <span class="n">type</span><span class="o">.</span><span class="na">getPropertyDefinitions</span><span class="o">().</span><span class="na">get</span><span class="o">(</span><span class="n">PropertyIds</span><span class="o">.</span><span class="na">OBJECT_ID</span><span class="o">);</span>
+<span class="n">String</span> <span class="n">objectIdQueryName</span> <span class="o">=</span> <span class="n">objectIdPropDef</span><span class="o">.</span><span class="na">getQueryName</span><span class="o">();</span>
 
+<span class="c1">// execute query</span>
+<span class="n">ItemIterable</span><span class="o">&lt;</span><span class="n">QueryResult</span><span class="o">&gt;</span> <span class="n">results</span> <span class="o">=</span> <span class="n">session</span><span class="o">.</span><span class="na">query</span><span class="o">(</span><span class="n">queryString</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span>
 
-<p>qResult.getPropertyValueByQueryName(objectIdQueryName);</p>
-<div class="codehilite"><pre>   <span class="n">Document</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="k">for</span> <span class="o">(</span><span class="n">QueryResult</span> <span class="n">qResult</span> <span class="o">:</span> <span class="n">results</span><span class="o">)</span> <span class="o">{</span>
+   <span class="n">String</span> <span class="n">objectId</span> <span class="o">=</span> <span class="n">qResult</span><span class="o">.</span><span class="na">getPropertyValueByQueryName</span><span class="o">(</span><span class="n">objectIdQueryName</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">session</span><span class="o">.</span><span class="na">createObjectId</span><span class="o">(</span><span class="n">objectId</span><span class="o">));</span>
+<span class="o">}</span>
 </pre></div>
 
 
-<p>session.getObject(session.createObjectId(objectId));
-    }</p>
 <p><a name="OpenCMISCookbook-GettingCMISextensions"></a></p>
 <h3 id="getting_cmis_extensions">Getting CMIS extensions</h3>
 <p><em>(since OpenCMIS 0.2.0)</em>
@@ -401,479 +381,345 @@ These extensions are XML fragments for t
 binding. (It will be something simpler for the upcoming JSON binding.)
 Think of it as a tree structure with named node and leafs. Only the leafs
 can have a value.</p>
-<p>{code:java}
-// get an object from somewhere
-CmisObject object = ...</p>
-<p>// extensions can be attached to different levels
-// in this example we get the extensions on the properties level
-List<CmisExtensionElement> extensions =
-object.getExtensions(ExtensionLevel.PROPERTIES);</p>
-<p>if(extensions == null) {
-   // this object has no extensions on this level
-   return;
-}</p>
-<p>// iterate through the extensions until we find the one we are looking for
-for(CmisExtensionElement ext: extensions) {</p>
-<p>if("myExtension".equals(ext.getName()) {</p>
-<div class="codehilite"><pre> <span class="sr">//</span> <span class="n">found</span> <span class="n">it</span><span class="p">,</span> <span class="n">now</span> <span class="k">print</span> <span class="n">the</span> <span class="nb">values</span> <span class="n">of</span> <span class="n">the</span> <span class="n">children</span>     
- <span class="k">for</span><span class="p">(</span><span class="n">CmisExtensionElement</span> <span class="n">child:</span> <span class="n">ext</span><span class="o">.</span><span class="n">getChildren</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="n">child</span><span class="o">.</span><span class="n">getName</span><span class="p">()</span> <span class="o">+</span> <span class="s">&quot;: &quot;</span> <span class="o">+</span> <span class="n">child</span><span class="o">.</span><span class="n">getValue</span><span class="p">());</span>
- <span class="p">}</span>
-</pre></div>
-
+<div class="codehilite"><pre><span class="c1">// get an object from somewhere</span>
+<span class="n">CmisObject</span> <span class="n">object</span> <span class="o">=</span> <span class="o">...</span>
 
-<p>}</p>
-<p>}</p>
-<div class="codehilite"><pre><span class="n">h3</span><span class="o">.</span> <span class="n">Connecting</span> <span class="n">from</span> <span class="n">a</span> <span class="o">.</span><span class="n">Net</span> <span class="n">client</span> <span class="n">via</span> <span class="n">the</span> <span class="n">Web</span> <span class="n">Services</span> <span class="n">binding</span>
-
-<span class="n">This</span> <span class="n">is</span> <span class="n">a</span> <span class="n">very</span> <span class="n">simple</span> <span class="n">C</span><span class="c1"># example that demonstrates how to connect to an</span>
+<span class="c1">// extensions can be attached to different levels</span>
+<span class="c1">// in this example we get the extensions on the properties level</span>
+<span class="n">List</span><span class="o">&lt;</span><span class="n">CmisExtensionElement</span><span class="o">&gt;</span> <span class="n">extensions</span> <span class="o">=</span> <span class="n">object</span><span class="o">.</span><span class="na">getExtensions</span><span class="o">(</span><span class="n">ExtensionLevel</span><span class="o">.</span><span class="na">PROPERTIES</span><span class="o">);</span>
+
+<span class="k">if</span><span class="o">(</span><span class="n">extensions</span> <span class="o">==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
+   <span class="c1">// this object has no extensions on this level</span>
+   <span class="k">return</span><span class="o">;</span>
+<span class="o">}</span>
+
+<span class="c1">// iterate through the extensions until we find the one we are looking for</span>
+<span class="k">for</span><span class="o">(</span><span class="n">CmisExtensionElement</span> <span class="nl">ext:</span> <span class="n">extensions</span><span class="o">)</span> <span class="o">{</span>
+   <span class="k">if</span><span class="o">(</span><span class="s">&quot;myExtension&quot;</span><span class="o">.</span><span class="na">equals</span><span class="o">(</span><span class="n">ext</span><span class="o">.</span><span class="na">getName</span><span class="o">())</span> <span class="o">{</span>
+     <span class="c1">// found it, now print the values of the children     </span>
+     <span class="k">for</span><span class="o">(</span><span class="n">CmisExtensionElement</span> <span class="nl">child:</span> <span class="n">ext</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="n">child</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="n">child</span><span class="o">.</span><span class="na">getValue</span><span class="o">());</span>
+     <span class="o">}</span>
+   <span class="o">}</span>
+<span class="o">}</span>
 </pre></div>
 
 
-<p>OpenCMIS server via the Web Services binding. Please note that .Net only
+<h3 id="connecting_from_a_net_client_via_the_web_services_binding">Connecting from a .Net client via the Web Services binding</h3>
+<p>This is a very simple C# example that demonstrates how to connect to an
+OpenCMIS server via the Web Services binding. Please note that .Net only
 allows UsernameTokens over HTTPS.</p>
-<p>using System;
-using System.ServiceModel;
-using OpenCMISClient.OpenCMISServer;
-using System.Net;</p>
-<p>namespace OpenCMISClient
-{
-    class CMISClientDemo
-    {
-    public void DoStuff()
-    {
-        try
-        {
-        // uncomment the next line if you are using a self signed
-SSL certificate 
-        // ServicePointManager.ServerCertificateValidationCallback
-= delegate { return true; };</p>
-<div class="codehilite"><pre>    <span class="sr">//</span> <span class="n">get</span> <span class="n">hold</span> <span class="n">of</span> <span class="n">the</span> <span class="n">services</span>
-    <span class="n">RepositoryServicePortClient</span> <span class="n">repService</span> <span class="o">=</span>
-</pre></div>
-
-
-<p>GetRepositoryService("https://localhost:8443/opencmis/services/RepositoryService?wsdl",
-"test", "test");
-        NavigationServicePortClient navService =
-GetNavigationService("https://localhost:8443/opencmis/services/NavigationService?wsdl",
-"test", "test");
-        ObjectServicePortClient objService =
-GetObjectService("https://localhost:8443/opencmis/services/ObjectService?wsdl",
-"test", "test");</p>
-<div class="codehilite"><pre>    <span class="sr">//</span> <span class="n">get</span> <span class="n">the</span> <span class="n">list</span> <span class="n">of</span> <span class="n">repositories</span>
-            <span class="n">cmisRepositoryEntryType</span><span class="o">[]</span><span class="p">(</span><span class="o">.</span><span class="n">html</span><span class="p">)</span>
-</pre></div>
-
-
-<p>repositoryEntries = repService.getRepositories(null);
-        foreach (cmisRepositoryEntryType repositoryEntry in
-repositoryEntries)
-        {
-            Console.WriteLine("Repository: " +
-repositoryEntry.repositoryName + " (" + repositoryEntry.repositoryId +
-")");</p>
-<div class="codehilite"><pre>        <span class="sr">//</span> <span class="n">get</span> <span class="n">repository</span> <span class="n">info</span>
-        <span class="n">cmisRepositoryInfoType</span> <span class="n">repositoryInfo</span> <span class="o">=</span>
-</pre></div>
-
-
-<p>repService.getRepositoryInfo(repositoryEntry.repositoryId, null);
-            Console.WriteLine("  Info:");
-            Console.WriteLine("    Description: " +
-repositoryInfo.repositoryDescription);
-            Console.WriteLine("    Product: " +
-repositoryInfo.vendorName + " / " + repositoryInfo.productName + " " +
-repositoryInfo.productVersion);</p>
-<div class="codehilite"><pre>        <span class="sr">//</span> <span class="n">get</span> <span class="n">all</span> <span class="n">base</span> <span class="n">types</span> <span class="n">of</span> <span class="n">the</span> <span class="n">repository</span>
-        <span class="n">cmisTypeDefinitionListType</span> <span class="n">typeList</span> <span class="o">=</span>
-</pre></div>
-
-
-<p>repService.getTypeChildren(repositoryInfo.repositoryId, null, true, null,
-null, null);
-            Console.WriteLine("  Types:");
-            foreach (cmisTypeDefinitionType type in typeList.types)
-            {
-            Console.WriteLine("    " + type.displayName + " ("
-+ type.id + ")");
-            }</p>
-<div class="codehilite"><pre>        <span class="sr">//</span> <span class="n">get</span> <span class="n">all</span> <span class="n">root</span> <span class="n">folder</span> <span class="n">children</span>
-        <span class="n">cmisObjectInFolderListType</span> <span class="n">children</span> <span class="o">=</span>
-</pre></div>
-
-
-<p>navService.getChildren(repositoryInfo.repositoryId,
-repositoryInfo.rootFolderId, null, null, true, null, null, false, null,
-null, null);
-            Console.WriteLine("  Root folder:");
-            foreach (cmisObjectInFolderType objInFolder in
-children.objects)
-            {
-            cmisObjectType obj = objInFolder.@object;
-            String objId = GetIdPropertyValue(obj.properties,
-"cmis:objectId");
-            Console.WriteLine("    Name: " +
-GetStringPropertyValue(obj.properties, "cmis:name") + " (" + objId + ")");
-            Console.WriteLine("  Type:      " +
-GetIdPropertyValue(obj.properties, "cmis:baseTypeId"));
-            Console.WriteLine("  Created by:    " +
-GetStringPropertyValue(obj.properties, "cmis:createdBy"));
-            Console.WriteLine("  Creation date: " +
-GetDateTimePropertyValue(obj.properties, "cmis:creationDate"));</p>
-<div class="codehilite"><pre>        <span class="sr">//</span> <span class="k">if</span> <span class="n">it</span> <span class="n">is</span> <span class="n">a</span> <span class="n">document</span><span class="p">,</span> <span class="n">get</span> <span class="n">the</span> <span class="n">size</span> <span class="ow">and</span> <span class="n">the</span>
-</pre></div>
-
-
-<p>content
-            String baseType =
-GetIdPropertyValue(obj.properties, "cmis:baseTypeId");
-            if ("cmis:document".Equals(baseType))
-            {
-                // get the size
-                Int64? size =
-GetIntegerPropertyValue(obj.properties, "cmis:contentStreamLength");
-                Console.WriteLine("      Size:      " +
-size);</p>
-<div class="codehilite"><pre>            <span class="sr">//</span> <span class="n">get</span> <span class="n">the</span> <span class="n">content</span>
-            <span class="n">cmisContentStreamType</span> <span class="n">content</span> <span class="o">=</span>
-</pre></div>
-
-
-<p>objService.getContentStream(repositoryInfo.repositoryId, objId, null, null,
-null, null);
-                Console.WriteLine("      MIME type:     " +
-content.mimeType);</p>
-<div class="codehilite"><pre>            <span class="sr">//</span> <span class="n">get</span> <span class="n">the</span> <span class="s">&quot;stream&quot;</span>
-                        <span class="n">byte</span><span class="o">[]</span><span class="p">(</span><span class="o">.</span><span class="n">html</span><span class="p">)</span>
-</pre></div>
-
-
-<p>bytes = content.stream; // really streaming requires some more work
-                Console.WriteLine("      Stream:        " +
-(bytes.Length == size ? "ok" : "mismatch"));
-            }
-            }</p>
-<div class="codehilite"><pre>    <span class="p">}</span>
-    <span class="p">}</span>
-    <span class="n">catch</span> <span class="p">(</span><span class="n">FaultException</span><span class="sr">&lt;cmisFaultType&gt;</span> <span class="n">fe</span><span class="p">)</span>
-    <span class="p">{</span>
-    <span class="n">Console</span><span class="o">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;CMIS Exception: &quot;</span> <span class="o">+</span> <span class="n">fe</span><span class="o">.</span><span class="n">Detail</span><span class="o">.</span><span class="n">message</span><span class="p">);</span>
-    <span class="n">Console</span><span class="o">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;Type: &quot;</span> <span class="o">+</span> <span class="n">fe</span><span class="o">.</span><span class="n">Detail</span><span class="o">.</span><span class="n">type</span><span class="p">);</span>
-    <span class="n">Console</span><span class="o">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;Code: &quot;</span> <span class="o">+</span> <span class="n">fe</span><span class="o">.</span><span class="n">Detail</span><span class="o">.</span><span class="n">code</span><span class="p">);</span>
-    <span class="p">}</span>
-    <span class="n">catch</span> <span class="p">(</span><span class="n">Exception</span> <span class="n">e</span><span class="p">)</span>
-    <span class="p">{</span>
-    <span class="n">Console</span><span class="o">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;Exception: &quot;</span> <span class="o">+</span> <span class="n">e</span><span class="o">.</span><span class="n">Message</span><span class="p">);</span>
-    <span class="n">Console</span><span class="o">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">e</span><span class="o">.</span><span class="n">StackTrace</span><span class="p">);</span>
-    <span class="p">}</span>
-
-    <span class="n">Console</span><span class="o">.</span><span class="n">ReadKey</span><span class="p">();</span>
-<span class="p">}</span>
-
-<span class="n">public</span> <span class="n">RepositoryServicePortClient</span> <span class="n">GetRepositoryService</span><span class="p">(</span><span class="n">String</span>
-</pre></div>
-
-
-<p>wsdlUrl, String user, String password)
-    {
-        BasicHttpBinding binding = new BasicHttpBinding();
-        binding.MessageEncoding = WSMessageEncoding.Mtom;
-        binding.Security.Mode =
-BasicHttpSecurityMode.TransportWithMessageCredential;</p>
-<div class="codehilite"><pre>    <span class="n">RepositoryServicePortClient</span> <span class="n">service</span> <span class="o">=</span> <span class="k">new</span>
-</pre></div>
+<div class="codehilite"><pre><span class="n">using</span> <span class="n">System</span><span class="p">;</span>
+<span class="n">using</span> <span class="n">System</span><span class="p">.</span><span class="n">ServiceModel</span><span class="p">;</span>
+<span class="n">using</span> <span class="n">OpenCMISClient</span><span class="p">.</span><span class="n">OpenCMISServer</span><span class="p">;</span>
+<span class="n">using</span> <span class="n">System</span><span class="p">.</span><span class="n">Net</span><span class="p">;</span>
 
+<span class="n">namespace</span> <span class="n">OpenCMISClient</span>
+<span class="p">{</span>
+    <span class="n">class</span> <span class="n">CMISClientDemo</span>
+    <span class="p">{</span>
+        <span class="n">public</span> <span class="kt">void</span> <span class="n">DoStuff</span><span class="p">()</span>
+        <span class="p">{</span>
+        <span class="n">try</span>
+            <span class="p">{</span>
+                <span class="c1">// uncomment the next line if you are using a self signed SSL certificate </span>
+                <span class="c1">// ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };</span>
+
+                <span class="c1">// get hold of the services</span>
+                <span class="n">RepositoryServicePortClient</span> <span class="n">repService</span> <span class="o">=</span> <span class="n">GetRepositoryService</span><span class="p">(</span><span class="s">&quot;https://localhost:8443/opencmis/services/RepositoryService?wsdl&quot;</span><span class="p">,</span> <span class="s">&quot;test&quot;</span><span class="p">,</span> <span class="s">&quot;test&quot;</span><span class="p">);</span>
+                <span class="n">NavigationServicePortClient</span> <span class="n">navService</span> <span class="o">=</span> <span class="n">GetNavigationService</span><span class="p">(</span><span class="s">&quot;https://localhost:8443/opencmis/services/NavigationService?wsdl&quot;</span><span class="p">,</span> <span class="s">&quot;test&quot;</span><span class="p">,</span> <span class="s">&quot;test&quot;</span><span class="p">);</span>
+                <span class="n">ObjectServicePortClient</span> <span class="n">objService</span> <span class="o">=</span> <span class="n">GetObjectService</span><span class="p">(</span><span class="s">&quot;https://localhost:8443/opencmis/services/ObjectService?wsdl&quot;</span><span class="p">,</span> <span class="s">&quot;test&quot;</span><span class="p">,</span> <span class="s">&quot;test&quot;</span><span class="p">);</span>
+
+                <span class="c1">// get the list of repositories</span>
+                <span class="n">cmisRepositoryEntryType</span><span class="p">[](.</span><span class="n">html</span><span class="p">)</span> <span class="n">repositoryEntries</span> <span class="o">=</span> <span class="n">repService</span><span class="p">.</span><span class="n">getRepositories</span><span class="p">(</span><span class="n">null</span><span class="p">);</span>
+                <span class="n">foreach</span> <span class="p">(</span><span class="n">cmisRepositoryEntryType</span> <span class="n">repositoryEntry</span> <span class="n">in</span> <span class="n">repositoryEntries</span><span class="p">)</span>
+                <span class="p">{</span>
+                    <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;Repository: &quot;</span> <span class="o">+</span> <span class="n">repositoryEntry</span><span class="p">.</span><span class="n">repositoryName</span> <span class="o">+</span> <span class="s">&quot; (&quot;</span> <span class="o">+</span> <span class="n">repositoryEntry</span><span class="p">.</span><span class="n">repositoryId</span> <span class="o">+</span> <span class="s">&quot;)&quot;</span><span class="p">);</span>
+
+                    <span class="c1">// get repository info</span>
+                    <span class="n">cmisRepositoryInfoType</span> <span class="n">repositoryInfo</span> <span class="o">=</span> <span class="n">repService</span><span class="p">.</span><span class="n">getRepositoryInfo</span><span class="p">(</span><span class="n">repositoryEntry</span><span class="p">.</span><span class="n">repositoryId</span><span class="p">,</span> <span class="n">null</span><span class="p">);</span>
+                    <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;  Info:&quot;</span><span class="p">);</span>
+                    <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;    Description: &quot;</span> <span class="o">+</span> <span class="n">repositoryInfo</span><span class="p">.</span><span class="n">repositoryDescription</span><span class="p">);</span>
+                    <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;    Product: &quot;</span> <span class="o">+</span> <span class="n">repositoryInfo</span><span class="p">.</span><span class="n">vendorName</span> <span class="o">+</span> <span class="s">&quot; / &quot;</span> <span class="o">+</span> <span class="n">repositoryInfo</span><span class="p">.</span><span class="n">productName</span> <span class="o">+</span> <span class="s">&quot; &quot;</span> <span class="o">+</span> <span class="n">repositoryInfo</span><span class="p">.</span><span class="n">productVersion</span><span class="p">);</span>
+
+                    <span class="c1">// get all base types of the repository</span>
+                    <span class="n">cmisTypeDefinitionListType</span> <span class="n">typeList</span> <span class="o">=</span> <span class="n">repService</span><span class="p">.</span><span class="n">getTypeChildren</span><span class="p">(</span><span class="n">repositoryInfo</span><span class="p">.</span><span class="n">repositoryId</span><span class="p">,</span> <span class="n">null</span><span class="p">,</span> <span class="nb">true</span><span class="p">,</span> <span class="n">null</span><span class="p">,</span> <span class="n">null</span><span class="p">,</span> <span class="n">null</span><span class="p">);</span>
+                    <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;  Types:&quot;</span><span class="p">);</span>
+                    <span class="n">foreach</span> <span class="p">(</span><span class="n">cmisTypeDefinitionType</span> <span class="n">type</span> <span class="n">in</span> <span class="n">typeList</span><span class="p">.</span><span class="n">types</span><span class="p">)</span>
+                    <span class="p">{</span>
+                        <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;    &quot;</span> <span class="o">+</span> <span class="n">type</span><span class="p">.</span><span class="n">displayName</span> <span class="o">+</span> <span class="s">&quot; (&quot;</span> <span class="o">+</span> <span class="n">type</span><span class="p">.</span><span class="n">id</span> <span class="o">+</span> <span class="s">&quot;)&quot;</span><span class="p">);</span>
+                    <span class="p">}</span>
+
+                    <span class="c1">// get all root folder children</span>
+                    <span class="n">cmisObjectInFolderListType</span> <span class="n">children</span> <span class="o">=</span> <span class="n">navService</span><span class="p">.</span><span class="n">getChildren</span><span class="p">(</span><span class="n">repositoryInfo</span><span class="p">.</span><span class="n">repositoryId</span><span class="p">,</span> <span class="n">repositoryInfo</span><span class="p">.</span><span class="n">rootFolderId</span><span class="p">,</span> <span class="n">null</span><span class="p">,</span> <span class="n">null</span><span class="p">,</span> <span class="nb">true</span><span class="p">,</span> <span class="n">null</span><span class="p">,</span> <span class="n">null</span><span class="p">,</span> <span class="nb">false</span><span class="p">,</span> <span class="n">null</span><span class="p">,</span> <span class="n">null</span><span class="p">,</span> <span class="n">null</span><span class="p">);</span>
+                    <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;  Root folder:&quot;</span><span class="p">);</span>
+                    <span class="n">foreach</span> <span class="p">(</span><span class="n">cmisObjectInFolderType</span> <span class="n">objInFolder</span> <span class="n">in</span> <span class="n">children</span><span class="p">.</span><span class="n">objects</span><span class="p">)</span>
+                    <span class="p">{</span>
+                        <span class="n">cmisObjectType</span> <span class="n">obj</span> <span class="o">=</span> <span class="n">objInFolder</span><span class="p">.</span><span class="err">@</span><span class="n">object</span><span class="p">;</span>
+                        <span class="n">String</span> <span class="n">objId</span> <span class="o">=</span> <span class="n">GetIdPropertyValue</span><span class="p">(</span><span class="n">obj</span><span class="p">.</span><span class="n">properties</span><span class="p">,</span> <span class="s">&quot;cmis:objectId&quot;</span><span class="p">);</span>
+                        <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;    Name: &quot;</span> <span class="o">+</span> <span class="n">GetStringPropertyValue</span><span class="p">(</span><span class="n">obj</span><span class="p">.</span><span class="n">properties</span><span class="p">,</span> <span class="s">&quot;cmis:name&quot;</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot; (&quot;</span> <span class="o">+</span> <span class="n">objId</span> <span class="o">+</span> <span class="s">&quot;)&quot;</span><span class="p">);</span>
+                        <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;  Type:      &quot;</span> <span class="o">+</span> <span class="n">GetIdPropertyValue</span><span class="p">(</span><span class="n">obj</span><span class="p">.</span><span class="n">properties</span><span class="p">,</span> <span class="s">&quot;cmis:baseTypeId&quot;</span><span class="p">));</span>
+                        <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;  Created by:    &quot;</span> <span class="o">+</span> <span class="n">GetStringPropertyValue</span><span class="p">(</span><span class="n">obj</span><span class="p">.</span><span class="n">properties</span><span class="p">,</span> <span class="s">&quot;cmis:createdBy&quot;</span><span class="p">));</span>
+                        <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;  Creation date: &quot;</span> <span class="o">+</span> <span class="n">GetDateTimePropertyValue</span><span class="p">(</span><span class="n">obj</span><span class="p">.</span><span class="n">properties</span><span class="p">,</span> <span class="s">&quot;cmis:creationDate&quot;</span><span class="p">));</span>
+
+                        <span class="c1">// if it is a document, get the size and the content</span>
+                        <span class="n">String</span> <span class="n">baseType</span> <span class="o">=</span> <span class="n">GetIdPropertyValue</span><span class="p">(</span><span class="n">obj</span><span class="p">.</span><span class="n">properties</span><span class="p">,</span> <span class="s">&quot;cmis:baseTypeId&quot;</span><span class="p">);</span>
+                        <span class="k">if</span> <span class="p">(</span><span class="s">&quot;cmis:document&quot;</span><span class="p">.</span><span class="n">Equals</span><span class="p">(</span><span class="n">baseType</span><span class="p">))</span>
+                        <span class="p">{</span>
+                            <span class="c1">// get the size</span>
+                            <span class="n">Int64</span><span class="o">?</span> <span class="n">size</span> <span class="o">=</span> <span class="n">GetIntegerPropertyValue</span><span class="p">(</span><span class="n">obj</span><span class="p">.</span><span class="n">properties</span><span class="p">,</span> <span class="s">&quot;cmis:contentStreamLength&quot;</span><span class="p">);</span>
+                            <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;      Size:      &quot;</span> <span class="o">+</span> <span class="n">size</span><span class="p">);</span>
+
+                            <span class="c1">// get the content</span>
+                            <span class="n">cmisContentStreamType</span> <span class="n">content</span> <span class="o">=</span> <span class="n">objService</span><span class="p">.</span><span class="n">getContentStream</span><span class="p">(</span><span class="n">repositoryInfo</span><span class="p">.</span><span class="n">repositoryId</span><span class="p">,</span> <span class="n">objId</span><span class="p">,</span> <span class="n">null</span><span class="p">,</span> <span class="n">null</span><span class="p">,</span> <span class="n">null</span><span class="p">,</span> <span class="n">null</span><span class="p">);</span>
+                            <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;      MIME type:     &quot;</span> <span class="o">+</span> <span class="n">content</span><span class="p">.</span><span class="n">mimeType</span><span class="p">);</span>
+
+                            <span class="c1">// get the &quot;stream&quot;</span>
+                            <span class="n">byte</span><span class="p">[]</span><span class="n">bytes</span> <span class="o">=</span> <span class="n">content</span><span class="p">.</span><span class="n">stream</span><span class="p">;</span> <span class="c1">// really streaming requires some more work</span>
+                            <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;      Stream:        &quot;</span> <span class="o">+</span> <span class="p">(</span><span class="n">bytes</span><span class="p">.</span><span class="n">Length</span> <span class="o">==</span> <span class="n">size</span> <span class="o">?</span> <span class="s">&quot;ok&quot;</span> <span class="o">:</span> <span class="s">&quot;mismatch&quot;</span><span class="p">));</span>
+                        <span class="p">}</span>
+                    <span class="p">}</span>
+
+                <span class="p">}</span>
+            <span class="p">}</span>
+            <span class="n">catch</span> <span class="p">(</span><span class="n">FaultException</span><span class="o">&lt;</span><span class="n">cmisFaultType</span><span class="o">&gt;</span> <span class="n">fe</span><span class="p">)</span>
+            <span class="p">{</span>
+                <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;CMIS Exception: &quot;</span> <span class="o">+</span> <span class="n">fe</span><span class="p">.</span><span class="n">Detail</span><span class="p">.</span><span class="n">message</span><span class="p">);</span>
+                <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;Type: &quot;</span> <span class="o">+</span> <span class="n">fe</span><span class="p">.</span><span class="n">Detail</span><span class="p">.</span><span class="n">type</span><span class="p">);</span>
+                <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;Code: &quot;</span> <span class="o">+</span> <span class="n">fe</span><span class="p">.</span><span class="n">Detail</span><span class="p">.</span><span class="n">code</span><span class="p">);</span>
+            <span class="p">}</span>
+            <span class="n">catch</span> <span class="p">(</span><span class="n">Exception</span> <span class="n">e</span><span class="p">)</span>
+            <span class="p">{</span>
+                <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="s">&quot;Exception: &quot;</span> <span class="o">+</span> <span class="n">e</span><span class="p">.</span><span class="n">Message</span><span class="p">);</span>
+                <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="n">StackTrace</span><span class="p">);</span>
+            <span class="p">}</span>
 
-<p>RepositoryServicePortClient(binding, new EndpointAddress(wsdlUrl));</p>
-<div class="codehilite"><pre>    <span class="n">service</span><span class="o">.</span><span class="n">ClientCredentials</span><span class="o">.</span><span class="n">UserName</span><span class="o">.</span><span class="n">UserName</span> <span class="o">=</span> <span class="n">user</span><span class="p">;</span>
-    <span class="n">service</span><span class="o">.</span><span class="n">ClientCredentials</span><span class="o">.</span><span class="n">UserName</span><span class="o">.</span><span class="n">Password</span> <span class="o">=</span> <span class="n">password</span><span class="p">;</span>
-
-    <span class="k">return</span> <span class="n">service</span><span class="p">;</span>
-<span class="p">}</span>
-
-<span class="n">public</span> <span class="n">NavigationServicePortClient</span> <span class="n">GetNavigationService</span><span class="p">(</span><span class="n">String</span>
-</pre></div>
-
+            <span class="n">Console</span><span class="p">.</span><span class="n">ReadKey</span><span class="p">();</span>
+        <span class="p">}</span>
 
-<p>wsdlUrl, String user, String password)
-    {
-        BasicHttpBinding binding = new BasicHttpBinding();
-        binding.MessageEncoding = WSMessageEncoding.Mtom;
-        binding.Security.Mode =
-BasicHttpSecurityMode.TransportWithMessageCredential;</p>
-<div class="codehilite"><pre>    <span class="n">NavigationServicePortClient</span> <span class="n">service</span> <span class="o">=</span> <span class="k">new</span>
-</pre></div>
+        <span class="n">public</span> <span class="n">RepositoryServicePortClient</span> <span class="n">GetRepositoryService</span><span class="p">(</span><span class="n">String</span> <span class="n">wsdlUrl</span><span class="p">,</span> <span class="n">String</span> <span class="n">user</span><span class="p">,</span> <span class="n">String</span> <span class="n">password</span><span class="p">)</span>
+        <span class="p">{</span>
+            <span class="n">BasicHttpBinding</span> <span class="n">binding</span> <span class="o">=</span> <span class="n">new</span> <span class="n">BasicHttpBinding</span><span class="p">();</span>
+            <span class="n">binding</span><span class="p">.</span><span class="n">MessageEncoding</span> <span class="o">=</span> <span class="n">WSMessageEncoding</span><span class="p">.</span><span class="n">Mtom</span><span class="p">;</span>
+            <span class="n">binding</span><span class="p">.</span><span class="n">Security</span><span class="p">.</span><span class="n">Mode</span> <span class="o">=</span> <span class="n">BasicHttpSecurityMode</span><span class="p">.</span><span class="n">TransportWithMessageCredential</span><span class="p">;</span>
 
+            <span class="n">RepositoryServicePortClient</span> <span class="n">service</span> <span class="o">=</span> <span class="n">new</span> <span class="n">RepositoryServicePortClient</span><span class="p">(</span><span class="n">binding</span><span class="p">,</span> <span class="n">new</span> <span class="n">EndpointAddress</span><span class="p">(</span><span class="n">wsdlUrl</span><span class="p">));</span>
 
-<p>NavigationServicePortClient(binding, new EndpointAddress(wsdlUrl));</p>
-<div class="codehilite"><pre>    <span class="n">service</span><span class="o">.</span><span class="n">ClientCredentials</span><span class="o">.</span><span class="n">UserName</span><span class="o">.</span><span class="n">UserName</span> <span class="o">=</span> <span class="n">user</span><span class="p">;</span>
-    <span class="n">service</span><span class="o">.</span><span class="n">ClientCredentials</span><span class="o">.</span><span class="n">UserName</span><span class="o">.</span><span class="n">Password</span> <span class="o">=</span> <span class="n">password</span><span class="p">;</span>
+            <span class="n">service</span><span class="p">.</span><span class="n">ClientCredentials</span><span class="p">.</span><span class="n">UserName</span><span class="p">.</span><span class="n">UserName</span> <span class="o">=</span> <span class="n">user</span><span class="p">;</span>
+            <span class="n">service</span><span class="p">.</span><span class="n">ClientCredentials</span><span class="p">.</span><span class="n">UserName</span><span class="p">.</span><span class="n">Password</span> <span class="o">=</span> <span class="n">password</span><span class="p">;</span>
 
-    <span class="k">return</span> <span class="n">service</span><span class="p">;</span>
-<span class="p">}</span>
+            <span class="k">return</span> <span class="n">service</span><span class="p">;</span>
+        <span class="p">}</span>
 
-<span class="n">public</span> <span class="n">ObjectServicePortClient</span> <span class="n">GetObjectService</span><span class="p">(</span><span class="n">String</span> <span class="n">wsdlUrl</span><span class="p">,</span>
-</pre></div>
+        <span class="n">public</span> <span class="n">NavigationServicePortClient</span> <span class="n">GetNavigationService</span><span class="p">(</span><span class="n">String</span> <span class="n">wsdlUrl</span><span class="p">,</span> <span class="n">String</span> <span class="n">user</span><span class="p">,</span> <span class="n">String</span> <span class="n">password</span><span class="p">)</span>
+        <span class="p">{</span>
+            <span class="n">BasicHttpBinding</span> <span class="n">binding</span> <span class="o">=</span> <span class="n">new</span> <span class="n">BasicHttpBinding</span><span class="p">();</span>
+            <span class="n">binding</span><span class="p">.</span><span class="n">MessageEncoding</span> <span class="o">=</span> <span class="n">WSMessageEncoding</span><span class="p">.</span><span class="n">Mtom</span><span class="p">;</span>
+            <span class="n">binding</span><span class="p">.</span><span class="n">Security</span><span class="p">.</span><span class="n">Mode</span> <span class="o">=</span> <span class="n">BasicHttpSecurityMode</span><span class="p">.</span><span class="n">TransportWithMessageCredential</span><span class="p">;</span>
 
+            <span class="n">NavigationServicePortClient</span> <span class="n">service</span> <span class="o">=</span> <span class="n">new</span>
+            <span class="n">NavigationServicePortClient</span><span class="p">(</span><span class="n">binding</span><span class="p">,</span> <span class="n">new</span> <span class="n">EndpointAddress</span><span class="p">(</span><span class="n">wsdlUrl</span><span class="p">));</span>
 
-<p>String user, String password)
-    {
-        BasicHttpBinding binding = new BasicHttpBinding();
-        binding.MessageEncoding = WSMessageEncoding.Mtom;
-        binding.Security.Mode =
-BasicHttpSecurityMode.TransportWithMessageCredential;
-        binding.TransferMode = TransferMode.Streamed;</p>
-<div class="codehilite"><pre>    <span class="n">ObjectServicePortClient</span> <span class="n">service</span> <span class="o">=</span> <span class="k">new</span>
-</pre></div>
+            <span class="n">service</span><span class="p">.</span><span class="n">ClientCredentials</span><span class="p">.</span><span class="n">UserName</span><span class="p">.</span><span class="n">UserName</span> <span class="o">=</span> <span class="n">user</span><span class="p">;</span>
+            <span class="n">service</span><span class="p">.</span><span class="n">ClientCredentials</span><span class="p">.</span><span class="n">UserName</span><span class="p">.</span><span class="n">Password</span> <span class="o">=</span> <span class="n">password</span><span class="p">;</span>
 
+            <span class="k">return</span> <span class="n">service</span><span class="p">;</span>
+        <span class="p">}</span>
 
-<p>ObjectServicePortClient(binding, new EndpointAddress(wsdlUrl));</p>
-<div class="codehilite"><pre>    <span class="n">service</span><span class="o">.</span><span class="n">ClientCredentials</span><span class="o">.</span><span class="n">UserName</span><span class="o">.</span><span class="n">UserName</span> <span class="o">=</span> <span class="n">user</span><span class="p">;</span>
-    <span class="n">service</span><span class="o">.</span><span class="n">ClientCredentials</span><span class="o">.</span><span class="n">UserName</span><span class="o">.</span><span class="n">Password</span> <span class="o">=</span> <span class="n">password</span><span class="p">;</span>
+        <span class="n">public</span> <span class="n">ObjectServicePortClient</span> <span class="n">GetObjectService</span><span class="p">(</span><span class="n">String</span> <span class="n">wsdlUrl</span><span class="p">,</span> <span class="n">String</span> <span class="n">user</span><span class="p">,</span> <span class="n">String</span> <span class="n">password</span><span class="p">)</span>
+        <span class="p">{</span>
+            <span class="n">BasicHttpBinding</span> <span class="n">binding</span> <span class="o">=</span> <span class="n">new</span> <span class="n">BasicHttpBinding</span><span class="p">();</span>
+            <span class="n">binding</span><span class="p">.</span><span class="n">MessageEncoding</span> <span class="o">=</span> <span class="n">WSMessageEncoding</span><span class="p">.</span><span class="n">Mtom</span><span class="p">;</span>
+            <span class="n">binding</span><span class="p">.</span><span class="n">Security</span><span class="p">.</span><span class="n">Mode</span> <span class="o">=</span> <span class="n">BasicHttpSecurityMode</span><span class="p">.</span><span class="n">TransportWithMessageCredential</span><span class="p">;</span>
+            <span class="n">binding</span><span class="p">.</span><span class="n">TransferMode</span> <span class="o">=</span> <span class="n">TransferMode</span><span class="p">.</span><span class="n">Streamed</span><span class="p">;</span>
 
-    <span class="k">return</span> <span class="n">service</span><span class="p">;</span>
-<span class="p">}</span>
+            <span class="n">ObjectServicePortClient</span> <span class="n">service</span> <span class="o">=</span> <span class="n">new</span> <span class="n">ObjectServicePortClient</span><span class="p">(</span><span class="n">binding</span><span class="p">,</span> <span class="n">new</span> <span class="n">EndpointAddress</span><span class="p">(</span><span class="n">wsdlUrl</span><span class="p">));</span>
 
-<span class="n">public</span> <span class="n">String</span> <span class="n">GetStringPropertyValue</span><span class="p">(</span><span class="n">cmisPropertiesType</span> <span class="n">properties</span><span class="p">,</span>
-</pre></div>
+            <span class="n">service</span><span class="p">.</span><span class="n">ClientCredentials</span><span class="p">.</span><span class="n">UserName</span><span class="p">.</span><span class="n">UserName</span> <span class="o">=</span> <span class="n">user</span><span class="p">;</span>
+            <span class="n">service</span><span class="p">.</span><span class="n">ClientCredentials</span><span class="p">.</span><span class="n">UserName</span><span class="p">.</span><span class="n">Password</span> <span class="o">=</span> <span class="n">password</span><span class="p">;</span>
 
+            <span class="k">return</span> <span class="n">service</span><span class="p">;</span>
+        <span class="p">}</span>
 
-<p>String id)
-    {
-        String result = null;</p>
-<div class="codehilite"><pre>    <span class="k">foreach</span> <span class="p">(</span><span class="n">cmisProperty</span> <span class="n">property</span> <span class="n">in</span> <span class="n">properties</span><span class="o">.</span><span class="n">Items</span><span class="p">)</span>
-    <span class="p">{</span>
-    <span class="k">if</span> <span class="p">(</span><span class="n">property</span><span class="o">.</span><span class="n">propertyDefinitionId</span><span class="o">.</span><span class="n">Equals</span><span class="p">(</span><span class="n">id</span><span class="p">))</span>
-    <span class="p">{</span>
-        <span class="k">if</span> <span class="p">(</span><span class="n">property</span> <span class="n">is</span> <span class="n">cmisPropertyString</span><span class="p">)</span>
+        <span class="n">public</span> <span class="n">String</span> <span class="n">GetStringPropertyValue</span><span class="p">(</span><span class="n">cmisPropertiesType</span> <span class="n">properties</span><span class="p">,</span> <span class="n">String</span> <span class="n">id</span><span class="p">)</span>
         <span class="p">{</span>
-                    <span class="n">result</span> <span class="o">=</span> <span class="p">((</span><span class="n">cmisPropertyString</span><span class="p">)</span><span class="n">property</span><span class="p">)</span><span class="o">.</span><span class="n">value</span><span class="p">[</span><span class="mi">0</span><span class="p">](</span><span class="mi">0</span><span class="o">.</span><span class="n">html</span><span class="p">)</span>
-</pre></div>
+            <span class="n">String</span> <span class="n">result</span> <span class="o">=</span> <span class="n">null</span><span class="p">;</span>
 
+            <span class="n">foreach</span> <span class="p">(</span><span class="n">cmisProperty</span> <span class="n">property</span> <span class="n">in</span> <span class="n">properties</span><span class="p">.</span><span class="n">Items</span><span class="p">)</span>
+            <span class="p">{</span>
+                <span class="k">if</span> <span class="p">(</span><span class="n">property</span><span class="p">.</span><span class="n">propertyDefinitionId</span><span class="p">.</span><span class="n">Equals</span><span class="p">(</span><span class="n">id</span><span class="p">))</span>
+                <span class="p">{</span>
+                    <span class="k">if</span> <span class="p">(</span><span class="n">property</span> <span class="n">is</span> <span class="n">cmisPropertyString</span><span class="p">)</span>
+                    <span class="p">{</span>
+                        <span class="n">result</span> <span class="o">=</span> <span class="p">((</span><span class="n">cmisPropertyString</span><span class="p">)</span><span class="n">property</span><span class="p">).</span><span class="n">value</span><span class="p">[</span><span class="mi">0</span><span class="p">](</span><span class="mf">0.</span><span class="n">html</span><span class="p">);</span>
+                    <span class="p">}</span>
+                    <span class="k">break</span><span class="p">;</span>
+                <span class="p">}</span>
+            <span class="p">}</span>
 
-<p>;
-            }
-            break;
-        }
-        }</p>
-<div class="codehilite"><pre>    <span class="k">return</span> <span class="n">result</span><span class="p">;</span>
-<span class="p">}</span>
+            <span class="k">return</span> <span class="n">result</span><span class="p">;</span>
+        <span class="p">}</span>
 
-<span class="n">public</span> <span class="n">String</span> <span class="n">GetIdPropertyValue</span><span class="p">(</span><span class="n">cmisPropertiesType</span> <span class="n">properties</span><span class="p">,</span>
-</pre></div>
-
-
-<p>String id)
-    {
-        String result = null;</p>
-<div class="codehilite"><pre>    <span class="k">foreach</span> <span class="p">(</span><span class="n">cmisProperty</span> <span class="n">property</span> <span class="n">in</span> <span class="n">properties</span><span class="o">.</span><span class="n">Items</span><span class="p">)</span>
-    <span class="p">{</span>
-    <span class="k">if</span> <span class="p">(</span><span class="n">property</span><span class="o">.</span><span class="n">propertyDefinitionId</span><span class="o">.</span><span class="n">Equals</span><span class="p">(</span><span class="n">id</span><span class="p">))</span>
-    <span class="p">{</span>
-        <span class="k">if</span> <span class="p">(</span><span class="n">property</span> <span class="n">is</span> <span class="n">cmisPropertyId</span><span class="p">)</span>
+        <span class="n">public</span> <span class="n">String</span> <span class="n">GetIdPropertyValue</span><span class="p">(</span><span class="n">cmisPropertiesType</span> <span class="n">properties</span><span class="p">,</span> <span class="n">String</span> <span class="n">id</span><span class="p">)</span>
         <span class="p">{</span>
-                    <span class="n">result</span> <span class="o">=</span> <span class="p">((</span><span class="n">cmisPropertyId</span><span class="p">)</span><span class="n">property</span><span class="p">)</span><span class="o">.</span><span class="n">value</span><span class="p">[</span><span class="mi">0</span><span class="p">](</span><span class="mi">0</span><span class="o">.</span><span class="n">html</span><span class="p">)</span>
-</pre></div>
-
+            <span class="n">String</span> <span class="n">result</span> <span class="o">=</span> <span class="n">null</span><span class="p">;</span>
 
-<p>;
-            }
-            break;
-        }
-        }</p>
-<div class="codehilite"><pre>    <span class="k">return</span> <span class="n">result</span><span class="p">;</span>
-<span class="p">}</span>
-
-<span class="n">public</span> <span class="n">Int64</span><span class="p">?</span> <span class="n">GetIntegerPropertyValue</span><span class="p">(</span><span class="n">cmisPropertiesType</span>
-</pre></div>
+            <span class="n">foreach</span> <span class="p">(</span><span class="n">cmisProperty</span> <span class="n">property</span> <span class="n">in</span> <span class="n">properties</span><span class="p">.</span><span class="n">Items</span><span class="p">)</span>
+            <span class="p">{</span>
+                <span class="k">if</span> <span class="p">(</span><span class="n">property</span><span class="p">.</span><span class="n">propertyDefinitionId</span><span class="p">.</span><span class="n">Equals</span><span class="p">(</span><span class="n">id</span><span class="p">))</span>
+                <span class="p">{</span>
+                    <span class="k">if</span> <span class="p">(</span><span class="n">property</span> <span class="n">is</span> <span class="n">cmisPropertyId</span><span class="p">)</span>
+                    <span class="p">{</span>
+                        <span class="n">result</span> <span class="o">=</span> <span class="p">((</span><span class="n">cmisPropertyId</span><span class="p">)</span><span class="n">property</span><span class="p">).</span><span class="n">value</span><span class="p">[</span><span class="mi">0</span><span class="p">](</span><span class="mf">0.</span><span class="n">html</span><span class="p">);</span>
+                    <span class="p">}</span>
+                    <span class="k">break</span><span class="p">;</span>
+                <span class="p">}</span>
+            <span class="p">}</span>
 
+            <span class="k">return</span> <span class="n">result</span><span class="p">;</span>
+        <span class="p">}</span>
 
-<p>properties, String id)
-    {
-        Int64? result = null;</p>
-<div class="codehilite"><pre>    <span class="k">foreach</span> <span class="p">(</span><span class="n">cmisProperty</span> <span class="n">property</span> <span class="n">in</span> <span class="n">properties</span><span class="o">.</span><span class="n">Items</span><span class="p">)</span>
-    <span class="p">{</span>
-    <span class="k">if</span> <span class="p">(</span><span class="n">property</span><span class="o">.</span><span class="n">propertyDefinitionId</span><span class="o">.</span><span class="n">Equals</span><span class="p">(</span><span class="n">id</span><span class="p">))</span>
-    <span class="p">{</span>
-        <span class="k">if</span> <span class="p">(</span><span class="n">property</span> <span class="n">is</span> <span class="n">cmisPropertyInteger</span><span class="p">)</span>
+        <span class="n">public</span> <span class="n">Int64</span><span class="o">?</span> <span class="n">GetIntegerPropertyValue</span><span class="p">(</span><span class="n">cmisPropertiesType</span> <span class="n">properties</span><span class="p">,</span> <span class="n">String</span> <span class="n">id</span><span class="p">)</span>
         <span class="p">{</span>
-                    <span class="n">result</span> <span class="o">=</span> <span class="n">Int64</span><span class="o">.</span><span class="n">Parse</span><span class="p">(((</span><span class="n">cmisPropertyInteger</span><span class="p">)</span><span class="n">property</span><span class="p">)</span><span class="o">.</span><span class="n">value</span><span class="p">[</span><span class="mi">0</span><span class="p">](</span><span class="mi">0</span><span class="o">.</span><span class="n">html</span><span class="p">)</span>
-</pre></div>
+            <span class="n">Int64</span><span class="o">?</span> <span class="n">result</span> <span class="o">=</span> <span class="n">null</span><span class="p">;</span>
 
+            <span class="n">foreach</span> <span class="p">(</span><span class="n">cmisProperty</span> <span class="n">property</span> <span class="n">in</span> <span class="n">properties</span><span class="p">.</span><span class="n">Items</span><span class="p">)</span>
+            <span class="p">{</span>
+                <span class="k">if</span> <span class="p">(</span><span class="n">property</span><span class="p">.</span><span class="n">propertyDefinitionId</span><span class="p">.</span><span class="n">Equals</span><span class="p">(</span><span class="n">id</span><span class="p">))</span>
+                <span class="p">{</span>
+                    <span class="k">if</span> <span class="p">(</span><span class="n">property</span> <span class="n">is</span> <span class="n">cmisPropertyInteger</span><span class="p">)</span>
+                    <span class="p">{</span>
+                        <span class="n">result</span> <span class="o">=</span> <span class="n">Int64</span><span class="p">.</span><span class="n">Parse</span><span class="p">(((</span><span class="n">cmisPropertyInteger</span><span class="p">)</span><span class="n">property</span><span class="p">).</span><span class="n">value</span><span class="p">[</span><span class="mi">0</span><span class="p">](</span><span class="mf">0.</span><span class="n">html</span><span class="p">));</span>
+                    <span class="p">}</span>
+                    <span class="k">break</span><span class="p">;</span>
+                <span class="p">}</span>
+            <span class="p">}</span>
 
-<p>);
-            }
-            break;
-        }
-        }</p>
-<div class="codehilite"><pre>    <span class="k">return</span> <span class="n">result</span><span class="p">;</span>
-<span class="p">}</span>
+            <span class="k">return</span> <span class="n">result</span><span class="p">;</span>
+        <span class="p">}</span>
 
-<span class="n">public</span> <span class="n">DateTime</span><span class="p">?</span> <span class="n">GetDateTimePropertyValue</span><span class="p">(</span><span class="n">cmisPropertiesType</span>
-</pre></div>
-
-
-<p>properties, String id)
-    {
-        DateTime? result = null;</p>
-<div class="codehilite"><pre>    <span class="k">foreach</span> <span class="p">(</span><span class="n">cmisProperty</span> <span class="n">property</span> <span class="n">in</span> <span class="n">properties</span><span class="o">.</span><span class="n">Items</span><span class="p">)</span>
-    <span class="p">{</span>

[... 257 lines stripped ...]


Mime
View raw message