Apache OpenOffice (AOO) Bugzilla – Issue 22044
How to avoid the *update all links?* dialog while programmatically loading docs?
Last modified: 2013-07-30 02:45:02 UTC
Hi, I need/want to avoid any “update all links?” dialog while programmatically loading certain (MS-Word) documents in OpenOffice including external files. I understand that I have to set an *UpdateDocMode* PropertyValue to *FULL_UPDATE* and use it invoking *loadComponentFromURL* method as in PropertyValue loaderPropertyvalue[] = new PropertyValue[ 1 ]; loaderPropertyvalue[ 0 ] = new PropertyValue(); loaderPropertyvalue[ 0 ].Name = "UpdateDocMode"; loaderPropertyvalue[ 0 ].Value = new Short( UpdateDocMode.FULL_UPDATE ); Object objectDocumentToStore = xcomponentloader.loadComponentFromURL("file:///C:/temp/file.doc", "_blank", 0, loaderPropertyvalue ); but, unfortunately, it doesn’t work. I’m sure I’m very close to the solution of the problem (maybe I have to use something different from Short in the 4th line? I unsuccessfully tryed String and Integer, too), but I can’t solve it alone. Any help would be appreciated. I’m currently using OpenOffice 1.1, java jdk1.4.2 and Windows 2000 Professional and based my code on the *examples\java\ConverterServlet\ConverterServlet.java* (I'm building a web application to convert MS-Office file to OOffice and than store them in a web repository) and *examples\java\DocumentHandling\DocumentConverter.java* examples. Thanks in advance, mimmo
forwarding to responsible developer
If you look into the documentation of the interface css.document.UpdateDocMode you will see the following comment for the value FULL_UPDATE: "Update document even if it does require a dialog." On the other side there is a mode QUIET_UPDATE with the following comment: "Update document if it does not require a dialog. Otherwise do not update. For example a link to a database can require a dialog to get password for an update." As you can see - there is currently no chance to have a full update mode without any UI. But I will set this task to OOo Later and flag it as an ENHANCEMENT. Please stay tuned.
I have the same problem with the UpdateDocMode = QUIET_UPDATE. I don't want the document to update, so I use the QUIET_UPDATE value. Here is an extract from my vbscript code : dim DocURL DocURL = "file:///C:/test/test.DOC" Dim args(3) Set args(0) = createStruct("com.sun.star.beans.PropertyValue") Set args(1) = createStruct("com.sun.star.beans.PropertyValue") Set args(2) = createStruct("com.sun.star.beans.PropertyValue") Set args(3) = createStruct("com.sun.star.beans.PropertyValue") args(0).Name = "UpdateDocMode" args(0).Value = 1 args(1).Name = "Hidden" args(1).Value = true args(2).Name = "ReadOnly" args(2).Value = true args(3).Name = "FilterName" args(3).Value = "writer_MS_Word_97" Set objDocument= objDesktop.loadComponentFromURL(DocURL, "_blank", 0, args) Function createStruct( strTypeName) Set classSize= objCoreReflection.forName( strTypeName) Dim aStruct classSize.createObject aStruct Set createStruct= aStruct End Function I'm using OOo 1.1.1 (Windows XP Pro). My goal is to use OOo for batch converting MS Word document to PDF. Thanxs for your time and attention.
xmore: Please attach the WORD document and describe your problem in more detail and what exactly you want.
I did it a long time ago and meanwile I changed platform and activities many times so I can't be very helpful. Not even have those file and the code. I'm sorry. In any case I'll try to tell you what I remember. A couple of years ago I tryied to use OO running in server mode to translate MS-Office ms-docs in XML and parse the new file via XSL-T to extract information. My application was a web one and the interaction with OO had to be managed on the server following the upload of the file. It worked fine with self consistent files. The problem arised only when I feeded docs with external links (that is with links to other files). In that case OO, while loading, issued a dialog asking if it should "update all links". If I didn't answer yes or no, OO simply hanged. This dialog didn't show when I opened the file from the OO GUI, only when I used the API as explained. I noticed it because, while developing, the server and the client coincided. As suggested in my e-mail, one solution would be to add a parameter to the xcomponentloader to allow the programmer to declare the OO behaviour in that case and avoid the dialog. Thanxs for your work. mimmo
Reset assignee on issues not touched by assignee in more than 1000 days.