MIS 4372 -- Midterm -- Spring 2012 -- Parks

Name ________________________________________________________________ Last 4 digits of PSID_______________
A simple content management database contains a single table that stores the HTML components of multiple pages. This table is named cm. Each HTML page has a unique identifier named page_name. Each HTML page contains mutiple DIV block or SPAN block elements each in a table row (element_name) that contain the actual content (cont) and several attributes (zindex, fontname, fontsize, backcolor, forecolor, toploc, lftloc, etc.). The structure of the table cm is:
Column Name [conditions or info]CSS STYLE attribute name and format
na = NOT APPLICABLE
page_id bigint identity (1,1),na
page_name varchar(30),na
element_name varchar(30),na
div_or_span int, [1 is a DIV block, 2 is a SPAN block]na
zindex int,z-index:[zindex value];
fontname varchar(40),font-family:[fontname value];
fontsize int,font-size:[fontsize value]px;
backcolorhex char(6),background-color:#[backcolorhex value];
forecolorhex char(6),color:#[forecolorhex value];
toploc int, [value used to specify the element's Top attribute]Top:[toploc value]px;
lftloc int, [value used to specify the element's Left attribute]Left:[lftloc value]px;
hi int, [contains a positive integer for height only if div_or_span=1, otherwise contains a 0]height:[hi value]px;
wide int, [contains a positive integer for width if div_or_span=1, otherwise contains a 0],width:[wide value]px;
bordr_wid int, [contains a positive integer only if div_or_span=1, otherwise contains a 0],CSS format:

border:[bordr_style] #[bordr_color] [bordr_wid]px;

bordr_color varchar(10), [contains a string only if div_or_span=1, otherwise contains a single blank],
bordr_style varchar(10), [contains a string only if div_or_span=1, otherwise contains a single blank],
cont varchar(8000), [this is the HTML content of the DIV or SPAN]na
PRIMARY KEY (page_name,element_name)

  • (80 points) Create a four pass asp program named modpage.asp to modify a specific page's element (i.e., update a row in the cm table). The program should:
    1. In PASS1, create a form (METHOD=GET) that has:
      • a textbox to specify the page_name and
      • a hidden variable name token with the value "2"
      • a submit button
    2. In PASS2, rollout from the cm table a list of ALL the elements for the page_name chosen in pass 1. This is a list of links of the form:

      <br><a href='modpage.asp?token=3&pn=[place the page_name from Pass1 here]&en=[place the element_name here]'>[place the element_name here]</a>

      on the next line show the element's cont value.

    3. In PASS3, create a form (METHOD="GET"), that shows ALL the attributes elements and content for the page_name specified in PASS1 and the element_name chosen in PASS2. Issues:
      • The div_or_span attribute is made with two radio buttons (DIV and SPAN)
      • The HTML content of the DIV or SPAN (stored in the cont column) is shown in a textarea (rows=100 cols=80)
      • All other CSS attribute values are in textboxes of the appropriate size (see above for sizes)
      • Also include:
        • a hidden variable for the page_name (called pn)
        • a hidden variable for the element_name (called en)
        • a hidden variable named token with value="4"
    4. In PASS4, update the cm table with the data from PASS3. NO DATA EDITS
  • (20 points) When the asp program named display.asp is executed, it always has a querystring that specifies the name of the page to be displayed in the form:

    some_URL/display.asp?pn=[some page_name that appears in the cm table]

    display.asp is a single page that has the code to roll through ALL the elements in the cm table for the page_name specified and the necessary code to display the page's entire contents (i.e., all the DIV and/or SPAN elements with their content with CSS attributes). Issues: