[DAISY] Updated: Introduction
[email protected] Mon, 18 Aug 2008 12:59:15 +0000 (GMT+00:00)
| Newsgroups | gmane.text.xml.cocoon.documentation |
|---|---|
| Message-ID | <[email protected]> |
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><s:write xmlns:s="http://apache.org/cocoon/source/1.0">
+++ <s:source>${cocoon.parameters.PATH}</s:source><
+++ <s:fragment>
+++ <content>${cocoon.parameters.CONTENT}</content>
+++ </s:fragment>
+++ </s:write></pre>
+++
+++ <p>Let's have a look at the respective part of the sitemap:</p>
+++
+++ <pre><map:match pattern="write/**">
+++ <map:generate src="write.xml" type="jx">
+++ <map:parameter name="CONTENT" value="{request-param:content}"/>
+++ <map:parameter name="PATH" value="jcr://{1}" />
+++ </map:generate>
+++ <map:transform type="write-source" />
+++ <map:serialize type="xml" />
+++ </map:match>
+++ </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><content>Text</content></pre>
+++
</body>
</html>