Business constructions by Russel Thurston from www.artville.comRobosites
How NetObjects Fusion can create a hot site for you from your database


by John San Filippo

Think of the Web as a window on data—almost any kind of data. Most Web pages today are created from word processing files and other text data. But many businesses have tons of data in databases to make it easier to retrieve and sort in countless useful ways. Now it's easier than ever to take that data and put it on the Web, or an intranet.

One of the most common reasons you'd want to use a database to build a Web site is to offer a catalog of products. Your database might contain information such as a product name, description, price, or even pictures. If you have hundreds of items, and your list of items or prices changes regularly, building all those pages by hand could be a huge task that requires many people working long hours.

But if your Web site is built from the information you already store and update in your database, then your site can always be up to date, at low cost with little manual intervention.

Another example of a database-driven site is eFuse.com's own Stylizer. NetObjects Fusion has more than 200 SiteStyles that give sites a professional look right out of the box. eFuse.com wanted to show them all but present them to readers grouped by various impressions: "formal," "casual," "modern," "traditional," "cool," and "warm."

When broken down this way, the site required more than 1,000 pages. Doing this by hand literally could have taken hundreds of hours. But using NetObjects Fusion's database features, the editor created one simple database (which didn't even require a database program; it was simply typed in using the notepad!). The database is really a list with the name of each style, its "impression," and the filename of the screen shot. The designer created one page for each of the impressions and NetObjects Fusion did the rest, reading the database, inserting that data and the associated graphics onto the pages, and automatically generating more than 1,000 pages in just a few minutes!

Static or live

There are two basic kinds of database-driven sites: static, like the Stylizer for which standard HTML files are created from a database, and live or realtime, for which the fixed HTML pages are replaced by a "server" that creates pages on-the-fly when someone visits the site and requests certain information.

NetObjects Fusion 4.0 supports the creation of live pages. If the information in the database changes by the minute, then so do the Web pages visitors see. They always see the latest version of your information. NetObjects Fusion 4.0's easy-to-use connectivity features mean no programming is required to connect your database to your Web site, though you do need to use special Web servers such as Allaire Cold Fusion, Lotus Domino, or Microsoft Active Server Pages.

If your site is hosted by a remote ISP, you may not have access to one of these special servers. Or, if your data doesn't change as frequently, you might not need this kind of real-time connection.

 NetObjects Fusion has built-in data publishing capabilities that allow you to publish data drawn from a variety of desktop database programs, including Access, FileMaker Pro, and FoxPro. NetObjects Fusion achieves this feat by extracting the current data from your database when you publish your site. In other words, although the data is not "live" on your Web site, the current data does get published each time you republish your site, without any additional action required by you.

If you don't have a database program and you still want to use this feature, what do you do?

You have two choices. You can, as eFuse.com did, simply type your data into a simple format such as "comma delimited ASCII" so it looks like this:

Stylename, formal, modern, serious, cool, C:\styles\stylepic.gif

Each "record" or item gets its own line, with each "field" or subitem separated by commas. Notice how you can even point to a graphic image file on your hard disk and have it automatically added to your Web page. For another tip about adding graphics this way, see eFuse.com's Build Tips and Tricks.

Your other choice is to take advantage of the fact that NetObjects Fusion let's you create a database inside itself, so you actually enter this information into NetObjects Fusion one record at a time.  While this works, it often makes more sense to use a database program, or type your records in ASCII format. Then you can edit them more easily, which lets you take more advantage of the database format.

How it works

NetObjects Fusion's database publishing capabilities can be a little confusing at first, mainly because of the unique terminology the programmers at NetObjects came up with to describe the process. There are three important terms with which you need to become familiar before you can master NetObjects Fusion desktop database publishing.

  • The first term is data object. A data object is essentially a pointer to the particular desktop database file from which you wish to publish information. Once you've created a data object in your site, you can use it over and over, applying different filtering options in each use. For example, suppose you maintain a database of company press releases. You can create a single data object from that database and then, by applying a simple filter, create one Web page that lists 1998 press releases, one page that lists 1999 press releases, one page that lists all releases where the subject contains the word "Cat," and another list that only lists releases that contain the word "Dog." All these pages draw from the same data object.
  • The next term to know is data list. When you want to publish information from a database, you create a data list on your page that shows an abbreviated listing of all the records you're publishing. This page becomes a parent to the pages beneath it that will display your records, one per page. Each item in the data list includes a hypertext link to the corresponding child page that contains that complete record.
  • The final term here is stacked pages. Instead of treating each child page mentioned in the previous paragraph as an individual page, all the child pages that are linked to a particular data list are treated as a single collection of stacked pages. NetObjects Fusion creates these stacked pages automatically any time you create a new data list. What this means is that instead of formatting each page individually, you're able to format just one page and have that formatting applied to all the records in that set of stacked pages.

This might make more sense if we go back to the press release example. In this scenario, the data list might include only the date and headline for each press release. More than likely, the headline would serve as the hypertext link to the stacked page. After you've created the data list, you can jump down one level in the hierarchy. Here you'll find only one page, which includes the first record in your database. You format this page however you want. Then when you publish the site, a separate page formatted to this specification is created for each database record.

Here's another area of possible confusion. The way I described the three main components, you'd think the first step in the process is creating a data object. However, that's not exactly correct. Instead, you start by creating a data list. It's while creating the data list that you actually create the data object.

Don't worry if you're still a little confused by all this. I tried and tried to figure out this process by reading the documentation, but it didn't make a bit of sense until I actually tried it. I suggest you do the same. However, before you get started, you should make sure you have everything you need.

What you need

If you use Windows, you need the following:

  • NetObjects Fusion for Windows.
  • The correct ISAM driver for your database application. NetObjects Fusion has built-in support for Access. However, if you install the correct ISAM driver, you can also use data from FoxPro, Visual FoxPro, Paradox, Excel, dBase, or virtually any database that can create a "Comma Delimited ASCII" file. You can find complete instructions for downloading and installing ISAM drivers on the NetObjects Web site.
  • A database file from which you wish to publish information.

If you use a Mac, you need the following:

  • NetObjects Fusion for the Mac OS.
  • An installed copy of FileMaker Pro. FileMaker Pro is the only supported database on the Mac platform. To publish a FileMaker Pro database, you need to have the database open in FileMaker Pro when you create the data object. That means someone can't give you a FileMaker Pro database to publish if you don't have the application yourself.
  • A FileMaker Pro database file from which you wish to publish information.

To help you practice, I've provided an Access file for Windows users. Since NetObjects Fusion has built-in support for Access, you won't have to fiddle around with any ISAM drivers at this point if you don't want to. And for Mac users, I've provided a sample FileMaker Pro database. Just remember you must have FileMaker Pro installed on your system.

Step by step

I'm going to assume at this point that you already have NetObjects Fusion running and you're in Page view on a page where you want to create the data list. I've used screen grabs from Windows, but the Mac interface is nearly identical. I'll be sure to point out any variations.

  1. Click on the Data List button on the Advanced Tools toolbar. It looks like this. Data publishing button
  2. Click the pointer in the approximate location where you want the data list to appear. This pops up a Data Publishing window that looks like this. Don't worry about clicking in the exact place because you can move the list later.

    Data Publishing dialog
     
  3. Click on the New button. This presents you with a Data Object window, as shown here. Note that you have the option to create either an internal or external data object. While NetObjects Fusion allows you to create an internal data object and thus store records within your site, internal data objects will be covered in a later article.

    Data Objects Dialog
     
  4. Click the External radio button and then click the Source button. This displays a Data Source Type window, as shown here. Note that NetObjects Fusion gives you the option to publish from a desktop database or from an ODBC/SQL database.

    Data Source Type Windows

    At this point, the Mac interface looks a little different. On a Mac, the Data Source Type window looks like this. We're interested in a database file on a local drive.

    Data Source Type Mac
     
  5. On Windows, select the appropriate file format from the Type popup and then click Browse; on a Mac, click on the Select button. In either case, you're given the opportunity to navigate around your system and identify the desired source database. After selecting the file and a couple of OK clicks, you find yourself back at the Data List Properties window.

Sort and filter

Although this article cannot thoroughly explore your sorting and filtering options, I'll touch on them briefly here. NetObjects Fusion allows you to sort your records, thereby controlling the order in which your stacked pages are created. This works much like the sorting feature in a typical database program. You can also create data filter. This allows you to include only certain records based on criteria you define. For example, with the database of press releases, you could create a filter that excluded all but 1999 press releases.

The most important area of the Data List Properties window is the Fields list. By marking the check box in front of each field, you control whether that particular field is included in the data list. By selecting a field and then clicking the Link/Unlink button, you control whether that particular field serves as a hypertext link to a stacked page. You can also adjust the order of the fields by clicking the arrows on the right.

Your Stacked Pages options are also very important. If you check the "Automatically display all fields" check box, all fields from the database will appear on the stacked page. Otherwise, you'll have to manually add fields to the stacked page. It's easier to check this box and then remove the fields when you format the stacked page. Checking the "Add next and previous navigation buttons" check box causes NetObjects Fusion to automatically add navigation buttons for poking around your stacked pages. This is a nice touch.

After you've specified the desired options in this window, click OK. This takes you back to your page, where you'll find your new data list, like the one shown below. The little icon in front of the list is whatever image was specified as the Data List Icon for your current SiteStyle. Note that at this point, the data list contains no actual records; the complete list is generated when you publish the site. You can resize, format, and move the data list just as you would any other table.

Data List 

The next step is to format the stacked page. By whatever means you prefer, navigate down one level in the site hierarchy to display the stacked page. Once there, you can move the fields around and format the page pretty much any way you want.

You may have noticed that the NavBar and Banner read something like "Untitled Stacked Page." Since NetObjects Fusion treats all stacked pages for one data list as a single page, they all share the same banner and are represented by one icon on any NavBar. After you're done formatting your stacked page, click over to the Site view and use the Custom Names button on the Properties palette to change both the NavBar and Banner names for your stacked pages.

The final step in the process is publishing your site. Just to make sure it looks the way you want, I recommend local publishing first. In addition to letting you verify the formatting, this also lets you confirm that your sorting and filtering worked as you expected.

Once you've double-checked the local publish, wrap it up with your remote publish. The next time any information changes in your database, all you need to do is republish your site. NetObjects Fusion will take care of updating all your stacked pages.

As with most things, the first time is the hardest, but if you follow these steps, you can build your first database-driven site in minutes, and after that, it literally is a snap to build more.

Once you see how fast and easy this is, you'll start to think of lots of ways that information you already have can be almost instantly and automatically turned into hundreds or thousands of useful Web pages, with almost no effort on your part. Pretty neat, huh?

b-line 

About the author

john-san-filipoJohn is the author of NetObjects Fusion 3 for Dummies, as well as a  number of other computer books. He is also the editor of ComputorEdge magazine, the technology correspondent for The Credit Union Journal, and the San Diego chief correspondent for Radio Digest. He can be reached at his Web site.

Illustration: Business Constructions by Russel Thurston of www.artville.com
 

[Home] [Start Here] [Plan] [Design] [Build] [Grow] [FuseLetter] [New]

SITE MAP - Contact us - Legal Info
www.efuse.com ©2000, NetObjects

Sign up for our free FuseLetter!

BuiltByNOF

bulletTry NetObjects Fusion for free
bulletBuy  NetObjects Fusion 4 for $49
bulletBuy FusionMX for $99

Learn about NetObjects Training Classes

fuseman