Ariel Constenla-Haile wrote:
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.
probably no good idea to transport the username and password in the Url.
As i mentioned we have an interaction handler that handles this perfect. If authentication is required a password dialog come up and asks for the password. Alternatively ther password and username can be stored in the password container. The interaction handler looks into the password container and if a user and password for the specific Url is found it is used. Otherwise the password dialogs comes up. By the way the password container used a master password and the data is stored encrypted. This is quite nice and useful and you don't have to implement your own interaction handler. If you want UI interaction and want to use the file dialog, you can use the office filepicker and can initialize this filepicker with a preselected Url to access your WebDAV directory directly. The office file picker handles everything correct and of course use an appropriate interaction handler.
I will create a tutorial for that when i have time.

Juergen





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]






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

Reply via email to