Re: [Zope] document_src not doing what I thought it did

2001-01-13 Thread Tim Hicks


- Original Message -
From: Dieter Maurer [EMAIL PROTECTED]
To: Tim Hicks [EMAIL PROTECTED]
Sent: Friday, January 12, 2001 10:28 PM
Subject: Re: [Zope] document_src not doing what I thought it did


 Tim Hicks writes:
   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?
 Is is possible that your edit form is called
 in the context of you ZInstance?


I'm not sure I completely understand the terminology you use, but I guess it
sounds right that the edit form method is called 'on' (in my terminology
;-) ) the Zclass instance.  It is in that way that the dtml-var
id/title/get_size/etc retrieve the attributes of the instance and not the
method itself... is that correct? Is that what you mean?

 Then, it might be able that *it* interpretes the "private"
 and redirects before "document_src" is executed at all.

Each Zclass instance has dtml-call privacydtml-if "available* ==
1"dtml-call RESPONSE.redirect(restricted)dtml-elseblah/dtml-if . (*
set by the privacy method).  Thanks for your help with that btw :-).
However, the edit form method does not have this code in it.  As far as I
can gather, the only time the method gets to 'see' the code shown above is
when it inserts dtml-var document_src.

What am I missing?

tim




 Dieter



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] document_src not doing what I thought it did

2001-01-11 Thread Tim Hicks

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"EMTitle/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"
emSize/em
/th
 td align="left" valign="top"
dtml-var get_size bytes
 /td
  /tr
  tr
 th align="left" valign="top"
emLast 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


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )