[api-dev] error with pkgchk and windows

2005-03-17 Thread Ines Pfauch
Today I tried to use my java-addon (developed under linux) with OOo  
1.1.2 at windows.
After deploying the functions in the addon submenu were greyed out. In  
the log file from pkgchk I've found following error:

 warning: registering  
vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE/uno_packages/ 
OGoPlugin.uno.zip.059801/OGoPlugin.uno.jar into registry  
file:///C:/Programme/OpenOffice.org1.1.2/user/uno_packages/cache/ 
services.rdb: failed! (cannot register implementation: Could not create  
Java implementation loader)!

Can anyone tell my where this error comes from or how I get the addon  
installed correctly?

Thank you in advance
Ines
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] How can I get the url of the currently opened document?

2005-03-11 Thread Ines Pfauch
On 10.03.2005, at 14:09, Christoph Lutz wrote:

XDesktop desktop =  
(XDesktop)xmulticomponentfactory.createInstanceWithContext 
(com.sun.star.frame.Desktop, ctx);


Unfortunately I get a ClassCastException at the line above. To get the  
URL is the only thing I need. I dont program more in java for OOo, and  
the developers guide is very complicated for me...

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


Re: [api-dev] How can I get the url of the currently opened document?

2005-03-11 Thread Ines Pfauch
On 11.03.2005, at 09:50, Jürgen Schmidt wrote:

Object oDesktop = xmulticomponentfactory.createInstanceWithContext  
(com.sun.star.frame.Desktop, ctx);
XDEsktop xDesktop =  
(XDesktop)UnoRuntime.queryInterface(XDesktop.class, oDesktop);

I did.
At the moment I use the following code, but it still seems to be  
wrong...:

--snip--
Object desktop =  
xmulticomponentfactory.createInstanceWithContext 
(com.sun.star.frame.Desktop, ctx );
XDesktop xDesktop =  
(XDesktop)UnoRuntime.queryInterface(com.sun.star.frame.XDesktop.class,  
desktop);
XComponent document = xDesktop.getCurrentComponent();
XPropertySet documentProps =  
(XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,document);
System.out.println(documentProps.getPropertyValue(URL));
--snap--

... because I get following error at the System.out.println-line above:
--snip--
com.sun.star.beans.UnknownPropertyException:
at com.sun.star.bridges.jni_uno.JNI_proxy.dispatch_call(Native  
Method)
at  
com.sun.star.bridges.jni_uno.JNI_proxy.invoke(JNI_proxy.java:204)
at $Proxy6.getPropertyValue(Unknown Source)
--snap--


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


Re: [api-dev] How can I get the url of the currently opened document?

2005-03-11 Thread Ines Pfauch
On 11.03.2005, at 10:15, Tom Schindl wrote:
But as already suggested by Christian
((XModel)UnoRuntime.queryInterface 
(com.sun.star.XModel,xDesktop.getCurrentComponent())).getURL();

Should work.
Tom

No: I get the following error.
cannot resolve symbol
symbol  : method queryInterface  
(java.lang.String,com.sun.star.lang.XComponent)
location: class com.sun.star.uno.UnoRuntime
XModel xmodel =  
(XModel)UnoRuntime.queryInterface(com.sun.star.frame.XModel,  
desktop);


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


Re: [api-dev] How can I get the url of the currently opened document?

2005-03-11 Thread Ines Pfauch
On 11.03.2005, at 10:34, Tom Schindl wrote:
Sorry should have been  
((XModel)UnoRuntime.queryInterface 
(XModel.class,xDesktop.getCurrentComponent())).getURL();
Great. Thank you! It works.

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


Re: [api-dev] How can I get the url of the currently opened document?

2005-03-11 Thread Ines Pfauch
On 11.03.2005, at 11:10, Tom Schindl wrote:
It would be great if you would summerize this small thread which 
showed us not to use the MediaDescriptor.html#URL to retrieve the URL 
form a document but instead the XModel in a small and tiny 
codesnippet.

It's worth the time you saved by people helping to your solve problem 
;-)
OK. That is no problem. And thanks again for the help! :)
Here is the codesnippet for getting the url of a current opened 
document:

-- snip --
// XMultiComponentFactory xmcf = ...
// XComponentContext ctx = ...
Object desktop = 
xmcf.createInstanceWithContext(com.sun.star.frame.Desktop, ctx);
XDesktop xDesktop = 
(XDesktop)UnoRuntime.queryInterface(com.sun.star.frame.XDesktop.class, 
desktop);
XComponent document = xDesktop.getCurrentComponent();
XPropertySet documentProps = 
(XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,document);
XModel xmodel = 
(XModel)UnoRuntime.queryInterface(XModel.class,document);
if (xmodel != null) String url = xmodel.getURL();
-- snap --



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


Re: [api-dev] How can I get the url of the currently opened document?

2005-03-10 Thread Ines Pfauch
On 09.03.2005, at 13:20, Aidan Butler wrote:
Hello,
 The URL of the document is stored as a property of the document 
component. The following python code will print the URL

#ctx is the current context
desktop = ctx.ServiceManager.createInstanceWithContext( \
   com.sun.star.frame.Desktop, ctx )
document = desktop.getCurrentComponent()
print document.URL
Alternatively a document.getPropertyValue(URL) should do the trick
Maybe I so something wrong but this does not work, when I try to 
convert it to java.

I can understand the whole thing unto here:
// XComponentContext ctx ...
// XMultiComponentFactory f ...
XDesktop desktop = 
(XDesktop)f.createInstanceWithContext(com.sun.star.frame.Desktop, 
ctx);
XComponent document = (XComponent)desktop.getCurrentComponent();

But a document.getPropertyValue(URL) method does not exist.
Please help me.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[api-dev] How can I get the url of the currently opened document?

2005-03-09 Thread Ines Pfauch
My java addon now has some functions which are only visible if a 
document is opened. Before I can do anything with this document I need 
the url of it (path and name on the filesystem), how can I retrieve 
this?

Thanks in advance,
Ines
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[api-dev] problem with external jar and java add-on - PS

2005-02-28 Thread Ines Pfauch
PS.
When executing the program extern from OOo this error does not occur.
Today I changed something in the addons.xcu file, but this should not 
be the problem, because older versions of my addon still make this 
strange error when executing within OOo.

Does someone have an idea?
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[api-dev] problem with jar file

2005-02-23 Thread Ines Pfauch
Hi,
At first I am sorry, because I think my problem does not belong very 
good to this mailing list.

For the last 20 weeks I was creating an java add-on for OOo. Now three 
days are left and my installer does not what it should. Therefore I 
hope, someone can help me:

I have created a self-executing jar file with some class files, which 
contains the GUI and the execution of pkgchk. It also contains the zip 
file, which I want to deploy with pkgchk.

But when I try to copy the zip to some directory I get 
filenotfoundexception. Is there an other way to extract a file from 
within the self-executing jar (without using a jar command) to any 
directory...?

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


Re: [api-dev] problem with jar file

2005-02-23 Thread Ines Pfauch
On 23.02.2005, at 13:24, Simon Mieth wrote:
Hi Ines,
Hi Simon,
if I understand you correct and you want to copy the embeded zip-file.
Yes, thats exactly what I want.
(code)
Thank your for your fast answer. And: THANK YOU so much for the code. 
With some simple changes it did exactly what I want. :)


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


[api-dev] pkgchk

2005-02-22 Thread Ines Pfauch
I have some questions about the OOo's commandline tool for deploying an 
addon to OOo:

Is there somewhere a manual where I can find the possible parameters 
which I can use with pkgchk? In the forum and the Developers Guide I 
only have found informations like copy zip file to 
OOo/user/uno_packages and execute pkgchk... and for removing delete 
zip from... and execute pkgchk...

Is it possible to get an answer from pkgchk after deploying where it 
copied the zip file, when I call it this way pkgchk 
/mypath/addon.uno.zip because I need the information for uninstall (if 
the addon becomes automatically installed with an installer I will not 
search manually for the file). Or better: is there a way to uninstall 
the addon with executing pkgchk with some parameters?

Hope, someone can help :)
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]