Sample Plug-ins

(download all the samples, here)

Electron Server ships with several sample plugins:

The ADO_DB Plug-in:

1) Place the "WebPlugInADO01.config" file in the same directory as the E2WebServer.exe. This is the configuration file that enables this plugin to connect to the Northwind DB. The config file consists of two lnes. The first line is the ADO connection string to the your intended DB. The second line identifies the "default database". This demo is pointing at the "Northwind" database. You may experiment with different configuration strings to match your own SQL Server installation.

2) If the "adortl70.bpl" file isn't already installed in the Environment path of the machine then place it in the same directory as the E2WebServer.exe. If this version of Delphi is already installed on this machine, then the machine already has (and can find) this BPL.

3) Place the WebPlugInADO01.bpl in the ..\E2WebServer\Plugins\E2Plugins directory.

4) Place "QueryGrid.template.txt" file in the directory: ..\E2WebServer\Plugins\E2Plugins\TADOTest02Templates

5) The full source for this ADO_DB plug-in is available in the "Sample Plug-ins" zip, downloadable from the Electron Server site.

The File Server Plug-in

The File Server Plug-in is the module which executes the serving of all disk based files (e.g. *.gif, *.jpg. *.html ect.)... Although this is basic part of any web server, I've exposed some of this functionality to third-party developers to give them a chance to tweak the behaviour if desired. For instance, perhaps you want to trap for a particular file request? This is one logical place to do that. WebPlugFileServer.bpl ships with the main distribution and will be located in the directory: ..\E2WebServer\Plugins\E2Plugins\ The full source for the File Server plug-in is available in the "Sample Plug-ins" zip, downloadable from the Electron Server site.

The Logger Plug-in

Electron Server exposes a plug-in interface for customized logging. If no custom logger is available Electron Server will use its default message logging, which means all messages will be written to the the memo buffer within the main application. If a custom logger (there can be only at a time) is present, then the user has the option to use it by indicating the choice in the applicatons main configuration file. Currently the product ships with one sample custom logger. The full source for the Nx Win Event sample logger plug-in is available in the "Sample Plug-ins" zip, downloadable from the Electron Server site. The full source for the Nx Win Event sample logger plug-in is available in the "Sample Plug-ins" zip, downloadable from the Electron Server site.

To install: The Nexus WinEvent Logger Plug-in requires the NexusDB207llxx.bpl to be placed in the same directory as E2WebServer.exe. NexusDB207llxx.bpl can be found in NexusDB207_BPLs.zip downloadable (Delphi D7 or Delphi 2006) from the Electron Server website. LoggerNxWinEvent.bpl must be placed in the logger directory: ..\E2WebServer\Plugins\Logger

The NexusDB Embedded Plug-in

The WebPlugInNxEmbed.bpl is a sample plug-in demsontrating how to write an embedded NexusDB Database Plug-in. You do not need the NexusDb product installed to use this plug-in. Although, you will need the NexusDB run-time pkgs.

Installing the NexusDB_Embedded Electron Server Plug-in:

  • 1) Download the NexusDB207_BPLs.zip (Delphi D7 or Delphi 2006) from the Electron Server web site and install all the BPLs in the same directory as E2Webserver.exe.

  • 2) Place the WebPlugInNxEmbed.bpl in the ..\E2WebServer\Plugins\E2Plugins directory.

  • 3) Place "QueryGrid.template.txt" file in the directory: ..\E2WebServer\Plugins\E2Plugins\TNxEmbed02Templates

  • 4) The full source for this NexusDB_Embedded Electron Server Plug-in is available in the "Sample Plug-ins" zip, downloadable from the Electron Server site.

The NexusDB Remote Plug-in

The WebPlugInNexus.bpl is a sample plug-in demsontrating how to write an Remote NexusDB Database Plug-in. You will need the NexusDb product installed to use this plug-in. And, you will need the NexusDB run-time pkgs.

Installing the NexusDB_Embedded Electron Server Plug-in:

  • 1) Download the NexusDB207_BPLs.zip (Delphi D7 or Delphi 2006) from the Electron Server web site and install all the BPLs in the same directory as E2Webserver.exe. Note, you can of course use any version of NexusDB BPLs you wish, as long as they match the version of Delphi Electron Server is compiled with, which at the moment will be either D7 or D2006.

  • 2) Place the WebPlugInNexus.bpl in the ..\E2WebServer\Plugins\E2Plugins directory.

  • 3) Place "QueryGrid.template.txt" file in the directory: ..\E2WebServer\Plugins\E2Plugins\TNxTest02Templates

  • 4) The full source for this Remote NexusDB Electron Server Plug-in is available in the "Sample Plug-ins" zip, downloadable from the Electron Server site.
NexusDB programmers may find this sample of interest, because I provide a way of reconnecting with a Remote NexusDb Server whenever a connection has been lost. One easy way to see this in action is to start up Electron Server without starting up the NexusDB Server. Use the demo to see this. When you attempt to navigate to the first page of the Remote NexusDB demo, you will get an error message saying something like it can't find a server. Now, start up the NexusDB Server, and refresh the web page. You will see the DB Alias names served up by the NexusDB Server. This means that we were able to reconnect to the NexusDB server without needing to start and stop the webserver! Check it out.

A Simple Test Plug-in

Our 'hello world' example is represented by WebPlugInTest.bpl It ships with the main distribution and is located in E2WebServer\Plugins\E2Plugins. The full source for the Simple Test plug-in is available in the "Sample Plug-ins" zip, downloadable from the Electron Server site. This is also the sample class we use in our "getting started - creating a plug-in class" tutorial.

The Site Demo Plug-in

The site demo plug-in is a simple plug-in that generates the left-hand pane of the demo website. It demonstrates how to interrogate the webserver for conditional meta-data affecting the html output of left pane. Specifically this plug-in checks to see which sample DB plug-in classes are installed and only generates links for the plug-ins that are present. As I said, a simple demo. This BPL: SITE_DEMO_01.bpl is already installed with the main distribution in the ..\E2WebServer\Plugins\E2Plugins directory. The full source for SITE_DEMO plug-in is available in the "Sample Plug-ins" zip, downloadable from the Electron Server site.