chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r944091 - in /websites/staging/chemistry/trunk/content: ./ java/examples/example-create-session.html java/examples/example-create-update.html java/examples/example-get-id-from-path.html
Date Tue, 17 Mar 2015 10:16:40 GMT
Author: buildbot
Date: Tue Mar 17 10:16:40 2015
New Revision: 944091

Log:
Staging update by buildbot for chemistry

Modified:
    websites/staging/chemistry/trunk/content/   (props changed)
    websites/staging/chemistry/trunk/content/java/examples/example-create-session.html
    websites/staging/chemistry/trunk/content/java/examples/example-create-update.html
    websites/staging/chemistry/trunk/content/java/examples/example-get-id-from-path.html

Propchange: websites/staging/chemistry/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue Mar 17 10:16:40 2015
@@ -1 +1 @@
-1667226
+1667231

Modified: websites/staging/chemistry/trunk/content/java/examples/example-create-session.html
==============================================================================
--- websites/staging/chemistry/trunk/content/java/examples/example-create-session.html (original)
+++ websites/staging/chemistry/trunk/content/java/examples/example-create-session.html Tue
Mar 17 10:16:40 2015
@@ -248,6 +248,25 @@ How to create a session and connect to a
 </pre></div>
 
 
+<h2 id="browser-binding">Browser binding</h2>
+<div class="codehilite"><pre><span class="c1">// default factory implementation</span>
+<span class="n">SessionFactory</span> <span class="n">factory</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;Otto&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;****&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">BROWSER_URL</span><span class="o">,</span>
<span class="s">&quot;http://&lt;host&gt;:&lt;port&gt;/cmis/browser&quot;</span><span
class="o">);</span>
+<span class="n">parameter</span><span class="o">.</span><span
class="na">put</span><span class="o">(</span><span class="n">SessionParameter</span><span
class="o">.</span><span class="na">BINDING_TYPE</span><span class="o">,</span>
<span class="n">BindingType</span><span class="o">.</span><span
class="na">BROWSER</span><span class="o">.</span><span class="na">value</span><span
class="o">());</span>
+<span class="n">parameter</span><span class="o">.</span><span
class="na">put</span><span class="o">(</span><span class="n">SessionParameter</span><span
class="o">.</span><span class="na">REPOSITORY_ID</span><span class="o">,</span>
<span class="s">&quot;myRepository&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="n">factory</span><span class="o">.</span><span
class="na">createSession</span><span class="o">(</span><span class="n">parameter</span><span
class="o">);</span>
+</pre></div>
+
+
 <h2 id="local-binding">Local binding</h2>
 <p>The local binding is specific to OpenCMIS. It lets an OpenCMIS client connect to
an OpenCMIS server in the same JVM.</p>
 <div class="codehilite"><pre><span class="c1">// default factory implementation</span>

Modified: websites/staging/chemistry/trunk/content/java/examples/example-create-update.html
==============================================================================
--- websites/staging/chemistry/trunk/content/java/examples/example-create-update.html (original)
+++ websites/staging/chemistry/trunk/content/java/examples/example-create-update.html Tue
Mar 17 10:16:40 2015
@@ -201,59 +201,59 @@ Apache Chemistry - Creating and updating
              <div class="wiki-content"><h1 id="creating-and-updating-cmis-objects">Creating
and updating CMIS objects</h1>
 <h2 id="creating-a-folder">Creating a folder</h2>
 <p>This example creates a folder under the root folder.</p>
-<div class="codehilite"><pre><span class="n">Folder</span> <span
class="n">root</span> <span class="p">=</span> <span class="n">session</span><span
class="p">.</span><span class="n">getRootFolder</span><span class="p">();</span>
+<div class="codehilite"><pre><span class="n">Folder</span> <span
class="n">root</span> <span class="o">=</span> <span class="n">session</span><span
class="o">.</span><span class="na">getRootFolder</span><span class="o">();</span>
 
-<span class="o">//</span> <span class="k">properties</span>
-<span class="o">//</span> <span class="p">(</span><span class="n">minimal</span>
<span class="n">set</span><span class="p">:</span> <span class="n">name</span>
<span class="n">and</span> <span class="n">object</span> <span
class="n">type</span> <span class="n">id</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">Object</span><span
class="o">&gt;</span> <span class="k">properties</span> <span
class="p">=</span> <span class="n">new</span> <span class="n">HashMap</span><span
class="o">&lt;</span><span class="n">String</span><span class="p">,</span>
<span class="n">Object</span><span class="o">&gt;</span><span
class="p">();</span>
-<span class="k">properties</span><span class="p">.</span><span
class="n">put</span><span class="p">(</span><span class="n">PropertyIds</span><span
class="p">.</span><span class="n">OBJECT_TYPE_ID</span><span class="p">,</span>
&quot;<span class="n">cmis</span><span class="p">:</span><span
class="n">folder</span>&quot;<span class="p">);</span>
-<span class="k">properties</span><span class="p">.</span><span
class="n">put</span><span class="p">(</span><span class="n">PropertyIds</span><span
class="p">.</span><span class="n">NAME</span><span class="p">,</span>
&quot;<span class="n">a</span> <span class="n">new</span> <span
class="n">folder</span>&quot;<span class="p">);</span>
+<span class="c1">// properties</span>
+<span class="c1">// (minimal set: name and object type id)</span>
+<span class="n">Map</span><span class="o">&lt;</span><span
class="n">String</span><span class="o">,</span> <span class="n">Object</span><span
class="o">&gt;</span> <span class="n">properties</span> <span
class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span
class="o">&lt;</span><span class="n">String</span><span class="o">,</span>
<span class="n">Object</span><span class="o">&gt;();</span>
+<span class="n">properties</span><span class="o">.</span><span
class="na">put</span><span class="o">(</span><span class="n">PropertyIds</span><span
class="o">.</span><span class="na">OBJECT_TYPE_ID</span><span class="o">,</span>
<span class="s">&quot;cmis:folder&quot;</span><span class="o">);</span>
+<span class="n">properties</span><span class="o">.</span><span
class="na">put</span><span class="o">(</span><span class="n">PropertyIds</span><span
class="o">.</span><span class="na">NAME</span><span class="o">,</span>
<span class="s">&quot;a new folder&quot;</span><span class="o">);</span>
 
-<span class="o">//</span> <span class="n">create</span> <span
class="n">the</span> <span class="n">folder</span>
-<span class="n">Folder</span> <span class="n">newFolder</span> <span
class="p">=</span> <span class="n">root</span><span class="p">.</span><span
class="n">createFolder</span><span class="p">(</span><span class="k">properties</span><span
class="p">);</span>
+<span class="c1">// create the folder</span>
+<span class="n">Folder</span> <span class="n">newFolder</span> <span
class="o">=</span> <span class="n">root</span><span class="o">.</span><span
class="na">createFolder</span><span class="o">(</span><span class="n">properties</span><span
class="o">);</span>
 </pre></div>
 
 
 <h2 id="creating-a-document">Creating a document</h2>
 <p>This example creates a document in the folder <code>parent</code>.</p>
-<div class="codehilite"><pre><span class="n">Folder</span> <span
class="n">parent</span> <span class="p">=</span> <span class="p">....</span>
+<div class="codehilite"><pre><span class="n">Folder</span> <span
class="n">parent</span> <span class="o">=</span> <span class="o">....</span>
 
-<span class="n">String</span> <span class="n">name</span> <span
class="p">=</span> &quot;<span class="n">myNewDocument</span><span
class="p">.</span><span class="n">txt</span>&quot;<span class="p">;</span>
+<span class="n">String</span> <span class="n">name</span> <span
class="o">=</span> <span class="s">&quot;myNewDocument.txt&quot;</span><span
class="o">;</span>
 
-<span class="o">//</span> <span class="k">properties</span> 
-<span class="o">//</span> <span class="p">(</span><span class="n">minimal</span>
<span class="n">set</span><span class="p">:</span> <span class="n">name</span>
<span class="n">and</span> <span class="n">object</span> <span
class="n">type</span> <span class="n">id</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">Object</span><span
class="o">&gt;</span> <span class="k">properties</span> <span
class="p">=</span> <span class="n">new</span> <span class="n">HashMap</span><span
class="o">&lt;</span><span class="n">String</span><span class="p">,</span>
<span class="n">Object</span><span class="o">&gt;</span><span
class="p">();</span>
-<span class="k">properties</span><span class="p">.</span><span
class="n">put</span><span class="p">(</span><span class="n">PropertyIds</span><span
class="p">.</span><span class="n">OBJECT_TYPE_ID</span><span class="p">,</span>
&quot;<span class="n">cmis</span><span class="p">:</span><span
class="n">document</span>&quot;<span class="p">);</span>
-<span class="k">properties</span><span class="p">.</span><span
class="n">put</span><span class="p">(</span><span class="n">PropertyIds</span><span
class="p">.</span><span class="n">NAME</span><span class="p">,</span>
<span class="n">name</span><span class="p">);</span>
-
-<span class="o">//</span> <span class="n">content</span>
-<span class="n">byte</span><span class="p">[]</span> <span class="n">content</span>
<span class="p">=</span> &quot;<span class="n">Hello</span> <span
class="n">World</span>!&quot;<span class="p">.</span><span class="n">getBytes</span><span
class="p">();</span>
-<span class="n">InputStream</span> <span class="n">stream</span>
<span class="p">=</span> <span class="n">new</span> <span class="n">ByteArrayInputStream</span><span
class="p">(</span><span class="n">content</span><span class="p">);</span>
-<span class="n">ContentStream</span> <span class="n">contentStream</span>
<span class="p">=</span> <span class="n">new</span> <span class="n">ContentStreamImpl</span><span
class="p">(</span><span class="n">name</span><span class="p">,</span>
<span class="n">BigInteger</span><span class="p">.</span><span
class="n">valueOf</span><span class="p">(</span><span class="n">content</span><span
class="p">.</span><span class="nb">length</span><span class="p">),</span>
&quot;<span class="n">text</span><span class="o">/</span><span
class="n">plain</span>&quot;<span class="p">,</span> <span class="n">stream</span><span
class="p">);</span>
+<span class="c1">// properties </span>
+<span class="c1">// (minimal set: name and object type id)</span>
+<span class="n">Map</span><span class="o">&lt;</span><span
class="n">String</span><span class="o">,</span> <span class="n">Object</span><span
class="o">&gt;</span> <span class="n">properties</span> <span
class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span
class="o">&lt;</span><span class="n">String</span><span class="o">,</span>
<span class="n">Object</span><span class="o">&gt;();</span>
+<span class="n">properties</span><span class="o">.</span><span
class="na">put</span><span class="o">(</span><span class="n">PropertyIds</span><span
class="o">.</span><span class="na">OBJECT_TYPE_ID</span><span class="o">,</span>
<span class="s">&quot;cmis:document&quot;</span><span class="o">);</span>
+<span class="n">properties</span><span class="o">.</span><span
class="na">put</span><span class="o">(</span><span class="n">PropertyIds</span><span
class="o">.</span><span class="na">NAME</span><span class="o">,</span>
<span class="n">name</span><span class="o">);</span>
+
+<span class="c1">// content</span>
+<span class="kt">byte</span><span class="o">[]</span> <span class="n">content</span>
<span class="o">=</span> <span class="s">&quot;Hello World!&quot;</span><span
class="o">.</span><span class="na">getBytes</span><span class="o">();</span>
+<span class="n">InputStream</span> <span class="n">stream</span>
<span class="o">=</span> <span class="k">new</span> <span class="n">ByteArrayInputStream</span><span
class="o">(</span><span class="n">content</span><span class="o">);</span>
+<span class="n">ContentStream</span> <span class="n">contentStream</span>
<span class="o">=</span> <span class="k">new</span> <span class="n">ContentStreamImpl</span><span
class="o">(</span><span class="n">name</span><span class="o">,</span>
<span class="n">BigInteger</span><span class="o">.</span><span
class="na">valueOf</span><span class="o">(</span><span class="n">content</span><span
class="o">.</span><span class="na">length</span><span class="o">),</span>
<span class="s">&quot;text/plain&quot;</span><span class="o">,</span>
<span class="n">stream</span><span class="o">);</span>
 
-<span class="o">//</span> <span class="n">create</span> <span
class="n">a</span> <span class="n">major</span> <span class="n">version</span>
-<span class="n">Document</span> <span class="n">newDoc</span> <span
class="p">=</span> <span class="n">parent</span><span class="p">.</span><span
class="n">createDocument</span><span class="p">(</span><span class="k">properties</span><span
class="p">,</span> <span class="n">contentStream</span><span class="p">,</span>
<span class="n">VersioningState</span><span class="p">.</span><span
class="n">MAJOR</span><span class="p">);</span>
+<span class="c1">// create a major version</span>
+<span class="n">Document</span> <span class="n">newDoc</span> <span
class="o">=</span> <span class="n">parent</span><span class="o">.</span><span
class="na">createDocument</span><span class="o">(</span><span class="n">properties</span><span
class="o">,</span> <span class="n">contentStream</span><span class="o">,</span>
<span class="n">VersioningState</span><span class="o">.</span><span
class="na">MAJOR</span><span class="o">);</span>
 </pre></div>
 
 
 <h2 id="updating-properties">Updating properties</h2>
 <p>This example updates five properties of a CMIS object</p>
-<div class="codehilite"><pre><span class="n">CmisObject</span> <span
class="n">cmisobject</span> <span class="p">=</span> <span class="p">....</span>
+<div class="codehilite"><pre><span class="n">CmisObject</span> <span
class="n">cmisobject</span> <span class="o">=</span> <span class="o">....</span>
 
-<span class="n">Map</span><span class="o">&lt;</span><span
class="n">String</span><span class="p">,</span> <span class="n">Object</span><span
class="o">&gt;</span> <span class="n">updateProperties</span> <span
class="p">=</span> <span class="n">new</span> <span class="n">HashMap</span><span
class="o">&lt;</span><span class="n">String</span><span class="p">,</span>
<span class="n">Object</span><span class="o">&gt;</span><span
class="p">();</span>
+<span class="n">Map</span><span class="o">&lt;</span><span
class="n">String</span><span class="o">,</span> <span class="n">Object</span><span
class="o">&gt;</span> <span class="n">updateProperties</span> <span
class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span
class="o">&lt;</span><span class="n">String</span><span class="o">,</span>
<span class="n">Object</span><span class="o">&gt;();</span>
 
-<span class="n">updateProperties</span><span class="p">.</span><span
class="n">put</span><span class="p">(</span>&quot;<span class="n">my</span><span
class="p">:</span><span class="n">property</span>&quot;<span class="p">,</span>
&quot;<span class="n">new</span> <span class="n">value</span>&quot;<span
class="p">);</span> <span class="o">//</span> <span class="n">single</span><span
class="o">-</span><span class="n">value</span> <span class="n">property</span>
-<span class="n">updateProperties</span><span class="p">.</span><span
class="n">put</span><span class="p">(</span>&quot;<span class="n">my</span><span
class="p">:</span><span class="n">int</span><span class="p">.</span><span
class="n">property</span>&quot;<span class="p">,</span> 42<span
class="p">);</span>
-<span class="n">updateProperties</span><span class="p">.</span><span
class="n">put</span><span class="p">(</span>&quot;<span class="n">my</span><span
class="p">:</span><span class="n">date</span><span class="p">.</span><span
class="n">property</span>&quot;<span class="p">,</span> <span
class="n">new</span> <span class="n">GregorianCalendar</span><span
class="p">());</span>
-<span class="n">updateProperties</span><span class="p">.</span><span
class="n">put</span><span class="p">(</span>&quot;<span class="n">my</span><span
class="p">:</span><span class="n">bool</span><span class="p">.</span><span
class="n">property</span>&quot;<span class="p">,</span> <span
class="n">true</span><span class="p">);</span>
-
-<span class="n">List</span><span class="o">&lt;</span><span
class="n">String</span><span class="o">&gt;</span> <span class="n">shoppingList</span>
<span class="p">=</span> <span class="n">new</span> <span class="n">ArrayList</span><span
class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span><span
class="p">();</span>
-<span class="n">shoppingList</span><span class="p">.</span><span
class="n">add</span><span class="p">(</span>&quot;<span class="n">milk</span>&quot;<span
class="p">);</span>
-<span class="n">shoppingList</span><span class="p">.</span><span
class="n">add</span><span class="p">(</span>&quot;<span class="n">bread</span>&quot;<span
class="p">);</span>
-<span class="n">shoppingList</span><span class="p">.</span><span
class="n">add</span><span class="p">(</span>&quot;<span class="n">cheese</span>&quot;<span
class="p">);</span>
-<span class="n">updateProperties</span><span class="p">.</span><span
class="n">put</span><span class="p">(</span>&quot;<span class="n">my</span><span
class="p">:</span><span class="n">shopping</span><span class="p">.</span><span
class="n">list</span>&quot;<span class="p">,</span> <span class="n">shoppingList</span><span
class="p">);</span> <span class="o">//</span> <span class="n">multi</span><span
class="o">-</span><span class="n">value</span> <span class="n">property</span>
+<span class="n">updateProperties</span><span class="o">.</span><span
class="na">put</span><span class="o">(</span><span class="s">&quot;my:property&quot;</span><span
class="o">,</span> <span class="s">&quot;new value&quot;</span><span
class="o">);</span> <span class="c1">// single-value property</span>
+<span class="n">updateProperties</span><span class="o">.</span><span
class="na">put</span><span class="o">(</span><span class="s">&quot;my:int.property&quot;</span><span
class="o">,</span> <span class="mi">42</span><span class="o">);</span>
+<span class="n">updateProperties</span><span class="o">.</span><span
class="na">put</span><span class="o">(</span><span class="s">&quot;my:date.property&quot;</span><span
class="o">,</span> <span class="k">new</span> <span class="n">GregorianCalendar</span><span
class="o">());</span>
+<span class="n">updateProperties</span><span class="o">.</span><span
class="na">put</span><span class="o">(</span><span class="s">&quot;my:bool.property&quot;</span><span
class="o">,</span> <span class="kc">true</span><span class="o">);</span>
+
+<span class="n">List</span><span class="o">&lt;</span><span
class="n">String</span><span class="o">&gt;</span> <span class="n">shoppingList</span>
<span class="o">=</span> <span class="k">new</span> <span class="n">ArrayList</span><span
class="o">&lt;</span><span class="n">String</span><span class="o">&gt;();</span>
+<span class="n">shoppingList</span><span class="o">.</span><span
class="na">add</span><span class="o">(</span><span class="s">&quot;milk&quot;</span><span
class="o">);</span>
+<span class="n">shoppingList</span><span class="o">.</span><span
class="na">add</span><span class="o">(</span><span class="s">&quot;bread&quot;</span><span
class="o">);</span>
+<span class="n">shoppingList</span><span class="o">.</span><span
class="na">add</span><span class="o">(</span><span class="s">&quot;cheese&quot;</span><span
class="o">);</span>
+<span class="n">updateProperties</span><span class="o">.</span><span
class="na">put</span><span class="o">(</span><span class="s">&quot;my:shopping.list&quot;</span><span
class="o">,</span> <span class="n">shoppingList</span><span class="o">);</span>
<span class="c1">// multi-value property</span>
 
-<span class="n">cmisobject</span><span class="p">.</span><span
class="n">updateProperties</span><span class="p">(</span><span class="n">updateProperties</span><span
class="p">);</span>
+<span class="n">cmisobject</span><span class="o">.</span><span
class="na">updateProperties</span><span class="o">(</span><span class="n">updateProperties</span><span
class="o">);</span>
 </pre></div></div>
              <!-- Content -->
            </td>

Modified: websites/staging/chemistry/trunk/content/java/examples/example-get-id-from-path.html
==============================================================================
--- websites/staging/chemistry/trunk/content/java/examples/example-get-id-from-path.html (original)
+++ websites/staging/chemistry/trunk/content/java/examples/example-get-id-from-path.html Tue
Mar 17 10:16:40 2015
@@ -198,7 +198,7 @@ Apache Chemistry - Getting the id from p
            </td>
            <td height="100%">
              <!-- Content -->
-             <div class="wiki-content"><h1 id="getting-the-id-of-an-object-from-its-path">Getting
the id of an object from its path</h1>
+             <div class="wiki-content"><h1 id="getting-the-id-of-an-object-from-its-path">Getting
the ID of an object from its path</h1>
 <p>A code snippet how to get the id of an object when only a path is known:</p>
 <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">session</span><span class="o">.</span><span
class="na">getObjectByPath</span><span class="o">(</span><span class="n">path</span><span
class="o">);</span>



Mime
View raw message