chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r785901 - /websites/staging/chemistry/trunk/content/java/opencmis-cookbook.html
Date Mon, 21 Feb 2011 17:54:48 GMT
Author: buildbot
Date: Mon Feb 21 17:54:48 2011
New Revision: 785901

Log:
Staging update by buildbot

Modified:
    websites/staging/chemistry/trunk/content/java/opencmis-cookbook.html

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:54:48
2011
@@ -258,13 +258,14 @@ Since this sends the password as plain t
 <ol>
 <li>Download the WSDL with a web browser and store it on your local disk. The WSDL
URL is <code>http://&lt;host&gt;/_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>
-<p>Activate the OpenCMIS NTLM authentication provider.
-<br/></p>
-<p>:::java
-parameters.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS, CmisBindingFactory.NTLM_AUTHENTICATION_PROVIDER);</p>
-</li>
+<li>Activate the OpenCMIS NTLM authentication provider.</li>
 </ol>
+&nbsp;
+
+<div class="codehilite"><pre><span class="n">parameters</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">AUTHENTICATION_PROVIDER_CLASS</span><span
class="o">,</span> <span class="n">CmisBindingFactory</span><span
class="o">.</span><span class="na">NTLM_AUTHENTICATION_PROVIDER</span><span
class="o">);</span>
+</pre></div>
+
+
 <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>
@@ -288,35 +289,46 @@ So it might return stale objects.<br />
 </p>
 <p>There are multiple ways to deal with that:</p>
 <ul>
-<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);</p>
-<p>CmisObject object = session.getObject(id, oc);</p>
-</li>
-<li>
-<p>Clear the session cache (not recommended).
-<br/></p>
-<p>:::java
-session.clear();</p>
-</li>
+<li>Refresh the object data that is returned from <code>getObject()</code>.</li>
+</ul>
+&nbsp;
+
+<div class="codehilite"><pre><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">id</span><span class="o">);</span>
+<span class="n">object</span><span class="o">.</span><span class="na">refresh</span><span
class="o">();</span> <span class="c1">// contacts the repository and refreshes
the object</span>
+<span class="n">object</span><span class="o">.</span><span class="na">refreshIfOld</span><span
class="o">(</span><span class="mi">60</span> <span class="o">*</span>
<span class="mi">1000</span><span class="o">);</span> <span class="c1">//
... or refreshes the object only if the data is older than a minute</span>
+</pre></div>
+
+
+<ul>
+<li>Turn off the session cache completely.</li>
 </ul>
+&nbsp;
+
+<div class="codehilite"><pre><span class="n">session</span><span
class="o">.</span><span class="na">getDefaultContext</span><span class="o">().</span><span
class="na">setCacheEnabled</span><span class="o">(</span><span class="kc">false</span><span
class="o">);</span>
+</pre></div>
+
+
+<ul>
+<li>Turn off caching for this <code>getObject()</code> call.</li>
+</ul>
+&nbsp;
+
+<div class="codehilite"><pre><span class="n">OperationContext</span>
<span class="n">oc</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">oc</span><span class="o">.</span><span class="na">setCacheEnabled</span><span
class="o">(</span><span class="kc">false</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">id</span><span
class="o">,</span> <span class="n">oc</span><span class="o">);</span>
+</pre></div>
+
+
+<ul>
+<li>Clear the session cache (not recommended).</li>
+</ul>
+&nbsp;
+
+<div class="codehilite"><pre><span class="n">session</span><span
class="o">.</span><span class="na">clear</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>
 <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>
@@ -375,7 +387,7 @@ session.clear();</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>
+<p><em>(since OpenCMIS 0.2.0)</em> <br/>
 The CMIS specification allows to add extensions at several points in CMIS
 data structures (object, properties, allowable actions, ACLs, policies,
 etc.).
@@ -631,7 +643,7 @@ allows UsernameTokens over HTTPS.</p>
 <p>TODO</p>
 <h2 id="cmis_server">CMIS Server</h2>
 <h3 id="adding_cmis_extensions">Adding CMIS extensions</h3>
-<p><em>(since OpenCMIS 0.2.0)</em></p>
+<p><em>(since OpenCMIS 0.2.0)</em> <br/></p>
 <div class="codehilite"><pre><span class="c1">// we want to attach an extension
to an object</span>
 <span class="n">ObjectData</span> <span class="n">object</span> <span
class="o">=</span> <span class="o">...</span>
 



Mime
View raw message