Vadim Gritsenko wrote:
On Apr 2, 2008, at 10:05 AM, Luca Morandini wrote:
Vadim Gritsenko wrote:
On Apr 2, 2008, at 2:28 AM, Luca Morandini wrote:

IIUC, Cocoon doesn't add properties of its own (bar the ones defined in blocks). Hence we can just put a reference to Maven properties, an example of how to use them in the sitemap and we're done, right ?
No.
I'd imagine this would work only if somebody to use Cocoon installed into Jetty started from Maven.

Sadly, I am not able even to "see" the Maven properties when starting Jetty from Maven:
       <map:call function="{1}">
         <map:parameter name="version" value="${project.version}"/>
       </map:call>

Hm, why do you think this syntax should work?

My cousin told me (just kidding... it was my grandma).

Seriously, if I try java.home it works, same if I try with some properties in my block. Actually, the syntax makes some sense, since it is the way properties are used in, say, Ant.


Try a standard way of accessing settings:

    <map:parameter name="version" value="{global:project.version}"/>

http://svn.apache.org/repos/asf/cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/resources/COB-INF/modules/sitemap.xmap

Been there, done that:
      <map:match pattern="action*">
        <map:call function="{1}">
          <map:parameter name="javahome" value="${java.home}"/>
          <map:parameter name="gjavahome" value="{global:java.home}"/>
          <map:parameter name="version" value="{global:project.version}"/>
        </map:call>
      </map:match>

function login() {
cocoon.log.debug("XXX:" + cocoon.parameters["javahome"]); // XXX    
cocoon.log.debug("XXX:" + cocoon.parameters["gjavahome"]); // XXX   
cocoon.log.debug("XXX:" + cocoon.parameters["version"]); // XXX     
...
}

2008-04-02 21:32:15,233 btpool0-5 DEBUG cocoon - XXX:/usr/java/jdk1.5.0_12/jre 2008-04-02 21:32:15,233 btpool0-5 DEBUG cocoon - XXX:/usr/java/jdk1.5.0_12/jre
2008-04-02 21:32:15,233 btpool0-5 DEBUG cocoon -
XXX:

So, it seems either syntax (${java.home} and {global:java.home}) is fine, but Maven's properties are not visible to the sitemap, even when using the jetty plugin.

Regards,

--------------------
   Luca Morandini
www.lucamorandini.it
--------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to