cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <DHo...@csir.co.za>
Subject RE: pdf output in IE
Date Tue, 26 Oct 2004 06:01:00 GMT
Gary

Thanks - would you object if this was added as a "how to" page on
the wiki site?

Derek

>>> GSchultz@commerce.state.wi.us 2004/10/25 05:09:11 PM >>>
The RedirectMatch directive uses the mod_alias module. Our
implementation is
based on the information and samples provided at:
http://httpd.apache.org/docs-2.0/mod/mod_alias.html. We use a
combination of
the Alias directive and the RedirectMatch directive to achieve the
desired
result. 

We are running Apache 2.0.49, Tomcat 5.0.18, Cocoon 2.1.5.1 on a
Windows
2000 server.

First some background. Our web site is setup as a set a smaller sub
web
sites based on business division. To access information for our Safety
and
Buildings division, you access the sub web site SB. All Safety and
Buildings
web resources are accessed via a URL match
http://commerce.wi.gov/SB/SB-resource.xxx. The home page is accessed
through
http://commerce.wi.gov/SB.

All resources for the Commerce business division sub web sites reside
in a
directory for the business division. Continuing with the Safety and
Buildings example, the sub web site folder is SB. The SB sub web site
directory structure is:

SB 
   content
           xml flies (contains content that is transformed in Cocoon)
           images (contains images used in SB web pages)
           docs (contains documents linked to in SB web pages)
           
           
The directory structure for web content files may look like may look
c:/webresources/sb/content, with a directory structure for documents
looking
something like this c:/webresources/sb/content/docs.           
           
A web page link will reference a document in one of two ways, <a
href="SB-doc.pdf">SB PDF Doc</a> or <a href="docs/SB-doc.pdf">SB PDF
Doc</a>.


How to setup in Apache. Changes are made in the Apache configuration
file,
http.conf. There are two primary steps, create an alias for the docs
directory, than create a redirect match using the RedirectMatch
directive. 

Create the alias to look something like this. 

Alias /SBdocs "c:/webresources/sb/content/docs"


Create the RedirectMatch directive to look something like this:

RedirectMatch /SB/SB-(.*)\.pdf$ http://commerce.wi.gov/SBdocs/SB-$1.pdf



When someone requests a PDF document, for example, 

http://commerce.wi.gov/sb/SB-CommercialBuildingsXProductEvaluations200105-w.
pdf

Apache redirects the request to the aliased SBdocs web site which
references
the docs folder in the SB sub web site. 

This approach allows us to maintain all resources in a single
directory
structure for each business division sub web site, eliminating the need
to
maintain web sites for different resources.

I'm not sure if this can be done via Tomcat or Jetty.

Hopefully this helps describe our method for serving static content
outside
of Cocoon.

Gary T. Schultz
Web Technical Administrator / GIS Coordinator
Wisconsin Department of Commerce
6th Floor
P.O. Box 7970
Madison, WI 
1-608-266-1283

-----Original Message-----
From: Derek Hohls [mailto:DHohls@csir.co.za] 
Sent: Friday, October 22, 2004 12:53 AM
To: users@cocoon.apache.org 
Subject: RE: pdf output in IE


Gary

Is this a relatively simply task; if so, could you outline the steps
required - if not, perhaps you could point to a resource for 
learning how to do this.

Thanks
Derek

PS Any idea if this can be done via Tomcat or Jetty?

>>> GSchultz@commerce.state.wi.us 2004/10/21 08:20:24 PM >>>
We continue to experience problems with static content such as PDF
documents, Word files, and some images going through Cocoon. We have
started
using the redirect directive in Apache so that all PDF documents are
served
directly through Apache and avoid sending PDF documents through
Cocoon.
This
has solved our PDF problems in IE. We are in the process of
implementing
this for all static files, PDF Word, images etc. Cocoon will handle
transformation of XHTML content in our web publishing system template,
Apache will serve all static content. There is a noticeable
performance
increase when serving static files through Apache instead of Cocoon. 

Gary T. Schultz
Web Administrator / GIS Coordinator
Wisconsin Department of Commerce
201 W. Washington Ave.
Madison, WI 53707
608-266-1283

-----Original Message-----
From: J.Pietschmann [mailto:j3322ptm@yahoo.de] 
Sent: Thursday, October 21, 2004 12:07 PM
To: users@cocoon.apache.org 
Subject: Re: pdf output in IE


Gunter D'Hondt wrote:
> When using a plain servlet or jsp and outputting PDF (and setting
the

> response content type to pdf) and reading that in IE (not Mozilla,
NS, 
> ... ) a lot of problems can occur; this is becourse IE looks for the

> file extension to see which content type he should use (and not the
http 
> headers).
> 
> I was just wondering how this is done with Cocoon if your URL is for

> example "report" (so definitely without an extension) and in the
sitemap 
> you are using a reader to get the pdf from the filesystem and
setting

> the content type to pdf.

If you don't use anything which can be mistaken as an extension, IEx
uses the content-type to decide what to do with the content. If you've
got a dot in the last component of the URL, it depends whether the
string after the last dot is a a registered file extension in the
Windows registry.
There's still the problem that the content may be retrieved twice
or even three times.

> has Cocoon some workaround for this or does it have the same
problem?

Cocoon's mapping mechanism makes it is easy to use URLs ending
in .pdf for PDF content.

J.Pietschmann

---------------------------------------------------------------------
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 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.


---------------------------------------------------------------------
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 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.


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


Mime
View raw message