3 messages in org.openoffice.fr.progRe: [prog] Re: Sauvegarder via webdav
FromSent OnAttachments
Philippe AllartSep 15, 2008 7:40 am 
AladdinSep 16, 2008 12:55 am 
Philippe AllartSep 16, 2008 4:02 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [prog] Re: Sauvegarder via webdavActions...
From:Philippe Allart (pall@cudl-lille.fr)
Date:Sep 16, 2008 4:02:55 am
List:org.openoffice.fr.prog

Bonjour à tous,

Ooops! merci, j'aurais du quand même chercher dans les issues.

Ca marche... presque.

Voici mon code basic:

---------------------------------------------------- ' ' Sauvegarde sur un serveur WebDav au format PDF '

dim propfichPDF(1) as New com.sun.star.beans.PropertyValue propfichPDF(0).Name = "InteractionHandler" iHandler = createUnoService("com.sun.star.task.InteractionHandler") propfichPDF(0).Value = iHandler

propfichPDF(1).Name = "FilterName" propfichPDF(1).Value = "writer_pdf_Export" monDocument.StoreToURL(nomPDF, propfichPDF())

' ' Sauvegarde sur un serveur WebDav au format ODT '

dim propfichODT(0) as New com.sun.star.beans.PropertyValue propfichODT(0).Name = "InteractionHandler" iHandler = createUnoService("com.sun.star.task.InteractionHandler") propfichODT(0).Value = iHandler monDocument.StoreToURL(nomODT, propfichODT())

----------------------------------------------

La première sauvegarde se passe bien, la seconde plante. A tout hasard j'ai créé un second InteractiveHandler, parce que la doc développeur interdit de le conserver.

Ce qui parait bizarre, c'est la log, côté serveur:

---------------------------------------------- 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "OPTIONS /office/GED/Arrete01.pdf HTTP/1.1" 200 - "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "PROPFIND /office/GED/Arrete01.pdf HTTP/1.1" 404 221 "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "PUT /office/GED/Arrete01.pdf HTTP/1.1" 201 196 "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "PROPFIND /office/GED/Arrete01.pdf HTTP/1.1" 207 492 "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "OPTIONS /office/GED/Arrete01.odt HTTP/1.1" 200 - "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "PROPFIND /office/GED/Arrete01.odt HTTP/1.1" 404 221 "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "OPTIONS /office/GED/Arrete01.odt HTTP/1.1" 200 - "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "PROPFIND /office/GED/Arrete01.odt HTTP/1.1" 404 221 "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "OPTIONS /office/GED/Arrete01.odt HTTP/1.1" 200 - "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "PROPFIND /office/GED/Arrete01.odt HTTP/1.1" 404 221 "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "OPTIONS /office/GED/Arrete01.odt HTTP/1.1" 200 - "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "PROPFIND /office/GED/Arrete01.odt HTTP/1.1" 404 221 "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "LOCK /office/GED/Arrete01.odt HTTP/1.1" 200 400 "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "GET /office/GED/Arrete01.odt HTTP/1.1" 404 221 "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "OPTIONS /office/GED/Arrete01.odt HTTP/1.1" 200 - "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "PROPFIND /office/GED/Arrete01.odt HTTP/1.1" 207 374 "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "PROPFIND /office/GED/Arrete01.odt HTTP/1.1" 207 293 "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "PROPFIND /office/GED/Arrete01.odt HTTP/1.1" 207 510 "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "PROPFIND /office/GED/Arrete01.odt HTTP/1.1" 207 372 "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "PROPFIND /office/GED/Arrete01.odt HTTP/1.1" 207 1068 "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "GET /office/GED/Arrete01.odt HTTP/1.1" 404 221 "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "GET /office/GED/Arrete01.odt HTTP/1.1" 404 221 "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "OPTIONS /office/GED/ HTTP/1.1" 200 - "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "PROPFIND /office/GED/ HTTP/1.1" 207 314 "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "COPY /office/GED/Arrete01.odt HTTP/1.1" 404 221 "-" "-" 150.1.13.168 - - [16/Sep/2008:11:21:51 +0200] "UNLOCK /office/GED/Arrete01.odt HTTP/1.1" 204 - "-" "-"

---------------------------------------------------------------

La sauvegarde en PDF se fait en trois accès seulement, avec une commande PUT, alors que la sauvegarde en odt déclenche plein d'accès, qui se terminent mal. En fait tout se déroule exactement comme lorsqu'il n'y avait pas d'InteractiveHandler.

Je n'ai pas renseigné le FilterName pour odt, parce que ce format est sélectionné par défaut. Mais j'ai essayé aussi avec FilterName=writer8, et ça fait la même chose.

Finalement j'ai remplacé la dernière ligne de code par les suivantes:

dim propfich() dim nomTemp as string nomTemp = ConvertToURL("/tmp/toto.odt") monDocument.StoreAsURL(nomTemp, propfich()) FileCopy(nomTemp, nomODT)

Et ça marche.

Encore merci pour le tuyau,

Ph.

Aladdin a écrit :

Bonjour,

Peut-être que quelqu'un a une idée? merci d'avance;

Il semblerait qu'il faut passer par un "InteractionHandler".[1]

[1] http://fr.openoffice.org/issues/show_bug.cgi?id=79952