You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Robert Blank <ro...@s2003.tu-chemnitz.de> on 2006/09/26 15:30:19 UTC

Upgrading Cocoon 2.1.8->2.1.9

Hello,

I want to upgrade Cocoon in my project.
I did the following things:
-download Cocoon 2.1.9
-compiled it
-replaced old jars/libs with newer
-merged changes of forms-samples-styling.xsl and subfiles with project 
specific changes

First Question: Is there anything more i have to do? A HowToUpdate would 
be very nice in future.

Secend Question/Problem: With Firefox erverything seems to work like 
before but with IE I get "The Website http://localhost... can not be 
opend. Process canceled" (translated from German). I found out that when 
i delete the import of dojo.js (<script 
src="{$resources-uri}/dojo/dojo.js" type="text/javascript"/>) in 
forms-field-styling.xsl I get a Website and some Javascript errors like 
"dojo is not defined".

I hope somebody can help me.

Robert Blank


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


RE: link to a file

Posted by Andrew Stevens <at...@hotmail.com>.
>From: "Geert Josten" <ge...@daidalos.nl>
>Date: Wed, 27 Sep 2006 20:15:52 +0200
>
> > >tnx, but does that means that for every different extension,
> > I should
> > >supply a mime-type?
> >
> > It depends.  The default reader will try and pick one
> > automatically, but the ones it knows depends on some JDK
> > settings file (search the list archives, I asked about this a
> > while back).  For others, you either need to add them to this
> > file, or just use a specific map:read that supplies it.
>
>I might be mistaken, but there are mime-type mappings in
>web-inf/web.xml. The default reader could be using these..

You're not mistaken.  I'd hope the reader uses those too, though I was 
thinking of the platform default ones in 
$JAVA_HOME/lib/content-types.properties
http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=114901235121721&w=2


Andrew.

>
>Kind regards,
>Geert
>
>
>Drs. G.P.H. Josten
>Consultant
>
>
>
>Daidalos BV
>Source of Innovation
>Hoekeindsehof 1-4
>2665  JZ  Bleiswijk
>Tel.: +31 (0) 10 850 1200
>Fax: +31 (0) 10 850 1199
>www.daidalos.nl
>KvK 27164984



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


RE: link to a file

Posted by Geert Josten <ge...@daidalos.nl>.
> >tnx, but does that means that for every different extension, 
> I should 
> >supply a mime-type?
> 
> It depends.  The default reader will try and pick one 
> automatically, but the ones it knows depends on some JDK 
> settings file (search the list archives, I asked about this a 
> while back).  For others, you either need to add them to this 
> file, or just use a specific map:read that supplies it.

I might be mistaken, but there are mime-type mappings in
web-inf/web.xml. The default reader could be using these..

Kind regards,
Geert
   
 
Drs. G.P.H. Josten
Consultant
 
 

Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665  JZ  Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
www.daidalos.nl
KvK 27164984


De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.

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


RE: link to a file

Posted by Andrew Stevens <at...@hotmail.com>.
>From: Roel Croonenberghs <Ro...@sofico.be>
>Date: Tue, 26 Sep 2006 16:30:06 +0200
>
>tnx, but does that means that for every different extension, I should
>supply a mime-type?

It depends.  The default reader will try and pick one automatically, but the 
ones it knows depends on some JDK settings file (search the list archives, I 
asked about this a while back).  For others, you either need to add them to 
this file, or just use a specific map:read that supplies it.


Andrew.


>"Andrew Stevens" <at...@hotmail.com>
>26/09/2006 16:23
>Please respond to
>users@cocoon.apache.org
>
>
>To
>users@cocoon.apache.org
>cc
>
>Subject
>RE: link to a file
>
>
>
>
>
>
> >From: Roel Croonenberghs <Ro...@sofico.be>
> >Date: Tue, 26 Sep 2006 16:12:28 +0200
> >
> >Hello,
> >
> >I have a dir in my WEB_INF folder where users can upload there files.
>That
> >works. But I want these files to be available for download. so I use a
> >directory generator;
> ><map:generate type="directory" src="\WEB-INF\files\download">
> >
> >and I transform the result via xsl to produce a html with the links to
> >these files.
> >
> >But what should I put in the href"" tag of a file? Because instead of
> >letting the user download the file, cocoon tries to resolve the url in
>the
> >sitemap.
>
>Well, if they're under WEB-INF you won't be able to link directly to them
>anyway since the spec says web containers shouldn't serve up files under
>there.  You don't say what URL you're matching on to get the directory
>listing, but assuming it's something like <map:match pattern="mydir"> then
>
>you could just use relative links in the generated hrefs and add
><map:match pattern="mydir/*">
><map:read src="\WEB-INF\files\download\{1}"/>
></map:match>
>to your sitemap.  Depending on the filetypes you may also need to match
>based on the extension and supply the relevant mime-type attributes on the
>
>map:read elements.
>
>
>Andrew.



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


RE: link to a file

Posted by Roel Croonenberghs <Ro...@sofico.be>.
tnx, but does that means that for every different extension, I should 
supply a mime-type?




"Andrew Stevens" <at...@hotmail.com> 
26/09/2006 16:23
Please respond to
users@cocoon.apache.org


To
users@cocoon.apache.org
cc

Subject
RE: link to a file






>From: Roel Croonenberghs <Ro...@sofico.be>
>Date: Tue, 26 Sep 2006 16:12:28 +0200
>
>Hello,
>
>I have a dir in my WEB_INF folder where users can upload there files. 
That
>works. But I want these files to be available for download. so I use a
>directory generator;
><map:generate type="directory" src="\WEB-INF\files\download">
>
>and I transform the result via xsl to produce a html with the links to
>these files.
>
>But what should I put in the href"" tag of a file? Because instead of
>letting the user download the file, cocoon tries to resolve the url in 
the
>sitemap.

Well, if they're under WEB-INF you won't be able to link directly to them 
anyway since the spec says web containers shouldn't serve up files under 
there.  You don't say what URL you're matching on to get the directory 
listing, but assuming it's something like <map:match pattern="mydir"> then 

you could just use relative links in the generated hrefs and add
<map:match pattern="mydir/*">
<map:read src="\WEB-INF\files\download\{1}"/>
</map:match>
to your sitemap.  Depending on the filetypes you may also need to match 
based on the extension and supply the relevant mime-type attributes on the 

map:read elements.


Andrew.



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



Re: RE: RE: link to a file

Posted by Bertrand Delacretaz <bd...@apache.org>.
On 9/29/06, Geert Josten <ge...@daidalos.nl> wrote:

> ...However, for some reason it doesn't work on readers. I hadn't noticed
> until after my first reply that I had commented it out in my own sitemap
> and had replaced it with a generate/serialize wrapped in the set-header
> action...

Ok, thanks for the clarification!

I don't know the reason offhand, but the reader code is not
complicated, shouldn't be too hard to find out what happens by
debugging it.

-Bertrand

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


setting content-disposition header for a reader [was: link to a file]

Posted by "Steven D. Majewski" <sd...@virginia.edu>.
I found an old thread describing the same problem I'm running into --
but it seems to end here. Has anyone else found a solution ?

I have xml files served up by a cocoon reader.
They sometimes generate annoying errors messages in the browser.
  Normally, these are styled into html in cocoon, but a raw
directory link is provided for download -- but all of the
users don't know they should right-click, and they get confused
by the error messages into thinking that it didn't completely
load. I would rather not go thru the xml pipeline, if only to
allow them to download broken XML files to edit and fix.

  But it doesn't look like you can set the content-disposition
header from an action or from flowscript when using a reader.

Any ideas ?

-- Steve Majewski / UVA Alderman Library



On Sep 29, 2006, at 11:24 AM, Geert Josten wrote:

> PS:
>
> I believe I also tried setting the header from FlowScript, but had the
> impression it was either ignored or overruled by the reader..
>
> Kind regards,
> Geert
>
>> -----Oorspronkelijk bericht-----
>> Van: Geert Josten [mailto:geert.josten@daidalos.nl]
>> Verzonden: vrijdag 29 september 2006 17:04
>> Aan: users@cocoon.apache.org
>> Onderwerp: RE: RE: link to a file
>>
>> Hi,
>>
>> You found the thread on which I based my solution! :-)
>>
>> However, for some reason it doesn't work on readers. I hadn't
>> noticed until after my first reply that I had commented it
>> out in my own sitemap and had replaced it with a
>> generate/serialize wrapped in the set-header action.
>>
>> It looks apparently like the response object is not yet
>> created at the moment that the action is executed, which is
>> before the reader. Design flaw?
>>
>> Kind regards,
>> Geert
>>
>>>
>>
>>
>> Drs. G.P.H. Josten
>> Consultant
>>
>>
>>
>> Daidalos BV
>> Source of Innovation
>> Hoekeindsehof 1-4
>> 2665  JZ  Bleiswijk
>> Tel.: +31 (0) 10 850 1200
>> Fax: +31 (0) 10 850 1199
>> www.daidalos.nl
>> KvK 27164984
>>
>>
>> De informatie - verzonden in of met dit emailbericht - is
>> afkomstig van Daidalos BV en is uitsluitend bestemd voor de
>> geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen,
>> verzoeken wij u het te verwijderen. Aan dit bericht kunnen
>> geen rechten worden ontleend.
>>
>>
>>> Van: bdelacretaz@gmail.com [mailto:bdelacretaz@gmail.com] Namens
>>> Bertrand Delacretaz
>>> Verzonden: vrijdag 29 september 2006 16:49
>>> Aan: users@cocoon.apache.org
>>> Onderwerp: Re: RE: link to a file
>>>
>>> On 9/29/06, Roel Croonenberghs <Ro...@sofico.be> wrote:
>>>
>>>> ...it opens .html, .txt, .jpg, .gif  files in the browser
>>> instead of
>>>> downloading them...
>>>
>>> You need to set the content-disposition HTTP header to trigger a
>>> download, this thread shows how (I think, didn't check in detail):
>>>
>>> http://marc2.theaimsgroup.com/?l=xml-cocoon-users&m=1108910965
>>> 22009&w=2
>>>
>>> And this explains the principle:
>>> http://www.onjava.com/pub/a/onjava/excerpt/jebp_3/index3.html
>>>
>>> -Bertrand
>>>
>>>
>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>> For additional commands, e-mail: users-help@cocoon.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


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


RE: RE: link to a file

Posted by Geert Josten <ge...@daidalos.nl>.
PS:

I believe I also tried setting the header from FlowScript, but had the
impression it was either ignored or overruled by the reader..

Kind regards,
Geert

> -----Oorspronkelijk bericht-----
> Van: Geert Josten [mailto:geert.josten@daidalos.nl] 
> Verzonden: vrijdag 29 september 2006 17:04
> Aan: users@cocoon.apache.org
> Onderwerp: RE: RE: link to a file
> 
> Hi,
> 
> You found the thread on which I based my solution! :-)
> 
> However, for some reason it doesn't work on readers. I hadn't 
> noticed until after my first reply that I had commented it 
> out in my own sitemap and had replaced it with a 
> generate/serialize wrapped in the set-header action.
> 
> It looks apparently like the response object is not yet 
> created at the moment that the action is executed, which is 
> before the reader. Design flaw?
> 
> Kind regards,
> Geert
> 
> > 
>    
>  
> Drs. G.P.H. Josten
> Consultant
>  
>  
> 
> Daidalos BV
> Source of Innovation
> Hoekeindsehof 1-4
> 2665  JZ  Bleiswijk
> Tel.: +31 (0) 10 850 1200
> Fax: +31 (0) 10 850 1199
> www.daidalos.nl
> KvK 27164984
> 
> 
> De informatie - verzonden in of met dit emailbericht - is 
> afkomstig van Daidalos BV en is uitsluitend bestemd voor de 
> geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, 
> verzoeken wij u het te verwijderen. Aan dit bericht kunnen 
> geen rechten worden ontleend.
>  
> 
> > Van: bdelacretaz@gmail.com [mailto:bdelacretaz@gmail.com] Namens 
> > Bertrand Delacretaz
> > Verzonden: vrijdag 29 september 2006 16:49
> > Aan: users@cocoon.apache.org
> > Onderwerp: Re: RE: link to a file
> > 
> > On 9/29/06, Roel Croonenberghs <Ro...@sofico.be> wrote:
> > 
> > > ...it opens .html, .txt, .jpg, .gif  files in the browser
> > instead of
> > > downloading them...
> > 
> > You need to set the content-disposition HTTP header to trigger a 
> > download, this thread shows how (I think, didn't check in detail):
> > 
> > http://marc2.theaimsgroup.com/?l=xml-cocoon-users&m=1108910965
> > 22009&w=2
> > 
> > And this explains the principle:
> > http://www.onjava.com/pub/a/onjava/excerpt/jebp_3/index3.html
> > 
> > -Bertrand
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> > 
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

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


RE: RE: link to a file

Posted by Geert Josten <ge...@daidalos.nl>.
Hi,

You found the thread on which I based my solution! :-)

However, for some reason it doesn't work on readers. I hadn't noticed
until after my first reply that I had commented it out in my own sitemap
and had replaced it with a generate/serialize wrapped in the set-header
action.

It looks apparently like the response object is not yet created at the
moment that the action is executed, which is before the reader. Design
flaw?

Kind regards,
Geert

> 
   
 
Drs. G.P.H. Josten
Consultant
 
 

Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665  JZ  Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
www.daidalos.nl
KvK 27164984


De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.
 

> Van: bdelacretaz@gmail.com [mailto:bdelacretaz@gmail.com] 
> Namens Bertrand Delacretaz
> Verzonden: vrijdag 29 september 2006 16:49
> Aan: users@cocoon.apache.org
> Onderwerp: Re: RE: link to a file
> 
> On 9/29/06, Roel Croonenberghs <Ro...@sofico.be> wrote:
> 
> > ...it opens .html, .txt, .jpg, .gif  files in the browser 
> instead of 
> > downloading them...
> 
> You need to set the content-disposition HTTP header to 
> trigger a download, this thread shows how (I think, didn't 
> check in detail):
> 
> http://marc2.theaimsgroup.com/?l=xml-cocoon-users&m=1108910965
> 22009&w=2
> 
> And this explains the principle:
> http://www.onjava.com/pub/a/onjava/excerpt/jebp_3/index3.html
> 
> -Bertrand
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
>

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


Re: RE: link to a file

Posted by Bertrand Delacretaz <bd...@apache.org>.
On 9/29/06, Roel Croonenberghs <Ro...@sofico.be> wrote:

> ...it opens .html, .txt, .jpg, .gif  files in the browser instead of
> downloading them...

You need to set the content-disposition HTTP header to trigger a
download, this thread shows how (I think, didn't check in detail):

http://marc2.theaimsgroup.com/?l=xml-cocoon-users&m=110891096522009&w=2

And this explains the principle:
http://www.onjava.com/pub/a/onjava/excerpt/jebp_3/index3.html

-Bertrand

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


RE: link to a file

Posted by Roel Croonenberghs <Ro...@sofico.be>.
ok, I tried it and it gives me the same as 

 <map:read src="{1}" mime-type="application/octet-stream"

it opens .html, .txt, .jpg, .gif  files in the browser instead of 
downloading them. For .zip .wma files the browser opens the download 
dialog box. 
But it would be nice to have him open de file download dialog box 
everytime.


roel



Hmmm, right... Sorry..

It does work on generate/serialize, but perhaps I was wrong and doesn't
it work on matches that only contain a reader. Funny though..

Have you tried the following already?

                 <map:match pattern="download/**">
                                 <map:read src="{1}" 
mime-type="application/x-download"
/>
                 </map:match>

(or something alike?)

Kind regards,
Geert 



RE: link to a file

Posted by Geert Josten <ge...@daidalos.nl>.
Hmmm, right... Sorry..

It does work on generate/serialize, but perhaps I was wrong and doesn't
it work on matches that only contain a reader. Funny though..

Have you tried the following already?

	<map:match pattern="download/**">
		<map:read src="{1}" mime-type="application/x-download"
/>
	</map:match>

(or something alike?)

Kind regards,
Geert 

> -----Oorspronkelijk bericht-----
> Van: Roel Croonenberghs [mailto:Roel.Croonenberghs@sofico.be] 
> Verzonden: vrijdag 29 september 2006 14:24
> Aan: users@cocoon.apache.org
> Onderwerp: RE: link to a file
> 
> 
> If I do that, i ge the following error; 
> 
> 
> Internal Server Error 
> 
> Message: null 
> 
> Description: java.lang.NullPointerException 
> 
> Sender: org.apache.cocoon.servlet.CocoonServlet 
> 
> Source: Cocoon Servlet 
> 
> Request URI 
> 
> download/test.pdf 
> 
> cause 
> 
> java.lang.NullPointerException 
> 
> request-uri 
> 
> /cocoontest/download/test.pdf 
> 
> stacktrace 
> 
> java.lang.NullPointerException
>                 at 
> org.apache.catalina.connector.ResponseBase.setContentType(Resp
> onseBase.java:874)
>                 at 
> org.apache.catalina.connector.HttpResponseBase.setContentType(
> HttpResponseBase.java:853)
>                 at 
> org.apache.catalina.connector.ResponseFacade.setContentType(Re
> sponseFacade.java:197)
>                 at 
> org.apache.cocoon.environment.http.HttpResponse.setContentType
> (HttpResponse.java:214)
>                 at 
> org.apache.cocoon.environment.http.HttpEnvironment.setContentT
> ype(HttpEnvironment.java:216)
>                 at 
> org.apache.cocoon.components.pipeline.AbstractProcessingPipeli
> ne.setupReader(AbstractProcessingPipeline.java:583)
>                 at 
> org.apache.cocoon.components.pipeline.AbstractProcessingPipeli
> ne.preparePipeline(AbstractProcessingPipeline.java:515)
>                 at 
> org.apache.cocoon.components.pipeline.AbstractProcessingPipeli
> ne.process(AbstractProcessingPipeline.java:479)
>                 at 
> org.apache.cocoon.components.treeprocessor.sitemap.ReadNode.in
> voke(ReadNode.java:119)
>                 at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProce
> ssingNode.invokeNodes(AbstractParentProcessingNode.java:84)
>                 at 
> org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode
> .invoke(ActTypeNode.java:176)
>                 at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProce
> ssingNode.invokeNodes(AbstractParentProcessingNode.java:84)
>                 at 
> org.apache.cocoon.components.treeprocessor.sitemap.PreparableM
> atchNode.invoke(PreparableMatchNode.java:165)
>                 at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProce
> ssingNode.invokeNodes(AbstractParentProcessingNode.java:108)
>                 at 
> org.apache.cocoon.components.treeprocessor.sitemap.PipelineNod
> e.invoke(PipelineNode.java:163)
>                 at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProce
> ssingNode.invokeNodes(AbstractParentProcessingNode.java:108)
>                 at 
> org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNo
> de.invoke(PipelinesNode.java:152)
>                 at 
> org.apache.cocoon.components.treeprocessor.TreeProcessor.proce
> ss(TreeProcessor.java:354)
>                 at 
> org.apache.cocoon.components.treeprocessor.TreeProcessor.proce
> ss(TreeProcessor.java:307)
>                 at org.apache.cocoon.Cocoon.process(Cocoon.java:656)
>                 at 
> org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.
> java:1112)
>                 at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>                 at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
> er(ApplicationFilterChain.java:247)
>                 at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
> cationFilterChain.java:193)
>                 at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardW
> rapperValve.java:256)
>                 at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invokeNext(StandardPipeline.java:643)
>                 at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
>                 at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>                 at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardC
> ontextValve.java:191)
>                 at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invokeNext(StandardPipeline.java:643)
>                 at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
>                 at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>                 at 
> org.apache.catalina.core.StandardContext.invoke(StandardContex
> t.java:2415)
>                 at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHost
> Valve.java:180)
>                 at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invokeNext(StandardPipeline.java:643)
>                 at 
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDi
> spatcherValve.java:171)
>                 at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invokeNext(StandardPipeline.java:641)
>                 at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReport
> Valve.java:172)
>                 at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invokeNext(StandardPipeline.java:641)
>                 at 
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValv
> e.java:509)
>                 at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invokeNext(StandardPipeline.java:641)
>                 at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
>                 at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>                 at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEn
> gineValve.java:174)
>                 at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invokeNext(StandardPipeline.java:643)
>                 at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
>                 at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>                 at 
> org.apache.catalina.connector.http.HttpProcessor.process(HttpP
> rocessor.java:1040)
>                 at 
> org.apache.catalina.connector.http.HttpProcessor.run(HttpProce
> ssor.java:1151)
>                 at java.lang.Thread.run(Thread.java:534)
> 
> 
> Apache Cocoon 2.1.4-dev <http://cocoon.apache.org/>  
> 
> 
> 
> 
> > >2de question; I want the user to download the file, that
> > when teh user
> > >cliks the link, his browser opens a download dialog box so heb can 
> > >choose where to save the file.
> > >
> > >how do I do that?
> > 
> > To a large extent, that depends on the browser they're using
> > - for example, I have mine set to automatically download files to a 
> > specific folder without prompting.
> > 
> > More generally, though, if the browser has a plugin that can handle 
> > the returned mime type it will open it in that; otherwise it will 
> > download it.
> > There may also be a separate "download this link" option on the RMB 
> > popup menu to allow it to be saved rather than opened.
> > If you want to force files to be downloaded rather than handled by 
> > plugins, you could return application/octet-stream as the mime type 
> > instead of the actual value.
> 
> I use the following strategy, which should work for most browsers I
> believe:
> 
>                 <map:match pattern="download/*">
>        <map:act type="set-header">
>          <map:parameter name="Content-Type"
> value="application/x-download"/>
>          <map:parameter name="Content-Disposition" 
> value="attachment ; filename={1}"/>
> 
>          <map:read src="{global:datadir}{1}" />
>        </map:act>
>                 </map:match>
> 
> PS: {global:datadir} refers to a datadir element in 
> map:pipelines/map:component-configurations/global-variables
> 
> Kind regards,
> Geert
>   
> 
> Drs. G.P.H. Josten
> Consultant
> 
> 
> 
> Daidalos BV
> Source of Innovation
> Hoekeindsehof 1-4
> 2665  JZ  Bleiswijk
> Tel.: +31 (0) 10 850 1200
> Fax: +31 (0) 10 850 1199
> www.daidalos.nl
> KvK 27164984
> 
> 
> De informatie - verzonden in of met dit emailbericht - is 
> afkomstig van Daidalos BV en is uitsluitend bestemd voor de 
> geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, 
> verzoeken wij u het te verwijderen. Aan dit bericht kunnen 
> geen rechten worden ontleend.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 
> 

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


RE: link to a file

Posted by Roel Croonenberghs <Ro...@sofico.be>.
If I do that, i ge the following error;


Internal Server Error
Message: null
Description: java.lang.NullPointerException
Sender: org.apache.cocoon.servlet.CocoonServlet
Source: Cocoon Servlet
Request URI
download/test.pdf
cause
java.lang.NullPointerException
request-uri
/cocoontest/download/test.pdf
stacktrace
java.lang.NullPointerException
                 at 
org.apache.catalina.connector.ResponseBase.setContentType(ResponseBase.java:874)
                 at 
org.apache.catalina.connector.HttpResponseBase.setContentType(HttpResponseBase.java:853)
                 at 
org.apache.catalina.connector.ResponseFacade.setContentType(ResponseFacade.java:197)
                 at 
org.apache.cocoon.environment.http.HttpResponse.setContentType(HttpResponse.java:214)
                 at 
org.apache.cocoon.environment.http.HttpEnvironment.setContentType(HttpEnvironment.java:216)
                 at 
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setupReader(AbstractProcessingPipeline.java:583)
                 at 
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.preparePipeline(AbstractProcessingPipeline.java:515)
                 at 
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:479)
                 at 
org.apache.cocoon.components.treeprocessor.sitemap.ReadNode.invoke(ReadNode.java:119)
                 at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84)
                 at 
org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode.invoke(ActTypeNode.java:176)
                 at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84)
                 at 
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:165)
                 at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
                 at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:163)
                 at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
                 at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:152)
                 at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:354)
                 at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:307)
                 at org.apache.cocoon.Cocoon.process(Cocoon.java:656)
                 at 
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1112)
                 at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
                 at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
                 at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
                 at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
                 at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
                 at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
                 at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
                 at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                 at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
                 at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
                 at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
                 at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
                 at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
                 at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
                 at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
                 at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                 at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
                 at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                 at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
                 at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                 at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
                 at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
                 at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
                 at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
                 at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
                 at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
                 at 
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1040)
                 at 
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1151)
                 at java.lang.Thread.run(Thread.java:534)

Apache Cocoon 2.1.4-dev




> >2de question; I want the user to download the file, that 
> when teh user 
> >cliks the link, his browser opens a download dialog box so heb can 
> >choose where to save the file.
> >
> >how do I do that?
> 
> To a large extent, that depends on the browser they're using 
> - for example, I have mine set to automatically download 
> files to a specific folder without prompting.
> 
> More generally, though, if the browser has a plugin that can 
> handle the returned mime type it will open it in that; 
> otherwise it will download it. 
> There may also be a separate "download this link" option on 
> the RMB popup menu to allow it to be saved rather than opened.
> If you want to force files to be downloaded rather than 
> handled by plugins, you could return application/octet-stream 
> as the mime type instead of the actual value.

I use the following strategy, which should work for most browsers I
believe:

                 <map:match pattern="download/*">
        <map:act type="set-header">
          <map:parameter name="Content-Type"
value="application/x-download"/>
          <map:parameter name="Content-Disposition" value="attachment ;
filename={1}"/>

          <map:read src="{global:datadir}{1}" />
        </map:act>
                 </map:match>

PS: {global:datadir} refers to a datadir element in
map:pipelines/map:component-configurations/global-variables

Kind regards,
Geert
 
 
Drs. G.P.H. Josten
Consultant
 
 

Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665  JZ  Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
www.daidalos.nl
KvK 27164984


De informatie - verzonden in of met dit emailbericht - is afkomstig van 
Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit 
bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan 
dit bericht kunnen geen rechten worden ontleend.

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



RE: link to a file

Posted by Geert Josten <ge...@daidalos.nl>.
> >2de question; I want the user to download the file, that 
> when teh user 
> >cliks the link, his browser opens a download dialog box so heb can 
> >choose where to save the file.
> >
> >how do I do that?
> 
> To a large extent, that depends on the browser they're using 
> - for example, I have mine set to automatically download 
> files to a specific folder without prompting.
> 
> More generally, though, if the browser has a plugin that can 
> handle the returned mime type it will open it in that; 
> otherwise it will download it.  
> There may also be a separate "download this link" option on 
> the RMB popup menu to allow it to be saved rather than opened.
> If you want to force files to be downloaded rather than 
> handled by plugins, you could return application/octet-stream 
> as the mime type instead of the actual value.

I use the following strategy, which should work for most browsers I
believe:

	<map:match pattern="download/*">
        <map:act type="set-header">
          <map:parameter name="Content-Type"
value="application/x-download"/>
          <map:parameter name="Content-Disposition" value="attachment ;
filename={1}"/>

          <map:read src="{global:datadir}{1}" />
        </map:act>
	</map:match>

PS: {global:datadir} refers to a datadir element in
map:pipelines/map:component-configurations/global-variables

Kind regards,
Geert
   
 
Drs. G.P.H. Josten
Consultant
 
 

Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665  JZ  Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
www.daidalos.nl
KvK 27164984


De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.

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


RE: link to a file

Posted by Andrew Stevens <at...@hotmail.com>.
>From: Roel Croonenberghs <Ro...@sofico.be>
>Date: Tue, 26 Sep 2006 17:02:23 +0200
>
>2de question; I want the user to download the file, that when teh user
>cliks the link, his browser opens a download dialog box so heb can choose
>where to save the file.
>
>how do I do that?

To a large extent, that depends on the browser they're using - for example, 
I have mine set to automatically download files to a specific folder without 
prompting.

More generally, though, if the browser has a plugin that can handle the 
returned mime type it will open it in that; otherwise it will download it.  
There may also be a separate "download this link" option on the RMB popup 
menu to allow it to be saved rather than opened.
If you want to force files to be downloaded rather than handled by plugins, 
you could return application/octet-stream as the mime type instead of the 
actual value.


Andrew.

>
>
>
>
>"Andrew Stevens" <at...@hotmail.com>
>26/09/2006 16:23
>Please respond to
>users@cocoon.apache.org
>
>
>To
>users@cocoon.apache.org
>cc
>
>Subject
>RE: link to a file
>
>
>
>
>
>
> >From: Roel Croonenberghs <Ro...@sofico.be>
> >Date: Tue, 26 Sep 2006 16:12:28 +0200
> >
> >Hello,
> >
> >I have a dir in my WEB_INF folder where users can upload there files.
>That
> >works. But I want these files to be available for download. so I use a
> >directory generator;
> ><map:generate type="directory" src="\WEB-INF\files\download">
> >
> >and I transform the result via xsl to produce a html with the links to
> >these files.
> >
> >But what should I put in the href"" tag of a file? Because instead of
> >letting the user download the file, cocoon tries to resolve the url in
>the
> >sitemap.
>
>Well, if they're under WEB-INF you won't be able to link directly to them
>anyway since the spec says web containers shouldn't serve up files under
>there.  You don't say what URL you're matching on to get the directory
>listing, but assuming it's something like <map:match pattern="mydir"> then
>
>you could just use relative links in the generated hrefs and add
><map:match pattern="mydir/*">
><map:read src="\WEB-INF\files\download\{1}"/>
></map:match>
>to your sitemap.  Depending on the filetypes you may also need to match
>based on the extension and supply the relevant mime-type attributes on the
>
>map:read elements.
>
>
>Andrew.



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


RE: link to a file

Posted by Roel Croonenberghs <Ro...@sofico.be>.
2de question; I want the user to download the file, that when teh user 
cliks the link, his browser opens a download dialog box so heb can choose 
where to save the file.


how do I do that?




"Andrew Stevens" <at...@hotmail.com> 
26/09/2006 16:23
Please respond to
users@cocoon.apache.org


To
users@cocoon.apache.org
cc

Subject
RE: link to a file






>From: Roel Croonenberghs <Ro...@sofico.be>
>Date: Tue, 26 Sep 2006 16:12:28 +0200
>
>Hello,
>
>I have a dir in my WEB_INF folder where users can upload there files. 
That
>works. But I want these files to be available for download. so I use a
>directory generator;
><map:generate type="directory" src="\WEB-INF\files\download">
>
>and I transform the result via xsl to produce a html with the links to
>these files.
>
>But what should I put in the href"" tag of a file? Because instead of
>letting the user download the file, cocoon tries to resolve the url in 
the
>sitemap.

Well, if they're under WEB-INF you won't be able to link directly to them 
anyway since the spec says web containers shouldn't serve up files under 
there.  You don't say what URL you're matching on to get the directory 
listing, but assuming it's something like <map:match pattern="mydir"> then 

you could just use relative links in the generated hrefs and add
<map:match pattern="mydir/*">
<map:read src="\WEB-INF\files\download\{1}"/>
</map:match>
to your sitemap.  Depending on the filetypes you may also need to match 
based on the extension and supply the relevant mime-type attributes on the 

map:read elements.


Andrew.



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



RE: link to a file

Posted by Andrew Stevens <at...@hotmail.com>.
>From: Roel Croonenberghs <Ro...@sofico.be>
>Date: Tue, 26 Sep 2006 16:12:28 +0200
>
>Hello,
>
>I have a dir in my WEB_INF folder where users can upload there files. That
>works. But I want these files to be available for download. so I use a
>directory generator;
><map:generate type="directory" src="\WEB-INF\files\download">
>
>and I transform the result via xsl to produce a html with the links to
>these files.
>
>But what should I put in the href"" tag of a file? Because instead of
>letting the user download the file, cocoon tries to resolve the url in the
>sitemap.

Well, if they're under WEB-INF you won't be able to link directly to them 
anyway since the spec says web containers shouldn't serve up files under 
there.  You don't say what URL you're matching on to get the directory 
listing, but assuming it's something like <map:match pattern="mydir"> then 
you could just use relative links in the generated hrefs and add
<map:match pattern="mydir/*">
<map:read src="\WEB-INF\files\download\{1}"/>
</map:match>
to your sitemap.  Depending on the filetypes you may also need to match 
based on the extension and supply the relevant mime-type attributes on the 
map:read elements.


Andrew.



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


link to a file

Posted by Roel Croonenberghs <Ro...@sofico.be>.
Hello,

I have a dir in my WEB_INF folder where users can upload there files. That 
works. But I want these files to be available for download. so I use a 
directory generator;
<map:generate type="directory" src="\WEB-INF\files\download">

and I transform the result via xsl to produce a html with the links to 
these files.

But what should I put in the href"" tag of a file? Because instead of 
letting the user download the file, cocoon tries to resolve the url in the 
sitemap.

tnx

Roel