cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@mobilebox.pl>
Subject Re: XPatch support for maven-cocoon-deployer-plugin
Date Tue, 05 Sep 2006 07:27:43 GMT
Giacomo Pati wrote:
> I'm not sure what this xpatch stuff is all about (I thought we've been 
> over it with patching in 2.2). But what about
> 
>    src/test/webapp/WEB-INF/web.xml
>    src/test/webapp/sitemap.xmap
We've been discussing a variation of this approach here [1]. My point was:

there is myblock-opensessioninview-enabler. It has a patch to web.xml:

<?xml version="1.0"?>
<xweb xpath="/web-app"
       unless="comment()[contains(., 'OpenSessionInView')]"
       insert-before="servlet">
     <!-- OpenSessionInView -->
     <filter>
         <filter-name>openSessionInViewFilter</filter-name>
         <filter-class>
 
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
         </filter-class>
     </filter>
     <filter-mapping>
         <filter-name>openSessionInViewFilter</filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>
</xweb>

If the patch is carried along with the myblock-opensessioninview-enabler 
block any other block (say myblock-client-interface) is able to have 
web.xml patched just by stating dependency on 
myblock-opensessioninview-enabler.

There are already some blocks in cocoon that are used alike:
cocoon-trunk\blocks\cocoon-databases\cocoon-databases-oracle-client
cocoon-trunk\blocks\cocoon-databases\cocoon-databases-postgresql-client

The only thing the block does is ensuring the proper class gets loaded.

 >    src/test/webapp/WEB-INF/web.xml
 >    src/test/webapp/sitemap.xmap

Those are not the only files that need patching right now.

> 
> if you need special ones for testing your block (packaging=jar)?
> 
> For packaging=webapp you don't really need patching at all as you are in 
> total control of it!

Same goes for webapp. Even if I have a total control over webapp I want 
this definition to look exactly the same in all projects in my company. 
This way I make my myapp-webapp depend on 
myblock-opensessioninview-enabler and thats it.

[1] http://issues.apache.org/jira/browse/COCOON-1898

-- 
Leszek Gawron, IT Manager                          MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Mime
View raw message