SQLData Systems, Inc.
e-Bridge User Guide
e-Bridge User Guide
Introduction
SQLData e-Bridge is a complete e-Commerce server that allows you to sell all your products with no programming. The package is 100% database driven and supports all ODBC compliant database systems, featuring embedded shopping cart, powerful order processing framework, automatic inventory deduction and flexible payment handling.
Here is a list of features offered by the SQLData e-Bridge Server:
- Database Driven
: The e-Bridge server operates on orders, products and shoppers stored in database tables. It supports all ODBC compliant database systems. The installed databases are in Microsoft Access under the DATA subdirectory. We have predefined many database tables for demonstration purpose. They can be altered or exported to fit your needs.
- Shopping Cart
: The server comes with full featured shopping cart management. It allows shoppers to add, remove, change products in the shopping cart, and automatically cleans up it after checking out.
- Inventory Management
: The server performs automatic inventory deduction for all listed products.
- Order Processing: The e-Bridge uses a concept of shopping pipeline. Multiple stages are defined in the server for processing customer orders. You can add or remove order processing stages as needed. All these can be done through web browsers.
- Data Validations
: Multiple layers of data validation are implemented in e-Bridge. Java Scripts are used for preliminary validation in shopper's browser and regular expressions are used on the server side.
- Guest Book
: A guest book is provided, which contains shopper information such as address and telephone numbers. Registered guests can check order status, view order history and update registration information online.
- Supplier Service
: The server allows suppliers to add products, increase inventory, check orders and order details using a web browser.
- e-mail notification
: The server sends e-mail confirmation to customers after order completion. A notification is also sent to suppliers with order id and product id.
- Secure Order Form
: The server uses SSL 3.0. Communications between the server and users browsers go through channel encryption and decryption.
Setting Up the Server
The installation is very easy, the setup program asks couple very simple questions and installs the server at specified directory. The server should be fully functional after installation. It can be started either from your system control panel as a Windows NT service or from the Program folder.
Note:
The default port for the e-Bridge server is 8731. It also uses port 80 if the port is available.
Start the Server as a Windows NT service
Go to the Control Panel and double click the Services icon.
In the service list, select SQLData e-Bridge Server and click the start button.
You may want to set the Startup mode to Automatic when it is fully functional. The server will automatically start when the machine is powered on.
Start the Server from the Program Folder
The server is located at:
Start->Program->SQLData Service->e-Bridge Server
The server runs as a console program and shows error messages in its window.
Run the server in debug mode
In case the server does not start properly using the method above, you can find out the problem by running the server in debug mode:
- Start a DOS prompt and change the directory to the BIN subdirectory where the server is installed.
- Type in
sqldata -debug 4
The server runs in very verbose mode and displays detailed processing information. All the information is also logged in the files under the LOGS subdirectory.
Adding Products
The e-Bridge server provides interfaces for adding products into merchant stores. You must register as a supplier to use the services. To register:
- Type http://yourhost:8731 to enter the storefront, where yourhost is the machine name on which the server is installed.
- Click on the Merchant Service link to enter the merchant service area.
- Click the Register button and enter all information on the screen. Supplier ID is the key for accessing your product and record, it should contain only letters and digits. Your email address is used for sending notifications when an order is received.
- Write down your Supplier ID and password and click the Add New button.
After registering in the database, you can now adding your products into the store:
- Click the My Product link while you are in the merchant service area, and type in your supplier ID and password if asked.
- The serve displays a list of products belong to you. The list is empty the first time you logged in. Click on the Add New button on the bottom of the page.
- Enter your product information as completely as possible. The ImageURL points to an image file under the HTDOCS\IMAGE directory, it can be empty if no image available. The CategoryID is a string description of your category, try to use common category name such as Books, Computers etc. The product URL is optional, it should point to a web page that describes your product in further detail.
- Click the Add New button when done.
You products are made available immediately when they are added. You can now go to the storefront to buy the products.
Shopping in the e-Bridge Server
The e-Bridge server provides a persist shopping cart for each user, which means items in the shopping cart can be checked out many days later. It also facilitates product searches and hot item searches.
Here is a simple procedure of shopping in the e-Bridge store:
- Type http://yourhost:8731 in a web browser to enter e-Bridge server.
- Click on the Products link to show a list of products.
- Select a category and click the search button if your product of interest is not displayed, otherwise click on one of the products in the list to show product details.
- On the product detail page, enter the quantity you wish to buy and click the Add To Cart Button.
- The server displays the content of your shopping cart with price, shipping charges, taxes and the total displayed in the far right of the page.
- Click the Continue Shopping if you wish to buy other products (and repeat step 3-5). Follow the Checkout link if you want to pay for the products.
- The server shows a Guest Book if you are a first-time buyer, please fill in all entries in the registration screen. Otherwise a shipping screen is displayed.
- Select Ship to My Home or a complete shipping address in the form and click the Next button.
- Select the Payment method, Credit card type and type in a credit card number (use 4111111111111111 for test) on the payment screen. Click the next button to finalize the payment.
- The server displays a thank-you note and the purchase is complete.
An email message will also be sent to you confirming the purchase.
Using Online Customer Services
Once you made a service, you can view order history, check order status, and change guest book record using web browsers.
- Click on the Customer Services link while you are in the e-Bridge storefront.
- Click the Login link and enter your user id and password.
- Click the My Orders link to show your order history (A empty list is displayed if you haven't logged in). Select the order you wish to view in detail.
- The server displays the order details including status. On the bottom of the page, the server shows a link for Order Items, which contains detailed information about items of the order.
You may also update your record by clicking on the My Record. The server displays your registration information in a record editor. You may change your address, password etc.
Using Online Merchant Services
Once registered, a supplier can manage products, control inventories, check customer orders using the online merchant services provided by the e-Bridge server.
Once an order is finalized, the server sends an email notification to suppliers. For offline payment merchant, the supplier is responsible for processing the payment and shipping the product out.
The e-Bridge server captures order information in three database tables: Orders, OrderDetails and Payments. The Orders table contains basic order information and shipping address. OrderDetails contains items in each order and Payment stores payment method, credit card information.
A store may have many suppliers and each supplier can only view its own orders through the e-Bridge Merchant Services.
The following is a simple procedure for checking customer orders.
- Click on the Merchant Services link once you are in the storefront.
- Click the Login button and enter supplier ID and password.
- Click the Customer Orders link to see all orders belong to you.
The e-Bridge server currently doesn't provide online payment services.
How the Server Works
The e-Bridge server is built on top of the SQLData Enterprise Server. Most of the features offered by the enterprise server are also available in the e-Bridge server. Unlike the SQLData Enterprise Server, however, the e-Bridge server has build-in business rules for handling transactions, managing inventories and controlling data flows and so on. These business rules are stored in two database tables:
- TableLogic: Contains SQL Procedures, reports, triggers and other database related routines. Almost all SQL statements used by the e-Bridge server can be found in the table. The server loads the table at startup and keeps it in memory for efficiency.
- Pipeline: Contains definitions of stages in Logic Processing Pipeline (LPP) (Refer to
Building Business Logic for definition of LPP). Each stage has internal processor, external processor, and may refer to more than one SQL procedures in the TableLogic table. A shopping process is divided into smaller united called stages. For instance, shipping and payment are stages in the pipeline. Stages can be chained together through the NextStage column in the table. The server executes stages one after another (if each stage is executed successfully) until the NextStage is empty.
The component responsible for executing pipeline stages is SHOPPER.DLL, a server extension component. The processor requires at least two parameters, the store name and the stage name, and have the following syntax:
http://www.yourhost.com/shopper.dll?StoreName=YourStore&Stage=YourStage
where YourStore is the name of the store and YourStage is the stage to be executed. It can also be used in a HTML form where store name and stage name are hidden parameters: such as the following
<form method="POST" action="shopper.dll">
<input type=hidden name="StoreName", value="MyStore">
<input type=hidden name="Stage", value="ADDCART">
… the rest of the form elements
</form>
The example above is the actual code for adding an item into a shopping cart. Before we get into the details how the request is processed, let’s take a look at the definition of stage ADDCART:
Group Name (Store Name) : MyStore
Stage : ADDCART
SQLProcedure : GetCart
Action : INSERT
OnSuccess : ShowCart
The stage defines the SQL procedure to be executed, the database operation to be taken and what to do when successful. The whole process of adding a product into a shopping cart is summarized in the following:
- The server receives the posted form and passes it along with the entire HTTP request to SHOPPER.DLL for processing.
- The shopper component finds the ADD cart stage, and prepares the SQL statement defined in GetCart for a positioned operation. Note that GetCart is just a SQL select statement using cookie and customer id as condition.
- The component then instructs the SQLData Server to perform an INSERT operation to the SHOPPINGCART table. The server collects all values in the form and performs a positioned insert operation.
- The component executes the next stage: ShowCart, which displays the contents of the shopping cart, if the insert operation was successful. Otherwise, a default error page is sent to the user.
The idea of storing pipeline stages and business logic in database table is to allow storeowners to make changes and adjust the process without programming. You may dramatically change the way customer order is processed by modifying either the LPP or SQL Procedures.
Calculating Totals and Discounts
Selling product online often involving calculation of total line items, discounts, taxes, shipping charges and so on. The computations are done in the HTML pages and handled by SQLData script processor and template tokens. So you have the freedom to perform computation in your own ways.
Adding up totals
User selected items are stored in the ShoppingCart table. One of main tasks of display shopping cart contents is to show the total charge of all items in the shopping cart. The SQLData server offers one template token to simplify the task. The syntax of the template token is:
GetTotal(VarName, Price, Quantity, Discount);
Where
- VarName: The variable name where the final result is stored. It should be a character string with no spaces in it. The server store the variable and its value in the Request object.
- Price: The name of price column in a database table.
- Quantity: The name of quantity column in a database table. The variable is optional. Quantity=1 is assumed as the default.
- Discount: The name of a discount column, if any, in a database table. The discount must be in percentage. The variable is optional, the default value is 0.
For each record in the result set, the template token calculates the line item total using
(Price-Price*Discount)*Quatity, and adds them together. It then saves the final result in the specified variable. The variable can later be retrieved using the GetValue template token.
Most of the calculations are done on the template file: ShoppingCart.HTML in several steps:
Calculate the line item total using
GetTotal("_LineTotal", "Price", "Quantity", "Discount");
Add up the shipping charges using
GetTotal("_Shipping", "ShippingCharge", "", "");
Compute the taxes using SQLData Scripts:
[Code Tax=GetValue(_LineTotal)+GetValue(_Shipping);
Tax=Tax*0.06;
SetValue("_Tax", Tax);
]
assume a 6 percent tax rate. The tax value is stored in a session variable _Tax.
Sum all together to get the grant total:
[Code Tax=Add(GetValue("_LineTotal"), GetValue("_Shipping"))+GetValue("_Tax");
SetEnvSetting("_Total", Total);
]
Note that the final value is stored in the Session object using the SetEnvSetting function, the value persists until the session is terminated. This is how the total is carried over to the Payment stage.
All the code is in the SHOPPINGCART.HTML file. You may modify the file to suit your requirements. For further information about SQLData Script Language can be find in the
Server Scripting Guide.
Other Related Documents
Template Token Guide
SQLData Scripting Guide
Server Configuration
Building Business Logic