Author: buildbot
Date: Mon May 14 10:48:00 2012
New Revision: 817578

Log:
Production update by buildbot for cxf

Modified:
    websites/production/cxf/content/cache/docs.pageCache
    websites/production/cxf/content/docs/jax-rs-advanced-features.html

Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/cxf/content/docs/jax-rs-advanced-features.html
==============================================================================
--- websites/production/cxf/content/docs/jax-rs-advanced-features.html 
(original)
+++ websites/production/cxf/content/docs/jax-rs-advanced-features.html Mon May 
14 10:48:00 2012
@@ -124,7 +124,7 @@ Apache CXF -- JAX-RS Advanced Features
 <div id="ConfluenceContent"><p><span 
style="font-size:2em;font-weight:bold">JAX-RS : Advanced Features</span></p>
 
 <div>
-<ul><li><a shape="rect" href="#JAX-RSAdvancedFeatures-JMSSupport">JMS 
Support</a></li><li><a shape="rect" 
href="#JAX-RSAdvancedFeatures-FIQLsearchqueries">FIQL search 
queries</a></li><ul><li><a shape="rect" 
href="#JAX-RSAdvancedFeatures-Introduction">Introduction</a></li><li><a 
shape="rect" 
href="#JAX-RSAdvancedFeatures-DependenciesandConfiguration">Dependencies and 
Configuration</a></li><li><a shape="rect" 
href="#JAX-RSAdvancedFeatures-ConsumingFIQLqueries">Consuming FIQL 
queries</a></li><li><a shape="rect" 
href="#JAX-RSAdvancedFeatures-BuildingFIQLqueries">Building FIQL 
queries</a></li><li><a shape="rect" 
href="#JAX-RSAdvancedFeatures-Usingdatesinqueries">Using dates in 
queries</a></li></ul><li><a shape="rect" 
href="#JAX-RSAdvancedFeatures-Onewayinvocations">Oneway 
invocations</a></li><li><a shape="rect" 
href="#JAX-RSAdvancedFeatures-SupportforContinuations">Support for 
Continuations</a></li><li><a shape="rect" 
href="#JAX-RSAdvancedFeatures-Serversidecaching">Server-side c
 aching</a></li><li><a shape="rect" 
href="#JAX-RSAdvancedFeatures-RESTfulserviceswithoutannotations">RESTful 
services without annotations</a></li><ul><li><a shape="rect" 
href="#JAX-RSAdvancedFeatures-Configuration">Configuration</a></li></ul></ul></div>
+<ul><li><a shape="rect" href="#JAX-RSAdvancedFeatures-JMSSupport">JMS 
Support</a></li><li><a shape="rect" 
href="#JAX-RSAdvancedFeatures-FIQLsearchqueries">FIQL search 
queries</a></li><ul><li><a shape="rect" 
href="#JAX-RSAdvancedFeatures-Introduction">Introduction</a></li><li><a 
shape="rect" 
href="#JAX-RSAdvancedFeatures-DependenciesandConfiguration">Dependencies and 
Configuration</a></li><li><a shape="rect" 
href="#JAX-RSAdvancedFeatures-ConsumingFIQLqueries">Consuming FIQL 
queries</a></li><ul><li><a shape="rect" 
href="#JAX-RSAdvancedFeatures-SearchBean">SearchBean</a></li></ul><li><a 
shape="rect" href="#JAX-RSAdvancedFeatures-BuildingFIQLqueries">Building FIQL 
queries</a></li><li><a shape="rect" 
href="#JAX-RSAdvancedFeatures-Usingdatesinqueries">Using dates in 
queries</a></li></ul><li><a shape="rect" 
href="#JAX-RSAdvancedFeatures-Onewayinvocations">Oneway 
invocations</a></li><li><a shape="rect" 
href="#JAX-RSAdvancedFeatures-SupportforContinuations">Support for 
Continuations<
 /a></li><li><a shape="rect" 
href="#JAX-RSAdvancedFeatures-Serversidecaching">Server-side 
caching</a></li><li><a shape="rect" 
href="#JAX-RSAdvancedFeatures-RESTfulserviceswithoutannotations">RESTful 
services without annotations</a></li><ul><li><a shape="rect" 
href="#JAX-RSAdvancedFeatures-Configuration">Configuration</a></li></ul></ul></div>
 
 <h1><a shape="rect" name="JAX-RSAdvancedFeatures-JMSSupport"></a>JMS 
Support</h1>
 
@@ -222,6 +222,9 @@ An expression such as "name==CXF*" can b
 </pre>
 </div></div>
 
+<p>Note that a searchContext.getCondition(Book.class) call may return an 
arbitrary complex SearchCondition, it can be a simple primitive<br clear="none">
+expression or a more complex one. The Book class needs to have a matching 
property per every name found in the FIQL expression, for example, given a 
'name==b;id==123' expression, the Book class would need to have 'name' and 'id' 
properties available.</p>
+
 <p>SearchCondition can also be used to get to all the search requirements 
(originally expressed in FIQL) and do some manual<br clear="none">
 comparison against the local data. For example, SearchCondition provides a 
utility toSQL(String tableName, String... columnNames) method which internally 
introspects all the search expressions constituting a current query and 
converts them into an SQL expression:</p>
 
@@ -332,11 +335,36 @@ assertEquals("SELECT LEVEL_COLUMN FROM t
         MultivaluedMap&lt;<span class="code-object">String</span>, <span 
class="code-object">String</span>&gt; params = ui.getQueryParameters();
         <span class="code-object">String</span> fiqlQuery = 
params.getFirst(<span class="code-quote">"_s"</span>);
         <span class="code-comment">// delegate to your own custom handler 
+</span>
+        <span class="code-comment">// note that the original search expression 
can also be retrieved 
+</span>        <span class="code-comment">// using a 
SearchContext.getSearchExpression() method
 </span>}
 
 </pre>
 </div></div>
 
+<h3><a shape="rect" 
name="JAX-RSAdvancedFeatures-SearchBean"></a>SearchBean</h3>
+
+<p>org.apache.cxf.jaxrs.ext.search.SearchBean is a utility bean class which 
can simplify analyzing the captured FIQL expressions and converting them to the 
other language expressions, in cases where having to update the bean class such 
as Book.class with all the properties thatmay need to be supported is not 
practical. For example:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent 
panelContent">
+<pre class="code-java">
+<span class="code-comment">// ?_s=<span class="code-quote">"level=gt=10"</span>
+</span>SearchCondition&lt;SearchBean&gt; sc = 
searchContext.getCondition(SearchBean.class);
+
+Map\&lt;, <span class="code-object">String</span>\&gt; fieldMap = <span 
class="code-keyword">new</span> HashMap\&lt;<span 
class="code-object">String</span>, <span 
class="code-object">String</span>\&gt;();
+fieldMap.put(<span class="code-quote">"level"</span>, <span 
class="code-quote">"LEVEL_FIELD"</span>);
+
+SQLPrinterVisitor&lt;SearchBean&gt; visitor = <span 
class="code-keyword">new</span> SQLPrinterVisitor&lt;SearchBean&gt;(fieldMap, 
<span class="code-quote">"table"</span>, <span 
class="code-quote">"LEVEL_COLUMN"</span>);
+sc.visit(visitor);
+assertEquals("SELECT LEVEL_COLUMN FROM table 
+              WHERE LEVEL_COLUMN &gt; '10'",
+              visitor.getResult());
+</pre>
+</div></div>
+
+
+
 <h2><a shape="rect" 
name="JAX-RSAdvancedFeatures-BuildingFIQLqueries"></a>Building FIQL queries</h2>
 
 <p>CXF 2.4.0 introduces <a shape="rect" class="external-link" 
href="http://svn.apache.org/repos/asf/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/search/client/SearchConditionBuilder.java";>SearchConditionBuilder</a>
 which makes it simpler to build FIQL queries. SearchConditionBuilder is an 
abstract class that returns a FIQL builder by default:</p>


Reply via email to