[dev] Re: basic macro to uno package
Thank Daniel for your help. Now I got the package working! I have followed the guidelines from "Add On Tool" from http://www.ooomacros.org/dev.php Now I have created my own addon which can be installed to OOo. The last question is how to assign the macro from the addon to some OOo document event automatically. I do not want to bother users to do this manually (mostly they are not capable doing such things). Thanks for any hints Ales - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] basic macro to uno package
Hi, can anybody give me a hint how to create an uno package? I have small basic macro attached to "document close event" and I want to create uno package with this macro. The purpose of doing this is that our Delphi application is cooperating with OOo and when our app is installed on a system, we need to install this package to existing OOo installation (it means force OOo to use this macro and beeing it attached to the close document event). Thak you in advance. Ales - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] basic macro to uno package
Hi, can anybody give me a hint how to create an uno package? I have small basic macro attached to "document close event" and I want to create uno package with this macro. The purpose of doing this is that our Delphi application is cooperating with OOo and when our app is installed on a system, we need to install this package to existing OOo installation (it means force OOo to use this macro and beeing it attached to the close document event). Thak you in advance. Ales - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] Re: Writer allows deleting opened file while saving
Mathias Bauer wrote: As it seems you don't apply any modifications to the Ooo installation, but you deliver your application to your users, right? Do they have to execute a setup for this? You could deliver the macro or component mentioned above as a UNO package and integrate it into your installation so that no user needs to do anything manually. Best regards, Mathias Yes, this sounds sensible. We will try to do this. Again - many thanks. Ales - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] Re: Writer allows deleting opened file while saving
Mathias Bauer wrote: Ales Kahanek wrote: I have found this: "In OpenOffice.org API the Listener mechanism is used to add a handler for a specific event. This is not possible from Delphi because the COM bridge does not support call-back primitives necessary for that purpose." Now, as we use Delphi, this is not the right way for us. Is there another approach how to get know, when the file edited in OOo is closed? The next best thing that comes to my mind is writing an OOo Basic macro, binding it to the events "Save/SavesAsDone" and call native code from inside the basic macro that notifies your application. Native code in DLLs (C linkage) can be called by defining the exported function as a Basic function. Best regards, Mathias Thank you Mathias for your help. This could be a solution, we could write some macros, but it requires to deliver a explain to everybody who wants to use OOo with our app that he has to apply this macro to his/her OOo instalation. If the user overlooked this information, it wouldn´t work correctly. What do you think about following solution built in the standard OOo instalation: when starting saving document OOo will create a very small file (only a several bytes) with name corresponding with the original file and remove this temporary file after saving is finished. Then the existence of such file could be checked. Thank again for your hints Ales Kahanek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] Re: Writer allows deleting opened file while saving
I have found this: "In OpenOffice.org API the Listener mechanism is used to add a handler for a specific event. This is not possible from Delphi because the COM bridge does not support call-back primitives necessary for that purpose." Now, as we use Delphi, this is not the right way for us. Is there another approach how to get know, when the file edited in OOo is closed? Thanks for any hints. Ales Kahanek Mathias Bauer wrote: Ales Kahanek wrote: If you placed a listener in every open document you would get notifications when they are closed This sounds good, could you, please, point me to the right direction about listener? Are there some documents or info how to do this? Our Developers Guide contains a chapter about it. Do you have some code integrated into OOo already? How do people access your database? Best regards, Mathias - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] Re: Writer allows deleting opened file while saving
Mathias Bauer wrote: > Relying on the "locked" state of a file IMHO is a hack (sorry). But Yes, I know that this is not the best way, but there are many applications that do their job in many different ways and if the "check if the process is active" scenario fails, then this is may be the last possibility. If you placed a listener in every open document you would get notifications when they are closed This sounds good, could you, please, point me to the right direction about listener? Are there some documents or info how to do this? Best regards, Mathias Thank you very much for your answers. Best regards Ales - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] Writer allows exclusive access to opened file while saving!
Hi, there is a problem with OO Writer when saving document. I would really appreciate any hints: we are developing document management system, the document (files) are stored in a database. When user wants to edit the file, it is extracted from database to disk and then external application is called to open the file. Then user makes changes to this document and closes the application. The key point is to know, when user has finished editing the file and copy it back to database. Mostly we start the external process and periodically check if it is active. If not, we know that editing has finished. This is not possible with OO, as then process is still running when another file is opened in another OO window. The process seems to be the same for all OO windows. With such applications we do another approach: we try periodically to get ShareExclusive access to this file. If the request is rejected, we know that the file is still opened and edited. And here is the problem with Writer - when you save the file in Writer, there is a short period of time, when the the exclusive access to the file can be obtained and more, the file can be even DELETED. There is an important point to know: this behaviour can be reproduced when the OO QuickStarter is running (I do not know if this could have any impact on it). Also when comparing to MS Word or Excel, trying to get exclusive access to the file works fine. Word or Excel does not release the "lock" from the file until the file is closed. What do you think about it? How can I know, when the file opened by Writer was closed? Or better - shouldn´t this behaviour be changed not to release the file access "lock"? Thank you very much for any hint. If this is wrong group, please, point me to the right place. Ales Kahanek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] Writer allows deleting opened file while saving
Hi, there is a problem with OO Writer when saving document. I would really appreciate any hints: we are developing document management system, the document (files) are stored in a database. When user wants to edit the file, it is extracted from database to disk and then external application is called to open the file. Then user makes changes to this document and closes the application. The key point is to know, when user has finished editing the file and copy it back to database. Mostly we start the external process and periodically check if it is active. If not, we know that editing has finished. This is not possible with OO, as then process is still running when another file is opened in another OO window. The process seems to be the same for all OO windows. With such applications we do another approach: we try periodically to get ShareExclusive access to this file. If the request is rejected, we know that the file is still opened and edited. And here is the problem with Writer - when you save the file in Writer, there is a short period of time, when the the exclusive access to the file can be obtained and more, the file can be even DELETED. There is an important point to know: this behaviour can be reproduced when the OO QuickStarter is running (I do not know if this could have any impact on it). Also when comparing to MS Word or Excel, trying to get exclusive access to the file works fine. Word or Excel does not release the "lock" from the file until the file is closed. What do you think about it? How can I know, when the file opened by Writer was closed? Or better - shouldn´t this behaviour be changed not to release the file access "lock"? Thank you very much for any hint. If this is wrong group, please, point me to the right place. Ales Kahanek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]