cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Kossakowski <gkossakow...@apache.org>
Subject Re: map:read options
Date Mon, 14 Jan 2008 16:54:06 GMT
Robin Wyles pisze:
> 
> On 14 Jan 2008, at 15:40, Romain Slootmaekers wrote:
> 
>> Robin Wyles wrote:
>> Yes the file:///C:/some path/installer.msi works
>>
>> but I would like to have a relative path as the app needs to be
>> relocatable
> 
> Relative paths are resolved relative to the location of the sitemap, and
> in C2.2 the location of the sitemap varies greatly depending on how you
> run cocoon during development, deployment etc. In your production webapp
> your sitemap will be in the jar file created for your block.
> 
> You could use the directory generator [1] along with ../ in your src
> attribute to determine how the relative paths are resolved.
> 
> I would suggest you try to determine the absolute path to your webapp
> context first and then resolve your path relative to that, you might
> want to take a look at using the ContextPathModule [2] which could help
> you.

Robin is right on his suggestion. In order obtain absolute location of your block you could
make use
of Input Module provided in COCOON-2145 but this demands patching Cocoon's sources.

Another way is to use properties as Romain already does. In sitemap one can obtain system
property
using settings module:

  {settings:your_property}

Since 2.2 incorporates Cocoon Spring Configurator sub-project it's very easy to work with
various
configuration options. See [2] for more details.

[1] https://issues.apache.org/jira/browse/COCOON-2145
[2] http://cocoon.apache.org/subprojects/configuration/1.0/spring-configurator/1.0/1304_1_1.html

-- 
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/

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


Mime
View raw message