The Internet Business Cards System
by Daniel Sabsay, v1.16 Aug 5, 2000
Overview
The Internet Business Card system consists of two web servers, three databases, several CGIs, applets, servelets and image libraries. The two servers are known as (1) The Application server, and (2) The Affiliate server. These servers are generally run on separate computers, but this is not strictly necessary. Both websites use hidden state variables, not "cookies" to provide session continuity and to track Affiliate identity. In addition, the system utilizes an external server called AuthorizeNet to provide payment gateway services.
All webpages in both websites are dynamically built by the CGIs from memory-resident HTML templates (including a common footer) by substituting "<!INCLUDE:xxx>" markers for the current value of the associated variable. The exception is the home page for each Affiliate which is built once by the Affiliate server from a master local template, and then transferred by FTP to a dynamically-created folder on the Application server. Thereafter, they are served as static HTML pages by the Application server.
(back to top)
The Application Server
The Application server handles all the high-traffic webpages requiring image display and custom image generation. This server also provides the secure credit card ordering form to the customer, but the form's data is actually sent directly to the AuthorizeNet server by the customer's web browser using SSL. AuthorizeNet then sends the results of this payment transaction to the Application server on a secure (HTTPS) link. Using these results, the Application server returns a confirmation page to the customer, and sends the order to the Affiliate server by e-mail (with credit card data scrambled). This server also provides FTP services for remote upload of new Affiliate home folders.
(back to top)
Application CGIs, servelets and applets
- design.acgi (CGI)
Methods:
Language: HyperCard & AppleScript
Location: WebSTAR:cgi-bin folder
Launched: by alias in Start Up folder
Externals: StrsOnPict XFCN (embedded within this stack)
Files: Several image libraries and HTML templates explicitly designated by the form on the first page of the stack (see: Templates & Libraries)
Notes: There are three main scripts in this stack. The AppleScript routines for sending e-mail and listing folder contents are in the Stack script. The main CGI sequence is in the card script, and the remainder is in the background script.
- layout.acgi (CGI)
Methods:
- EDIT - Serves template 16layout.html with current large image. This page loads the Java applet (layoutedit.jar)
- DISPLAY - Serves template 17display.html with current large image
- FORWARD - Serves template 17display.html with current large image
- REVIEW - Creates a new version of the current large image utilizing the changed text parameters from the Java applet, and serves template 17display.html
- UPDATE - Creates a new version of the current large image utilizing the changed text parameters from the Java applet, and returns the changed image to the Java applet (layoutedit.jar).
- DONE - Creates a new version of the current large image utilizing the changed text parameters from the Java applet, and invokes method MESSAGE of design.acgi.
Language: Applescript
Launched: by alias in Start Up folder
Location: WebSTAR:cgi-bin folder
Externals:
- layout.lib in WebSTAR:cgi-bin folder
- Parse CGI in System:Scripting Additions folder (freeware)
- PixStack in the WebSTAR folder (contains StrsOnPict XFCN)
- layoutedit.jar in the WebSTAR cgi-bin folder
- design.acgi in the WebSTAR cgi-bin folder
Files: Several image libraries and HTML templates (see: Templates & Libraries)
- layout.lib (code library)
Purpose: A library of subroutines for layout.acgi, loaded at launch
Language: Applescript
Location: WebSTAR:cgi-bin folder
Externals: layout.acgi
- layoutedit.jar (applet)
Purpose: Browser-side layout design capability
Language: Java
Location: WebSTAR:cgi-bin folder
Launched: served by WebSTAR
Externals: None
Files: Two input images dynamically prepared by layout.acgi
- MondoMail (e-mail sending servelet)
Purpose:
- Sends customer orders by e-mail from the design.acgi to the Affiliate server
- Data packet in the e-mail body is bracketed by "[[DATA]]" markers
- Fields are keyword=value, separated by "&" characters in escaped HTML format
Language: executable (commercial product)
Location: WebSTAR:MondoMail folder
Launched: by alias in Start Up folder
Externals: MondoMail Extensions (preferences file in MondoMail folder in AppleScript format)
- PixStack (container for StrsOnPict XFCN)
Purpose: Engine that generates a BOTT JPEG image file
Language: C
Location: WebSTAR folder
Launched: by alias in Start Up folder
Externals: Invoked by layout.acgi
(back to top)
Application templates and libraries
-
01edit.html
Location: WebSTAR folder
Type: HTML template - served by design.acgi
Buttons:
- 02default
Purpose:
- Single group of medium-resolution images with default text (taken from 08CATsmall)
- Generated as necessary by design.acgi when requested as showcase card on 01edit.html
Location: WebSTAR folder
Type: Library folder - used by design.acgi
- 03medium
Purpose: Single group of all master card images as 248 x 152 pixel GIFs without text
Location: WebSTAR folder
Type: Library folder - used by design.acgi
-
04blank.pict
Purpose: Merged with medium 248 x 152 pixel images to provide bleed frame
Location: WebSTAR folder
Type: Pict file - used by design.acgi
- 05mediumjpgs
Purpose: Temporary repository for custom medium 248 x 152 pixel images (must be cleaned out regularly)
Location: WebSTAR folder
Type: Library folder
- 06large
Purpose:
- Contains a single group of master 440 x 250 PICT images without text
- Must contain a completely white PICT file called "all_white" (used by layout.acgi)
Location: WebSTAR folder
Type: Library folder - used by design.acgi
-
07frame.pict
Purpose: Merged with large 440 x 250 pixel images to provide bleed frame
Location: WebSTAR folder
Type: PICT file - used by design.acgi
- 08CATsmall
Purpose:
- Topic-named subfolders with groups of small JPEG images with text & parameters
- Folder names MUST match NAME tags in 28affiliateHome.html template
- Image files (in the subfolders) all reference images in the master set (in 06large)
- Certain operations, such as method TOPIC of design.acgi display only the first redundant file
- Image files are treated as redundant based on the first four letters of the name
- Text size, style and location properties are scaled for large-sized image
Location: WebSTAR folder
Type: Library folder - used by design.acgi
-
09approve.html
Location: WebSTAR folder
Type: HTML template - served by design.acgi
Buttons:
-
10decline.html
Location: WebSTAR folder
Type: HTML template - served by design.acgi
Buttons:
-
11pleaseCustomize.html
Location: WebSTAR folder
Type: HTML template - served by design.acgi
Buttons: (TBS)
- 12backgrounds
Location: WebSTAR folder
Type: Library folder - used by layout.acgi to retain large-sized versions of master cards without text.
-
13topic.html
Location: WebSTAR folder
Type: HTML template - served by design.acgi
Buttons:
- MORE CARDS - browser back button
- <click on card> - method SELECTION of design.acgi (the image's "NAME" tag identifies a target subfolder within 08CATsmall)
-
14order.html
Location: WebSTAR folder
Type: HTML template - served by design.acgi (see Order Form)
Buttons:
- ORDER NOW - method AUTH_CAPTURE/Relay_Response of AuthorizeNet
- <click on custom card> - method EDIT of layout.acgi
-
15confirm.html
Location: WebSTAR folder
Type: HTML template - served by design.acgi
Buttons:
-
16layout.html
Location: WebSTAR folder
Type: HTML template - served by layout.acgi
Buttons:
-
17display.html
Location: WebSTAR folder
Type: HTML template - served by layout.acgi
Buttons:
-
18review.html
Location: WebSTAR folder
Type: HTML template - served by layout.acgi
Buttons:
-
19reorder.html (currently unused)
Location: WebSTAR folder
Type: HTML template - served by design.acgi
-
41footer.html
Location: WebSTAR folder
Type: HTML template - used by design.acgi and layout.acgi
Buttons: none
(back to top)
The Affiliate Server
The Affiliate server handles customers who want to register as Affiliates, and provides registered Affiliates with web-based status and update capability. In addition, this server automatically receives batches of customer orders sent by e-mail from the Application server, and handles the fulfillment process for these orders.
The server uses three linked FileMaker Pro databases to register Affiliates and record customer orders. The IBC administrator can use a remote FileMaker Pro application to review and edit any data in these databases. When an order arrives by e-mail, a confirmation message is automatically sent to the customer along with a low-resolution version of the custom card image. (If the customer has ordered a high resolution image, it is sent instead.) For printed card orders, a high resolution image is sent to the appropriate printer by email along with a PDF file containing the customer's invoice. All JPEG images are custom-created with local libraries using the BOTT format.
When the printer has shipped the order, he simply replies to the orginal e-mail message. The system automatically receives these replies, and sends a shipping notification to the customer by e-mail. Orders flagged for future payment by check are held in the database and reported to the system administrator by e-mail. When the administrator replies to these original e-mail messages, they automatically re-activate the delayed order. Additional e-mail messages are sent to the administrator when an Affiliate registers, terminates, leaves a message, or requests payment. There is also a message sent to an Affiliate who has forgotten his password. Replies from e-mails sent to the administrator requesting payment or termination automatically update the database.
(back to top)
Affiliate CGIs, servelets and databases
- affiliate.acgi (CGI)
Purpose:
Methods:
Language: Applescript
Launched: by alias in Start Up folder
Location: WebSTAR:cgi-bin folder
Externals:
- affiliate.lib in WebSTAR:cgi-bin folder
- Parse CGI in System:Scripting Additions folder
Files: Several image libraries and HTML templates (see: Templates & Libraries)
- affiliate.lib (subroutine library)
Purpose: A library of subroutines for affiliate.acgi, loaded at launch
Language: Applescript
Location: WebSTAR:cgi-bin folder
Externals: affiliate.acgi
- Claris Emailer (e-mail client)
Purpose:
- Receives customer orders
- Receives printer ship notices, IBC administrator check-paid notices & affiliate-paid notices
- Sends customer confirmation messages
- Sends printer orders
- Sends administration notifications
Language: executable (commercial product)
Location: any folder
Launched: by alias in Start Up folder
Externals:
- Filter actions for customer orders, printer ship & admin paid notices
- Controlled by affiliate.acgi and scripts within Master_Control & Affiliate_Control
- Master_Control (database)
Purpose:
- Stores the data for all customers, and is linked to Affiate_Control database
- Generates PDF invoices and custom images for the card printer
Language: FileMaker Pro
Location: any folder with (4) and (5)
Launched: by alias in Start Up folder
Externals:
- Receives e-mail orders generated by design.acgi on Application Server
- Commands Claris Emailer to send orders/notifications and receive replies
- Contains scripts which are invoked by affiliate.acgi
- Generates PDF invoices using the PDFWriter chooser module
- Affiliate_Control (database)
Purpose: Stores the data for all Affiliates, and linked to Master_Control & Affiliate_Detail
Language: FileMaker Pro
Location: any folder with (3) and (5)
Launched: by alias in Start Up folder
Externals:
- Contains several scripts which are invoked by affiliate.acgi
- Script "[REMOTE] - Create Affiliate Home Folder" uses FTP to send a customized version of 30affiliateFolder to folder "A" on the Application Server. This is a password-protected process for user=Affiliate, see the script for the password.
- Commands Claris Emailer to send notifications
- Affiliate_Detail (database)
Purpose: Stores a change history of the Affiliate_Control database
Language: FileMaker Pro
Location: any folder with (3) and (4)
Launched: by alias in Start Up folder
Externals: Utilized by affiliate.acgi, and linked to Affiliate_Control
- PixStack (container for StrsOnPict XFCN)
Purpose: Engine that generates a BOTT JPEG image file
Language: C
Location: any folder (WebSTAR folder preferred)
Launched: by alias in Start Up folder
Externals: Invoked by Master_Control
(back to top)
Affiliate templates and libraries
(back to top)
BOTT Technology Basics
All images generated and displayed by this system use the Comments feature of the JPEG format to store extra text containing the name of the base image, as well as the content, style and position of the text lines overlayed onto the image. This allows the software to retrieve the text and re-edit the composite image at any time. Images of this type are used in the 08CATsmall segmented folder (see below) to provide a library of images with sample (default) text. The current system uses 4 image sizes (1) small ? x ?, (2) medium 248 x 152 pixel, (3) large 440 x 250 pixel and (4) hi-rez ? x ?.
(back to top)
The Order Form
All data fields from the 14order.html order form are sent to AuthorizeNet and returned to design.acgi with some additions (AuthorizeNet field names are preceded by "x_"). Design.acgi deletes the field x_card_num (credit card number) from the package for security reasons, and sends the rest to Master_Control where they are selectively imported by script "Load Order Fields". Each imported field is extracted from the e-mail message and stored in the appropriate database field by a three step sequence (1) SET the fieldname into global variable _keyword, (2) PERFORM "Load a Field" and (3) SET global variable _field_value into the target database field. Target field names in Master_Control are generally not the same as the field names in 14order.html
(back to top)