Hi Joerg,

Alle 14:41, mercoledì 21 settembre 2005, Joerg Barfurth ha scritto:
[...]
> For the Events components, you can add an xcu file containing a number
> of event bindings to your package. These bindings should then become
> effective - possibly after restarting the application. You can create
> such an xcu file by editing event bindings in OOo and then coyping
> (possibly editing) the resulting user/registry/data/.../Events.xcu file.
> The name of the file you add to your package does not matter - the
> component is identified by attributes inside the file.
>
> If a user (or a document) already has an event binding for one of the
> events that binding takes precedence (to me it looks like the event
> configuration only allows one binding for each event)
[...]

Ok, event configuration only allows one binding for each event, but to my 
eyes, here the problem is another:

suppose that the user has manually set an an event-binding, for instance 
"OnStartApp"

after a while, the user decides to remove the binding (manually again, by the 
proper config dialog)

Now write your custom Events.xcu in this manner:

<?xml version="1.0" encoding="UTF-8"?>
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; oor:name="Events" 
oor:package="org.openoffice.Office">
 <node oor:name="ApplicationEvents">
  <node oor:name="Bindings">
   <node oor:name="OnStartApp" oor:op="replace">
    <prop oor:name="BindingURL" oor:type="xs:string">
     
<value>vnd.sun.star.script:Standard.Module1.Main?language=Basic&amp;location=application</value>
    </prop>
   </node>
  </node>
 </node>
</oor:component-data>

and try to install it by unopkg.
You will see that it won't work

IMHO this happens because, when the user has manually removed the binding, the 
node has not been deleted but simply marked as "remove" in this way:

 <node oor:name="ApplicationEvents">
  <node oor:name="Bindings">
   <node oor:name="OnStartApp" oor:op="remove"/>
  </node>
 </node>

And this takes the precedence.

In practice, if you use unopkg for installing event-bindings, the result is     
  
simply unpredictable, regardless if the event is currently already bind or 
not

BTW In my experience I noticed that this happens in general, not only for the 
Event.xcu file.

regards
Paolo M








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

Reply via email to