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: BD: Tutorial: Using the block deployer to create a Cocoon web application
Date Wed, 11 Jan 2006 22:08:46 GMT
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>&lt;deploy xmlns=""&gt;
---  ...
+++    &lt;cocoon version="2.2.0"/&gt;
+++    &lt;block id="core" urn="org.apache.cocoon:cocoon-core:2.2.0"/&gt;
    &lt;/deploy&gt;</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>&lt;deploy xmlns=""&gt;
---  ...
---   &lt;block&gt;
---  
---   &lt;/block&gt;
+++   ...
+++   &lt;block id="my-block" urn="com.mycompany:myBlock:1.0"/&gt;
+++   ...
    &lt;/deploy&gt;</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>&lt;deploy xmlns=""&gt;
+++   ...
+++   &lt;block id="myBlock" urn="com.mycompany:myBlock:1.0"&gt;
+++     &lt;mount path="/myBlock"/&gt;
+++   &lt;/block&gt;
+++   ...
+++ &lt;/deploy&gt;</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>&lt;block xmlns=""&gt;
--- 
+++ <pre>&lt;block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
+++   id="com.mycompany:myBlock:1.0"&gt;
+++   &lt;properties&gt;
+++     &lt;property name="foo1"&gt;
+++       &lt;description&gt;some property 1&lt;/description&gt;
+++       &lt;default&gt;bar&lt;/default&gt;
+++     &lt;/property&gt;
+++     &lt;property name="foo2"&gt;
+++       &lt;description&gt;some property 2&lt;/description&gt;
+++       &lt;default&gt;bar&lt;/default&gt;
+++     &lt;/property&gt;
+++   &lt;/properties&gt;
    &lt;/block&gt;</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>&lt;deploy xmlns=""&gt;
+++ <pre>&lt;deploy  xmlns="http://apache.org/cocoon/blocks/deploy/1.0"&gt;
+++   &lt;properties&gt;
+++     &lt;property name="foo1" value="xyz"/&gt;
+++   &lt;/properties&gt;   
+++ &lt;/deploy&gt;
+++ </pre>
    
--- &lt;/deploy&gt;</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>&lt;deploy xmlns=""&gt;
+++ <pre>&lt;deploy  xmlns="http://apache.org/cocoon/blocks/deploy/1.0"&gt;
      ...
      &lt;block id="blockA" urn="mycompany:blockA:1.0.0"&gt;
    <strong>    &lt;connections&gt;
(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>&lt;block xmlns=""&gt;
+++ <pre>block xmlns="http://apache.org/cocoon/blocks/cob/1.0"&gt;
      ...
      &lt;requirements&gt;
        &lt;requires interface="" name="" <strong>default=""</strong>/&gt;
(10 equal lines skipped)
    blockB uses, you can point from your blockA descriptor to your blockB
    descriptor:</p>
    
--- <pre>&lt;deploy xmlns=""&gt;
+++ <pre>&lt;deploy  xmlns="http://apache.org/cocoon/blocks/deploy/1.0"&gt;
    
      &lt;block id="blockA" urn="mycompany:blockA:1.0.0"&gt;
        &lt;connections&gt;
(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>&lt;block id="myblock" location="/home/rpoetz/myblock" urn="mycompany:myblock:1.0.0"&gt;
---   &lt;mount path="/myblock"/&gt;
--- &lt;/block&gt;
+++ <pre>&lt;deploy  xmlns="http://apache.org/cocoon/blocks/deploy/1.0"&gt;
+++   ...
+++   &lt;block id="myblock" location="/home/rpoetz/myblock" urn="mycompany:myblock:1.0.0"&gt;
+++     &lt;mount path="/myblock"/&gt;
+++   &lt;/block&gt;
+++   ...
+++ &lt;/deploy&gt;
    </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

Mime
View raw message