cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@cocoon.zones.apache.org
Subject [DAISY] Updated: Introduction
Date Mon, 18 Aug 2008 12:59:15 GMT
A document has been updated:

http://cocoon.zones.apache.org/daisy/documentation/1505.html

Document ID: 1505
Branch: main
Language: default
Name: Introduction (unchanged)
Document Type: Cocoon Document (unchanged)
Updated on: 8/18/08 12:59:12 PM
Updated by: Lukas Lang

A new version has been created, state: draft

Parts
=====

Content
-------
This part has been updated.
Mime type: text/xml (unchanged)
File name:  (unchanged)
Size: 6705 bytes (previous version: 5072 bytes)
Content diff:
(17 equal lines skipped)
    <ul>
    <li>styled repository browsing</li>
    <li>native repository access</li>
--- <li>XPath query</li>
+++ <li>XPath query (see <a href="daisy:1506">JCRQueryTransformer</a>)</li>
    </ul>
    
    <p>Furthermore, a basic write operation can be used.</p>
(57 equal lines skipped)
    says: It writes sample content to the repository, which is then available
    internally for browsing <em>jcr://</em> URIs.</p>
    
--- <p>After pointing your browser to</p>
+++ <p>After pointing your browser at</p>
    
    <pre>http://localhost:8080/cocoon-jcr-sample/populate</pre>
    
    <p>and each of the response messages tell success, you can now access content.
--- To receive the repository root, point your browser to</p>
+++ To receive the repository root, point your browser at</p>
    
    <pre>http://localhost:8080/cocoon-jcr-sample/browse/</pre>
    
(41 equal lines skipped)
    <p>the generator will resolve the JCR path <em>jcr://cocoon/sitemap</em>,
using
    the referenced JCRSourceFactory.</p>
    
--- <h1>Configuration</h1>
+++ <h3>Native XML access</h3>
    
--- <h1>Further reading</h1>
+++ <p>The <em>repository </em>pattern in the sitemap allows you to get
native XML
+++ access to the repository.</p>
    
+++ <h3>Write access</h3>
+++ 
+++ <p>Currently, the <em>it</em> subdirectory allows write access only,
as it has
+++ not been integrated into the sample page. This chapter gives you a basic
+++ overview about how to use Cocoon's source namespace to write JCR sources.</p>
+++ 
+++ <p>The file <em>it/write.xml</em> contains elements in the
+++ <em>http://apache.org/cocoon/source/1.0</em> namespace, which tell the
+++ <em>write-source</em> built-in transformer to write content fragments to the
+++ specified source.</p>
+++ 
+++ <pre>&lt;s:write xmlns:s="http://apache.org/cocoon/source/1.0"&gt;
+++   &lt;s:source&gt;${cocoon.parameters.PATH}&lt;/s:source&gt;&lt;
+++     &lt;s:fragment&gt;
+++       &lt;content&gt;${cocoon.parameters.CONTENT}&lt;/content&gt;
+++     &lt;/s:fragment&gt;
+++ &lt;/s:write&gt;</pre>
+++ 
+++ <p>Let's have a look at the respective part of the sitemap:</p>
+++ 
+++ <pre>&lt;map:match pattern="write/**"&gt;
+++   &lt;map:generate src="write.xml" type="jx"&gt;
+++     &lt;map:parameter name="CONTENT" value="{request-param:content}"/&gt;
+++     &lt;map:parameter name="PATH" value="jcr://{1}" /&gt;
+++   &lt;/map:generate&gt;
+++   &lt;map:transform type="write-source" /&gt;
+++   &lt;map:serialize type="xml" /&gt;
+++ &lt;/map:match&gt;
+++ </pre>
+++ 
+++ <p>For example, pointing your browser at</p>
+++ 
+++ <pre>http://localhost:8080/cocoon-jcr-sample/it/write/some/random/node?content=Text</pre>
+++ 
+++ <p>let's the JX template generator replace the variables and will result in the
+++ JCR node <em>/some/random/node</em> with content</p>
+++ 
+++ <pre>&lt;content&gt;Text&lt;/content&gt;</pre>
+++ 
    </body>
    </html>


Mime
View raw message