[Zope] New Zope user...how to create lists...and what happens to files

Steve Hunter Steve@hosys.com
Wed, 26 May 1999 23:41:16 -0400


Hello,
 The code below in Zope should
 1.Capture data from a Form into    <!--#vars
 2. Create an instances of an object whose variables are set to the values
in 1. and add the object to
    a persistent list of objects.  [e.g. adding persons to a Person db]
 3. Output the list as a table.

How do I do the middle part ?

Also...one field is a "file" filed. When the form is submitted I get an
indication that Zope
does something with the file....any idea what that is suppose to be ?

thanks,
 Steve

  THe CODE

------------------------------------------------------------
AddPosting (this is a document that collects info and calls
the doAddPosting document)
------------------------------------------------------------

<!--#var standard_html_header-->

<H2><CENTER>Add Potential Candidate Posting</CENTER> </H2>
<HR>

<FORM ACTION="doAddPosting" METHOD="POST"
      ENCTYPE="multipart/form-data">

<TABLE>
<TR><TH ALIGN="LEFT" VALIGN="TOP">Post Date:</TH>
    <TD ALIGN="LEFT" VALIGN=TOP">
    <INPUT TYPE="TEXT" NAME="submit_date" size="20" value="ADefaultDate">
</TR>
<TR>
    <TH ALIGN="LEFT" VALIGN="TOP">Applicant ID:</TH>
    <TD ALIGN="LEFT" VALIGN=TOP">
    <INPUT TYPE="TEXT" NAME="applicant_id" size="10" value="ACountUP">
</TR>
<TR>
    <TH ALIGN="LEFT" VALIGN="TOP">Synopsis</TH>
    <TD ALIGN="LEFT" VALIGN=TOP">
    <TEXTAREA NAME="synopsis" ROWs="5" COLs="60"></TEXTAREA>
</TR>
<TR>
    <TH ALIGN="LEFT" VALIGN="TOP">Resume</TH>
    <TD ALIGN="LEFT" VALIGN=TOP">
    <INPUT TYPE="file" NAME="resume" Rows="5">
</TR>
<TR>
    <TH ALIGN="LEFT" VALIGN="TOP">Posting Source</TH>
    <TD ALIGN="LEFT" VALIGN=TOP">
    <INPUT TYPE="Text" NAME="submitter" Value="Me">
</TR>
<TR>
<TD></TD>
<TD><BR><INPUT TYPE="SUBMIT" VALUE="SUBMIT NEW CANDIADATE POSTING"></TD>
</TR>

</TABLE>
</FORM>

<!--#var standard_html_footer-->


----------------------------------------------------------------------------
--------
doAddPosting (this is the document that takes the variables from the
AddPosting
document, creates a new "applicant record" and stuffs the data into the new
rec,
and calls index_html which displays the updated list
----------------------------------------------------------------------------
--------

<!-- Create an instance of an Applicant Object and set it's
variables/relations to -->
<!--#var submit_date-->
<!--#var applicant_id-->
<!--#var synopsis-->
<!--#var resume-->
<!--#var submitter-->

<!--Clear?-->

<!--#var index_html-->


----------------------------------------------------------------------------
---------
index_html  should build a table from a list pf recoreds (instances)
----------------------------------------------------------------------------
---------




<SCRIPT>
function openHelpWin()
{
	helpwin=window.open("PotentialCandiateHelp.html",'steve', menubar='no',
toolbar='no', directories='no',

status='no',scrollbars='yes',resizable='no',width='100',height='60');
}


</SCRIPT>

<H1><CENTER>Potential Candidates</CENTER></H1>

<FORM>
<HR>
If you are interested in a candiate please identify by placing a check mark
in the Candidate
ID (CID) check box for that candiate. Select the REQ ID that you are
interested for the
candiate or specify N/A in the REQ ID field if this is for a
"non-requisitioned" position.
<BR><BR>
Name:<Input name="loggedinperson" value="nameofloggedinperson">


<Input Type="submit" name="submit" value="Submit">
<Input Type="submit" name="matchCandiateHelp" value="Potential Candidate
Help"
onClick="openHelpWin()">

&nbsp;&nbsp
<A HREF="AddPosting">Add Posting </A>

<Input Type="submit" name="AddPosting" value="AddPosting">

<HR>

<table border="1">
<th>Post
Date</th><th>CID</th><TH>Synopsis</TH><th><B>Reviewed<B></th><TH>Resume</TH>
<th>Posting Source</th>
</table>

<!--#var standard_html_footer-->