shizhoubo[OOoFrm] wrote: > hi all, > > I'm reading the "Using the Dispatch Framework" in OOo Developers Guide > 7.1.6, > I have two question about Dispatching a Command and Command URL. > a.) Are all user action defined Command URL?
No, there are some actions that are executed directly. This is unfortunate at least from one point of view: they can't be disabled or intercepted easily. > b.) What is the relationship between Command URL and Dispatching a > Command? Are they one-one correspondence? CommandURLs are used for command dispatching, status updating and UI configuration files. > c.) What value the com.sun.star.util.URL's Protocol should be in the OOo? You can use any protocol you like. The "internal" UI elements of OOo's applications all use the ".uno:" protocol. But the dispatch API allows to dispatch any Command if a protocol handler is installed and registered for the used protocol. Besides the ".uno:" protocol some other "built in" protocols are supported without installing any additional components: "macro:" "vnd.sun.star.script:" and all protocols handed by a UCP (file,http,ftp etc.). Thus you can open a file using Dispatch API. The difference between dispatching e.g. a "file:" URL and using loadComponentFromURL() for the same URL is that in the latter case no interaction is used while in case of dispatching all interactive elements are used just like in the UI (that in fact also uses dispatching to open documents). Interactions e.g. the password dialog, error messages in case something goes wrong, update processes etc. In case of loadComponentFromURL() they are not executed except if advised differently, in case of dispatching it's the opposite. If extensions with menu or toolbar entries are installed they usually define and register their own protocols and protocol handlers. This registration is based on a configuraion (xcu) file. Ciao, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please don't reply to "[EMAIL PROTECTED]". I use it for the OOo lists and only rarely read other mails sent to it. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]