David Dankwerth wrote:
Hello Mathias

Sorry it took me so long to come back to you,
I have now incorporated your suggestion into my code
however i get
"[java] Exception in thread "main" com.sun.star.uno.Exception: Query for
service factory for com.sun.star.loader.SharedLibrary failed."
before the program attempts to load , do i need to setup something in
order to be able to use the InteractionHandler ?

You probably try to instantiate the InteractionHandler service at your local Java component context/service manager. Try the remote one, obtained from soffice, instead.

-Stephan

Thanks
David D


Mathias Bauer wrote:


David Dankwerth wrote:



Hi

The attached sample java program does the following:

1. Connect to a remote open office
2. Ask open office to loadComponentFromURL using tomcat and webdav
3. Ask open office to storeToURL using the writer_export_PDF filter,
saving the doc
  back to tomcat with the original name and add a ".pdf"
4. release the connection to the remote open office.

The program works fine when Open office is running on a remote linux
server (gentoo used emerge openoffice-1.9.109.ebuild)
However, when openoffice runs on a windows machine (server 2003) the
loadComponent returns null.

The openoffice on the windows machine does manage to open the url when i
am using the GUI interface of openoffice.

Anything i need to enable in openoffice to make this work ?

You could add a InteractionHandler to your loadComponentFromURL call.
This might show you an error message that can point to the problem.

And BTW: the parameter name "read-only" is wrong.
Code (not tested) shown below:




com.sun.star.beans.PropertyValue [] args = new com.sun.star.beans.PropertyValue 
[2];

args[ 0 ] = new PropertyValue();
args[ 0 ].Name = "ReadOnly";
args[ 0 ].Value = new Boolean(true);

args[ 1 ] = new PropertyValue();
args[ 1 ].Name = "Interactionhandler";

Object oHandler = xRemoteServiceManager.createInstanceWithContext(
     "com.sun.star.task.InteractionHandler", xOfficeComponentContext );

args[ 1 ].Value = (com.sun.star.task.XInteractionHandler)
UnoRuntime.queryInterface( com.sun.star.task.XInteractionHandler.class, 
oHandler );

Best regards,
Mathias

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

Reply via email to