Example of Modifying Caucus: adding a "conference Description"

I had a very nice experience demonstrating how Caucus could be customized, while doing some Caucus training at a customer site earlier this week. And I thought it would make a good example of how one can go about customizing Caucus.

The customer in question was working their way through ways to change the default CML scripts to make Caucus look more like their Web pages, and similar to some other applications.


Change One:

So, first we changed the "Caucus" logo to their organization logo. That was trivial; the file CML/SP/Local/logo.i was defined for that purpose, since I expect a 'logo' change is the first thing people will want to do. (Just change the .gif file referenced in logo.i)


Change Two:

Second was changing the name of the "Welcome Page". That's also a predictable request. The end of the CML/SP/Local/switch.i file contains the definitions of several CML variables called
   welcome_pop      (name of welcome page in pull-down lists)
   welcome_text     (name of welcome page as text in a page)
   welcome_alt      (alternate tag for "Goto Welcome Page" button)

By changing the definition of these variables, you change the reference to the welcome page throughout the interface.

The last step in this task was to change the "Goto Welcome Page" button itself. The easiest way to accomplish that is to put a different .gif file in place of the button, which is located at public_html/GIF/bwelcome.gif.


Change Three

The third task was the most interesting. The customer wanted a "description" of each conference to appear next to the conference name, when a user clicks on "list all conferences" from the welcome page.

The Caucus database has a lot of built-in data about conferences, but there is no "description" for each conference. There is, however, an extendable feature called a "conference variable". Each conference may have a set of named variables associated with the conference, which are stored permanently. The variables may be used for any purpose, and can contain any amount of data.

This request was a perfect application for a conference variable. We chose to put the definition of this variable in the conference "customize" page, where only the organizer could change it.

As it turns out, the customize.cml page already has an example of setting a conference variable, the conference INTRODUCTION. That part of customize.cml looks like this:

   "Edit the HTML text of the <B>Introduction</B>.  
   "It should describe
   "the purpose of the conference, so that people can determine if
   "they want to join it. 
   "<INPUT TYPE="submit" VALUE="Submit Changes"> <BR>
   "<TEXTAREA WRAP=physical NAME="intro" ROWS=8 COLS=$(cols)>
   "$conf_var($arg(2) intro)</TEXTAREA>
This piece of CML code displays a text box, with the current value of the "intro" conference variable. (The function $arg(2) is the conference number, so the "$conf_var($arg(2) intro)" means "the variable intro for the current conference".

So all we did for this piece (to enter or edit a conference description) was copy the INTRODUCTION cml code and change the name of the variable from "intro" to "description":

   "Edit the HTML text of the <B>Description</B>.  
   "<INPUT TYPE="submit" VALUE="Submit Changes"> <BR>
   "<TEXTAREA WRAP=physical NAME="descrip" ROWS=8 COLS=$(cols)>
   "$conf_var($arg(2) description)</TEXTAREA>

That takes care of getting the description; but now it has to be stored. This is done by the page that handles the results of the form, which is called customizeF.cml. Here too, I just copied the line that stored the introduction, and modified it to store the description:

   set ignore $set_conf_var ($arg(1) intro         $form(intro))
   set ignore $set_conf_var ($arg(1) description $form(descrip))

So now the organizer can write a description, and save it. The last step is to actually display it, alongside the conference name in the list of all conferences. That list is displayed by allconfs.cml. Here's the original fragment that just displays the conference names:

  for cnum in $cl_list()
     if $cl_access($(cnum))
        "<LI> <A HREF="$(href)/lobby.cml?$(nch)+$(cnum)">
        "       $cl_name($(cnum))</A>
     end
     else
        "<LI> $cl_name($(cnum))
     end
  end
To display the description alongside the name, I put both into a row in a table. So the result looks like this:
  "<TABLE BORDER> 
  for cnum in $cl_list()
     "<TR> <TD>
     if $cl_access($(cnum))
        "<LI> <A HREF="$(href)/lobby.cml?$(nch)+$(cnum)">
        "       $cl_name($(cnum))</A>
     end
     else
        "<LI> $cl_name($(cnum))
     end
     "</TD>
     "<TD> $conf_var($(cnum) description)
     "</TD> 
  end
  "</TABLE>
Voila! "Instant" conference description.