The WebSite application demonstrates how to import a Web site -- consisting of HTML files and image files -- from a file-based system to a database, using the same directory structure as the file system. This technique can be used to create a customized Web-based information system.

This sample application resides in the WebSite3 database.

One advantage of storing Web content files in a database is that the data can be navigated for full-text searching, similar to the way the SilverStream online help system works. Once the files are imported into the database, a servlet serves up the images and pages from the SilverStream server to your browser.

Implementing this technique

To implement this technique for your own application, follow these steps:
  1. Install the WebSite3 database and add it to your server.
  2. Create an empty database to contain your Web-based system -- the target database.
  3. In the main SilverStream Designer, publish the following objects from the WebSite3 database to the target database:

    Object Purpose
    • HTMLTable
    • ImageTable
    Stores the HTML and image files.
    Page: pgStoreWebPages Reads a file structure and stores the data in the appropriate table.
    Business Object: bosrvletWebPages Serves up the pages in a browser.
    Form: frmHTMLTable Displays and updates the HTML data.

  4. Make sure the target URL directory -- the directory where you wish to store all Web pages -- matches the URL named in the servlet bosrvletWebPages.

    By default, the servlet looks for a directory named WebPages. To alter this setting, make the following changes in bosrvletWebPages:

  5. Follow the additional instructions that appear in pgStoreWebPages.html:

  6. Verify that the process worked by opening your new database in a browser.

    You should see the URL you specified. By clicking on this link, you will be able to access your HTML pages and images.