You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Rui Alberto L. Gonçalves" <ru...@ptinovacao.pt> on 2004/01/07 17:14:27 UTC
Writing transformer question!
Hi all,
I wrote a transformer that write and reads XML from a socket.
When a document is readed from the socket I need to fire
the corresponding events on the pipeline. For doing so
I'm using:
SAXParser parser = null;
try
{
byte[] bytes = buffer.toString().getBytes();
InputSource input = new
InputSource(new ByteArrayInputStream(bytes));
parser = (SAXParser)this.manager.lookup(SAXParser.ROLE);
parser.parse(input, this.xmlConsumer);
}
the problem is that there are events that can't be generated again,
like "startDocument", because the events sequence on the pipeline
will be invalid!!
Does anyone have an idea how can I overcome this problem.
Thanks to all,
Rui
--
Rui Alberto L. Gonçalves <ru...@ptinovacao.pt>
PT Inovação
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Showing plain text files with cocoon
Posted by Tim Larson <ti...@yahoo.com>.
--- Tony Collen <co...@umn.edu> wrote:
> Tim Larson wrote:
> > I have this problem also (with IE 5.5), but this did not solve it for me.
> > Any other ideas?
>
> AFAIK, MSIE thinks that it "knows better" and generally looks
> at the file extension coming off the server, not the mime-type.
> It's very frustrating to say the least. Try changing the map:match
> to *.txt and see if that works.
Thanks, but in my case it already is "something.txt".
One other data point: When I get the file was not found message,
it also asks me if I want to create a new file. If I click yes,
then it creates an empty file. Clicking on the link after this
procedure succeeds in loading the file without errors.
--Tim Larson
__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Showing plain text files with cocoon
Posted by Tony Collen <co...@umn.edu>.
Tim Larson wrote:
> --- Yury Mikhienko <Yu...@mobicomk.ru> wrote:
>
>>On Thu, 8 Jan 2004 16:47:31 +0100 (MET)
>>"Stephanie Zohner" <st...@gmx.at> wrote:
>>
>>
>>>I tried to use the resource reader, like this:
>>><map:match pattern="*.log">
>>><map:read type="resource" src="{1}.log" mime-type="text/plain"/>
>>></map:match>
>>>
>>>But this does not work.
>>>The editor is opened, but then an error message pops up, saying that the
>>>file can not be found.
>>>The Editor seems to search for the file under "Temporary Internet
>>>Files/Content.IE5"
>>>
>>
>>try
>>
>><map:match pattern="*.log">
>> <map:read src="{1}.log" mime-type="text/plain"/>
>></map:match>
>
>
> I have this problem also (with IE 5.5), but this did not solve it for me.
> Any other ideas?
AFAIK, MSIE thinks that it "knows better" and generally looks at the file extension coming off the
server, not the mime-type. It's very frustrating to say the least. Try changing the map:match to
*.txt and see if that works.
Regards,
Tony
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
indents & SourceWritingTransformer ?
Posted by Stephanie Zohner <st...@gmx.at>.
Hi,
I generate an XML File with cocoon with no indents.
Like
<page><header></header><content></content>
Then I would like to save this file with indents with the
SourceWritingTransformer.
How can I do this?
I already tried this (in vain):
1. I added <indent>yes</indent> to the configuration of the XML_Serializer
(I use the XML-Serializer for the output of the SourceWritingTransformer).
2. In my pipeline I added a XSL-Transformation that copies the whole file
but adds indents (with <xsl:output indent=yes/>) so that my pipeline looks
like the following now:
<map:match pattern="test">
<map:generate src="../test-files/archive-run.xml"/>
<map:transform type="xslt" src="stylesheets/indent.xsl"></map:transform>
<map:transform type="xslt" src="stylesheets/save.xsl"></map:transform>
<map:transform type="write-source"></map:transform>
<map:serialize type="xml"/>
</map:match>
But still the saved file has no indents.
Any help is appreciated,
Thanks Stephanie
--
+++ GMX - die erste Adresse für Mail, Message, More +++
Bis 31.1.: TopMail + Digicam für nur 29 EUR http://www.gmx.net/topmail
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Cocoon CLI & Request params
Posted by Upayavira <uv...@upaya.co.uk>.
Stephanie Zohner wrote:
>Hi,
>
>
>I'm just trying to get a better understanding of the cocoon command line
>interface. The configuration is quite tricky but with the help of the mailing
>list I could run a simple example, at least.
>
>However, my problem now is: How can I configure request parameters for one
>of the URLS in the cli.xconf?
>Can I hand request params over to a defined uri when I call the cocoon cli?
>
>Thanks for your help,
>
>Stephanie
>
>
The CLI can handle request parameters, but at present doesn't (I
believe) do it very elegantly. You just put the URL you want to request
in including the request parameters, e.g <uri
src="/page.html?x=1&y=2"/>. It 'mangles' the URL into a filename, such
as page.html_x_1_y_2. The mangling isn't very sophisticated, and could
do with being much better, e.g. page.x_1_y_2.html. It wouldn't be too
hard to do as the mangling code is quite well contained. Fancy having a
go at producing a patch to fix it? I'll happily give you pointers.
Regards, Upayavira
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Cocoon CLI & Request params
Posted by Stephanie Zohner <st...@gmx.at>.
Hi,
I'm just trying to get a better understanding of the cocoon command line
interface. The configuration is quite tricky but with the help of the mailing
list I could run a simple example, at least.
However, my problem now is: How can I configure request parameters for one
of the URLS in the cli.xconf?
Can I hand request params over to a defined uri when I call the cocoon cli?
Thanks for your help,
Stephanie
--
+++ GMX - die erste Adresse für Mail, Message, More +++
Bis 31.1.: TopMail + Digicam für nur 29 EUR http://www.gmx.net/topmail
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: XSP : how to get matcher's wildcard value
Posted by Joerg Heinicke <jo...@gmx.de>.
AFAIK you have access to sitemap parameters in an action, so pass it as
a sitemap parameter to the action:
<map:act>
<map:parameter name="paramname" value="{1}"/>
</map:act>
Joerg
PS: Please do not reply to other mails when you start a new thread, but
compose a new mail. Otherwise your mail breaks thread view and you will
get less support as people might not see your mail.
On 09.01.2004 10:46, julien bloit wrote:
> Hi all,
> Using this pipeline snippet :
>
> <map:match pattern="foo/*">
> <map:act type="serverpages" src="xsp/myAction.xsp">
> ....
> </map:act>
> </map:match>
>
> I need to get the matcher's wildcard value in myAction page, do you know
> which tag from which logicsheet I should use ?
>
> thank you!
> Julien
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
XSP : how to get matcher's wildcard value
Posted by julien bloit <Ju...@ircam.fr>.
Hi all,
Using this pipeline snippet :
<map:match pattern="foo/*">
<map:act type="serverpages" src="xsp/myAction.xsp">
....
</map:act>
</map:match>
I need to get the matcher's wildcard value in myAction page, do you know
which tag from which logicsheet I should use ?
thank you!
Julien
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Showing plain text files with cocoon
Posted by Stephanie Zohner <st...@gmx.at>.
Thanks for all your tips!
Deleting the cache finally brought the solution. I#m not sure that I
understand this behaviour, but at least it seems to work, now.
Thanks again,
Stephanie
> On 08.01.2004 21:27, Tim Larson wrote:
>
> >>>I tried to use the resource reader, like this:
> >>><map:match pattern="*.log">
> >>><map:read type="resource" src="{1}.log" mime-type="text/plain"/>
> >>></map:match>
> >>>
> >>>But this does not work.
> >>>The editor is opened, but then an error message pops up, saying that
> the
> >>>file can not be found.
> >>>The Editor seems to search for the file under "Temporary Internet
> >>>Files/Content.IE5"
> >>>
> >>
> >>try
> >>
> >><map:match pattern="*.log">
> >> <map:read src="{1}.log" mime-type="text/plain"/>
> >></map:match>
> >
> >
> > I have this problem also (with IE 5.5), but this did not solve it for
> me.
> > Any other ideas?
>
> Of course the above propagated solution can not work if the original
> does not work: resource reader is the default reader, so there is no
> difference between both. But I don't know why it shouldn't work, tried
> it and it works (snippet from root sitemap):
>
> <map:match pattern="*.log">
> <map:read src="WEB-INF/logs/{1}.log" mime-type="text/plain"/>
> </map:match>
>
> IE doesn't display the file, but asks me to save it somewhere. So I
> guess it's simply question of configuration in your windows. The hint
> with "Temporary Internet Files" also points to the download as all files
> are downloaded to this directory and later copied to the selected
> directory. Does deleting the cache help, so that the file can't be found
> there and the file must be dwonloaded again?
>
> Joerg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
--
+++ GMX - die erste Adresse für Mail, Message, More +++
Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Showing plain text files with cocoon
Posted by Joerg Heinicke <jo...@gmx.de>.
On 08.01.2004 21:27, Tim Larson wrote:
>>>I tried to use the resource reader, like this:
>>><map:match pattern="*.log">
>>><map:read type="resource" src="{1}.log" mime-type="text/plain"/>
>>></map:match>
>>>
>>>But this does not work.
>>>The editor is opened, but then an error message pops up, saying that the
>>>file can not be found.
>>>The Editor seems to search for the file under "Temporary Internet
>>>Files/Content.IE5"
>>>
>>
>>try
>>
>><map:match pattern="*.log">
>> <map:read src="{1}.log" mime-type="text/plain"/>
>></map:match>
>
>
> I have this problem also (with IE 5.5), but this did not solve it for me.
> Any other ideas?
Of course the above propagated solution can not work if the original
does not work: resource reader is the default reader, so there is no
difference between both. But I don't know why it shouldn't work, tried
it and it works (snippet from root sitemap):
<map:match pattern="*.log">
<map:read src="WEB-INF/logs/{1}.log" mime-type="text/plain"/>
</map:match>
IE doesn't display the file, but asks me to save it somewhere. So I
guess it's simply question of configuration in your windows. The hint
with "Temporary Internet Files" also points to the download as all files
are downloaded to this directory and later copied to the selected
directory. Does deleting the cache help, so that the file can't be found
there and the file must be dwonloaded again?
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Showing plain text files with cocoon
Posted by Tim Larson <ti...@yahoo.com>.
--- Yury Mikhienko <Yu...@mobicomk.ru> wrote:
> On Thu, 8 Jan 2004 16:47:31 +0100 (MET)
> "Stephanie Zohner" <st...@gmx.at> wrote:
>
>> I tried to use the resource reader, like this:
>> <map:match pattern="*.log">
>> <map:read type="resource" src="{1}.log" mime-type="text/plain"/>
>> </map:match>
>>
>> But this does not work.
>> The editor is opened, but then an error message pops up, saying that the
>> file can not be found.
>> The Editor seems to search for the file under "Temporary Internet
>> Files/Content.IE5"
>>
> try
>
> <map:match pattern="*.log">
> <map:read src="{1}.log" mime-type="text/plain"/>
> </map:match>
I have this problem also (with IE 5.5), but this did not solve it for me.
Any other ideas?
--Tim Larson
__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Showing plain text files with cocoon
Posted by Yury Mikhienko <Yu...@mobicomk.ru>.
On Thu, 8 Jan 2004 16:47:31 +0100 (MET)
"Stephanie Zohner" <st...@gmx.at> wrote:
> Hi all,
>
> Does anybody know how to show plain text files with cocoon?
>
> For example:
>
> <a href="logfile.log">Link to Logfile</a>
>
> Should open a new browser window with the plain text log file as its
> content. How can I do this with Cocoon.
>
> I tried to use the resource reader, like this:
>
> <map:match pattern="*.log">
> <map:read type="resource" src="{1}.log" mime-type="text/plain"/>
> </map:match>
>
try
<map:match pattern="*.log">
<map:read src="{1}.log" mime-type="text/plain"/>
</map:match>
--
Best regards,
Yury Mikhienko.
IT ERP group head, ZAO "Mobikom-Kavkaz"
tel: (8632) 704188
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Showing plain text files with cocoon
Posted by Stephanie Zohner <st...@gmx.at>.
Hi all,
Does anybody know how to show plain text files with cocoon?
For example:
<a href="logfile.log">Link to Logfile</a>
Should open a new browser window with the plain text log file as its
content. How can I do this with Cocoon.
I tried to use the resource reader, like this:
<map:match pattern="*.log">
<map:read type="resource" src="{1}.log" mime-type="text/plain"/>
</map:match>
But this does not work.
The editor is opened, but then an error message pops up, saying that the
file can not be found.
The Editor seems to search for the file under "Temporary Internet
Files/Content.IE5"
I'm using Cocoon 2.1.2 with Internet Explorer 6.0.
Can anybody help?
Thanks, Stephanie
--
+++ GMX - die erste Adresse für Mail, Message, More +++
Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org