Re: [dev] What happens during save?

2010-09-10 Thread Knut Olav Bøhmer
On 10 September 2010 09:43, Mathias Bauer nospamfor...@gmx.de wrote:

 On 09/02/2010 10:33 PM, Knut Olav Břhmer wrote:

  cut


 To fix this I need to know how OpenOffice.org saves the file. Does it
 create
 a temporary file, deletes the original file and then moves the temp file
 to
 the original file.


 OOo creates a temporary file, saves to it, truncates the original file and
 then streams the temporary file over it. This is the only way to preserve
 file access rights in every case.


  Or maybe someone has any idea on why the activeX component fails (probably
 difficult with so little information).


 Maybe the component recognizes the truncation but can't deal with the fact
 that OOo is still writing to the file.

 In general your attempt is very fragile. You should write an OOo extension
 that reacts on document events.


Thank you for answering.

This issue was fixed by removing all the fancy functionality from the
activeX component.
Luckily someone had access to the source code of the activeX component, and
fixed it. An OpenOffice.org extension would be the best solution in
stability and functionality, but these things are third party programs. So I
hope they ask me to write an OOo-ext.

Best regards
-- 
Knut Olav Bøhmer


[dev] What happens during save?

2010-09-02 Thread Knut Olav Bøhmer
Hi,

I'm working with an activeX component that does not work when used with
larges files in OpenOfice.org. When it takes more then two seconds to save
the file, it does not work. When it is less then two seconds to save the
file, it works most of the time.

The activeX component enables a user of a website to edit a document on the
website through other applications like OpenOffice.org.
The activeX component downloads the file to a temporary directory, and
starts the application used to edit the component. Then it polls every 2
seconds to see if the file file is changed and if the application is still
running.

When OpenOffice.org saves the file, the activeX component dies, and the
result file is not saved back to the webserver.

To fix this I need to know how OpenOffice.org saves the file. Does it create
a temporary file, deletes the original file and then moves the temp file to
the original file.

Or maybe someone has any idea on why the activeX component fails (probably
difficult with so little information).


-- 
Knut Olav Bøhmer