cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Knecht <fe...@otego.com>
Subject Re: Cocoon 2.2 - how to wire block into webapp
Date Tue, 24 Oct 2006 08:29:09 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


>
> When I run the "test" project which does include the demo block I
> cannot manage to have the same URL working.
> The webapp layout I observe in test project target/cocoon-webapp
> directory is:
>
> |-- WEB-INF
> |   |-- applicationContext.xml
> |   |-- cocoon
> |   |   |-- cocoon.xconf
> |   |   |-- lib
> (...)
> |   |   |   |-- demo-1.0.0-SNAPSHOT.jar
> (...)
> |   |   |-- spring
> |   |   |   |-- cocoon-core-applicationContext.xml
> |   |   |   `-- demo-application-context.xml
> (...)
> |   `-- web.xml
> |-- blocks
> |   `-- demo
> |       |-- demo.js
> |       |-- demo.xml
> |       `-- sitemap.xmap
> |-- sitemap.xmap
> `-- welcome.xml
>
> The content of the root sitemap.xmap only pipeline is as follow:
> <map:pipeline>
>   <map:match pattern="">
>     <map:generate src="welcome.xml"/>
>       <map:serialize type="xhtml"/>
>     </map:match>
>
>     <!-- ADDED FOR TEST -->
>     <map:match pattern="demo">
>       <map:redirect-to uri="blocks/demo/"/>
>     </map:match>       
>
>     <!-- ADDED FOR TEST -->
>     <!--+
>         | Mount everything else by calling the sitemap.xmap file
> located
>     | in the requested folder (sub-folder).
>     +-->
>      <map:match pattern="*/**">
>        <map:mount check-reload="yes" src="{1}/" uri-prefix="{1}"/>
>      </map:match>
> </map:pipeline>

You need to mount the block. Your missing 'blocks' in the src
attribute. Following webapp-sitemap works for me:

<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  <map:pipelines>
    <map:pipeline>
      <map:match pattern="">
        <map:generate src="welcome.xml"/>
        <map:serialize type="xhtml"/>
      </map:match>

    <map:match pattern="*/**">
      <map:mount src="blocks/{1}/" uri-prefix="{1}"/>
    </map:match>

    </map:pipeline>
  </map:pipelines>
</map:sitemap>

Felix
>
> Neither the redirect-to nor mount has the effect I expected: The
> demo block stays unreachable !
>
> Any idea of what I overlook ?
>
> Patrick
>
>>
>> Port configuration can be found in test/pom.xml (test = webapp
>> directory)
>>
>>> Any hints or direction to examples, documentation are welcome.
>>
>> Sample for webapp: {cocoon2.2-src}/core/cocoon-webapp
>> Sample for block:  {cocoon2.2-src}/blocks
>>
>> Felix
>>
>>> Patrick
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>> For additional commands, e-mail: users-help@cocoon.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFPc7U2lZVCB08qHERAqPNAKCcSY5FNXghLorqiHKakteAaxf2mwCcCIRP
PqmzNMxEJAnw5JzmVsZf0kY=
=X0Dy
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message