[Zope] Help with Acquisition (long)

Greg & Janet LINDSTROM yuba@cyberback.com
Sat, 7 Jun 2003 08:29:00 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_0005_01C32CCE.D8CE7500
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I'm building an application dealing with multiple Departments, each with =
multiple members.  Here's a short diagram of the folders in question

Department  (department level information and forms)
+--Members  (department Roster)
    +--Individual  (individual level information and forms)
        +--Status   (tracks status information and history)

The Members index_html (dtml_method) displays all of the active members =
(stored in a mySQL database), displaying each member as a link as =
follows ("Get" is a Z_SQLMethod)
  <ul>
  <dtml-in Get>
    <li><a href =3D =
"myserver/Individual?member_number=3D&dtml-member_number;>&dtml-name;</a>=

  </dtml-in>
  </ul>
     =20
This calls the Individual/index_html (a dtml_method), passing it =
member_number as expected.  The Individual folder has a link allowing =
the user to add a status value for the individual

  <a =
href=3D"myserver/Memebrs/Individual/Status/AddForm/memno=3D&dtml-memno;;"=
>Add Status</a><br>

This calls a dtml_document which renders a form to add a status for the =
individual.  This form calls Status/Add (a dtml method) which in turn =
calls AddSQL (an Z_SQLMethod) to post the data to the database.

<dtml-var my_header>

<dtml-call "AddSQL()">
<dtml-call "RESPONSE.redirect('Status')>

<dtml-call my_footer>

This post the data to my Status table, but fails on th redirect.

The problem I'm encountring is the redirect fails because the =
Status/index_html cannot find member_number.  I thought that =
member_number would be in the Individual namespace, but it's nowhere to =
be found.  Since the Individual folder will eventually have a lot of =
sub-folders (Addresses, Phones, Equipment, etc.) I would really like to =
use Acquisition rather than passing member_number explicitly.  I've =
re-read the sections in "The Zope Bible"  (pp 72+), "Web Application =
Construction Kit" (pp 82+), and "The Zope Book" (multiple places), but I =
guess I just don't get it.

How and Where do I set the member_number so that all of the sub-folders =
can "see" (acquire) it?

Thanks for your time and help.

Greg Lindstrom
Vilonia, Arkansas

------=_NextPart_000_0005_01C32CCE.D8CE7500
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I'm building an application dealing =
with multiple=20
Departments, each with multiple members.&nbsp; Here's a short diagram of =
the=20
folders in question</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Department&nbsp; (department level =
information and=20
forms)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>+--Members&nbsp; (department =
Roster)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; +--Individual&nbsp; =
(individual=20
level information and forms)</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
+--Status&nbsp;&nbsp; (tracks status information and =
history)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The Members index_html =
(dtml_method)&nbsp;displays=20
all of the active members (stored in a mySQL database), displaying each =
member=20
as a link as follows ("Get" is a Z_SQLMethod)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; &lt;ul&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; &lt;dtml-in Get&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &lt;li&gt;&lt;a href =
=3D=20
"myserver/Individual?member_number=3D&amp;dtml-member_number;&gt;&amp;dtm=
l-name;&lt;/a&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; &lt;/dtml-in&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; &lt;/ul&gt;</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>This calls the Individual/index_html (a =

dtml_method), passing it member_number as expected.&nbsp; The Individual =
folder=20
has a link allowing the user to add a status value for the=20
individual</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; &lt;a=20
href=3D"myserver/Memebrs/Individual/Status/AddForm/memno=3D&amp;dtml-memn=
o;;"&gt;Add=20
Status&lt;/a&gt;&lt;br&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>This calls a dtml_document which =
renders a form to=20
add a status for the individual.&nbsp; This form calls Status/Add (a =
dtml=20
method) which in turn calls AddSQL (an Z_SQLMethod) to post the data to =
the=20
database.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;dtml-var my_header&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;dtml-call =
"AddSQL()"&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&lt;dtml-call=20
"RESPONSE.redirect('Status')&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;dtml-call =
my_footer&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>This post the data to my Status table, =
but fails on=20
th redirect.</DIV>
<DIV><BR>The problem I'm encountring is the redirect fails because the=20
Status/index_html cannot find member_number.&nbsp; I thought that =
member_number=20
would be in the Individual namespace, but it's nowhere to be =
found.&nbsp; Since=20
the Individual folder will eventually have a lot of sub-folders =
(Addresses,=20
Phones, Equipment, etc.) I would really like to use Acquisition rather =
than=20
passing member_number explicitly.&nbsp; I've re-read the sections in =
"The Zope=20
Bible"&nbsp; (pp 72+), "Web Application Construction Kit" (pp 82+), and =
"The=20
Zope Book" (multiple places), but I guess I just don't get it.</DIV>
<DIV>&nbsp;</DIV>
<DIV>How and Where do I set the member_number so that all of the =
sub-folders can=20
"see" (acquire) it?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks for your time and help.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Greg Lindstrom</DIV>
<DIV>Vilonia, Arkansas</DIV></FONT></BODY></HTML>

------=_NextPart_000_0005_01C32CCE.D8CE7500--