A document has been updated:
http://cocoon.zones.apache.org/daisy/documentation/797.html
Document ID: 797
Branch: main
Language: default
Name: BD: Tutorial: Using the block deployer to create a Cocoon web application
(unchanged)
Document Type: Cocoon Document (unchanged)
Updated on: 1/11/06 10:08:30 PM
Updated by: Reinhard Pötz
A new version has been created, state: publish
Parts
=====
Content
-------
This part has been updated.
Mime type: text/xml (unchanged)
File name: (unchanged)
Size: 10636 bytes (previous version: 9269 bytes)
Content diff:
(117 equal lines skipped)
provides following descriptor:</p>
<pre><deploy xmlns="">
--- ...
+++ <cocoon version="2.2.0"/>
+++ <block id="core" urn="org.apache.cocoon:cocoon-core:2.2.0"/>
</deploy></pre>
--- <p class="fixme">Explain the content</p>
+++ <p class="fixme">Explain the content;<br/>
+++ It's hasn't been defined yet, how a Cocoon 2.2 webapp looks like. IMO it is
a
+++ web.xml pointing to a servlet and a couple of blocks deployed to
/WEB-INF/blocks
+++ </p>
<h2>Install a simple block (minimal configuration)</h2>
<p>Now we start to add the block from the former tutorial:</p>
<pre><deploy xmlns="">
--- ...
--- <block>
---
--- </block>
+++ ...
+++ <block id="my-block" urn="com.mycompany:myBlock:1.0"/>
+++ ...
</deploy></pre>
<p>id, urn</p>
(3 equal lines skipped)
<p>If you block contains a sitemap, you can mount it in your web
applications
URI space.</p>
+++ <pre><deploy xmlns="">
+++ ...
+++ <block id="myBlock" urn="com.mycompany:myBlock:1.0">
+++ <mount path="/myBlock"/>
+++ </block>
+++ ...
+++ </deploy></pre>
+++
<h2>Create the web application</h2>
<pre>mvn cocoon:deploy</pre>
(35 equal lines skipped)
environment. See the block descriptor (block.xml) to learn, which
properties can
be set for a particular block. If you have following block.xml</p>
--- <pre><block xmlns="">
---
+++ <pre><block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
+++ id="com.mycompany:myBlock:1.0">
+++ <properties>
+++ <property name="foo1">
+++ <description>some property 1</description>
+++ <default>bar</default>
+++ </property>
+++ <property name="foo2">
+++ <description>some property 2</description>
+++ <default>bar</default>
+++ </property>
+++ </properties>
</block></pre>
--- <p>you can set the properties foo1 and foo2.</p>
+++ <p>you can set the properties for foo1 and foo2 or use the default
values.</p>
--- <pre><deploy xmlns="">
+++ <pre><deploy xmlns="http://apache.org/cocoon/blocks/deploy/1.0">
+++ <properties>
+++ <property name="foo1" value="xyz"/>
+++ </properties>
+++ </deploy>
+++ </pre>
--- </deploy></pre>
+++ <p>The deployed block will use the properties foo1=xyz and foo2=bar.</p>
<h2>Explicit connections</h2>
<p>You specify, which block implementations you want to use to satisfy a
blocks
requirements:</p>
--- <pre><deploy xmlns="">
+++ <pre><deploy xmlns="http://apache.org/cocoon/blocks/deploy/1.0">
...
<block id="blockA" urn="mycompany:blockA:1.0.0">
<strong> <connections>
(24 equal lines skipped)
requirement (see block.xml to learn about a block's requirements), the
deployer
uses the default values of the requirement:</p>
--- <pre><block xmlns="">
+++ <pre>block xmlns="http://apache.org/cocoon/blocks/cob/1.0">
...
<requirements>
<requires interface="" name="" <strong>default=""</strong>/>
(10 equal lines skipped)
blockB uses, you can point from your blockA descriptor to your blockB
descriptor:</p>
--- <pre><deploy xmlns="">
+++ <pre><deploy xmlns="http://apache.org/cocoon/blocks/deploy/1.0">
<block id="blockA" urn="mycompany:blockA:1.0.0">
<connections>
(61 equal lines skipped)
attribute is set, the deployer doesn't deploy the block by unpacking it but
points to a local directory.</p>
--- <pre><block id="myblock" location="/home/rpoetz/myblock"
urn="mycompany:myblock:1.0.0">
--- <mount path="/myblock"/>
--- </block>
+++ <pre><deploy xmlns="http://apache.org/cocoon/blocks/deploy/1.0">
+++ ...
+++ <block id="myblock" location="/home/rpoetz/myblock"
urn="mycompany:myblock:1.0.0">
+++ <mount path="/myblock"/>
+++ </block>
+++ ...
+++ </deploy>
</pre>
<p>This mounts the web application in /home/rpoetz/myblock/src/main/webapp
to
(8 equal lines skipped)
Fields
======
no changes
Links
=====
no changes
Custom Fields
=============
no changes
Collections
===========
no changes