The FrontPage Voting Sample Component

 

What is the VoteBot Component?

Installation Overview

Installing for Win32 systems

Compiling and Installing for UNIX systems

Compiling modified VoteBot code

 

What is the VoteBot Component?

The FrontPage VoteBot SDK Sample is a client/server component built using the  FrontPage98 Bot SDK.  It is intended to exemplify how such a component might be written, and in the process makes use of some of the new Bot SDK functionality  (such as the WriteLinks MIME header) added for FrontPage98.  For a detailed explanation of the Bot SDK, please see the Microsoft FrontPage98 Software Developer's Kit (fpdevkit.doc in the SDK directory).

Once inserted onto a page, the VoteBot allows authors to specify whether the component will be used to allow users to vote for an opinion or a proposal.   This opinion or proposal should be contained elsewhere on the page, normally somewhere before the VoteBot component.  Also, this component allows authors to configure VoteBot to prompt for one of 3 types of votes: Yes/No, Agree/Disagree, or For/Against

When the page containing the VoteBot component is displayed in a browser, the user is able to express his/her feelings about the opinion/proposal found elsewhere on the page by selecting the appropriate vote option and clicking the "Cast My Vote!" button.  When the button is clicked, the user's vote is passed to the bot's server-side module, which constructs a confirmation page and returns it to the browser.  This confirmation page announces that the user's vote has been registered and tallied, and also displays the percentage of the voting population that agrees with the user's vote.

 

Installation Overview

This directory contains the source and Windows binaries necessary to install the FrontPage VoteBot Sample Component. The Windows binaries will run on Windows 95 or Windows NT 4.0.  

To install the VoteBot on a UNIX system, you must have correct file permissions to access the web server's directories. You must also compile the server source yourself.  The source has been tested on HPUX and Solaris systems.

Directory Structure:

client - Contains source code for compiling the client DLL
server - Contains source code for compiling the server DLL on all platforms
misc - Contains Miscellaneous files for the FrontPage VoteBot Sample component which are required for it to work correctly.
winbin - Contains the files which are produced by compiling the source
in the client and server directories for Windows.

*Please note that for FrontPage98, only users with author/admin access for the root web will have the ability to make newly-installed custom bots appear in the "Insert FrontPage Component" dialog after executing the Recalculate Hyperlinks command!

 

Installing for Win32 systems

This section instructs you on how to install the FrontPage VoteBot sample for Win95 and WinNT systems.  It is really quite simple.  Please note that you must have file and directory access permission for the machine on which you are installing this WebBot Component.

Please note that all the source code for this WebBot Component is on the FrontPage CD-ROM in the \sdk directory.

A. If you want all servers on the local machine to be able to use the VoteBot Sample Component, do the following:

1) Create the directory "bots" in the FrontPage program root directory.   Usually this will be C:\Program Files\Microsoft FrontPage\bots

2) In the bots directory, create another directory called "VoteBot".

3) Copy the following files to the votebot directory you just created.  These files can all be found in the \sdk\webbot\votebot\winbin directory on the FrontPage 98 CD-ROM:
votebot.inf
votesrvr.dll
votebot.dll


B. If you want only specific servers on the local machine to be able to use the VoteBot Sample Component, do the following:

1) For each server that you want to be able to access the VoteBot component, create a directory called "_vti_bot" in the server's root web directory.  Usually this will be:

C:\FrontPage Webs\Content\_vti_bot for FrontPage PWS
C:\webshare\wwwroot\_vti_bot for MS PWS
C:\InetPub\wwwroot\_vti_bot for MS IIS

2) In the _vti_bot directory that you just created, make a new directory called "votebot".

3) Copy the following files to the votebot directory you just created.  These files can all be found in the \sdk\webbot\votebot\winbin directory on the FrontPage 98 CD-ROM:
votebot.inf
votesrvr.dll
votebot.dll


C. Now you need to copy the executable program (votebot.exe) into each FrontPage web. For each web server that you want to be able to access the VoteBot Sample Component, do the following:

1) Find the cgi-bin directory for the FrontPage web. This is often just a directory directly under the root web directory. Sometimes web servers will have the cgi-bin directory mapped to another directory on the drive.  If your web server does not have a cgi-bin directory, and does not have a mapping for cgi-bin programs to another directory, you'll have to place the .exe in the _vti_bin directory of the root web.  For FrontPage98, this directory will always be marked executable.

2) Copy the file votebot.exe into the cgi-bin (or _vti_bin) directory for the FrontPage web.

3) Ensure the cgi-bin directory is executable. You can check if the directory is executable by right clicking on it and choosing "Properties" in the FrontPage Explorer.

4) In the [FrontPage 3.0] section of frontpg.ini on the server machine, add the following entry:

AllowExecutableScripts=

frontpg.ini is located in the windows directory on the server machine.

You must do a Recalculate Hyperlinks operation before the VoteBot Sample Component will appear in the "Insert FrontPage Component" dialog in FrontPage Editor.  To do this, run the FrontPage Explorer and open the root web for which the VoteBot sample was installed.  Then, select the command Tools->Recalculate Hyperlinks

You are done installing the VoteBot Sample Component. You can use it by executing Insert->FrontPage Component in the FrontPage Editor while the FrontPage Explorer has a FrontPage web open with the VoteBot Sample Component installed.

 

Compiling and Installing for UNIX systems

The server-side files for the VoteBot sample component will need to be built before they are moved to the appropriate directories.  In the following instructions replace $WEBROOT with your actual web content directory.

To compile the server files, you may need to edit the makefile (found in the server directory).  The makefile is currently set to compile Release code for non-SGI UNIX platforms.  The server files have been tested, and will compile for, HPUX and Solaris systems.  If you are compiling for a different UNIX system, for example SGI, you may have to make additional modifications to the makefile or the source files.

If you are compiling for UNIX, be sure to ftp the files to the UNIX system using ASCII mode, or to convert the files from MS-DOS format to UNIX format on the UNIX system before attempting to compile.  After editing the makefile, run make on it.

The result of compiling are two files: votesrvr.so and votebot.exe in the Release directory.  Note that on UNIX the makefile produces a shared object file (.so) instead of a dynamic link library (.dll). 

Next, to install the built components, do the following:

Edit votebot.inf to reference votesrvr.so instead of votesrvr.dll
Copy Release/votebot.exe to $WEBROOT/cgi-bin (or $WEBROOT/_vti_bin if the server does not have a cgi-bin directory)
Copy Release/votesrvr.so to $WEBROOT/_vti_bot/votebot
Copy ../misc/votebot.inf to $WEBROOT/_vti_bot/votebot
Copy ../winbin/votebot.dll to $WEBROOT/_vti_bot/votebot

Notes: If you decide to copy votebot.dll to the UNIX server via ftp, you may want to use BINARY mode.

If votebot.exe was placed in the cgi-bin directory, you'll need to make some modifications (see the SERK) to the frontpg.ini file.

If votebot.exe was placed in the _vti_bin directory, you'll need to do a chmod a+x for this file.

You must do a Recalculate Hyperlinks operation before the VoteBot Sample Component will appear in the "Insert FrontPage Component" dialog in FrontPage Editor.  To do this, run the FrontPage Explorer and open the root web on the server for which the VoteBot sample was installed.  Then, select the command Tools->Recalculate Hyperlinks

You are done installing the VoteBot Sample Component. You can use it by executing Insert->FrontPage Component in the FrontPage Editor while the FrontPage Explorer has a FrontPage web open with the VoteBot Sample Component installed.

 

Compiling Modified VoteBot Code

If you decide to make a change to one or more of the VoteBot Sample source files (either client or server), it will be necessary for you to re-compile the source into the appropriate DLL's and exe's.  This section gives a brief summary on compilation procedures.

There are two parts to the FrontPage VoteBot Sample component. The client section is compiled into a DLL file (votebot.dll), which is run on the client system. The server section is compiled into two programs (votesrvr.dll, votebot.exe), which run on the server system.  If the server is Windows NT or Windows 95, please see the Windows section to learn how you can use the binaries located in the "winbin" directory, rather than compiling the source yourself.  The client files are in the directory "client", and the server files are in the directory "server".

Compiling the client files

The client files are set up to be compiled with Microsoft Visual C++ 5.0.  To compile, load votebot.dsw as a project workspace in MSVC, or run nmake on votebot.mak. The result of the compilation will be the file votebot.dll, in the Release directory. This is the DLL which will run on the client system when a user inserts the VoteBot Sample component. This should be compiled for Windows even if the server is not Windows.

Compiling the server files

Steps required to compile the server files differ according to server platform.  For instructions on compiling the server files for UNIX, see the UNIX install section.

To compile the server files for Windows, you'll need to run nmake on votebot.mak and votesrvr.mak from the /server directory.  Or, you can import these two makefiles as projects (see the Microsoft VC5 documentation for details).  The results of compiling are two files: votesrvr.dll and votebot.exe.  These files can then be installed as described in the Windows install section, above.