cocoon-docs mailing list archives

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

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


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)
    <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>
    <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>
    <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>
(41 equal lines skipped)
    <p>the generator will resolve the JCR path <em>jcr://cocoon/sitemap</em>,
    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></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=""&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>

View raw message