#! /usr/bin/python

#system wide include
import sys, os, cgi, cgitb, urllib; cgitb.enable()



sys.path.insert(0, "../lib/")
sys.path.insert(0, "../../")
#including our own utilities
import Utils

from DVDUI import DVDDocument
Page = DVDDocument(t='DVDs listing')
Page.SetScriptName(s='dvd')
Page.SetAllowedModes(['view'])
form = cgi.FieldStorage()


from DVD import DVDStore
DB = DVDStore()

# in this view-only mode we want the table to yave a bit more info 
# than in the listing mode for the usual admin script.
# we just have to modify the attributeslisted variable, as follows
DB.attributeslisted = ['title','movieURI', 'description']



DB.file= '../data/dvd.xml'
DB.load(DB.file)




## Main ##



if form.has_key("action"):
	Page.LoadMode(form)
if os.environ['REQUEST_METHOD'] == 'POST':
	Page.ProcessPost(DB, form)

Page.Start()
Page.WriteHead()
Page.WriteBanner()
Page.WriteContent(DB, form)
Page.WriteNavBar(form)    
Page.WriteFoot()


