You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Joerg Heinicke <jo...@gmx.de> on 2004/07/01 00:07:09 UTC

Re: error with Window.open() in Cocoon

On 30.06.2004 21:17, Leona Slepetis wrote:

> I have a problem with Cocoon 2.1 that someone may have seen before.
> 
> I am trying to launch a window containing a pdf file, using the JavaScript
> Window.open() method.

> When I run this, I get an IE error saying that the site can't be found.

> If I use the same pipeline with mime-type="image/gif" and an image file,
> the JavaScript code works and opens a new window.
> 
> Does anyone know what is happening here? I know that I am getting to the
> same place in the sitemap by calling the URL directly or through the open()
> function,  It seems that certain mime types are not being handed off to the
> new window correctly.

Sounds strange but therefore you have logfiles. Set the log level to 
debug, and compare the requests when opening it via JS and typing it 
directly in core.log.

Joerg

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


Re: error with Window.open() in Cocoon

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Leona Slepetis wrote:
> I still would like to
> hear if anyone else has solved this, but I can live with the workaround for
> now.

Well, the lists keep repeating weird problems related to
content which IEx handles through COM extensions (GIFs are
handlend natively). I'd write this off as one of these
special IEx features.

J.Pietschmann

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


Re: error with Window.open() in Cocoon

Posted by Leona Slepetis <LS...@alliancetech.com>.





Joerg Heinicke <jo...@gmx.de> wrote on 07/01/2004 07:36:09 PM:

> On 01.07.2004 21:59, Leona Slepetis wrote:
>
>
> > So, in my sitemap, I have:
>  > <map:match type="regexp" pattern="files/daily_20040718.pdf">
>  >   <map:read mime-type="application/pdf"
>  >             src="file://Z:/daily_20040718.pdf"/>
> > </map:match>
> >
> > which causes the IE "Internet Explorer cannot download..." error. If
> > I change the mime-type to "image/gif" and use a .gif file, all is
> > well. I looked at the logs and see no errors, so I am wondering if it
> > has something to do with the reader for PDF, or perhaps the Cocoon
> > configuation. This code worked in Cocoon2.0.
>
> Shall it be the old PDF bug with relation to missing content-length
> header in IE??
>
> Joerg

I think you're right. I did a lot of research and came up with this
solution:

mywin = window.open("http://alliancetech.com/some_gif.gif", title, args);
mywin.location = ("http://alliancetech.com/files/daily_20040718.pdf");

The window is opened with a gif or something like a "Please wait..." page,
then the location call gets the pdf I'm really interested in. I still get
to take advantage of Cocoon for resolving my urls, but it adds an extra
step which, in my case, is not a serious problem. I still would like to
hear if anyone else has solved this, but I can live with the workaround for
now.

Thanks again.

Regards,
Leona


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


Re: error with Window.open() in Cocoon

Posted by Joerg Heinicke <jo...@gmx.de>.
On 01.07.2004 21:59, Leona Slepetis wrote:

>>> I have a problem with Cocoon 2.1 that someone may have seen
>>> before. I am trying to launch a window containing a pdf file,
>>> using the JavaScript Window.open() method.
>> 
>>> When I run this, I get an IE error saying that the site can't be
>>> found. If I use the same pipeline with mime-type="image/gif" and
>>> an image file, the JavaScript code works and opens a new window.
>>> 
>>> Does anyone know what is happening here? I know that I am getting
>>> to the same place in the sitemap by calling the URL directly or
>>> through the open() function,  It seems that certain mime types
>>> are not being handed off to the new window correctly.
>> 
>> Sounds strange but therefore you have logfiles. Set the log level
>> to debug, and compare the requests when opening it via JS and
>> typing it directly in core.log.
> 
> The problem here is that I want to use the sitemap to resolve the
> absolute path, rather than putting it directly in the JS call.

No, the browser does resolve the path for you if you open a window with 
javascript and a relative path. That's why I asked for the difference of 
the two requests as they should be exactly the same. If the relative 
path would not be resolved to an absolute one, you would not even get to 
Cocoon as there would be no host to send the request to.

> So, in my sitemap, I have:
 > <map:match type="regexp" pattern="files/daily_20040718.pdf">
 >   <map:read mime-type="application/pdf"
 >             src="file://Z:/daily_20040718.pdf"/>
> </map:match>
> 
> which causes the IE "Internet Explorer cannot download..." error. If
> I change the mime-type to "image/gif" and use a .gif file, all is
> well. I looked at the logs and see no errors, so I am wondering if it
> has something to do with the reader for PDF, or perhaps the Cocoon
> configuation. This code worked in Cocoon2.0.

Shall it be the old PDF bug with relation to missing content-length 
header in IE??

Joerg

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


Re: error with Window.open() in Cocoon

Posted by Leona Slepetis <LS...@alliancetech.com>.





Joerg Heinicke <jo...@gmx.de> wrote on 06/30/2004 05:07:09 PM:

> On 30.06.2004 21:17, Leona Slepetis wrote:
>
> > I have a problem with Cocoon 2.1 that someone may have seen before.
> >
> > I am trying to launch a window containing a pdf file, using the
JavaScript
> > Window.open() method.
>
> > When I run this, I get an IE error saying that the site can't be found.
>
> > If I use the same pipeline with mime-type="image/gif" and an image
file,
> > the JavaScript code works and opens a new window.
> >
> > Does anyone know what is happening here? I know that I am getting to
the
> > same place in the sitemap by calling the URL directly or through the
open()
> > function,  It seems that certain mime types are not being handed off to
the
> > new window correctly.
>
> Sounds strange but therefore you have logfiles. Set the log level to
> debug, and compare the requests when opening it via JS and typing it
> directly in core.log.
>
> Joerg

The problem here is that I want to use the sitemap to resolve the absolute
path, rather than putting it directly in the JS call.

So, in my sitemap, I have:
<map:match type="regexp" pattern="files/daily_20040718.pdf">
  <map:read mime-type="application/pdf" src="file://Z:/daily_20040718.pdf"
/>
</map:match>

which causes the IE "Internet Explorer cannot download..." error. If I
change the mime-type to "image/gif" and use a .gif file, all is well. I
looked at the logs and see no errors, so I am wondering if it has something
to do with the reader for PDF, or perhaps the Cocoon configuation. This
code worked in Cocoon2.0.

Thanks again for any help.

Regards,
Leona


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