chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r787801 - /websites/staging/chemistry/trunk/content/java/examples/example-process-query-results.html
Date Thu, 31 Mar 2011 09:46:20 GMT
Author: buildbot
Date: Thu Mar 31 09:46:20 2011
New Revision: 787801

Log:
Staging update by buildbot

Modified:
    websites/staging/chemistry/trunk/content/java/examples/example-process-query-results.html

Modified: websites/staging/chemistry/trunk/content/java/examples/example-process-query-results.html
==============================================================================
--- websites/staging/chemistry/trunk/content/java/examples/example-process-query-results.html
(original)
+++ websites/staging/chemistry/trunk/content/java/examples/example-process-query-results.html
Thu Mar 31 09:46:20 2011
@@ -183,7 +183,25 @@ Apache Chemistry - Perform a query 
            </td>
            <td height="100%">
              <!-- Content -->
-             <div class="wiki-content"><h1 id="perform_a_query_and_process_results">Perform
a query and process results</h1>
+             <div class="wiki-content"><h1 id="simple_query_pattern">Simple query
pattern</h1>
+<p>This example demonstrates a simple query that selects all properties from all documents
and then prints them.<br />
+(This query shouldn't be used in a real application. Always select only the properties and
objects you need!)</p>
+<div class="codehilite"><pre><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="s">&quot;SELECT * FROM cmis:document&quot;</span><span class="o">,</span>
<span class="kc">false</span><span class="o">);</span>
+
+<span class="k">for</span><span class="o">(</span><span class="n">QueryResult</span>
<span class="nl">hit:</span> <span class="n">results</span><span
class="o">)</span> <span class="o">{</span>  
+    <span class="k">for</span><span class="o">(</span><span class="n">PropertyData</span><span
class="o">&lt;?&gt;</span> <span class="nl">property:</span>
<span class="n">hit</span><span class="o">.</span><span class="na">getProperties</span><span
class="o">())</span> <span class="o">{</span>
+
+        <span class="n">String</span> <span class="n">queryName</span>
<span class="o">=</span> <span class="n">property</span><span class="o">.</span><span
class="na">getQueryName</span><span class="o">();</span>
+        <span class="n">Object</span> <span class="n">value</span>
<span class="o">=</span> <span class="n">property</span><span class="o">.</span><span
class="na">getFirstValue</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">queryName</span> <span class="o">+</span>
<span class="s">&quot;: &quot;</span> <span class="o">+</span>
<span class="n">value</span><span class="o">);</span>
+    <span class="o">}</span>
+    <span class="n">System</span><span class="o">.</span><span
class="na">out</span><span class="o">.</span><span class="na">println</span><span
class="o">(</span><span class="s">&quot;--------------------------------------&quot;</span><span
class="o">);</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<h1 id="get_document_objects_from_a_query">Get document objects from a query</h1>
 <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="c1">// get the query name of cmis:objectId</span>



Mime
View raw message