Re: [api-dev] Impossible to close a Base document

2006-03-15 Thread Mathias Bauer
Frank Schönheit - Sun Microsystems Germany wrote: That's why it's hard to tell who has the ownership of the document. If it were the frame (opened by the user), and the frame would close it, then the script would break. If it were the script, and the script would close the doc, then the frame

Re: [api-dev] Impossible to close a Base document

2006-03-15 Thread Frank Schönheit - Sun Microsystems Germa ny
Hi Mathias, I think that this is an API misuse. A view never should veto closing the document and in fact all other documents in OOo will not behave this way. It doesn't matter how the view was created. After reading the DevGuide chapter about closing documents (to which Bernard pointed me),

Re: [api-dev] Impossible to close a Base document

2006-03-14 Thread Frank Schönheit - Sun Microsystems Germa ny
Hi Bernard, ... dbDoc.close(True) The document usine.odb shows up, but the close instruction receives an exception. what kind of exception? Ciao Frank -- - Frank Schönheit, Software Engineer [EMAIL PROTECTED] - - Sun Microsystems

Re: [api-dev] Impossible to close a Base document

2006-03-14 Thread Laurent Godard
Hi Frank I reproduced the problem ... dbDoc.close(True) The document usine.odb shows up, but the close instruction receives an exception. what kind of exception? com.sun.star.util.CloseVetoException Laurent -- Laurent Godard [EMAIL PROTECTED] - Ingénierie OpenOffice.org Indesko

Re: [api-dev] Impossible to close a Base document

2006-03-14 Thread Frank Schönheit - Sun Microsystems Germa ny
Hi Laurent, com.sun.star.util.CloseVetoException That's okay :), and it was a bug that this exception wasn't thrown before. (Hmm. Thinking about it, do the other document types behave the same way?) The idea is that as long as a view to the document exists, you cannot close the document - the

Re: [api-dev] Impossible to close a Base document

2006-03-14 Thread Frank Schönheit - Sun Microsystems Germa ny
Hi Laurent, dbdoc.currentController.Frame.close(false) any reason you used false here? This means that if the close fails, you're still responsible for it ... Ciao Frank -- - Frank Schönheit, Software Engineer [EMAIL PROTECTED] - - Sun Microsystems

Re: [api-dev] Impossible to close a Base document

2006-03-14 Thread Frank Schönheit - Sun Microsystems Germa ny
Hi Laurent, hum, the method of the object that created it is called so there is a way to know that we want to close the views dependanding of it are you saying taht views are not attached to their creators ? They're bound to the model, but that's not necessarily the same as creator. For

Re: [api-dev] Impossible to close a Base document

2006-03-14 Thread Laurent Godard
Hi Frank They're bound to the model, but that's not necessarily the same as creator. yes For instance, you could load a model without any view, by retrieving the DataSource at the DatabaseContext (getByName( URL ) ), and asking this DataSource for its Document (.getDatabaseDocument). In

Re: [api-dev] Impossible to close a Base document

2006-03-14 Thread Bernard Marcelly
Bonjour Frank Message du 2006-03-14 09:59: Hi Laurent, com.sun.star.util.CloseVetoException That's okay :), and it was a bug that this exception wasn't thrown before. (Hmm. Thinking about it, do the other document types behave the same way?) No. If I load a text document for example, no

Re: [api-dev] Impossible to close a Base document

2006-03-14 Thread Frank Schönheit - Sun Microsystems Germa ny
Hi Laurent, Would it be possible to identify controllers that are loaded by different ways ? Hmm, not that I know. Basically, a controller is (almost) always loaded by a loadComponentFromURL, but nobody knows who called this method. Ciao Frank -- - Frank Schönheit, Software Engineer

Re: [api-dev] Impossible to close a Base document

2006-03-14 Thread Frank Schönheit - Sun Microsystems Germa ny
Hi Bernard, No. If I load a text document for example, no problem to close it. ... The idea is that as long as a view to the document exists, you cannot close the document - the view will veto is. This is not the case for documents other than odb. Hmm. Do you mind submitting an issue for

Re: [api-dev] Impossible to close a Base document

2006-03-14 Thread Frank Schönheit - Sun Microsystems Germa ny
Hi Laurent, in fact, what about the datasource that seems to load the file without displaying it as frank said We then end with 2 loads of the document one for the datasource ( maSource.DatabaseDocument) one for the loadComponentFromURL Effectively, it's loaded once only, but you have

Re: [api-dev] Impossible to close a Base document

2006-03-14 Thread Bernard Marcelly
Bonjour Frank Message du 2006-03-14 12:37: Hi Laurent, in fact, what about the datasource that seems to load the file without displaying it as frank said We then end with 2 loads of the document one for the datasource ( maSource.DatabaseDocument) one for the loadComponentFromURL

Re: [api-dev] Impossible to close a Base document

2006-03-14 Thread Laurent Godard
Hi Bernard, In the original code, I can understand that, although it is not obvious. But if I directly load the odb file, I still get the same exception the datasource is loaded to be accessed so you end with the same previous case i guess this is the difference with other document types :

Re: [api-dev] Impossible to close a Base document

2006-03-14 Thread Laurent Godard
Hi bernard Bernard Marcelly a écrit : Bonjour Frank Message du 2006-03-14 12:33: Hmm. Do you mind submitting an issue for this (and assigning it to me)? Not sure how it could be solved, since database documents are a little bit different (as you can obtain them without loading, via the

Re: [api-dev] Impossible to close a Base document

2006-03-14 Thread Frank Schönheit - Sun Microsystems Germa ny
Hi Bernard, Issue filed : http://www.openoffice.org/issues/show_bug.cgi?id=63162 Thanks. Ciao Frank -- - Frank Schönheit, Software Engineer [EMAIL PROTECTED] - - Sun Microsystems http://www.sun.com/staroffice - - OpenOffice.org Database

[api-dev] Impossible to close a Base document

2006-03-13 Thread Bernard Marcelly
Hi developers, I would like to have your opinion on a code which was working with 1.9 and does not work in 2.0.1 and 2.0.2. Operating System is Win XP SP2 Home. I can open a Base document, but it is impossible to close it by API : com.sun.star.util.CloseVotoException Dim monDbContext As