cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conal Tuohy" <con...@paradise.net.nz>
Subject RE: MS Word Transformer
Date Tue, 12 Aug 2003 22:02:10 GMT
You don't need to use special "Office" CSS - you can just serve an ordinary
HTML page, with an ordinary CSS, embedded or linked, and Word will interpret
it. The key is just to serialise the file with a mime-type of
"application/msword". To do this, add a serializer to the <map:serializers>
section of your sitemap and use it to serialise.

e.g.

<!-- serializer for producing HTML docs targeted at Microsoft Word -->
<map:serializer
	name="word-html"
	mime-type="application/msword"
	src="org.apache.cocoon.serialization.HTMLSerializer">
	logger="sitemap.serializer.html"
	pool-grow="4" pool-max="32" pool-min="4"
	<buffer-size>1024</buffer-size>
	<encoding>iso-8859-1</encoding>
	<indent>yes</indent>
</map:serializer>

Then in your pipeline:

<map:serialize type="word-html"/>

I also like to use the extension ".doc" for the URI since then if the user
saves the file locally it will remain associated with Word. Or you can use
".dochtml" because this is an extension which MSWord also registers in the
Windows registry, and which is perhaps more appropriate.

Cheers

Con

> -----Original Message-----
> From: Julian [mailto:cerebro70@yahoo.com]
> Sent: Wednesday, 13 August 2003 08:53
> To: users@cocoon.apache.org
> Subject: RE: MS Word Transformer
>
>
> Thanks all for the feedback.  I think I am going to
> use the jfor rtf serializer for now and leave it up to
> the user to create the doc file on save if desired.  I
> avoided the MS css markup b/c it obfuscates the file
> way too much; not to mention that I think these are
> built in stylesheets...I have never seen them work in
> Mozilla or Open Office.
>
> Thanks Again,
> Julian
>
> --- Steve Krulewitz <shooz@myrealbox.com> wrote:
> > > The same technique also works (with limits) for
> > Excel.  It has
> > > problems with graphics and can't do multiple
> > sheets, but... good to know
> > > anyway :)
> >
> > Yes, the main problem with this approach is that
> > sometimes a document is
> > saved using multiple HTML files.  For Excel, each
> > worksheet in a workbook
> > gets its own HTML file, and in Word, header and
> > footer information is saved
> > in a separate file as well.  I've had success
> > generating both a Word
> > document and its header file, storing the file on
> > the server, and
> > redirecting the client to the Word document -- and
> > Word will make the extra
> > HTTP request to load the header file.
> >
> > Maybe I'll try to get this working with Cocoon (I've
> > only done is previously
> > with ASP) and I can document it on a Wiki page.
> >
> > cheers,
> > -steve
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail:
> > users-help@cocoon.apache.org
> >
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message