Up and Running with Frontier Web Site Management
by Matt Neuburg
Author of the book Frontier: The Definitive Guide

Prev | TOC | Next


Getting Comfortable With Tables

Table manners

Now let's return to our examination of the Root Window. It is typical of another major class of window -- it's a table.

The big difference between tables and outlines is that every item in an outline is just a line of text, whereas every item in a table can be any one of a couple of dozen kinds of thing. Not only that; every item in a table has a name.

We can't just start randomly playing with the table in the Root Window (it's the database, and you remember what I said about breaking the database), so do this: see the first line of the window, the one with "examples" in the first line? Click its triangle (to select the whole line), and hit command-enter [ctl-keypad-enter]. A new window opens, showing a different table (the "examples" table). You may do just about anything you like in this window: it's in the database, but nothing about Frontier's workings depends upon anything here.

To begin with, a table is an outline. Everything we just learned about outlines is true of tables. You can use all the keyboard shortcuts, and items in the Outliner menu. But not every item in a table can have subitems. We'll learn why in just a moment. Take a second now to play around with the "examples" table as an outline.

Next, notice the column headings at the top: Name, Value, and Kind. You can click on any of them to make the bundle containing the selection sort itself on that column. (You can rearrange the items of a bundle manually, but that's only temporary; internally, Frontier sees every bundle of every table as sorted by one of these three columns, and will eventually restore its order.)

You can widen and narrow columns by dragging the divider lines between them. You can resize the window. You can change the font and size in which its text is displayed. Go ahead and play with these features now.

All right, now let's get serious. Look at the Kind column. A table can contain various kinds of things. One thing it can contain is more tables! Do you see a correspondence between the shading of the triangles at the left of the line and whether or not that item is a table? In a table, a subtable (and only a subtable) can have subitems, and can be expanded to show the items in that table. Try this with the subtable called "funStuff"; expand it as you would any outline item that has hidden subitems.

Now stop a moment, and think about the first subitem of funStuff, which is called "adventure". The window title shows that we are in the "examples" table. Is "adventure" an item in the "examples" table? Well -- no, not really. We can see and work with "adventure" from the "examples" table, as a matter of convenience. But "adventure" is an item of the "funStuff" table.

Select the triangle of the "funStuff" line, and hit command-enter [ctl-keypad-enter]. The "funStuff" table opens as a separate window. Compare this with the "examples" table. Do you see now why I say that "adventure" is in the "funStuff" table, not the "examples" table?

Remember what we've learned. If, in a table window, there is a subtable, there are two ways to open that subtable:

Other things in tables

Let's go back to thinking about the kinds of thing a table can contain. We've learned it can contain another table. But another thing it can contain is formatted text, called "wp text" (for "word-processing text"). One example here is called "readme". Let's read it. To do so, you can double-click on the triangle at the left of the name "readme", or select in the "readme" line and press command-enter [ctl-keypad-enter], or double-click in its Value column.

Now you can read it. Notice that it is like a little word-processing document. You can change the font, size, and style of individual stretches of text. You can alter the automatic line-wrapping to fit the size of the window with the Margins Fit Window of the WP menu that appears when a wptext is open.

A table can also contain an outline. The outline we looked at earlier, examples.universe, turns out to be right here in the "examples" table. Find it. Open it. Close it.

Keyboard navigation

As we already saw, when you're in a table, command-enter [ctl-keypad-enter] opens what is selected in that table. Similarly, shift-command-enter [backspace] goes from whatever you're in back out to the "parent", the table that contains it.

Also, the option-key [alt] makes what you're seeing now close as the next thing opens. So option-command-enter opens what is selected in a table while closing the table itself, and shift-option-command-enter opens a thing's parent while closing the thing itself [neither of these is available on Windows, apparently].

You can also option-double-click [alt-double-click] an item's Value column to open that item while dismissing its containing table window.

Another important trick is that you can command-click [right-click] on a window's title to see a popup menu of its containing tables, and choose from that popup to go to a desired table. (On Mac OS, you can hold the option-key while choosing, to close the current window at the same time.)

The current window can be closed by clicking in its go-away box [close button]. All windows (except the Root Window) can be closed at once, by option-clicking [alt-clicking] in the go-away box [close button] of any window (except the Root Window). You can use keyboard shortcut command-W [ctl-W] and command-option-W instead if you like.

Now's your moment to play with all this. Here's a summary:

go deeper                  cmd-Enter [ctl-keypad-enter]
                           cmd-dbl-click [ctl-dbl-click] triangle
                           dbl-click Value column
go deeper and dismiss      cmd-option-Enter
                           cmd-opt-dbl-click [ctl-alt-dbl-click] triangle
                           opt-dbl-click [alt-dbl-click] Value col
go shallower               cmd-shift-Enter [backspace]
go shallower and dismiss   cmd-shift-option-Enter
close this window          cmd-W [ctl-W]
close all windows          cmd-option-W
                           opt-click [alt-click] close box
popup containers           cmd-press [rt-click] window title
go container and dismiss   opt-choose from popup

Names and navigation

Clearly you now have the tools to go wherever you want within the database. But you do not, in fact, have to drill down by outlines or windows to go to a particular place in the database; you can go directly, if you know the name of where you want to go.

Let's talk about the business of names in a Frontier table. Frontier needs to be able to refer to every object in its database by a unique name. To do this, it strings together the names of all the tables containing the object, plus the object's name within its table. The pieces of the name are joined with a period.

Here's an example. Go to the Root Window, open the "user" subtable, and open its "prefs" subtable. You see the line called "initials"? That line shows the initials you gave Frontier when you first started up the program.

Now, what's the full name of this table item? We're inside the "prefs" subtable of the "user" table; so the full name of the "initials" entry is actually "user.prefs.initials". (You might argue that since the "user" table is inside the "root" table, the name should really be "root.user.prefs.initials", and that's quite right; but since absolutely everything is ultimately inside the "root" table, it is usual to omit "root" from the beginning of names.)

In this tutorial, I'll refer to database entries by partial names like "initials" or longer names like "user.prefs.initials", whichever seems likely to be clearest.

So now if I tell you the full name of an object in the database you should be able to find it by opening a succession of windows or by expanding lines of an outline. Let's try it, shall we? What's in user.scheduler.prefs.reschedule? In my database, it says "false". It might say something else in yours. The point is to make sure you can find any object given its full name.

Now, let's return to the point I was originally making. You do not have to "drill down" like this every time you are given the name of an object to go to. If you choose Jump from the Main menu you can type the name of any object and you'll be taken there instantly.

Try it: use Jump to find out what's inside user.webserver.prefs.errorPage. Say, it looks like some HTML!

Selecting and editing

Now get back to the "examples" table again, and let's use it to consider one more thing about tables: selections.

Click in the "Kind" column of various rows. Notice how the entire row is selected when you do this. You can also use arrow keys to manipulate the selection (because this is an outline), or type a letter to jump to the first entry whose name follows that letter alphabetically.

Now select any line, and hit Enter [keypad-enter]. Now instead of the whole row being selected, the selection point is at the end of the entry in the "Name" column. Now if you type a letter you add to the item's name. (You can try it if you like.) Hitting Enter [keypad-enter] repeatedly toggles between selecting a table entry as a whole (selection mode) and selecting the contents of that entry (content mode), just as with an outline.

But here's a surprise. Try clicking in the "Value" column of the rows called "setFontTest", "song", "soundTester". That just selects the whole row. But now click in the "Value" column of the row called "synonym". Whooops! Instead of selecting the whole line, you've just put the insertion point into the word "handle" -- and now, if you like, you can edit that word! What's going on here?

Let's remember what a table is. It's a collection of things of various kinds; each thing has a name. The names "setFontTest", "song", and "soundTester" are just names -- they are not the thing. To see the thing, double-click the "Value" column. For instance, "song" is actually an outline containing the "Tennessee Stud" song.

Well, "synonym" is just a name too -- it isn't the thing. The thing is the word "handle" -- a particular piece of unformatted text, or (as the "Kind" column tells you) a string.

There are two broad categories of kind of item in a table. Things like wptexts and outlines are edited by opening up a separate window. But things like this "synonym" are edited directly, right in the table. Things such as strings and numbers, which are edited directly in the table, are called "scalars". Things such as wptexts and outlines, which are edited in a separate edit window, are called "non-scalars".

One more navigation trick. Select the whole "synonym" line, hit Enter [keypad-enter] and then hit Tab. As you can see, when you're in content mode, you can use the Tab key to navigate from the "Name" column into the "Value" column. Shift-Tab moves you back to the "Name" column.

And now, the moment you've been waiting for: creating a new item in a table. Just select any line, and then hit Return [enter], just as in an outline. Presto: a new item has been created, and it's waiting for you to give it a new name. So type a name, hit Tab, and type a value (for instance, the value could be "hi there", without the quotes). Now hit Enter [keypad-enter] to get out of content mode and back to selection mode; that's important because it makes your new item become real.

There's another way to make a new item in a table, which might seem less convenient but which I actually use much more commonly: choose from the Table menu. I like this method because it gives you a chance to pick the Kind and name the item before actually making it. The various kinds are arranged in three groups in the Table menu: the five non-scalar types come first, and then come Scalar, Special, and Mac Type hierarchical submenus. Try choosing from the New Scalar submenu to create a new string called "myNewString" (don't type the quotes into the dialog box).

There are many other sorts of things stored in the database besides strings, wptexts, and tables; just about every one of them is exemplified in the "examples" table. (Say, maybe that's why it's called the "examples" table!) We won't study these right now, because we are now sufficiently familiar with the Frontier environment to build our first Web site. However, if you wish to play and explore a while in the "examples" table first, you certainly can. Get good at working with tables, because you'll be doing a lot of it from now on.


Prev | TOC | Next

All text is by Matt Neuburg, phd, matt@tidbits.com.
For information about the book Frontier: The Definitive Guide, see my home page:
http://www.tidbits.com/matt
All text copyright Matt Neuburg, 1997 and 1998. ALL RIGHTS RESERVED.
No one else has any right to copy or reproduce in any form, including electronic. You may download this material but you may not post it for others to see or distribute it to others without explicit permission from the author.
Downloadable versions at http://www.ojai.net/matt/downloads/webTutorial.hqx and http://www.ojai.net/matt/downloads/webTutorial.zip.
Please do not confuse this tutorial with a certain other Frontier 5 tutorial based upon my earlier work.
This page created with Frontier, 2/11/2000; 6:59:51 PM.