Hi Iñaki, Jürgen,

Juergen Schmidt escribió:
Hi,

we have WebDAV support in OpenOffice.org and you can use loadComponentFromURL directly with a http URL to your file. You don't need something special. If your WebDAV server requires authentication then you have to use an appropriate interaction handler. Don't ask me which interaction handler, i know that we have one that is perfect for typical use cases but i always forget the name. But of course you can implement your own interaction handler.

As he is working in OOo Basic, can an interaction handler be implemented in OOo Basic? I'd think no...

He can instantiate (createUnoService) the css.task.InteractionHandler and pass it in the MediaDescriptor:

Sub Web_Dav_Test
        Dim sURL as String
sURL = "http://..."; 'according to the API ref. one can use simply the http schema
        
        Dim oInteractionHandler as Object
oInteractionHandler = createUnoService("com.sun.star.task.InteractionHandler")
        
        Dim aMediaDescriptor(0) as New com.sun.star.beans.PropertyValue
        aMediaDescriptor(0).Name = "InteractionHandler"
        aMediaDescriptor(0).Value = oInteractionHandler
        
        Dim oDoc as Object
oDoc = StarDesktop.loadComponentFromURL(sURL, "_default", 0, aMediaDescriptor)
End Sub

I didn't test if this works, so Iñaki do your test.
I *guess* that to store this, if your server requires authentification you'll need also to provide the user-password to store it.

Another option may be to assemble the URL with the com.sun.star.util.URLTransformer, including user and pasword in it, I've seen it in Paolo's BasicAddonBuilder.


Regards
Ariel.


HTTPS is supported since OO.or 2.4

Juergen


iñaki alonso wrote:
I use the 2.4 versión of openOffice on windows, I like to modify a document
wich I have allocated in my webdav server.
I can open this document but only in read only mode. I like to do this with
macros. I include my code.
*

**Sub Main*
*dim docServidor as object*
*dim Dummy()*
*dim oDesktop as object*

*oDesktop = createUnoService("com.sun.star.frame.Desktop")*
*docServidor =  oDesktop.loadComponentFromURL("vnd.sun.star.webdav://
127.0.0.1/uploads/usuario1.ods", "_blank", 0, Dummy)*

*docServidor.store()*
*End Sub


*
Thanks and best regards.



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




--
Ariel Constenla-Haile
La Plata, Argentina

[EMAIL PROTECTED]
[EMAIL PROTECTED]

http://www.ArielConstenlaHaile.com.ar/ooo/



"Aus der Kriegsschule des Lebens
                - Was mich nicht umbringt,
        macht mich härter."
                Nietzsche Götzendämmerung, Sprüche und Pfeile, 8.

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

Reply via email to