Introduced in SilverStream 3.0, SilverBooks is a Web-based electronic commerce application that simulates an online bookstore. Users can interact with this application to purchase books from SilverBooks Corporation, a fictitious bookseller. There are two interfaces: an Internet and an Intranet.
This sample application resides in the SilverBooks3 database.
SilverBooks is written using Java servlets, which extend Web server functionality by responding to HTTP requests on URLs that are assigned to the servlets. One advantage of using servlets is that they are written entirely in Java and, therefore, work across platforms.
SilverBooks synthesizes a variety of state-of-the-art technologies in one full-featured application, including persistent session-level failover, enterprise JavaBeans, and credit card order processing. A feature called Behind the Scenes exposes these technologies for users in a context-sensitive way as they interact with SilverBooks.
This page covers the following topics:
For more information about servlets, see Using Servlet Business Object in the Programmer's Guide.
The SilverBooks application provides two interfaces: An Internet and an Intranet. Each of these interfaces serves a different user base with functions tailored to their unique needs.
The SilverBooks Internet component provides the following electronic commerce functions for the general public:
The SilverBooks internet is implemented using HTML pages that execute on the server. HTML is a technology that is more portable than Java in an internet environment where user configurations are not known and can run the gamut of technologies.
The Internet starts up by default on pgSilverBooks.html when you run the SilverBooks application. This home page provides access to search engines -- including full-text search -- for browsing inventory by various categories, to a mechanism for creating and querying accounts, and to a shopping cart for ordering products.
The Intranet is designed for internal users -- the employees of the SilverBooks corporation. Within the Intranet, SilverBooks employees can perform the following back office functions:
This corporate Intranet is implemented as a Java application running in SilverJRunner on a client machine. The application is launched from the form frmIntranet in the SilverBooks3 database. Java can be used here because users are internal and, therefore, their system environments can be configured to support state-of-the-art Java capabilities.
SilverJRunner is a pure Java dynamic application loader that can run in any Java 2 compliant environment. When running a Java application, SilverJRunner automatically downloads and caches the required SilverStream forms on the local hard drive. During this process, SilverJRunner automatically installs on the client machine any changes that were made to the application.
SilverBooks incorporates SilverStream technologies that solve a variety of application challenges, as summarized in this section. For more detailed explanations of the technologies that power this application, take a look at the SilverBooks Behind the Scenes component.
SilverBooks maintains critical data for each user's shopping cart in a persistent object store. Three SilverStream classes are used to manage user state:
To support session-level failover, the SilverBooks application uses a business object invPersistentStoreManager that extends the AgoPersistentStoreManager class to specify where and how user state will be stored as persistent data. In this case, the data is stored in a table called AgPersistentState in the SilverBooks3 database.
The AgoPersistentStateManager class provides methods that let users read data from and write data to the persistent store. The Shopping Cart servlet srvltShoppingCart.html calls a method on an AgoPersistentStateManager object, which evaluates the current application state. If application state needs to be recovered, the method instantiates a new AgoPersistentStateManager whose state is restored from the AgPersistentState table.
You can see persistent session-level failover in action on the Shopping Cart Page pgShoppingCart.html, which shows you the contents of your shopping basket at any time during your session.
To learn how to implement session-level failover using a live example, go to Application Techniques> HTML Client Techniques in the help system: Implementing Persistent Session-Level Failover.
For more information about working with Swing controls, see Programming Forms in the Programmer's Guide.
For more information about JavaBeans, see Using Utility Classes, JAR Files, and JavaBeans in the Programmer's Guide.
For more information about subpages, see Programming Pages in the Programmer's Guide.
For more information about tab panels, see Programming Pages in the Programmer's Guide.
For more information about table versioning, see Using Table-Modified Business Objects in the Programmer's Guide.
For more information about data binding, see Data Access Basics in the Programmer's Guide.
For more information about data caching, see Data Access Basics in the Programmer's Guide.
For more information about using HTML controls on pages, see Page Designer in the Tools Guide.
For more information about using HTTP session objects, see Triggered Object Basics in the Programmer's Guide.
The SilverBooks application is designed to work with an outside vendor, iTransact, for credit card order processing. The interface is an HTML form containing hidden and visible fields that is submitted to iTransact's CGI scripts.
This section describes how the process works and how to configure your system to exercise this functionality.
To build the HTML form and transmit the information to iTransact, Silver Books provide two servlets:
When an order is placed, an e-mail is sent to the customer and the merchant. A mail object listens for the merchant e-mail, parses it to find the credit card authorization, then inserts that authorization into SilverBooks.
To try out credit card order processing in SilverBooks, you must set up a test account with iTransact and enable the mail object.
To set up a test account with iTransact:
You will receive a merchant ID via e-mail.
For more information on running the SilverBooks Intranet, see Getting started.
To enable the mail object:
For more information about using the SMC, see Administration Overview in the Administrator's Guide.
The Business Object Designer opens.
SilverBooks includes a Behind the Scenes function that provides detailed, context-sensitive descriptions of the technologies underlying the forms and pages that make up this application.
To invoke Behind the Scenes:
The Behind the Scenes window opens, as in this example:
To get started exploring the SilverBooks application, follow these steps:
The Internet home page opens in your browser, as shown:
The Intranet portion of the application opens in SilverJRunner, as shown: