Hello Gerhard,

In my example I not only print a text out but also return an instance
to the DispatchProvider.
In OO-DevelopersGUice  4.7.1 Protocoll Handler, there is a tabe under
the headding Overview.
From this table, I understand, that it is enough to insert my
DispatchInterceptor into the dispatch chain using
XDispatchProviderInterception.registerDispatchProviderInterceptor.
Dispatch interception takes preceedence over the installed
ProtocollHandlers.

My experiance is:
- yes I can insert it that way
- the method queryDispatch of my DispatchProvider is called and there
I give back a reffernce back
- but without a *.xcu configuration file the command URL's are not
recognized, although my queryDispatch has already informed the system
that it would be happy to handle them

I thought I could insert a DispatchInterceptor the same way I inserted
the ContextMenuInterceptor.
Maybe it was never intended that way, but the OO-DevelopersGuide is
not clear about this.

You must differ between a ProtocolHandler and a normal DispatchInterceptor. Both objects are part of the dispatch queue bound to one frame. But they are thought to be used for different purposes !

a) A normal DispatchInterceptor must be registered at runtime. There is no automatism how such interceptor will be come in life. YOU have to do this job at runtime. Such interceptor can intercept ALL commands passed to the dispatch queue. As an optional feature you can provide an additional interface named XInterceptorInfo. There you can return a list of URL pattern (including wildcards) so the dispatch queue will call your interceptor only for those URLs ... and not for all.

b) A ProtocolHandler does the same then a DispatchInterceptor. The difference is: it' s registration is not done at runtime ... its done by using a XCU configuration file. So the call "registerDispatchInterceptor()" and the mechanism behind XInterceptorInfo are static by these XCu file.

Which mechanism should be used for which use case ?

If registration of an interceptor depends from "rules" (e.g. the opened document is scanned/analyzed and different interceptions are needed by different classes of documents) a) should be preferred. Further it's always a good idea to provide the additional interface XInterceptorInfo to perform handling of the dispatch queue.

If the set of commands/URLs is fix, does not depend on other things you should use b).

Hopefully that helps a little bit to understand how the dispatch queue works. Its sometimes not quite easy to understand - I know. But on the other side its the most flexible mechanism I know in OOo.

Best Regards
Andreas

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

Reply via email to