Hi Daniel,
Daniel Naber wrote:
Hi,
my addon (see http://www.danielnaber.de/languagetool/ for the base package,
no OOo integration online yet) needs to know where it has been installed
to load some external files that are part of its ZIP.
I actually got this working in a different context (see
http://api.openoffice.org/servlets/BrowseList?list=dev&by=thread&from=566206)
but now it's different, as I don't re-implement an existing service as
before (the thesaurus). In the old solution, __getServiceFactory was
called and I received an XMultiServiceFactory which could then be used to
get the path I need by several complicated steps.
of course, you have implemented an existing service and after
registration of your new implementation, your impl. was the default.
Each time the thesaurus was needed your impl. was instantiated ...
But you shouldn't bank on this scenario.
In your new situation, i assume you want to create and implement a
completely new service. Once registered this service can be instantiated
whenever you want over the global XMulitComponentFactory (the service
manager).
Currently it is not easy possible to get the installation place of a
component (impl. detail). I will think about a solution for the future
;-) But you can workaround this by specifying a new configuration for
your own component. In the configuration you can reference all necessary
content of your package using $ORIGIN/mypackages/whatever.gif. Later
during runtime you can use the MacroExpander service (singleton,
available at the global context) to expand this $ORIGIN containing URL
to a real URL.
I hope this helps. I know that i named probably a lot of new things for
you, but feel free to ask again.
Juergen
In my new code, __getServiceFactory isn't called anymore and thus I have no
instance of XMultiServiceFactory.
So what I'm look for is the path like this:
/home/dnaber/.openoffice2/user/uno_packages/cache/uno_packages/TXxcd8_/JLanguageTool.uno.zip/
Or a way to get XMultiServiceFactory so I can look up that path like it
worked with my old code.
You can see my current code here:
http://cvs.sourceforge.net/viewcvs.py/languagetool/JLanguageTool/src/java/de/danielnaber/languagetool/openoffice/Main.java?rev=1.8&view=markup
Thanks
Daniel
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]