[Zope] Dumb object aliasing question

Darrell dgallion@rochester.rr.com
Tue, 28 Dec 1999 10:52:48 -0500


This is a multi-part message in MIME format.

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

Sorry for the code on this list. Wasn't sure about moving it to ZopeDev.
=20
This fixes the problem for the outside caller. The images change in sync =
with what ever you upload.

I changed > to <
self._p_mtime is the date of the object in zope and ms is the changed =
since date from the browser.

OFS/image.py line: 187
       # Attempt to handle If-Modified-Since headers.
        ms=3DREQUEST.get_header('If-Modified-Since', None)
        if ms is not None:
            ms=3Dstring.split(ms, ';')[0]
            ms=3DDateTime(ms).timeTime()
            if self._p_mtime < ms:
                RESPONSE.setStatus(304)
                return RESPONSE


If 304 is set, it means the data hasn't changed.
        304: ('Not modified',
              'Document has not changed singe given time'),


This doesn't fix it for manage though.
I'll look at that one tonight.


--Darrell
  ----- Original Message -----=20
  From: Darrell=20
  To: Zope@zope.org=20
  Sent: Monday, December 27, 1999 10:27 PM
  Subject: [Zope] Dumb object aliasing question


  If I add a new image, call it img1 and view it outside of manage, all =
is well. If I replace that image and view it. It hasn't changed ?? If I =
view it in manage it's the new image.=20

  Restarting Zope doesn't help.

  If I now change this image in manage a second time it won't change. =
But it's size changed, just not the image.

  I picked up the CVS version deleted Data.fs and started over, with the =
same results. Shouldn't I be able to change an image ?

  Any idea where the code is that decides to render one way for local =
manage and another way for the remote user ? I'll find it eventually =
....gurrr


  --Darrell

------=_NextPart_000_2063_01BF5121.AE3BF9C0
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 content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2919.6307" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DCourier size=3D2>Sorry for the code on this list. =
Wasn't sure=20
about moving it to ZopeDev.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DCourier size=3D2>This fixes the problem for the =
outside caller.=20
The images change in sync with what ever you upload.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DCourier size=3D2>I changed &gt; to &lt;</FONT></DIV>
<DIV><FONT face=3DCourier size=3D2>self._p_mtime is the date of the =
object in zope=20
and ms is the changed since date from the browser.</FONT></DIV>
<DIV><FONT face=3DCourier size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DCourier size=3D2>OFS/image.py line: 187</FONT></DIV>
<DIV><FONT face=3DCourier size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
# Attempt to=20
handle If-Modified-Since =
headers.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
ms=3DREQUEST.get_header('If-Modified-Since',=20
None)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ms is not=20
None:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
ms=3Dstring.split(ms,=20
';')[0]<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;=20
ms=3DDateTime(ms).timeTime()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;=20
if self._p_mtime &lt;=20
ms:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;=20
RESPONSE.setStatus(304)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
return RESPONSE<BR></FONT></DIV>
<DIV><FONT face=3DCourier size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DCourier size=3D2>If 304 is set, it means the data =
hasn't=20
changed.</FONT></DIV>
<DIV><FONT face=3DCourier =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 304:=20
('Not=20
modified',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;=20
'Document has not changed singe given time'),<BR></FONT></DIV>
<DIV><FONT face=3DCourier size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DCourier size=3D2>This doesn't fix it for manage=20
though.</FONT></DIV>
<DIV><FONT face=3DCourier size=3D2>I'll look at that one =
tonight.</FONT></DIV>
<DIV><FONT face=3DCourier size=3D2>&nbsp;</DIV></FONT>
<DIV><FONT face=3DCourier size=3D2>&nbsp;</DIV></FONT>
<DIV>--Darrell</DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: =
0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A href=3D"mailto:darrell@dorb.com" =
title=3Ddarrell@dorb.com>Darrell</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
href=3D"mailto:Zope@zope.org"=20
  title=3DZope@zope.org>Zope@zope.org</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Monday, December 27, 1999 =
10:27=20
  PM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [Zope] Dumb object =
aliasing=20
  question</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=3DCourier size=3D2>If I add a new image, call it img1 =
and view it=20
  outside of manage, all is well. If I replace that image&nbsp;and view =
it. It=20
  hasn't changed ?? If I&nbsp;view it in manage it's the new image.=20
</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DCourier size=3D2>Restarting Zope doesn't =
help.</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DCourier size=3D2>If I now change this image in =
manage a second=20
  time it won't change. But it's size changed, just not the =
image.</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DCourier size=3D2>I picked up the CVS version deleted =
Data.fs and=20
  started over, with the same results. </FONT><FONT face=3DCourier=20
  size=3D2>Shouldn't I be able to change an image ?</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DCourier size=3D2>Any idea where the code is that =
decides to=20
  render one way for&nbsp;local manage and another way for the remote =
user ?=20
  I'll find it eventually ....gurrr</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DCourier =
size=3D2>--Darrell</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_2063_01BF5121.AE3BF9C0--