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 WebSite37 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 Application Server 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.
Create an empty database to contain your Web-based system--the target database.
In the Main Designer, publish the following objects from the WebSite database to the target database:
|
Object |
Purpose |
|---|---|
Reads a file structure and stores the data in the appropriate table | |
Make sure the target URL directory--the directory where you want 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:
Follow the additional instructions that appear in pgStoreWebPages.html:
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.
Copyright © 2001, SilverStream Software, Inc. All rights reserved.