Re: can you reach sitemap params from JXTemplate?

2003-08-22 Thread Steven Noels
Tony Collen wrote:

Steven,

When I tried wrapping my head around this stuff, I was boggled at the 
choice of two different syntaxes.  IMO this is a weakness and we should 
choose one or the other, but having both makes everything a million 
times more complicated.
Sure. Another thing for the JXTransformer todo list: taking into account 
XML comments. When I'm debugging, I put sections of jxpage code inside a 
comment. They are still executed IIUC.

/Steven
--
Steven Noelshttp://outerthought.org/
Outerthought - Open Source, Java  XML Competence Support Center
Read my weblog athttp://blogs.cocoondev.org/stevenn/
stevenn at outerthought.orgstevenn at apache.org


Re: can you reach sitemap params from JXTemplate?

2003-08-22 Thread Giacomo Pati
On Fri, 22 Aug 2003, Jeremy Quinn wrote:

 My sitemap looks like this:

 map:component-configurations
   global-variables
   assetResository/Library/Apache2/assets//assetResository
   assetServerhttp://iborg.local/assets//assetServer
   pendingpending//pending
   publishedarchive//published
   removedtrash//removed
   /global-variables
 /map:component-configurations

 snip/

 map:match pattern=*/*
   map:call function=main
   map:parameter name=action value={1}/
   map:parameter name=id value={2}/
   map:parameter name=uri value={0}/
   map:parameter name=pendingJobRepository
value={global:assetResository}{global:pending}/
   map:parameter name=pendingJobServer
value={global:assetServer}{global:pending}/
   map:parameter name=publishedJobRepository
value={global:assetResository}{global:published}/
   map:parameter name=publishedJobServer
value={global:assetServer}{global:published}/
   map:parameter name=removedJobRepository
value={global:assetResository}{global:removed}/
   /map:call
 /map:match

Ok, the sitemap parameters specified on the flow pipeline are not
accessible from the view pipeline (you should have got an Exception The
parameter 'status' does not contain a value). The view pipeline gets
its on set of parameters IIRC.

--
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com



Re: can you reach sitemap params from JXTemplate?

2003-08-22 Thread Jeremy Quinn
On Friday, August 22, 2003, at 10:10 AM, Giacomo Pati wrote:

Ok, the sitemap parameters specified on the flow pipeline are not
accessible from the view pipeline (you should have got an Exception 
The
parameter 'status' does not contain a value). The view pipeline gets
its on set of parameters IIRC.

AH!!

smacks-forehead/

Many thanks!!!

Sorry for the wasted bandwidth!!!

regards Jeremy



Re: can you reach sitemap params from JXTemplate?

2003-08-21 Thread Giacomo Pati
On Wed, 20 Aug 2003, Jeremy Quinn wrote:

 I cannot get this to work, I get:
 org.apache.commons.jxpath.JXPathException: Invalid XPath:
 '$parameters.getParameter(\publishedJobServer\)'. Syntax error after:
 '$p'

 If I try :

 ${$parameters.getParameter('publishedJobServer')}

Use: ${request.getParameter('publishedJobServery')}

this works for me.

--
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com



Re: can you reach sitemap params from JXTemplate?

2003-08-21 Thread Jeremy Quinn
On Thursday, August 21, 2003, at 02:10 AM, Christopher Oliver wrote:

This is how you do it:

#{$parameters.getParameter(publishedJobServer)}
results in :
org.apache.commons.jxpath.JXPathException: Invalid XPath: 
'$parameters.getParameter(\publishedJobServer\)'. Syntax error after: 
'$p'


${parameters.getParameter(publishedJobServer)}

no output

so I guess it must be a bug?

Thanks for your suggestions

regards Jeremy



Re: can you reach sitemap params from JXTemplate?

2003-08-21 Thread Jeremy Quinn
On Thursday, August 21, 2003, at 10:27 AM, Unico Hommes wrote:

What build are you using. This wasn't working a few weeks ago but has
been fixed.
2.1.1-dev, a couple of days old.

regards Jeremy



Re: can you reach sitemap params from JXTemplate?

2003-08-21 Thread Christopher Oliver
Sorry, my bad, the JXPath version should be this:

#{getParameter($parameters, 'publishedJobServer')}

and the Jexl version:

${parameters.getParameter('publishedJobServer')}

These do work (at least for me). The fact that you got no output from 
the Jexl version would seem to indicate that the specified parameter 
wasn't present. You can also call any method of 
org.apache.avalon.framework.parameters.Parameters, for example, try this:

t:forEach var=paramName items=${parameters.getNames()}
  name=${paramName}, value=${parameters.getParameter(paramName)}
/t:forEach
HTH,

Chris

Christopher Oliver wrote:

Yes, it's a bug.

Jeremy Quinn wrote:

On Thursday, August 21, 2003, at 02:10 AM, Christopher Oliver wrote:

This is how you do it:

#{$parameters.getParameter(publishedJobServer)}


results in :
org.apache.commons.jxpath.JXPathException: Invalid XPath: 
'$parameters.getParameter(\publishedJobServer\)'. Syntax error 
after: '$p'


${parameters.getParameter(publishedJobServer)}

no output

so I guess it must be a bug?

Thanks for your suggestions

regards Jeremy









Re: can you reach sitemap params from JXTemplate?

2003-08-21 Thread Steven Noels
Jeremy Quinn wrote:

On Thursday, August 21, 2003, at 10:27 AM, Unico Hommes wrote:

What build are you using. This wasn't working a few weeks ago but has
been fixed.
2.1.1-dev, a couple of days old.
... and I'm running into the same problem, with HEAD from this afternoon.

sitemap:

 map:match pattern=foo/*/bar/*
   map:generate src=forms/{1}-baz.xml type=jx/
   map:transform src=style/site2html.xsl/
   map:serialize/
 /map:match
jxpage:

page xmlns:jx=http://apache.org/cocoon/templates/jx/1.0;

[...]

jx:choose
  jx:when test=${parameters.getParameter('status') == 'success'}
pWe love you./p
  /jx:when
  jx:otherwise
pUnfortunately, the processing of your payment failed./p
  /jx:otherwise
/jx:choose
[...]

  /content
/page
I also tried any permutation of JEXL and JXPath, but no luck.

Some thoughts aside:

- The contract for exchanging (named) parameters between sitemap, 
flowscript and jxtransformer needs to be solidified (but we knew that)
- I'm slightly annoyed by the abundance of choice with JEXL and JXPath. 
Wouldn't it be better to stick with only one of them?

/Steven
--
Steven Noelshttp://outerthought.org/
Outerthought - Open Source, Java  XML Competence Support Center
Read my weblog athttp://blogs.cocoondev.org/stevenn/
stevenn at outerthought.orgstevenn at apache.org


RE: can you reach sitemap params from JXTemplate?

2003-08-20 Thread Reinhard Pötz
Without trying it ...
#{parameters.myParameter} should do it ...

Cheers,
Reinhard

 -Original Message-
 From: Jeremy Quinn [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, August 20, 2003 4:35 PM
 To: [EMAIL PROTECTED]
 Subject: can you reach sitemap params from JXTemplate?
 
 
 Hi All
 
 Does anyone know the correct syntax for getting a Sitemap 
 parameter in 
 JXTemplate?
 
 I have tried all of the following:
 
 #{cocoon/parameters[publishedJobServer]}
 #{cocoon/parameters/publishedJobServer/}
 ${cocoon.parameters[publishedJobServer]}
 ${cocoon.getParameters(publishedJobServer)}
 ${cocoon.parameters.publishedJobServer}
 
 
 The first two throw exceptions, the others output nothing.
 I can use cocoon.getParameters(publishedJobServer) in my FlowScript 
 without a problem, but I would prefer not to have to pass it 
 specially 
 to the view in cocoon.sendPage().
 
 Any ideas?
 
 thanks
 
 regards Jeremy
 



Re: can you reach sitemap params from JXTemplate?

2003-08-20 Thread Jeremy Quinn
On Wednesday, August 20, 2003, at 06:11 PM, Sylvain Wallez wrote:

Jeremy Quinn wrote:

Hi All

Does anyone know the correct syntax for getting a Sitemap parameter 
in JXTemplate?

I have tried all of the following:

#{cocoon/parameters[publishedJobServer]}
#{cocoon/parameters/publishedJobServer/}
${cocoon.parameters[publishedJobServer]}
${cocoon.getParameters(publishedJobServer)}
${cocoon.parameters.publishedJobServer}
The first two throw exceptions, the others output nothing.
I can use cocoon.getParameters(publishedJobServer) in my FlowScript 
without a problem, but I would prefer not to have to pass it 
specially to the view in cocoon.sendPage().

Any ideas?


The cocoon object only exists in the flowscript. In JXTemplate, you 
can directly access the parameters variable : 
#{$parameters.getParameter('publishedJobServer')}

I cannot get this to work, I get:
org.apache.commons.jxpath.JXPathException: Invalid XPath: 
'$parameters.getParameter(\publishedJobServer\)'. Syntax error after: 
'$p'

If I try :

${$parameters.getParameter('publishedJobServer')}

nothing happens

This makes me think we should unify the notation across the various 
components of a flow-script application.
In this regard, it would be more consistent to have request, 
session, context and parameter as children of a cocoon 
variable instead of having them directly as toplevel variables.
I agree

Or are they available as toplevel variables to mimic JSTL from which 
JXTemplate is inspired ?
They look like they are by a cursory reading of the code, but I have 
not been able to read many yet ;)

Thanks for your suggestions

regards Jeremy



Re: can you reach sitemap params from JXTemplate?

2003-08-20 Thread Jeremy Quinn
On Wednesday, August 20, 2003, at 05:42 PM, Reinhard Pötz wrote:

Without trying it ...
#{parameters.myParameter} should do it ...
no go

tried both:

#{parameters.publishedJobServer}
${parameters.publishedJobServer}
no output on either

thanks

regards Jeremy

Cheers,
Reinhard
-Original Message-
From: Jeremy Quinn [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 20, 2003 4:35 PM
To: [EMAIL PROTECTED]
Subject: can you reach sitemap params from JXTemplate?
Hi All

Does anyone know the correct syntax for getting a Sitemap
parameter in
JXTemplate?
I have tried all of the following:

#{cocoon/parameters[publishedJobServer]}
#{cocoon/parameters/publishedJobServer/}
${cocoon.parameters[publishedJobServer]}
${cocoon.getParameters(publishedJobServer)}
${cocoon.parameters.publishedJobServer}
The first two throw exceptions, the others output nothing.
I can use cocoon.getParameters(publishedJobServer) in my FlowScript
without a problem, but I would prefer not to have to pass it
specially
to the view in cocoon.sendPage().
Any ideas?

thanks

regards Jeremy