You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Ilya A. Kriveshko" <il...@kaon.com> on 2002/08/06 23:45:39 UTC

Proposed addition to RequestGenerator (diff -u patch included)

Hello,

I needed RequestGenerator to give me access not only to request 
parameters, but also to request attributes. Attributes allow a Request 
object to carry a "history" of the request among other things, and 
sometimes it is useful to have access to that history from an XPath 
expression [like document('cocoon://httprequest')] or any other place 
that might use RequestGenerator.

Attached is a small and simple patch to 
xml-cocoon2/src/java/org/apache/cocoon/generation/RequestGenerator.java 
that provides just that functionality.

In order to not adversely affect anyone who is relying on there not 
being any extra stuff in the generated request XML, I left attributes 
turned off by default. They can be turned on, either at the generator 
definition or invocation in the sitemap by specifying <map:parameter 
name="generate-attributes" value="true"/>.

I need this functionality for my project, and placing it in the 
RequestGenerator appears to be a natural choice.

The patch that I attached has been tested under cocoon-2.1-dev running 
on Tomcat 3.3.1 on Win2k and Linux under JDK 1.3.1.

Please, someone, review my changes and if I managed to convince you of 
their usefulness, commit them to the repository.
--
Ilya

Re: Proposed addition to RequestGenerator (diff -u patch included)

Posted by "Ilya A. Kriveshko" <il...@kaon.com>.

Carsten Ziegeler wrote:

>let's make a deal :) - I apply your patch and you contribute a (small)
>docu patch for the request generator doc.
>
>Oh, I already applied it, so now it's your turn...
>
Here's the doc. patch.

>Thanks for your patch! I removed the reference to the XSPObjectHelper,
>please verify if everything is OK.
>
Everything is OK, excepth that you removed the reference to the 
XSPObjectHelper... :-(
The neat thing about that was that if the attribute was an instance of 
XMLizable or Node, then appropriate XML would get generated. I copied 
this usage pattern from SessionAttributeGenerator.java, so I thought 
that it was OK to do that. I even almost started using this feature to 
have structured attribute values.

There is already a dependence on XSPObjectHelper in the generation 
package. Is there any chance that you may reconsider and put it back in?

Thanks for your prompt response!

==
Ilya

RE: Proposed addition to RequestGenerator (diff -u patch included)

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Vadim Gritsenko wrote:

> 
> > From: Carsten Ziegeler [mailto:cziegeler@s-und-n.de]
> > 
> > Hi Ilya,
> > 
> > let's make a deal :) - I apply your patch and you contribute a (small)
> > docu patch for the request generator doc.
> > 
> > Oh, I already applied it, so now it's your turn...
> > 
> > Thanks for your patch! I removed the reference to the XSPObjectHelper,
> > please verify if everything is OK.
> 
> Carsten,
> 
> But xspExpr did much more then String.valueOf. It was working with
> XMLizable, w2c.Node, Collections, etc.
> 
Argh, yes - you're right - Ok, I will fix this asap.

> 
> PS Why do not use getParameterAsBoolean?
> 
Will fix this, too

Thanks Vadim!

Carsten

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


RE: Proposed addition to RequestGenerator (diff -u patch included)

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Carsten Ziegeler [mailto:cziegeler@s-und-n.de]
> 
> Hi Ilya,
> 
> let's make a deal :) - I apply your patch and you contribute a (small)
> docu patch for the request generator doc.
> 
> Oh, I already applied it, so now it's your turn...
> 
> Thanks for your patch! I removed the reference to the XSPObjectHelper,
> please verify if everything is OK.

Carsten,

But xspExpr did much more then String.valueOf. It was working with
XMLizable, w2c.Node, Collections, etc.


PS Why do not use getParameterAsBoolean?

Vadim


> Thanks
> Carsten
> 
> > -----Original Message-----
> > From: Ilya A. Kriveshko [mailto:ilya@kaon.com]
> > Sent: Tuesday, August 06, 2002 11:46 PM
> > To: cocoon-dev@xml.apache.org
> > Subject: Proposed addition to RequestGenerator (diff -u patch
included)
> >
> >
> > Hello,
> >
> > I needed RequestGenerator to give me access not only to request
> > parameters, but also to request attributes. Attributes allow a
Request
> > object to carry a "history" of the request among other things, and
> > sometimes it is useful to have access to that history from an XPath
> > expression [like document('cocoon://httprequest')] or any other
place
> > that might use RequestGenerator.
> >
> > Attached is a small and simple patch to
> >
xml-cocoon2/src/java/org/apache/cocoon/generation/RequestGenerator.java
> > that provides just that functionality.
> >
> > In order to not adversely affect anyone who is relying on there not
> > being any extra stuff in the generated request XML, I left
attributes
> > turned off by default. They can be turned on, either at the
generator
> > definition or invocation in the sitemap by specifying <map:parameter
> > name="generate-attributes" value="true"/>.
> >
> > I need this functionality for my project, and placing it in the
> > RequestGenerator appears to be a natural choice.
> >
> > The patch that I attached has been tested under cocoon-2.1-dev
running
> > on Tomcat 3.3.1 on Win2k and Linux under JDK 1.3.1.
> >
> > Please, someone, review my changes and if I managed to convince you
of
> > their usefulness, commit them to the repository.
> > --
> > Ilya


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


RE: Proposed addition to RequestGenerator (diff -u patch included)

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Hi Ilya,

let's make a deal :) - I apply your patch and you contribute a (small)
docu patch for the request generator doc.

Oh, I already applied it, so now it's your turn...

Thanks for your patch! I removed the reference to the XSPObjectHelper,
please verify if everything is OK.

Thanks
Carsten

> -----Original Message-----
> From: Ilya A. Kriveshko [mailto:ilya@kaon.com]
> Sent: Tuesday, August 06, 2002 11:46 PM
> To: cocoon-dev@xml.apache.org
> Subject: Proposed addition to RequestGenerator (diff -u patch included)
> 
> 
> Hello,
> 
> I needed RequestGenerator to give me access not only to request 
> parameters, but also to request attributes. Attributes allow a Request 
> object to carry a "history" of the request among other things, and 
> sometimes it is useful to have access to that history from an XPath 
> expression [like document('cocoon://httprequest')] or any other place 
> that might use RequestGenerator.
> 
> Attached is a small and simple patch to 
> xml-cocoon2/src/java/org/apache/cocoon/generation/RequestGenerator.java 
> that provides just that functionality.
> 
> In order to not adversely affect anyone who is relying on there not 
> being any extra stuff in the generated request XML, I left attributes 
> turned off by default. They can be turned on, either at the generator 
> definition or invocation in the sitemap by specifying <map:parameter 
> name="generate-attributes" value="true"/>.
> 
> I need this functionality for my project, and placing it in the 
> RequestGenerator appears to be a natural choice.
> 
> The patch that I attached has been tested under cocoon-2.1-dev running 
> on Tomcat 3.3.1 on Win2k and Linux under JDK 1.3.1.
> 
> Please, someone, review my changes and if I managed to convince you of 
> their usefulness, commit them to the repository.
> --
> Ilya
> 

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