cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhard Pötz <>
Subject Re: Block resources and proxying
Date Mon, 02 Mar 2009 11:37:07 GMT
Thorsten Scherler wrote:
> Hi all, 
> we have developed a block to add a new section to our page.
> This section is independent from the rest of the portal. Since we are
> using Apache httpd to serve all images, css and js we had to implement a
> rewrite rule to the work dir of tomcat.
> Something like:
> RewriteRule "^/themes/images/28f2009/(.*)\.(gif|jpg|jpeg|ico)$"
> "$PORTAL/work/blocks/conectorEspeciales/themer/themes/common/images/$1.$2" [L]
> We cannot do this anymore out of constraints from our production
> department and are looking into ways to link to the resources in the
> block lib not pointing into the work dir of tomcat. 
> How do other solve this issue?
> Is there a a way to tell the block to deploy to another path then the
> work dir of tomcat?
> I see different solutions:
> 1) Link into the jar via httpd directly (not sure whether httpd can do
> that and whether that brings any drawbacks).
> 2) Use block deployer from cocoon (if exists) that extract the jar to
> certain configurable path. 

Have a look at the cocoon-block-deployment subproject. It contains a
servlet listener (BlockDeploymentServletContextListener) that extracts
all blocks into the work directory.

You could write an additional listener for you purpose which should be
fairly easy because DeploymentUtil.deployBlockArtifacts(File f) does
everything that you need.

The only problem that we would have to solve is how we make this
configurable. We can't use the Spring configurator for that purpose
because it is not initialized when the listener is called.

After writing this I think that you could also write an initializable
Spring bean that calls DeploymentUtil.deployBlockArtifacts(File f) which
would solve the configuration problem.

> 3) Tell production that they need to unzip the block.jar into a certain
> path themselves.

Of course possible but clumsy IMO.

> Any ideas and thoughts welcome.

Another idea is to use mod_cache of httpd.


Reinhard Pötz                           Managing Director, {Indoqa} GmbH

Member of the Apache Software Foundation
Apache Cocoon Committer, PMC member        

View raw message