CORBA, GNOME, CMUCL, and other macabre tales

$Id: gnome-lisp.html,v 1.4 2000/05/15 21:57:58 dan Exp $ - How's my writing? Call 1-800-MAIL-ME

New to CORBA? Unwilling to sit through another tedious explanation of client/server computing just to find out what the Naming Service is for? Try CORBA in 5 minutes - but be warned, it's no more polished than this document.

New! Jochen Schmidt has kindly provided a C++ program to print the IOR of a MICO Interface Repository. mico-irdumpior-0.1.tar.gz is a 10762 byte download.

Motivation

In the (perhaps unlikely) event that you ever want to call GNOME CORBA servers from CMUCL, this worked example with the GNOME Help Browser may help.

If you find it useful, please mail me and let me know. Although I write this stuff primarily to satiate my own devious twisted desires, it nevertheless would be a bonus to hear from anyone who benefited as a result.

Prerequisite

Where to start

1) Run GNOME. I do the full-on gdm thing, but I think that if you start the panel that should probably be sufficient. You want to be sure that gnome-name-service is running, anyway

:; ps ax | grep name-ser
27251 ?        SW     0:00 [gnome-name-serv]
25019 pts/4    S      0:00 grep name-ser

2) Start the ORBacus IR daemon

:; irserv --ior >/tmp/ior.irserv &

3) Customise clorb-options.lisp - there are two important changes here

  1. *interface-repository* should be set to a filename containing the IR's IOR -
    (defparameter *interface-repository* "/tmp/ior.irserv")
    
  2. GNOME uses Principal-based security - you need to set *principal* to the value contained in a file somewhere in /tmp:
    (defparameter *principal*
      #.(with-open-file (i "/tmp/orbit-dan/cookie")
          (let* ((s (make-string 2048))      ;; FIXME: is it always <2k?
                 (l (read-sequence s i)))
            (setf (elt s l) (code-char 0))   ;; extra \0 needed too ..
            (subseq s 0 (1+ l))))
      "Octet sequence used for the principal field in the GIOP message.
    Used by ORBit for its cookie.")
    
    (If that doesn't work for you straight off the bat, it may be that you're not called "dan". You might try changing your name and see if that helps)

4) Now build all the CLORB stuff

5) CLORB does all method lookup using the IR. So, you need to feed the IR with the right stuff for the GNOME Help Browser and the Interface Repository definitions themselves so that it can find the GNOME interfaces in the first place. These instructions are for ORBacus; moderate as appropriate if you're using MICO.

:; pwd 
/usr/local/src/OB-3.2/ob/idl
:; irfeed -I. -ORBrepository `cat /tmp/ior.irserv` IntRep.idl
:; irfeed -ORBrepository `cat /tmp/ior.irserv ` /usr/share/idl/help-browser.idl 

6) I haven't yet got as far as persuading the help browser to activate itself from CL - and as the GNOME people are all in the process of changing their activation mechanism anyway, I probably won't until they've figured out the new one. So, you have to start it by hand:

  1. Run goad-browser. This should pop up a window wider than your screen, and somewhere on it (you may have to scroll) is a row with Server ID gnome-help-browser and Description "GNOME Help Browser". It will probably not be marked "active". Click on it and then on the "Activate" icon. The Help browser will pop up.
  2. Now find the terminal window that you started goad-browser from. There should be a freshly-printed IOR in it. This corresponds to your help browser. Copy it somewhere safe. Don't kill the help browser window

7) Nearly there. Peruse the contents of /usr/share/idl/help-browser.idl while readying for the final push. You'll note that it's basically a very simple interface, which is why we're using it.

8) Find your CMUCL session with CLORB loaded, and do this. Don't type the comments (unless you really want to). Don't type the *, which represents the CMUCL top-level prompt

;;; substitute the IOR you got in the previous step for this one here,
;;; otherwise it won't work

* (defparameter *gnome-help*
  (op::string_to_object (corba:orb-init) "IOR:011834402400000049444c3a68656c705f62726f777365722f73696d706c655f62726f777365723a312e300001000000000000002c0000000101004014000000746e696e6b7061642e74656c656e742e6e657400c90b0000080000000000000001000000"))
* (clorb::invoke *gnome-help* "fetch_url" "toc:man")
*

9) Find the Help browser window again. Look! It's changed content! Congratulations!


Daniel Barlow, $Date: 2000/05/15 21:57:58 $