Hi Andreas, Thank you for finding the errors in the configuration files. I made modifications according to your suggestions. I changed the name of Job to com.example.MyAddOn.MyJob, and put the proper implementation name of my project. And registered the event OnViewCreated and onFirstVisibleTask. I also add vnd.sun.star.job:event=onFirstVisibleTask in the Addons.xcu file. I wish that the job will be trigged by the event onFirstVisibleTask. But When I debug the program, the execute() function is not called at all.
I am afraid I am not understanding the Developer Guide correctly. I also googled for tutorials or sample code, but didn't find any useful resources. Would you please help review the code? Thank you very much! Attachment is the project zip file. The new Job.xcu file is as follows: <oor:component-data oor:name="Jobs" oor:package="org.openoffice.Office" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <node oor:name="Jobs"> <node oor:name="com.example.MyAddOn.MyJob" oor:op="replace"> <prop oor:name="Service" oor:type="xs:string"> <value>com.example.MyAddOn</value> </prop> <node oor:name="Arguments"> <prop oor:name="arg_1" oor:type="xs:string"> <value>val_1</value> </prop> </node> </node> </node> <node oor:name="Events"> <node oor:name="OnViewCreated" oor:op="fuse"> <node oor:name="JobList"> <node oor:name="com.example.MyAddOn.MyJob" oor:op="replace"/> </node> </node> <node oor:name="onFirstVisibleTask" oor:op="fuse"> <node oor:name="JobList"> <node oor:name="com.example.MyAddOn.MyJob" oor:op="replace"/> </node> </node> </node> </oor:component-data> Andreas Schlüns-2 wrote: > > 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 > http://www.nabble.com/file/p20355437/MyAddOn1106.zip MyAddOn1106.zip -- View this message in context: http://www.nabble.com/Where-to-register-MouseClickHandler-in-an-Add-On--tp20221786p20355437.html Sent from the openoffice - api dev mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
