OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

opening open office writer file in php

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
parab0481
Newbie
Newbie


Joined: 23 Apr 2004
Posts: 2

PostPosted: Fri Apr 23, 2004 1:47 am    Post subject: opening open office writer file in php Reply with quote

hi thr....

i want to open my open office writer file in web browser through php


can any one help me ? ?

_________________
parab0481
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Fri Apr 23, 2004 5:50 am    Post subject: Reply with quote

What is it that you wish to do? It is difficult to answer because your question specifies so little.

You make make the browser do the work, if it is so equipped. The browser needs to have an ActiveX control capable of viewing the Writer content. The browser needs to be configured so that when a file ".sxw" or mime type of application/vnd.sun.xml.writer is sent from the server, the browser will display the writer document in the browser window using the ActiveX control. OOo on Windows comes with an ActiveX control, and Internet Explorer is capable of using it. The drawbacks with this approach are...
1. Only works for Internet Explorer
2. The end user must have OOo installed, and installed the ActiveX control
The advantages are...
1. Simple server programming. Just send the Writer document, and in the HTTP headers make sure you indicate Content-Type: application/vnd.sun.xml.writer.

A different approach is to do a lot of server programming that works for any browser. Code running in the server takes apart the content of the Writer document and sends something else, let's say, plain HTML down to the browser.
The advantages of this approach are...
1. Works on any browser.
2. Browser does not need to have OOo installed
The disadvantages are...
1. more complex server programming is required

If you learn OOo's complex API, you can manipulate it in any language for which there is a UNO bridge. This means OOo's internal Basic language, or Java or Python. When OOo is installed on Windows, then in addition, there is an UNO bridge to COM/OLE so that any Windows language which can access a COM object can manipulate OOo. The Windows version of PHP can manipulate COM objects, and a successful example of doing this has been shown in the past. (Links below.)

If you are running PHP on Linux, then your best bet might be to call a Java object from PHP if that is possible, and then the Java program would manipiulate OOo's API to convert the Writer document into HTML so your PHP script could stream its contents to the browser.

Another possibility is for your PHP code not to manipulate OOo at all. No installed copy of OOo is required at the server. Simply realize that an OOo document is a ZIP file containing XML files. Inside of every writer file (if you unzip it) is a Content.xml file. Do whatever XML processing you require to transform this into suitable HTML. This is probably most easily done using an XSLT translation.



There has been some discussion of using PHP on Windows in the past.
http://www.oooforum.org/forum/viewtopic.php?t=3474
http://www.oooforum.org/forum/viewtopic.php?t=3530
http://www.oooforum.org/forum/viewtopic.php?t=3502

The MIME types for OOo documents are here....
http://www.oooforum.org/forum/viewtopic.php?t=4581
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
parab04811
Guest





PostPosted: Thu Apr 29, 2004 12:10 am    Post subject: opening open office writer file in php Reply with quote

hi ...

i am new to php ...

i am working on new project using php mysql...on linux9 with apachi server...

now my problem is ...
i want to open openoffice writer in web browser using php or
is it possible to open openoffice writer ... by giving command (in linux)?? ??

confusion .... Rolling Eyes Mad
Plz help ......
Back to top
smbrant
General User
General User


Joined: 19 Nov 2003
Posts: 13
Location: Belo Horizonte, Brazil

PostPosted: Mon May 10, 2004 11:46 am    Post subject: Reply with quote

wasn't it possible just to put an anchor like

<a href="WriterDoc.sxw">Click to see the document</a>

and let the browser do what it knows, e.g., if it can it shows the document, if not it ask if the user wants to save it?

[]s
Back to top
View user's profile Send private message Visit poster's website
parab04811
Guest





PostPosted: Wed Jul 14, 2004 11:33 pm    Post subject: opening open office writer file in php Reply with quote

thanks for u r valuable feedbak

my webfiles r in one flders and .sxw files in other folder which require (user name and password) now how can i open that file ?????
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> General Discussion All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group