Issue 22044 - How to avoid the *update all links?* dialog while programmatically loading docs?
Summary: How to avoid the *update all links?* dialog while programmatically loading docs?
Status: ACCEPTED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC Windows 2000
: P2 Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-03 09:38 UTC by dommac
Modified: 2013-07-30 02:45 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description dommac 2003-11-03 09:38:00 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
Comment 1 ooo 2003-11-03 13:22:06 UTC
forwarding to responsible developer
Comment 2 andreas.schluens 2003-11-17 11:44:27 UTC
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.
Comment 3 xmore 2004-04-20 14:03:13 UTC
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.
Comment 4 christianjunker 2005-06-28 18:41:13 UTC
xmore: Please attach the WORD document and describe your problem in more detail
and what exactly you want.
Comment 5 dommac 2005-06-29 08:39:37 UTC
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
Comment 6 Rob Weir 2013-07-30 02:45:02 UTC
Reset assignee on issues not touched by assignee in more than 1000 days.