[Zope] document_src not doing what I thought it did

Tim Hicks Tim Hicks" <tim@sitefusion.co.uk
Fri, 12 Jan 2001 01:25:12 -0000


I have a dtml-documentish zclass and have created a custom edit method for
it so that I can do an automatic reindex when each instance is edited.  I
created this custom form by simply copying the source html that is generated
for the standard edit form, and then replacing the static parts of what I
copied with various <dtml-var > inserts (see below).  This seemed to go
according to plan until I realised that something strange is happening when
I try to view this edit form for an instance of the zclass.  In most cases,
everything seems normal, but when I try to edit an instance that has a
property set to 'private', my 'privacy' method kicks in and redirects me
away from the edit form to my standard 'Restricted Page'.  The redirection
is written into the text of the instance I am trying to edit, so I expected
that by using <dtml-var document_src>, the actual source would get placed in
the text area without being processed.  This is what appears to happen when
the instance does not have the 'private' property.  I guess therefore, my
question is, am I using document_src correctly?

thanks very much

tim

ps Sorry to be such a regular poster of problems


  <FORM ACTION="my_edit" METHOD="POST">
    <TABLE CELLSPACING="2">
      <TR>
 <TH ALIGN="LEFT" VALIGN="TOP">Id</TH>
 <TD ALIGN="LEFT" VALIGN="TOP"><dtml-var id></TD>
      </TR>
      <TR>
 <TH ALIGN="LEFT" VALIGN="TOP"><EM>Title</EM></TH>
 <TD ALIGN="LEFT" VALIGN="TOP">
  <INPUT TYPE="TEXT" NAME="title" SIZE="40" VALUE="<dtml-var title>">
 </TD>
      </TR>
      <tr>
 <th align="left" valign="top">
        <em>Size</em>
        </th>
 <td align="left" valign="top">
        <dtml-var get_size> bytes
 </td>
      </tr>
      <tr>
 <th align="left" valign="top">
        <em>Last modified</em>
        </th>
 <td align="left" valign="top">
        <dtml-var bobobase_modification_time>
 </td>
      </tr>
      <TR>
 <TD COLSPAN="2" ALIGN="CENTER">
 <TEXTAREA NAME="data:text" WRAP="Off" COLS="115" ROWS="25"><dtml-var
document_src></TEXTAREA>
 </TD>
      </TR>
      <TR>
 <TD align=left>
          <INPUT NAME=SUBMIT TYPE="SUBMIT" VALUE="Change">
 </TD>
 <TD align=left>
   <INPUT NAME=SUBMIT TYPE="SUBMIT" VALUE="Taller">
   <INPUT NAME=SUBMIT TYPE="SUBMIT" VALUE="Shorter">
   <INPUT NAME=SUBMIT TYPE="SUBMIT" VALUE="Wider">
   <INPUT NAME=SUBMIT TYPE="SUBMIT" VALUE="Narrower">
 </TD>
      </TR>
    </TABLE>
  </FORM>