You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Guido Casper <gc...@s-und-n.de> on 2003/07/18 11:01:39 UTC

Improving (?) the RequestGenerator

Hi all,

I want to extend RequestGenerator so that request parameters which names
start with "html:" are parsed (very much like it already parses request
parameters which names start with xml:" see:
http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=105174146229060&w=2 ) but
with JTidy.

This would allow easy integration of HTML editors like "htmlArea"
http://sourceforge.net/projects/itools-htmlarea/
into the sitemap.

I already submitted a patch to bugzilla.
I'm however unsure where this RequestGenerator should go since it has a
dependancy on JTidy. Maybe it should be renamed and go in the HTML block
besides the HTMLGenerator. But it doesn't really make sense to have 2
RequestGenerators.

Hope this will be useful for others as well.

Guido


Guido Casper
-------------------------------------------------
S&N AG, Open Source Competence Center
                    Tel.: +49-5251-1581-87
Klingenderstr. 5    mailto:gcasper@s-und-n.de
D-33100 Paderborn   http://www.s-und-n.de
-------------------------------------------------


Re: Improving (?) the RequestGenerator

Posted by Guido Casper <gc...@s-und-n.de>.
Gianugo Rabellino wrote:
> Gianugo Rabellino wrote:
>>> I already submitted a patch to bugzilla.
>>> I'm however unsure where this RequestGenerator should go since it
>>> has a dependancy on JTidy. Maybe it should be renamed and go in the
>>> HTML block besides the HTMLGenerator. But it doesn't really make
>>> sense to have 2 RequestGenerators.
>> 
>> 
>> I'm wondering whether it would be better to extend the HTML generator
>> instead so that it accepts not only html files as external sources
>> but also as a POST inputstream and/or request parameters. I tend to
>> think that this is the cleanest solution.
> 
> Not only that... but it seems to me that the HTMLGenerator already
> does what you want. And even worse, it was me adding such
> functionality a few months ago. I need holidays badly. :-) Isn't what
> is provided already enough for your needs?

see my last message

Thanks
Guido

Re: Improving (?) the RequestGenerator

Posted by Gianugo Rabellino <gi...@apache.org>.
Gianugo Rabellino wrote:
>> I already submitted a patch to bugzilla.
>> I'm however unsure where this RequestGenerator should go since it has a
>> dependancy on JTidy. Maybe it should be renamed and go in the HTML block
>> besides the HTMLGenerator. But it doesn't really make sense to have 2
>> RequestGenerators.
> 
> 
> I'm wondering whether it would be better to extend the HTML generator 
> instead so that it accepts not only html files as external sources but 
> also as a POST inputstream and/or request parameters. I tend to think 
> that this is the cleanest solution.

Not only that... but it seems to me that the HTMLGenerator already does 
what you want. And even worse, it was me adding such functionality a few 
months ago. I need holidays badly. :-) Isn't what is provided already 
enough for your needs?

-- 
Gianugo Rabellino
Pro-netics s.r.l. -  http://www.pro-netics.com
Orixo, the XML business alliance - http://www.orixo.com
     (Now blogging at: http://blogs.cocoondev.org/gianugo/)


Re: Improving (?) the RequestGenerator

Posted by Guido Casper <gc...@s-und-n.de>.
Gianugo Rabellino wrote:
> Guido Casper wrote:
> 
>>> Besided, we have ready (uncommitted since it seemed to me not that
>>> generally useful) an HTML transformer, getting content coming from a
>>> generator as HTML excaped (&lt;html&gt;) and converting it to XHTML
>>> using Tidy: we are using it for HTML taken from a blob on an rdbms.
>>> If there is any interest for that, I'd be glad to commit it.
>> 
>> 
>> This would indeed make the patch to the RequestGenerator (and to the
>> HTMLGenerator as well) redundant :-)
> 
> I just committed it to the HTML block, but I didn't change any
> configuration since I consider this thingy unstable (I wanted to put
> it into scratchpad, but this would have meant duplicating the
> jtidy.jar file so I just thought to add it, unconfigured, to the HTML
> block, where eventually will belong). Please see if it suits you and
> feel free to work on it.

Great! I'll try it and adjust the WebDAV sample.

Thanks
Guido
--

Guido Casper
-------------------------------------------------
S&N AG, Competence Center Open Source
                    Tel.: +49-5251-1581-87
Klingenderstr. 5    mailto:gcasper@s-und-n.de
D-33100 Paderborn   http://www.s-und-n.de
-------------------------------------------------

Re: Improving (?) the RequestGenerator

Posted by Gianugo Rabellino <gi...@apache.org>.
Guido Casper wrote:

>>Besided, we have ready (uncommitted since it seemed to me not that
>>generally useful) an HTML transformer, getting content coming from a
>>generator as HTML excaped (&lt;html&gt;) and converting it to XHTML
>>using Tidy: we are using it for HTML taken from a blob on an rdbms. If
>>there is any interest for that, I'd be glad to commit it.
> 
> 
> This would indeed make the patch to the RequestGenerator (and to the
> HTMLGenerator as well) redundant :-)

I just committed it to the HTML block, but I didn't change any 
configuration since I consider this thingy unstable (I wanted to put it 
into scratchpad, but this would have meant duplicating the jtidy.jar 
file so I just thought to add it, unconfigured, to the HTML block, where 
eventually will belong). Please see if it suits you and feel free to 
work on it.

Ciao,

-- 
Gianugo Rabellino
Pro-netics s.r.l. -  http://www.pro-netics.com
Orixo, the XML business alliance - http://www.orixo.com
     (Now blogging at: http://blogs.cocoondev.org/gianugo/)


Re: Improving (?) the RequestGenerator

Posted by Guido Casper <gc...@s-und-n.de>.
Gianugo Rabellino wrote:
> Guido Casper wrote:
>
>> I want to extend RequestGenerator so that request parameters which
>> names start with "html:" are parsed (very much like it already
>> parses request parameters which names start with xml:" see:
>> http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=105174146229060&w=2
>> ) but with JTidy.
>>
>> This would allow easy integration of HTML editors like "htmlArea"
>> http://sourceforge.net/projects/itools-htmlarea/
>> into the sitemap.
>>
>> I already submitted a patch to bugzilla.
>> I'm however unsure where this RequestGenerator should go since it
>> has a dependancy on JTidy. Maybe it should be renamed and go in the
>> HTML block besides the HTMLGenerator. But it doesn't really make
>> sense to have 2 RequestGenerators.
>
> I'm wondering whether it would be better to extend the HTML generator
> instead so that it accepts not only html files as external sources but
> also as a POST inputstream and/or request parameters. I tend to think
> that this is the cleanest solution.

Like the StreamGenerator does for posted XML? But wouldn't this restrict you
to have to pick a single request parameter to feed into the pipeline, while
I would like to have all parameters?

>
> Besided, we have ready (uncommitted since it seemed to me not that
> generally useful) an HTML transformer, getting content coming from a
> generator as HTML excaped (&lt;html&gt;) and converting it to XHTML
> using Tidy: we are using it for HTML taken from a blob on an rdbms. If
> there is any interest for that, I'd be glad to commit it.

This would indeed make the patch to the RequestGenerator (and to the
HTMLGenerator as well) redundant :-)

Guido

Guido Casper
-------------------------------------------------
S&N AG, Competence Center Open Source
                    Tel.: +49-5251-1581-87
Klingenderstr. 5    mailto:gcasper@s-und-n.de
D-33100 Paderborn   http://www.s-und-n.de
-------------------------------------------------


Re: Improving (?) the RequestGenerator

Posted by Gianugo Rabellino <gi...@apache.org>.
Guido Casper wrote:

> I want to extend RequestGenerator so that request parameters which names
> start with "html:" are parsed (very much like it already parses request
> parameters which names start with xml:" see:
> http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=105174146229060&w=2 ) but
> with JTidy.
> 
> This would allow easy integration of HTML editors like "htmlArea"
> http://sourceforge.net/projects/itools-htmlarea/
> into the sitemap.
> 
> I already submitted a patch to bugzilla.
> I'm however unsure where this RequestGenerator should go since it has a
> dependancy on JTidy. Maybe it should be renamed and go in the HTML block
> besides the HTMLGenerator. But it doesn't really make sense to have 2
> RequestGenerators.

I'm wondering whether it would be better to extend the HTML generator 
instead so that it accepts not only html files as external sources but 
also as a POST inputstream and/or request parameters. I tend to think 
that this is the cleanest solution.

Besided, we have ready (uncommitted since it seemed to me not that 
generally useful) an HTML transformer, getting content coming from a 
generator as HTML excaped (&lt;html&gt;) and converting it to XHTML 
using Tidy: we are using it for HTML taken from a blob on an rdbms. If 
there is any interest for that, I'd be glad to commit it.

Ciao,

-- 
Gianugo Rabellino
Pro-netics s.r.l. -  http://www.pro-netics.com
Orixo, the XML business alliance - http://www.orixo.com
     (Now blogging at: http://blogs.cocoondev.org/gianugo/)


Re: Improving (?) the RequestGenerator

Posted by Guido Casper <gc...@s-und-n.de>.
Stefano Mazzocchi wrote:
> On Friday, Jul 18, 2003, at 04:01 America/Guayaquil, Guido Casper
> wrote:
>
>> Hi all,
>>
>> I want to extend RequestGenerator so that request parameters which
>> names
>> start with "html:" are parsed (very much like it already parses
>> request parameters which names start with xml:" see:
>> http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=105174146229060&w=2
>> ) but
>> with JTidy.
>>
>> This would allow easy integration of HTML editors like "htmlArea"
>> http://sourceforge.net/projects/itools-htmlarea/
>> into the sitemap.
>>
>> I already submitted a patch to bugzilla.
>> I'm however unsure where this RequestGenerator should go since it
>> has a dependancy on JTidy. Maybe it should be renamed and go in the
>> HTML block
>> besides the HTMLGenerator. But it doesn't really make sense to have 2
>> RequestGenerators.
>>
>> Hope this will be useful for others as well.
>
> I welcome the patch, but dislike the fact that RequestGenerator ends
> up being in a block.
>
> What about HTMLRequestGenerator that extends RequestGenerator and put
> that into the block? (the xml: parsing is general enough to remain
> there, I think)

True.
Actually Gianugo just committed a HTMLTransformer to the html block that
obviates the need for the patch.

Guido


Re: Improving (?) the RequestGenerator

Posted by Stefano Mazzocchi <st...@apache.org>.
On Friday, Jul 18, 2003, at 04:01 America/Guayaquil, Guido Casper wrote:

> Hi all,
>
> I want to extend RequestGenerator so that request parameters which 
> names
> start with "html:" are parsed (very much like it already parses request
> parameters which names start with xml:" see:
> http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=105174146229060&w=2 ) 
> but
> with JTidy.
>
> This would allow easy integration of HTML editors like "htmlArea"
> http://sourceforge.net/projects/itools-htmlarea/
> into the sitemap.
>
> I already submitted a patch to bugzilla.
> I'm however unsure where this RequestGenerator should go since it has a
> dependancy on JTidy. Maybe it should be renamed and go in the HTML 
> block
> besides the HTMLGenerator. But it doesn't really make sense to have 2
> RequestGenerators.
>
> Hope this will be useful for others as well.

I welcome the patch, but dislike the fact that RequestGenerator ends up 
being in a block.

What about HTMLRequestGenerator that extends RequestGenerator and put 
that into the block? (the xml: parsing is general enough to remain 
there, I think)

--
Stefano.