Apache OpenOffice (AOO) Bugzilla – Issue 20066
Jobs: List of supported events
Last modified: 2013-02-24 21:06:34 UTC
(Reopened with additional information.) Chapter 4.7.2 (Jobs) of the Developer's Guide contains a "List of supported Events". The only event I found to work in OOo 1.1rc4 is onFirstVisibleTask. Either the documentation is wrong or the implementation is incomplete. Note that I am not talking about Basic, I'm talking about jobs (C++ and Java). To verify my claim, I added all the events listed in the "List of supported Events" to Jobs.xcu in OpenOffice.org1.1_SDK/examples/DevelopersGuide/Components/Addons/JobsAddon by copying the onFirstVisibleTask entry, removed OOo, reinstalled OOo (to make sure that no jobs are disabled), built the example (make clean; make), and run OOo. Result: Only one dialog box, for the onFirstVisibleTask event. Same result with C++ code. Here's the new Jobs.xcu I used (no other files changed in that example program): <?xml version='1.0' encoding='UTF-8'?> <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="AsyncJob" oor:op="replace"> <prop oor:name="Service" oor:type="xs:string"> <value>com.sun.star.comp.framework.java.services.AsyncJob</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="onFirstRunInitialization" oor:op="modify"> <node oor:name="JobList"> <node oor:name="AsyncJob" oor:op="replace"/> </node> </node> <node oor:name="onFirstVisibleTask" oor:op="modify"> <node oor:name="JobList"> <node oor:name="AsyncJob" oor:op="replace"/> </node> </node> <node oor:name="onDocumentOpened" oor:op="modify"> <node oor:name="JobList"> <node oor:name="AsyncJob" oor:op="replace"/> </node> </node> <node oor:name="OnStartApp" oor:op="modify"> <node oor:name="JobList"> <node oor:name="AsyncJob" oor:op="replace"/> </node> </node> <node oor:name="OnCloseApp" oor:op="modify"> <node oor:name="JobList"> <node oor:name="AsyncJob" oor:op="replace"/> </node> </node> <node oor:name="OnNew" oor:op="modify"> <node oor:name="JobList"> <node oor:name="AsyncJob" oor:op="replace"/> </node> </node> <node oor:name="OnLoad" oor:op="modify"> <node oor:name="JobList"> <node oor:name="AsyncJob" oor:op="replace"/> </node> </node> <node oor:name="OnSaveAs" oor:op="modify"> <node oor:name="JobList"> <node oor:name="AsyncJob" oor:op="replace"/> </node> </node> <node oor:name="OnSaveAsDone" oor:op="modify"> <node oor:name="JobList"> <node oor:name="AsyncJob" oor:op="replace"/> </node> </node> <node oor:name="OnSave" oor:op="modify"> <node oor:name="JobList"> <node oor:name="AsyncJob" oor:op="replace"/> </node> </node> <node oor:name="OnSaveDone" oor:op="modify"> <node oor:name="JobList"> <node oor:name="AsyncJob" oor:op="replace"/> </node> </node> <node oor:name="OnPrepareUnload" oor:op="modify"> <node oor:name="JobList"> <node oor:name="AsyncJob" oor:op="replace"/> </node> </node> <node oor:name="OnUnload" oor:op="modify"> <node oor:name="JobList"> <node oor:name="AsyncJob" oor:op="replace"/> </node> </node> <node oor:name="OnFocus" oor:op="modify"> <node oor:name="JobList"> <node oor:name="AsyncJob" oor:op="replace"/> </node> </node> <node oor:name="OnUnfocus" oor:op="modify"> <node oor:name="JobList"> <node oor:name="AsyncJob" oor:op="replace"/> </node> </node> <node oor:name="OnPrint" oor:op="modify"> <node oor:name="JobList"> <node oor:name="AsyncJob" oor:op="replace"/> </node> </node> <node oor:name="OnModifyChange" oor:op="modify"> <node oor:name="JobList"> <node oor:name="AsyncJob" oor:op="replace"/> </node> </node> <node oor:name="onMyOwnJobEvent" oor:op="replace"> <node oor:name="JobList"> <node oor:name="AsyncJob" oor:op="replace"/> </node> </node> </node> </oor:component-data>
sounds like a framework issue
Sorry - but you are wrong a second time. Please have a look into the user layer of your configuration files. If the first event "onFirstVisibleTask" is triggered by the JobExecutor (because its hardly called from the code) the AsyncJob force a deactivation for further events. see code line 215-218 inside AsyncJob.java. In case the next event is triggered by a document event (e.g. "OnNew") the same AsyncJob is already marked as "DEACTIVATED". So it wont be excuted! You should search for a file "user/registry/data/org/openoffice/Office/Jobs.xcu" inside your office installation. There should be two time stamps for one of the events, where the AsyncJob is registered for (e.g. "onFirstVisibleTask"). If you remove this file or these time stamps, the job will be started next time (requires new start of the office!). But of course it will be started for the first event only again. So you should try to reduce your example XCU to the real needed ones. Or you have to adapt the code to your own requirements.
.
clearing resolution
closing