James,

Ok, I found and fixed a bug in setAttribute in AntTag.java where the toString
was being called on the attribute value object and outputting the same ugly
stuff from the original problem.

I also noticed in Maven.java and MavenJellyContext.java a few places where a
CompositeExpression is tested for and if true, a call to evaluate(context) is
made.
Perhaps these also should also be changed to call evaluateAsValue when the next
jelly push comes. I played with changing them ran a few goals and didn't notice
any difference. I guess I need to find a test case to crap them out.

Also, you may want to consider the following _changes_ in Jelly:

1. CompositeExpression.evaluate(JellyContext context) should call
    evaluateAsString(context)

2. evaluateAsString() should call
    evaluateAsValue(context).toString()

3. CompositeExpression.toString() also calls evaluateAsString()

I was unsure of the total consequences as I've been away for a while. Maybe I'm
missing why this wouldn't work in all cases.

-Peter


----- Original Message -----
From: "Peter Lynch" <[EMAIL PROTECTED]>
To: "Turbine Maven Developers List" <[EMAIL PROTECTED]>
Sent: Saturday, September 21, 2002 7:59 PM
Subject: Re: [Maven-Jelly]Composite Expression toString()


> James,
>
> ----- Original Message -----
> From: "James Strachan" <[EMAIL PROTECTED]>
> To: "Turbine Maven Developers List" <[EMAIL PROTECTED]>;
> "Peter Lynch" <[EMAIL PROTECTED]>
> Sent: Friday, September 20, 2002 6:17 AM
> Subject: Re: [Maven-Jelly]Composite Expression toString()
>
>
> > The background to the problem is that the MavenJellyContext sometimes
> > contains variables which the values are Expressions (rather than simple
> > Strings). So if Jelly evaluates the expression ${foo.bar} the value of the
> > expression might be another expression. Hence what you're seeing is the
> > toString() called on the Expression in the context, not the value of the
> > expression.
> >
> > I've just patched CVS HEAD of Jelly to auto-unwrap nested expressions when
> > converting an expression to a String, Boolean or Itereator. So I think this
> > should work around this Maven-Jelly issue. Could you give CVS HEAD of Jelly
> > a whirl and see if this fixes your issue?
> >
>
> Yeah cool, that works great so far!
>
> Looking forward to have the next jelly release pushed....
>
> I opened a jelly bug or two about this issue a while back. I'll see if I can
> close those now.
>
> Thanks so much.
>
> -Peter
>
> > James
> > -------
> > http://radio.weblogs.com/0112098/
> > ----- Original Message -----
> > From: "Peter Lynch" <[EMAIL PROTECTED]>
> > To: "Turbine Maven Developers List" <[EMAIL PROTECTED]>
> > Sent: Friday, September 20, 2002 10:13 AM
> > Subject: [Maven-Jelly]Composite Expression toString()
> >
> >
> > > I'm really stumped....not sure which camp - Jelly or Maven - this resides
> > in...
> > >
> > > I'm trying to pass a property value (
> > >
> > maven.webserver.fullname=${maven.webserver.name}-${maven.webserver.version}
> > ) to
> > > a jelly script included via the core jelly tag "import"
> > >
> > > like this:
> > >
> > > In my main script I have:
> > > ------------------------
> > >
> > > <j:import inherit="true" uri="apache-2.x.jelly" />
> > >
> > > in apache-2.x.jelly I have this inside a goal:
> > > ---------------------------
> > >
> > >     <fail unless="${undefined.property}">
> > > To use this webserver, you must have a project specific
> > > configuration file at the following location:
> > >
> > > ${maven.webserver.conf.dir}/conf/httpd.conf
> > >     </fail>
> > >
> > >
> > > When I call the goal for the above snippet, I see this:
> > > [ERROR] BUILD FAILED
> > > [ERROR] File......
> > >
> > file:/G:/cygwin/app/maven/home/plugins/maven-webserver-plugin-1.0/apache-2.x
> > .jel
> > > ly
> > > [ERROR] Element... fail
> > > [ERROR] Line...... 13
> > > [ERROR] Column.... 57
> > > [ERROR] To use this webserver, you must have a project specific
> > > [ERROR] configuration file at the following location:
> > > [ERROR]
> > > [ERROR]
> > > [ERROR]
> > > [ERROR]
> > >
> > org.apache.commons.jelly.expression.CompositeExpression@132ae7[expressions=[
> > org.
> > > apache.commons.jelly.expression.jexl.JexlExpressionFactory$1@65b738,
> > >
> > org.apache.commons.jelly.expression.ConstantExpression@dfd868[value=/webserv
> > er/]
> > > ,
> > >
> > org.apache.commons.jelly.expression.jexl.JexlExpressionFactory$1@f894ce]]/co
> > nf/h
> > > ttpd.conf
> > > Total time:  23 seconds
> > >
> > > Does it make sense the toString outputs this? If I refer to this property
> > in a
> > > regular
> > > non-imported file, I get only the expected path that the expression
> > evaluates
> > > too. IS there a way to get the toString for a composite expression to
> > > evaluateAsString or such?
> > >
> > > I have had dismal success getting import and include functioning with
> > property
> > > references. For example where is my plugin basedir in front of this path,
> > or
> > > should I be expecting that?
> > >
> > > If anyone has some experience in this regard, I need advice on how to
> > resolve
> > > this...
> > >
> > > -Peter
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Everything you'll ever need on one web page
> > from News and Sport to Email and Music Charts
> > http://uk.my.yahoo.com
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>


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

Reply via email to