Welcome to the second part of a two-part series on building a tree with Active Client Pages. In this part, we will use the example of a museum's web site to take a close look at the code for a session. We'll see how the tree facilitates project development.
Completing a Tree with Active Client Pages (Page 1 of 4 )
Description of the Example
This is a hypothetical example. You have the web site of a museum. The museum contains old furniture, old shoes and old bags. The web site describes and shows everything that is in the museum.
As you can see, the existence of categories in the project becomes apparent. The master page gives you the general descriptions of the categories of items in the museum. These categories are the furniture, shoes and bags.
After the master page you can have three more pages: a page for the furniture that describes the items in more detail and links to the individual classes of furniture; another page that describes the shoes in the museum, and links to individual classes of shoes; the third page that describes the bags in the museum, and links to individual classes of bags. When you click a link on one of these first (second from the user’s perspective) level pages you see the final details of an item class in the museum.
The above description can be better put into a tree. This is the tree:
I use only windows for the pages. I did not use documents for the pages. From the tree, it is easier to do your ACP design. In some other example you would have more than one level of categories, and the tree would be longer, growing downward.
From the tree I can better continue with the description of the example. Node N0 is the master page that gives you a general description of the museum. Node N1_0 is the furniture page that has the links to furniture class pages. Node N2_0_0 is a page that talks about the chairs in the museum; this is one class (details). Node N2_1_0 is a page that talks about tables in the museum. Node N2_2_0 is a page that talks about the cupboards in the museum.
The other nodes can be similarly described. To save time and space I will not describe them here. At this point you should have the complete code and try (experiment with) it following the instructions given below, before you continue. There are thirteen files for the project. All of these files are in one zip file which can be obtained from here:
Use a personal web server where the root directory is “localhost.” Create a cgi-bin directory in the root directory. Unzip the downloaded file. Place the treeACP.htm file in the root directory. Place the rest of the files in the cgi-bin directory. Open you browser and typehttp://localhost/treeACP.htm; you should have the master page. Click all the buttons in all the different pages (as they open) to appreciate the design.