Santronics Software, Inc.,
Wildcat! Templates (WCT)

The help guide ("WCT Command/Macro References Guide") is availbable  to document WCT programming.

This section highlights specific update changes:

Version 452.1

WEB TEMPLATES

- NEW: New and Cleaned HTTP\template files.

 The following http\template\ files were updated or new:

      BigButtons.css
      LoginOptions.inc
      account_info.htm
      buttons.css
      chat.htm
      copyright.inc
      file_areas.htm
      file_frame_init.wct
      file_list.inc
      file_listing.htm
      file_listmenu.inc
      file_upload.htm
      file_uploadok.htm
      globalopts.inc
      layout.css
      mailclient.css
      message_conferences.htm
      message_create.htm
      message_frame_init.wct
      message_groupselect.htm
      message_inbox.htm
      message_index.htm
      message_indexmenu.inc
      message_indexthd.htm
      message_ok.htm
      message_read.htm
      pagefooter.inc
      pageheader.inc
      personal_page_audio.htm
      personal_page_chgpwd.htm
      personal_page_example.htm
      personal_page_example_save.wct
      personal_page_general.htm
      personal_page_messaging.htm
      personal_page_other.htm
      personal_page_pwdupdated.htm
      personalclient.css
      personalmenu.inc
      personalmenu.ini
      personalmenu3P.ini
      readme_templates.txt
      save_audio_profile.wct
      save_whos_online_options.wct
      templates.css
      verinfo.dat
      whoclient.css
      whos_online.htm

WCT

- NEW: New User Extended Fields database WCT macro support

Two new features were added to support WCT access to the user's  extended database record:

    - Ability to READ non-profile user extended fields, and
    - Ability to WRITE or SET user extended fields.

Prior to new WCT support, this was only possible using WCBASIC applications. This new feature will allow sysops to extend the user database via WCT page programming without requiring WCBASIC.

Reading User extended variables can be done  using two formats:

- DOT Format Style

  @USER.KEY@

   Read KEY field in section PROFILE. This is the current support in WCT
   to read user profile variables.

   Example:

   User's email address: @USER.EMAILADDRESS@

  @USER.[SECTION].KEY@

   Read KEY field in section defined by [SECTION]

   Example:

   Sound off:     @USER.[MAIL.OPTIONS].NOSOUND@
   Email Address: @USER.[PROFILE].EMAILADDRESS@

   Note: Using [PROFILE] is redundant since the default is to
   read from the user's profile section, but it is shown above
   to illustrate the PROFILE section is like any other section
   in the user's extended database.

- WCBASIC-LIKE function argument style

  @USER.VARIABLE(SECTION,KEY,DEFAULT)@
  @USER.PROFILE(KEY,DEFAULT)@

  To make it easier with the way WCBASIC reads user extended
  database data,  we can now use a similar syntax.  Note,
  the DEFAULT parameter is optional. If no default is provided,
  the default value is a blank string.

  Examples:

  Sound off:     @USER.VARIABLE(MAIL.OPTIONS,NOSOUND)@
  Email Address: @USER.PROFILE(EMAILADDRESS)@

Writing User Extended Database Variables

Setting user extended fields is done with the SET macro. The  following syntax is supported:

    @SET USER.KEY=VALUE@@
    @SET USER.[SECTION].KEY=VALUE@@
    @SET USER.PROFILE(KEY)=VALUE@@
    @SET USER.VARIABLE(SECTION,KEY)=VALUE@@

Examples:

Write to the profile section:

    @SET USER.PET.TYPE="CAT"@
    @SET USER.PET.NAME="JAZZ"@

or

    @SET USER.PROFILE(PET.TYPE)="CAT"@
    @SET USER.PROFILE(PET.NAME)="JAZZ"@

Write to specific section called "Mail"

    @SET USER.[MAIL].NOSOUND=TRUE@

or

    @SET USER.VARIABLE(MAIL,NOSOUND)=TRUE@

Deleting User Extended Database Variables

You can delete user extended fields by setting no value to the key.

    @SET USER.KEY=@

This is different than just setting the value to "":

    @SET USER.KEY=""@

which clears the key but keeps the key field in the user extended database.

example:

     @SET USER.PET.NAME=@
     @SET USER.PET.JAZZ=@

- CHG: Renamed the WCT date formating macros.

The @DATE.format@ was changed to @SUB FMTDATE.format@
The @TIME.format@ was changed to @SUB FMTTIME.format@

This feature was added in 451.4. But the renaming was necessary to avoid confusion with the inherent WCT @DATE@ and @TIME@ macros.

- FIX: Fixed relative path in @INCLUDE filename@ macro

- NEW: New @MODULE UTL NEWFILES@ macro command

The NEWFILES command will set a global template variable called "NEWFILES" which can be used to test if there are any new files.

  syntax: @MODULE UTL NEWFILES [option]@

If no option is passed, the default is LASTCALL (login) date.

  Option        Description
  ======        =============================================
  #             - # of days since today's date
  Today         - since today's date (same as days=0)
  Yesterday     - since yesterday's date (same as days=1)
  LastCall      - since last call date  (DEFAULT)
  LastDate      - since last new files date
  LastFile      - since last database file date (date order)
  ThisYear      - since this current year, month 1 day 1
  ThisMonth     - since this current month, day 1
  PastWeek      - since 7 days ago

Examples:

  @MODULE UTL NEWFILES Today@
  @if NewFiles@
    Total New files available: @SUB NewFiles@
  @else@
    No New files today!
  @endif@

  @MODULE UTL NEWFILES ThisMonth@
  @if NewFiles@
    @SUB NewFiles@ new files this month!
  @endif@

  @MODULE UTL NEWFILES@
  @if NewFiles@
    @SUB NewFiles@ new files since your last call!
  @endif@

  @MODULE UTL NEWFILES lastfile@
  @if NewFiles@
    @SUB NewFiles@ new files!
  @endif@

- NEW: Added new internal TFileRecord macros:

     @FILE.PRIVATEUSERID@    Target user id for private files
     @FILE.RECORDNUMBER@     File Database Record Number
     @FILE.SIZEMBYTES@       File size in megabytes

- ENH: WCX Libraries can now read command line parameters.

WCX Libraries now have access to the calling parent WCX program paramstr(n) variables. What this means is that a WCX application using WCX library functions, the library function itself can now use the WCX application's ParamCount and ParamStr(n) command line parameters.

- FIX: Disabled all processing of @ macros within @COMMENT@  block.

Although the @COMMENT@ blocked disabled all text output to the  browser, the macros within the blocked were processed anyway.

This was discovered, when using the @COMMENT@ block to document some templates with illustrative examples of macros, there were being processed by the WCT processor.

- ENH: Added multiple search words for @SHOWVARS@.

Now you can use multiple specs words. For example:

     @SHOWVARS OTHER* NODE*@

This will show all variables beginning with OTHER and NODE.

- FIX: Fixed template macro expander with uneven double quotes.

- NEW: New Inline Comment @//@ macro

This @//@ is good to comment out the entire or the remaining part of the line in a WCT file.  The rest of the line will not get processed or displayed.

- NEW: You can now expand variable names using angle brackets.

In the past, the variable name (left side of equal sign) for the @SET command was not expanded.  It is now expanded only if it contains angle brackets.

Example:

     @SET C=1@
     @SET name[{C}]="Joey"@

This will set a variable called NAME[1] with a value of "Joey" by expanding the angle bracket variable {C} first.  Without the new feature, the variable name would literally be "NAME[{C}]".

- NEW: @SET command now supports for creating string arrays

  @SET name = [item1, item2, item3,....itemN]@

The SET macro can be used to create a list of variables starting a base 1.

Example #1:

     @SET NAME = ["Joey","Bill","Tom","Mary"]@

This will automatically create new variables:

     NAME[1]      = "Joey"
     NAME[2]      = "Bill"
     NAME[3]      = "Tom"
     NAME[4]      = "Mary"
     NAME.COUNT   = 4

The NAME.COUNT can be used to get the size of the array. Useful in a @FOR loop:

     @FOR I=1 to NAME.COUNT@
       person #@GET I@ = @GET NAME[{I}]@
     @NEXT@

Example #2:

     @SET N=0@
     @ADD N@@SET COL{N} = ["Node",     "OTHERNODE.NUMBER"]@
     @ADD N@@SET COL{N} = ["Port",     "OTHERNODE.DEVICE.PORT"]@

The above creates variables:

     COL1.COUNT = 2
     COL1[1] = "Node"
     COL1[2] = "OTHERNODE.NUMBER"
     COL2.COUNT = 2
     COL2[1] = "Online"
     COL2[2] = "OTHERNODE.TIME.ONLINE"
     N=2

This is good to create a table:

   <table>
      <tr>
        @FOR I = 1 to N@
          <th>@SUB COL{I}[1]@</th>
        @NEXT@
      </tr>
      <tr>
        @FOR I = 1 to N@
          <td>@SUB COL{I}[2]@</th>
        @NEXT@
      </tr>
   </table>

- NEW: New @MODULE UTL REDIRECT url@ macro command

The REDIRECT command prepares a redirection via WCT.  It should be the last command in the WCT file. See how the new templates use this command:

    http\template\save_audio_profile.wct
    http\template\save_whos_online_options.wct

WHO'S ONLINE WEB CLIENT

The WHO'S ONLINE web client (html-who.wcx) was completely written with a new look and feel using new template variables @OTHERNODE.XXXXXX@ instead of the SUBx variables.

The SUBx are still used for compatibility with other templates.  But the new template http\template\WHOS_ONLINE.HTM was completely redone with the new OTHERNODE.XXXXX variables.  See http\template\WHOS_ONLINE.HTM for internal documentation.

Other enabled options for WHOS'S ONLINE:

   - A icon to write email directly to user
   - User ability to edit refresh and audio on/off
   - Optional icon to run HTML-USERINFO.WCX if it exist

WCBASIC

- CHG: The HTML-MSGSELECT.WCC module is now deprecated.

HTML-MSGSELECT was part of the personal properties "Messaging" tab to edit the mail options.

With the new PERSONAL client layout and customization property pages added, HTML-MSGSELECT was moved into HTML-PERSONAL, which handles all the page displays now, and handles the saving of options for the stock personal properties pages.

- ENH: USERPROPLIB.WCH Header

This WCH helps organized the internal USER PROFILE variables (names and default values) into one place.

- NEW: WCX Libraries can now read command line parameters.

In the past, a WCX library did not see the parameters passed to the calling WCX process application.  This is make it handle for WCX  libraries to see what the calling WCX was seeing as far as parameters.

NOTE: This is normal standard behavior for Processes and DLLs under windows.  WCX now follows the same logic.

- NEW: All the CLIENT WCX modules have a new ACCESS error page.

The CLIENT modules are:

    HTML-MESSAGE       --> Called by /CLIENT?MESSAGE.WCN
    HTML-FILE          --> Called by /CLIENT?FILE.WCN
    HTML-PERSONAL      --> Called by /CLIENT?PERSONAL.WCN
    HTML-CHAT          --> Called by /CLIENT?CHAT.WCN
    HTML-TERMINAL      --> Called by /CLIENT?TERMINAL.WCN
    HTML-WHO           --> Called by /CLIENT?WHO.WCN

In the past, if the user lacked access, a simply string was printed:

       You do not have access to run this client.

Now, each client will look for an error template page:

       wc:\http\template\NoClientAccess.htm

If found, it will be used to display the no access error display page.

WCSERVER

- NEW: A new LastCall key index for the user database.

Currently WCSERVER managers the users database with four keys,

   UserIdKey  - index of user' internal id #
   UserNameKey  - index of user's login name
   UserLastNameKey - index of user's last name
   UserSecurityKey - index of user's security

Now, a fifth one was added.

    UserLastCallKey - index of user's last call dates

This allows for five ways to do fast user looks ups.  The lastcall key was added to better support applications that is doing "Who Called Table" type applications.  But it can be used to quickly find the callers of your system by date range.

Please note, WCSERVER will automatically create the new INDEX file when you restart.

The is a massive approximate for developers to better scale the Wildcat! RPC CLient/server system.  A tool like "Who Called Table" requires a  complete transveral of the user's database (read each record).  For a large system, this can penalize the server if there are many users using an application like "Who Called Table".

For example, the following WCBASIC code would be the old and current way it would be done to find the who called table:

    // Show today's callers

    dim tid as integer
    dim u as Tuser
    Dim Today as DATETIME
    GetCurrentDateTime(Today)

    // scan all records
    if GetFirstUser(UserIdKey,u,tid) then
       do
         if DateString(Today)=DateString(u.LastCall) then
            print User.Info.Name
         end if
       loop while GetNextUser(UserIdKey,u,tid)
    end if

In the above, every record is read starting from the first to the last one.  So if you have 10,000 users, that is 10,000 user record requests from the server.

The problem is we didn't have a field that was sorted by date, such as the user's Last Call date.

With the new UserLastCallKey index, the above changes to this:

    // scan by lastcall starting with the last (newest)
    if GetLastUser(UserLastCallKey,u,tid) then
       do
         if DateString(Today)=DateString(u.LastCall) then
            print User.Info.Name
         else
            exit do // break out of do loop
         end if
       loop while GetPrevUser(UserLastCallKey,u,tid)
    end if

With the above we lookup by the user's last call date in reverse order.

This is a trememous reduction in server request.  If you have 10,000 users but only a few users called today thus far, the search will be require the minimum number of few calls to be made.  Not 10,000!!