Reading for this week:
Online assistance: 6.916 Q&A forum
You can assume that your server needs to serve only one family at a time. You don't have to persistently maintain a tree for more than one family.
For the purposes of the problem set, you can assume that your family is trustworthy. You can let any registered user edit anything.
Here are some guidelines for your data model:
create table family_relatives ( relative_id integer primary key, -- optional pointer to users table user_id references users, spouse references family_relatives, mother references family_relatives, father references family_relatives, -- in case they don't know the exact birthdate birthyear integer, birthday date, -- sadly, not everyone is still with us deathyear integer, first_names varchar(100) not null, last_name varchar(100) not null, sex char(1) check (sex in ('m','f')), -- note the use of multi-column check constraints check ( birthyear is not null or birthday is not null) );
create table family_photos ( family_photo_id integer primary key, photo blob not null, -- file name including extension but not path client_file_name varchar(500), file_type varchar(100), -- this is a MIME type (e.g., image/jpeg) file_extension varchar(50), -- e.g., "jpg" caption varchar(4000), -- when was this photo taken item_date date, item_year integer, original_width integer, original_height integer, access_control varchar(20) check (access_control in ('public', 'family', 'designated')), check (item_date is not null or item_year is not null) ); -- a photo might contain more than one person so we need -- an extra table create table family_photo_relative_map ( relative_id references family_relatives, family_photo_id references family_photos, primary key (relative_id, family_photo_id) ); create table family_photo_access_control ( family_photo_id references family_photos, user_id references users, -- note the order we spec the primary key -- (makes it fast to ask "who gets to see this photo") primary key (family_photo_id, user_id) );
create table family_stories ( family_story_id integer primary key, story clob not null, item_date date, item_year integer, access_control varchar(20) check (access_control in ('public', 'family', 'designated')), check (item_date is not null or item_year is not null) ); -- a story might be about more than one person create table family_story_relative_map ( family_story_id references family_stories, relative_id references family_relatives, primary key (relative_id, family_story_id) );
family_relatives
table
ns_ora blob_dml_file
API call documented in http://arsdigita.com/free-tools/oracle-driver.html
and also ns_queryget
from the AOLserver API.
You can find source code models for photo uploading in /comments/upload-attachment.tcl.
Once a photo is in the system and associated with one relative, provide an interface to add an association to one or more additional relatives.
Edit the family tree display page to show an extra little "p" when one or more photos including a relative are available. Once the user clicks on an individual, show the available photos of that person organized by the age the person would be in the photo (based on what your server knows about the date of the photo and the birth date of the relative).
For writing photos back to the Web, you'll need to return appropriate
HTTP and MIME headers, then call ns_ora write_blob
to
pull the photo direct from Oracle and write it to the Web.
Examples of ACS pages that do this include the following:
ns_ora clob_dml
API call documented in
http://arsdigita.com/free-tools/oracle-driver.html
family_events
(what is being planned) and
family_events_registration
(who is signed up). Each
event should have a creator who will be the coordinator.
Provide pages in a /family/events/ directory that will let people see who is signed up for a particular event, spam the attendees, etc. Link this in with general comments so that users can make public comments on an event.
family_stories
,
it will be nice to provide users with the ability to search through
them.
Build a /family/search-stories.tcl page that lets users search through
the CLOBs in family_stories
. Note that
For examples of how to query and present results, read http://photo.net/doc/site-wide-search.html and the Oracle Intermedia Text reference at http://philip.greenspun.com/sql/ref/intermediatext.create index family_stories_ctx on family_stories (story) indextype is ctxsys.context;
It is permanently housed at http://philip.greenspun.com/teaching/psets/ps5/ps5.adp.