CSCI-4220 Network Programming
Spring 2000
Project 4 - CGI Based Composite Web Page Manager
Due Date: March 20th
Tape Delay Due Date: March 28th
Composite Web Pages
A Composite Web Page is a web page that holds other web pages. Using
HTML frames, you can split the browser window in to sections - each
section can be filled with any web page.
You job is to build a CGI system that allows users to create
and use composite web pages. The user creates a composite web
page by filling out a form that includes the name of the new
(composite) web page and a list of the URLS that should each be placed
in a frame. Later the user can ask your CGI for one of these web pages
(using the name) and the result is that the browser gets the
composite web page.
Project requirements
- The system must be CGI based.
- You can wite your CGI program(s) in any language, although if you
are using something we might not have you need to check with us.
(C, C++, perl are all OK).
- The system must have a login screen. Before a user can use
they must tell the system who they are. You don't need to worry about
security (no passwords are necessary), the idea is just that different
users could create and use different collections of composite web
pages.
- You system should use HTTP cookies so that the user does not
need to login every time they request a composite web page (only
the first time). I'd suggest using a cookie with no expriation date so
the browser does not store it on disk.
- Each user can create multiple composite web pages, and later ask
for them by name.
- A user should be able to get a list of thier composite web pages,
these should be hyperlinks (the user can click on the name and get
the composite web page).
- It must be possible to "bookmark" the composite web pages.
- You should include JavaScript in all you HTML forms to make sure
the user enters something.
Demo system
There is a demonstration system running that allows you to build and
fetch composite web pages - this system does not (yet) support
multiple users (no login screen). You system must support multiple
users!.
For now (until I spiff it up), the demo system should be considered
nothing more than the general idea of having a CGI system that allows
you to build and request composite web pages (if you don't understand
what a composite web page is - play with the system and you'll see
what I mean).
The demo is at:
http://cgi.cs.rpi.edu/~hollingd/netprog/priv/comp.cgi
HTML Frames
If you don't know anything about HTML frames, here is a brief
description. You probably want to check out some of the links to HTML
resources on Dave's netprog home page for more information.
Frames allow you to divide the browser window into independent
frames, each frame holds a web page. It's easy to get started
using frames - you only need to learn about 2 tags:
FRAMESET and FRAME.
The FRAMESET tag
The FRAMESET HTML tag is used to define how the browser
window should be split up amongst multiple frames. You can control the
size of frames, whether things are split in to rows or columns,
etc.
Here is a couple of example FRAMESET tags:
<!-- This frameset tag splits the window in to 3 equal columns -->
<FRAMESET cols="*,*,*">
</FRAMESET>
<!-- This frameset tag splits the window in to 3 equal rows -->
<FRAMESET rows="*,*,*">
</FRAMESET>
<!-- This frameset tag splits the window so that the top frame is
1/2 the window and the lower 2 frames each get 1/4 of the window -->
<FRAMESET rows="50%,*,*">
</FRAMESET>
The FRAME tag
Between the FRAMESET and /FRAMESET tags can
be a number of FRAME tags that define what should be
placed inside the frames. In the simplest case you just specify the
SRC attribute with the value being a URL. A complete
example:
<!-- This frameset tag splits the window in to 2 equal columns -->
<FRAMESET cols="*,*">
<FRAME SRC="http://www.yahoo.com">
<FRAME SRC="http://www.excite.com/">
</FRAMESET>
Your CGI program needs to generate documents that include
FRAMESET and FRAME tags!
Submision
You should submit your source code to netprog-submit@cs.rpi.edu
including a README file and instructions on how to build your CGI
program(s).
IMPORTANT!
You must also include the URL of your running system! We don't
plan to build and install your CGI programs - we want to use your
running system whenever possible!
Ideas
- Build a couple of composite web pages by hand (edit a file
that is in your public.html directory and load it with a browser).
- Start with one of the demo CGI programs and modify it to do
what you want.
- If you are using C - check out the sample CGI program
named pizzacookie - it includes C code for getting and parsing
the request, and for parsing cookie headers.
- There are lots of things you can do to make the system
more useful:
- allow the user to specify (somehow) the layout of the
frames. Rows vs. columns vs. grid, etc.
- always include a (small) frame that is a control panel
- Allow users to edit existing composite web page definitions.
- I've tried to come up with an interesting CGI program that doesn't
require lots of file/IO parsing. You do need to save the definitions
of composite web pages, but that should be pretty simple. I envision
something like storing each composite web page in a file named for the
user and page (so keep them unique), when a request is made for a
composite web page you use the username and page name that come in
as part of the request to determine the filename.
- Start up a ".com" and make a billion dollars!