Re: [dev] OO 3.0, COM, loadComponentFromURL, readOnly ever .... :-(

2008-12-16 Thread Stephan Bergmann

On 12/15/08 20:44, Marten Feldtmann wrote:

| writerDocument |

writerDocument := aMSKOO desktop

loadComponentFromURL: 'file:///c:\test.odt' string
TargetFrameName: '_blank' string
SearchFlags: 0 long
Arguments: Array new.


The only thing that catches my eye is the wrong \ (vs. /) in the 
file URL (but I doubt that is of relevance here).


-Stephan

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] OO 3.0, COM, loadComponentFromURL, readOnly ever .... :-(

2008-12-16 Thread Marten Feldtmann

Stephan Bergmann schrieb:

On 12/15/08 20:44, Marten Feldtmann wrote:

| writerDocument |
writerDocument := aMSKOO desktop
loadComponentFromURL: 'file:///c:\test.odt' string
TargetFrameName: '_blank' string
SearchFlags: 0 long
Arguments: Array new.


The only thing that catches my eye is the wrong \ (vs. /) in the 
file URL (but I doubt that is of relevance here).



Wooow ! Amazing ! That was it !

Using 'file:///c:\test.odt' and it is opened readonly. Using 
'file:///c:/test.odt' and its working without problems !! I knew 
that it was not following the standard, but 2.4.x accepted it ...


Congratulations and many thanks !

On the other side: It works now but actually it seems a little suspect, 
that such a difference has such a strange impact on the working model 
... perhaps it would be better so throw an exception ..


But ok it's working now  and I updated my issue

Marten Feldtmann

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] OO 3.0, COM, loadComponentFromURL, readOnly ever .... :-(

2008-12-15 Thread Mikhail Voitenko

Hi Marten,

As Mathias has written it would really help if you provide the code 
snippet related to parameters generation of the call. There is currently 
no known problem in this area, thus the scenario you are using should 
have a specific that let the problem be reproducible. And to detect what 
goes wrong we need a possibility to reproduce the problem.


Best regards,
Mikhail.

On 12/13/08 22:21, Marten Feldtmann wrote:

Ok, I did some further tests:

a) deinstalled the 3.0.0 and installed the newest developer
   build - same error.

b) deinstalled the developer build and installed OO 2.4.1
   and my software worked without problems 

It's not a feature ... perhaps just a nasty little bug in the
OLE bridge ???

Marten

Mathias Bauer schrieb:

Marten Feldtmann wrote:

 
I did some tests with that API call and whatever I do: the document 
is always opened readOnly.


- when I open the document using OpenOffice 3.0 via dialog, the 
document opens the normal way: writeable

- when using the API call I always get a write protected document
- when I use the property ReadOnly and do set it to true I get a 
write protected document (thats ok ...)
- when I use the property ReadOnly and do set it to false I get a 
VT_UNKNOWN value from the loadComponentFromURL call.


Then I thought, that perhaps the parameter handling was wrong and 
created an empty document (via factory) and used the attribute 
Hidden and that work well. Therefore I think, that my parameter 
handling seems to be correct.


Any idea ???



It would perhaps help if you posted a code snippet showing the
parameters you use and the call itself. Besides that the only idea I
have is that the document might be open already.

Regards,
Mathias

  



-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] OO 3.0, COM, loadComponentFromURL, readOnly ever .... :-(

2008-12-15 Thread Marten Feldtmann

Mikhail Voitenko schrieb:

Hi Marten,

As Mathias has written it would really help if you provide the code 
snippet related to parameters generation of the call. There is 
currently no known problem in this area, thus the scenario you are 
using should have a specific that let the problem be reproducible. And 
to detect what goes wrong we need a possibility to reproduce the problem.




Ok, here is the Smalltalk code I execute. The smallest code I can 
execute on the Smalltalk

side to get the error is:

| writerDocument |

writerDocument := 
	aMSKOO desktop

loadComponentFromURL: 'file:///c:\test.odt' string
TargetFrameName: '_blank' string
SearchFlags: 0 long
Arguments: Array new.

This code returns a valid OLE object (and opens a document), but the document is read-only. The file is 
indeed opened readonly - because not lock files are shown in this directory and I can open the file 
without problems via OpenOffice-application.


I could change the code to:

| writerDocument |

writerDocument := 
	aMSKOO desktop

loadComponentFromURL: 'file:///c:|test.odt' string
TargetFrameName: '_blank' string
SearchFlags: 0 long
Arguments: Array new.

and I get an exception with content 
   com.sun.star.lang.IllegalArgumentException: URL seems to be an unsupported one.


This shows, that the stuff is at least something doing.

Then I changed the code to actually use parameters: In this document I used the attribute 
Hidden
and I set it to true and this also worked very well. I get a valid OLE object 
back and the file seems
to be opened readonly but hidden:

| writerDocument aProperty  |

aProperty := OOBeansPropertyValue ooNew: aMSKOO.
aProperty
name: 'Hidden' ;
value: true.

	writerDocument := 
		aMSKOO desktop

loadComponentFromURL: 'file:///c:\test.odt' string
TargetFrameName: '_blank' string
SearchFlags: 0 long
Arguments: (Array with: aProperty).

^writerDocument

To verify that the boolean parameters are evaluated I change the last code to:

| writerDocument aProperty  |

aProperty := OOBeansPropertyValue ooNew: aMSKOO.
aProperty
name: 'Hidden' ;
value: false.

	writerDocument := 
		aMSKOO desktop

loadComponentFromURL: 'file:///c:\test.odt' string
TargetFrameName: '_blank' string
SearchFlags: 0 long
Arguments: (Array with: aProperty).

^writerDocument

and the document is opened visible again (readonly). Then I change the code 
(now we are coming to the ReadOnly
attribute) to:

| writerDocument aProperty  |

aProperty := OOBeansPropertyValue ooNew: aMSKOO.
aProperty
name: 'READONLY' ;
value: false.

	writerDocument := 
		aMSKOO desktop

loadComponentFromURL: 'file:///c:\test.odt' string
TargetFrameName: '_blank' string
SearchFlags: 0 long
Arguments: (Array with: aProperty).

^writerDocument

and the document is again opened visible readonly. The system does not 
recognize the 'READONLY' parameter - fine.Therefore
I change it to:

| writerDocument aProperty  |

aProperty := OOBeansPropertyValue ooNew: aMSKOO.
aProperty
name: 'ReadOnly' ;
value: false.

	writerDocument := 
		aMSKOO desktop

loadComponentFromURL: 'file:///c:\test.odt' string
TargetFrameName: '_blank' string
SearchFlags: 0 long
Arguments: (Array with: aProperty).

^writerDocument

On the lowest level side i get an object

*OSVariantarg {
vt: 13
wReserved1: 0
wReserved2: 0
wReserved3: 0
}

which is an pointer to an OSVariantarg structure. The 13 means VtUnknown. If I change the code to 



| writerDocument aProperty  |

aProperty := OOBeansPropertyValue ooNew: aMSKOO.
aProperty
name: 'ReadOnly' ;
value: true

	writerDocument := 
		aMSKOO desktop

loadComponentFromURL: 'file:///c:\test.odt' string
TargetFrameName: '_blank' string
SearchFlags: 0 long
Arguments: (Array with: aProperty).


Re: [dev] OO 3.0, COM, loadComponentFromURL, readOnly ever .... :-(

2008-12-13 Thread Marten Feldtmann

Ok, I did some further tests:

a) deinstalled the 3.0.0 and installed the newest developer
   build - same error.

b) deinstalled the developer build and installed OO 2.4.1
   and my software worked without problems 

It's not a feature ... perhaps just a nasty little bug in the
OLE bridge ???

Marten

Mathias Bauer schrieb:

Marten Feldtmann wrote:

  
I did some tests with that API call and whatever I do: the document is 
always opened readOnly.


- when I open the document using OpenOffice 3.0 via dialog, the document 
opens the normal way: writeable

- when using the API call I always get a write protected document
- when I use the property ReadOnly and do set it to true I get a write 
protected document (thats ok ...)
- when I use the property ReadOnly and do set it to false I get a 
VT_UNKNOWN value from the loadComponentFromURL call.


Then I thought, that perhaps the parameter handling was wrong and 
created an empty document (via factory) and used the attribute Hidden 
and that work well. Therefore I think, that my parameter handling seems 
to be correct.


Any idea ???



It would perhaps help if you posted a code snippet showing the
parameters you use and the call itself. Besides that the only idea I
have is that the document might be open already.

Regards,
Mathias

  



-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] OO 3.0, COM, loadComponentFromURL, readOnly ever .... :-(

2008-11-26 Thread Mikhail Voitenko

Hi Marten,

It looks pretty like as if the document was locked. Strange enough you 
can still open it in UI office. The only possible scenario with such 
behavior that I currently see is that the script uses a different office 
instance ( at least different user configuration ) than the UI OOo 
session, and the file is locked by UI OOo session. But that would be too 
easy probably.


Anyway, as the first step please check whether there is a hidden lock 
file in the target folder before executing the script ( it would be 
c:\esdb\.~lock.WriterWithContentIndex.odt# in case of provided example ).


If it is there, please check that the document is not opened by another 
instance of OOo.


Regards,
Mikhail.


On 11/25/08 23:24, Marten Feldtmann wrote:

Mathias Bauer schrieb:

It would perhaps help if you posted a code snippet showing the
parameters you use and the call itself. Besides that the only idea I
have is that the document might be open already.

Regards,
Mathias
  
I think, that might not be really helpful for you, because the code is 
basically done in Smalltalk and therefore, but actually the code looks 
like:


   | loadURL desktop writerDocument loadPropertyValues  |

   loadURL := 'file:///c:\esdb\WriterWithContentIndex.odt'.

   desktop :=
   aMSKOO serviceManager
   createInstance: OOCSSFrameDesktop starName.
 
   writerDocument :=

   desktop
   loadComponentFromURL: loadURL string
   TargetFrameName: '_blank' string
   SearchFlags: 0 long
   Arguments: Array new.


Actually I did the development within a XP-SP3 virtual machine hosted by 
VirtualBox under Linux. I tried the code above at my native XP-SP3 at 
work and I'm pretty glad to say, that it worked there without problems. 
I have to do further investigations what is going wrong here 


Marten

-
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]



Re: [dev] OO 3.0, COM, loadComponentFromURL, readOnly ever .... :-(

2008-11-24 Thread Mathias Bauer
Marten Feldtmann wrote:

 I did some tests with that API call and whatever I do: the document is 
 always opened readOnly.
 
 - when I open the document using OpenOffice 3.0 via dialog, the document 
 opens the normal way: writeable
 - when using the API call I always get a write protected document
 - when I use the property ReadOnly and do set it to true I get a write 
 protected document (thats ok ...)
 - when I use the property ReadOnly and do set it to false I get a 
 VT_UNKNOWN value from the loadComponentFromURL call.
 
 Then I thought, that perhaps the parameter handling was wrong and 
 created an empty document (via factory) and used the attribute Hidden 
 and that work well. Therefore I think, that my parameter handling seems 
 to be correct.
 
 Any idea ???

It would perhaps help if you posted a code snippet showing the
parameters you use and the call itself. Besides that the only idea I
have is that the document might be open already.

Regards,
Mathias

-- 
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to [EMAIL PROTECTED].
I use it for the OOo lists and only rarely read other mails sent to it.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[dev] OO 3.0, COM, loadComponentFromURL, readOnly ever .... :-(

2008-11-21 Thread Marten Feldtmann
I did some tests with that API call and whatever I do: the document is 
always opened readOnly.


- when I open the document using OpenOffice 3.0 via dialog, the document 
opens the normal way: writeable

- when using the API call I always get a write protected document
- when I use the property ReadOnly and do set it to true I get a write 
protected document (thats ok ...)
- when I use the property ReadOnly and do set it to false I get a 
VT_UNKNOWN value from the loadComponentFromURL call.


Then I thought, that perhaps the parameter handling was wrong and 
created an empty document (via factory) and used the attribute Hidden 
and that work well. Therefore I think, that my parameter handling seems 
to be correct.


Any idea ???

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]