Hi Benjamin,
Sorry, but editing of a document is not allowed if it is already edited
by the office. I assume that you could reach it since OOo3.0.x does not
use system file locking, so the document file can be edited in parallel.
This is actually the reason why OOo3.1 supports the system file locking
as well now, to prevent such situations.
The problem with ".uno:CloseDoc" and XCloseable sounds strange. Could
you please provide more information regarding how you are using the API.
Best regards,
Mikhail.
On 06/05/09 13:06, [email protected] wrote:
Quoting Mathias Bauer <[email protected]>:
Benjamin Vollmer wrote:
Hello,
I work on an extension where in some cases the opened document is
updated externally. So I have to reload my document.
In a snippet I found this way:
PropertyValue[] aLoadProps = new PropertyValue[0];
// reload current document
xComponentLoader.loadComponentFromURL(this.xFrame.getController().getModel().getURL(),
"_self", 0, aLoadProps);
But in my context this snippet doesn't work. Under Ubuntu nothing
happens when the code is executed, under Windows there occurs an UNO
Runtime Error. At the moment I reload the file manually over File ->
Reload. This works but it is not really a solution.
What is the right way to reload a document via API?
You can use the Dispatch API to achieve that. The command you have to
dispatch at the documents' frame is ".uno:Reload".
Unfortunately the solution with ".uno:Reload" does not work anymore
since OO.org 3.1 was released. Under Windows I cannot update the
opened document externally because it is locked. I need a workaround
with close and then reopen the document. Is there also a Dispatch API
command for close? I found ".uno:CloseDoc", but it doesn't work as
aspected. Nothing happens when I use ".uno:CloseDoc" instead of
".uno:Reload".
I also found the interface xClosable
(http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/Closing_Documents#XCloseable),
but I had no success with the usage. Under Ubuntu OpenOffice crashes
with the sample code, under Windows the code closes the document but
also all other visible OpenOffice components.
regards
Benjamin
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]