chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r785874 - /websites/staging/chemistry/trunk/content/java/opencmis-client-api.html
Date Mon, 21 Feb 2011 14:59:03 GMT
Author: buildbot
Date: Mon Feb 21 14:59:03 2011
New Revision: 785874

Log:
Staging update by buildbot

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

Modified: websites/staging/chemistry/trunk/content/java/opencmis-client-api.html
==============================================================================
--- websites/staging/chemistry/trunk/content/java/opencmis-client-api.html (original)
+++ websites/staging/chemistry/trunk/content/java/opencmis-client-api.html Mon Feb 21 14:59:03
2011
@@ -350,6 +350,7 @@ In order to create a session, the Sessio
 </DIV></p>
 <p><a name="OpenCMISClientAPI-ReadingProperties-SingleProperty"></a></p>
 <h3 id="reading_properties_-_single_property">Reading Properties - Single Property</h3>
+<p><DIV class="codeHeader">Reading a Single Property</DIV></p>
 <div class="codehilite"><pre><span class="n">ObjectId</span> <span
class="n">id</span> <span class="o">=</span> <span class="k">this</span><span
class="o">.</span><span class="na">session</span><span class="o">.</span><span
class="na">createObjectId</span><span class="o">(</span><span class="s">&quot;4711&quot;</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="k">this</span><span class="o">.</span><span
class="na">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">Property</span><span class="o">&lt;</span><span
class="n">String</span><span class="o">&gt;</span> <span class="n">p</span>
<span class="o">=</span> <span class="n">document</span><span class="o">.</span><span
class="na">getProperty</span><span class="o">(</span><span class="n">PropertyIds</span><span
class="o">.</span><span class="na">OBJECT_ID</span><span class="o">);</span>
@@ -360,24 +361,24 @@ In order to create a session, the Sessio
 
 <p><a name="OpenCMISClientAPI-ReadingProperties-AllProperties"></a></p>
 <h3 id="reading_properties_-_all_properties">Reading Properties - All Properties</h3>
-<p><strong>Reading all Properties</strong>
-    :::java
-    ObjectId id = this.session.createObjectId("4711");
-    Document document = (Document) this.session.getObject(id);
-    List<Property<?>&gt; l = document.getProperties();
-    Iterator<Property<?>&gt; i = l.iterator();
-    while (i.hasNext()) {
-      Property&lt;?&gt; p = i.next();
-      Object value = p.getValue();
-      PropertyType t = p.getType();</p>
-<div class="codehilite"><pre>  <span class="n">switch</span> <span
class="p">(</span><span class="n">t</span><span class="p">)</span>
<span class="p">{</span>
-    <span class="k">case</span> <span class="n">INTEGER:</span>
-      <span class="n">Integer</span> <span class="n">n</span> <span
class="o">=</span> <span class="p">(</span><span class="n">Integer</span><span
class="p">)</span> <span class="n">value</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">p</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">n</span><span class="p">);</span>
-      <span class="n">break</span><span class="p">;</span>
-    <span class="k">case</span> <span class="n">STRING:</span>
- <span class="p">[</span><span class="o">...</span><span class="p">]</span>
-<span class="p">}</span>
+<p><strong>Reading all Properties</strong></p>
+<div class="codehilite"><pre><span class="n">ObjectId</span> <span
class="n">id</span> <span class="o">=</span> <span class="k">this</span><span
class="o">.</span><span class="na">session</span><span class="o">.</span><span
class="na">createObjectId</span><span class="o">(</span><span class="s">&quot;4711&quot;</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="k">this</span><span class="o">.</span><span
class="na">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">List</span><span class="o">&lt;</span><span
class="n">Property</span><span class="o">&lt;?&gt;&gt;</span>
<span class="n">l</span> <span class="o">=</span> <span class="n">document</span><span
class="o">.</span><span class="na">getProperties</span><span class="o">();</span>
+<span class="n">Iterator</span><span class="o">&lt;</span><span
class="n">Property</span><span class="o">&lt;?&gt;&gt;</span>
<span class="n">i</span> <span class="o">=</span> <span class="n">l</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">i</span><span
class="o">.</span><span class="na">hasNext</span><span class="o">())</span>
<span class="o">{</span>
+  <span class="n">Property</span><span class="o">&lt;?&gt;</span>
<span class="n">p</span> <span class="o">=</span> <span class="n">i</span><span
class="o">.</span><span class="na">next</span><span class="o">();</span>
+  <span class="n">Object</span> <span class="n">value</span> <span
class="o">=</span> <span class="n">p</span><span class="o">.</span><span
class="na">getValue</span><span class="o">();</span>
+  <span class="n">PropertyType</span> <span class="n">t</span> <span
class="o">=</span> <span class="n">p</span><span class="o">.</span><span
class="na">getType</span><span class="o">();</span>
+
+  <span class="k">switch</span> <span class="o">(</span><span
class="n">t</span><span class="o">)</span> <span class="o">{</span>
+    <span class="k">case</span> <span class="nl">INTEGER:</span>
+      <span class="n">Integer</span> <span class="n">n</span> <span
class="o">=</span> <span class="o">(</span><span class="n">Integer</span><span
class="o">)</span> <span class="n">value</span><span class="o">;</span>
+      <span class="n">System</span><span class="o">.</span><span
class="na">out</span><span class="o">.</span><span class="na">println</span><span
class="o">(</span><span class="n">p</span><span class="o">.</span><span
class="na">getName</span><span class="o">()</span> <span class="o">+</span>
<span class="s">&quot; = &quot;</span> <span class="o">+</span>
<span class="n">n</span><span class="o">);</span>
+      <span class="k">break</span><span class="o">;</span>
+    <span class="k">case</span> <span class="nl">STRING:</span>
+ <span class="o">[...]</span>
+<span class="o">}</span>
 </pre></div></div>
              <!-- Content -->
            </td>



Mime
View raw message