cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [DAISY] Updated: JCRQueryTransformer
Date Mon, 18 Aug 2008 13:33:16 GMT
A document has been updated:

Document ID: 1506
Branch: main
Language: default
Name: JCRQueryTransformer (unchanged)
Document Type: Sitemap Component (unchanged)
Updated on: 8/18/08 1:33:08 PM
Updated by: Lukas Lang

A new version has been created, state: draft


Long description
This part has been added.
Mime type: text/xml
File name: null
Size: 1884 bytes

<p>The JCRQueryTransformer performs a query on a JCR server. It expects a
"query" element without namespace containing the query to execute, either in
XPath or SQL, and eventually the properties to fetch (since JSR-170 does not
define a standard for specifying them in xpath queries). It will then replace it
with a "result" element containing the query results in elements named "node".
Please keep in mind, namespace awareness depends on the JCR repository used and
is not supported by Jackrabbit yet, as we use the Jackrabbit repository in the


<p>Imagine, the following template was defined for sending queries through a

<pre>&lt;query language="xpath" xmlns:jcr=""&gt;
  &lt;jcr:encoding /&gt;
  &lt;jcr:isCheckedOut /&gt;${cocoon.parameters.QUERY}&lt;/query&gt;</pre>

<p>By adding a query transformer to a sitemap's pipeline match, the completed
query is sent to the repository:</p>

<pre>&lt;map:match pattern="query"&gt;
  &lt;map:generate type="jx" src="querytemplate.xml"&gt;
    &lt;map:parameter name="QUERY" value="{request-param:query}" /&gt;
  &lt;map:transform type="JCRQuery" /&gt;
  &lt;map:serialize type="xml" /&gt;

<p>If you point your browser at</p>


<p>all resources under <em>cocoon </em>will be returned. It is possitlbe
specify any arbitrary XPath query.</p>


<p>JCRQueryTransformer is configured, using Spring. A JCR repository must be

<pre>  &lt;bean name="org.apache.cocoon.transformation.Transformer/JCRQuery"
    &lt;property name="repo" ref="javax.jcr.Repository" /&gt;


CocoonComponentReference: Transformer (new field)
CocoonBlock: jcr (new field)
FQ Java class: org.apache.cocoon.jcr.transforming.JCRQueryTransformer (new field)

View raw message