Hi wheelsdong,

Your jobs.xcu contains a non existing UNO implementation name.
If I'm not wrong your class will be "com.example.MyAddon" ... but you registered
"com.sun.star.comp.framework.java.services.AsyncJob" inside Jobs.xcu.
That cant work ... of course :-)

BTW: Your job name is "AsyncJob". You should use something more unambigous ... Because ALL jobs written for OOo will be merged together into ONE single Jobs.xcu file at runtime ... "AsyncJob" only will be not enough. I thgink more then one developer will use it too .-)
You should use YOUR namespace here also (e.g. com.yourcompany.addons.MyJob).

Regards
Andreas

Hi Andreas,

Thank you very much for your advice. I changed onFirstVisibleTask to
OnViewCreated, but when I debug it, the executeAsync() is still never
called. I am afraid there is something wrong with the configuration files.

The Attachment is a simple TestAddon created using the OO plugin with
NetBeans, which only implements the XAsyncJob interface. And I copied the
related information from the example AsyncJob provided by the developer
guide.

If you have time, would you please help review the project?
I much appreciate your help.


Andreas Schlüns-2 wrote:
wheelsdong wrote:
Hi Carsten,

Thank you very much for your advice. I followed the links you provided
and
tried to run the example, but I failed. My steps are below.

I read the chapters on Jobs of the developer guide. Then I tried the
example
JobsAddon provided by SDK. The path is
OpenOffice.org_2.4_SDK\examples\DevelopersGuide\Components\Addons\JobsAddon
There are three files in this example: Addons.xcu, AsyncJob.java,
Jobs.xcu.

I created a simple OpenOffice.org Add-on using the OpenOffice plugin for
NetBeans, we call it NewAddon. Then I did the following: 1, copied the configuration code in Addons.xcu of JobsAddon to Addons.xcu
of
NewAddon.
2, copied the file Jobs.xcu to the project NewAddon
3, extended XAsyncJob interface in NewAddon and copy the code in
executeAsync() to the same method in NewAddon.

After building successfully, I made a breakpoint in executeAsync() and
tried
to debug the NewAddon. But executeAsync() was never called.
I am afraid I am not using Jobs correctly. Would you please share me some
examples or give me more advice? Thank you very much.

Did you changed the Jobs.xcu so it uses the right event ?
Example Jobs.xcu file uses e.g. "onFirstVisibleTask" where you should use "OnViewCreated" for your special purpose.

Regards
Andreas


http://www.nabble.com/file/p20318331/MyAddOn.zip MyAddOn.zip

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

Reply via email to