Re: [Zope-dev] Cache-bug in handling of files

2000-08-11 Thread Jim Sanford

since all the data at my corporate intranet site is pulled from a RDMS, all my 
refrence URLS are generated in JavaScript and have a
rnd="a randomly generated number between 1 and a million" to force the browser to get 
the current page.

 __

      Jim Sanford
  .   Database Engineer
 / \  /   Accelerated Technology, Inc.
/   / 720 Oak Circle Drive East
   /  /  \Mobile, AL 36609
  / / \   Voice: 334-661-5770  fax: 334-661-5788
 / \  E-Mail: [EMAIL PROTECTED]
  Web: http://www.atinucleus.com

 Nucleus.  All You NEED in an RTOS.  Royalty Free
 __


- Original Message -
From: Brian Lloyd [EMAIL PROTECTED]
To: 'Peter Arvidsson' [EMAIL PROTECTED]; Brian Lloyd [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, August 11, 2000 10:44 AM
Subject: RE: [Zope-dev] Cache-bug in handling of files


 I am using IE 5 (5.00.2919.6307), cache settings set to:
 "Check for newer versions of stored pages:
 Automatically

 Those settings should get the new file if it has changed.

 I am accessing the server through a proxy.. could that be a problem? I
 think it would be strange if everyone accessing the website I am
 building can see the new files..

 What do you think?

 Peter

Peter - I have done some testing here and I can demonstrate
that this is an IE issue.

I set my cache to "Automatically" like yours and restarted
it. I then opened a Netscape and created a new file object.
I instrumented the code in the 'index_html' method of File
objects so that I could tell _for sure_ whether things were
actually being called at the server or not. Here's what I
did:

  - create a file 'myfile.txt', uploading a contents of
text1.txt into it.

  - visit the view tab with IE. The server
confirms that the index_html was called, and the whole
content was sent, not a 304.

  - now (using netscape again) upload the contents of
text2.txt into the file object. The mgmt screen
correctly shows the updated byte length, etc.

  - click the 'view' tab again on IE. My instrumenting
confirms that IE is not contacting the server *at all*
no matter how many times I click the 'view' tab, and I
keep seeing the old content. A look at the headers
produced by this shows nothing that tells IE it should
be doing that:

HTTP/1.1 200 OK
Server: Zope/(unreleased version) ZServer/1.1b1
Date: Fri, 11 Aug 2000 15:18:50 GMT
Connection: close
Content-Type: text/plain
Content-Length: 944
Last-Modified: Fri, 11 Aug 2000 15:16:06 GMT

Interestingly, if you open the "view" tab in a new window,
you'll see the updated content. Now, using that same new
window, set your cursor at the end of the url string in the
url bar and hit return. IE seems to reload the page, but it
is not actually even contacting the server. Stranger yet, if
you click the "refresh" button it *will* contact the server
(and it passes an If-Modified-Since header, and correctly
gets a 304 Not Modified).

Now, use netscape to change the content again. The whole thing
starts over. Clicking the 'view' link on the page or pressing
return in the URL bar will not even contact the server and
the only way to get the updated content is to explicitly press
"refresh" or open a new window, even though the resource
returned no caching information one way or the other.

I'm going to close that bug report and include this report
for those who may find it useful in the future.

Brian Lloyd[EMAIL PROTECTED]
Software Engineer  540.371.6909
Digital Creations  http://www.digicool.com




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




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




Re: [Zope-dev] possible bug in dtml-in

2000-06-22 Thread Jim Sanford

Shouldn't that be "sequence-end" instead of "sequence-last"?

- Original Message - 
From: Federico Di Gregorio [EMAIL PROTECTED]
To: Zope Dev [EMAIL PROTECTED]
Sent: Thursday, June 22, 2000 12:16 PM
Subject: [Zope-dev] possible bug in dtml-in


hi *,

an external method returns a list of tuples like this one:

[(elt1, elt2), (elt3, elt4), ...]

and i want to print something after the last one so i do:

dtml-in "build_list(args...)"
  ...do some work here...
  dtml-if sequence-last
should be executed only after last iteration
  /dtml-if
/dtml-in

that always worked (when getting stuff out of a DB, for example) but
with a list built as above, if there is *more* than 1 element i get...

  File /usr/lib/zope/lib/python/DocumentTemplate/DT_Util.py, line 276, in render
  File /usr/lib/zope/lib/python/OFS/DTMLMethod.py, line 146, in __call__
(Object: lettera_ricevuta)
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__
(Object: lettera_ricevuta)
  File /usr/lib/zope/lib/python/OFS/DTMLMethod.py, line 146, in __call__
(Object: genera_ricevuta_mail)
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__
(Object: genera_ricevuta_mail)
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_In.py, line 691, in renderwob
(Object: elenco.keys())
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_Let.py, line 145, in render
(Object: key=sequence-item)
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_In.py, line 691, in renderwob
(Object: elenco[key][1])
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_Let.py, line 145, in render
(Object: row=sequence-item)
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_InSV.py, line 392, in __getitem__
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_InSV.py, line 194, in last
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_InSV.py, line 182, in value
TypeError: getattr, argument 2: expected string, int found

any idea?
federico

-- 
Federico Di Gregorio
MIXAD LIVE System Programmer   [EMAIL PROTECTED]
Debian GNU/Linux Developer  Italian Press Contact[EMAIL PROTECTED]
  Those who do not study Lisp are doomed to reimplement it. Poorly.
  -- from Karl M. Hegbloom .signature

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




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




Re: [Zope-dev] Repeating a piece of HTML code

2000-06-02 Thread Jim Sanford

if  number_of_stars is 5 then

dtml-var " '*' * number_of_stars "

will give you *

(Multiplication works on strings in python and thus Zope!)

Jim Sanford

- Original Message - 
From: "Alex Mendez" [EMAIL PROTECTED]
To: "Lista Zope" [EMAIL PROTECTED]
Sent: Friday, June 02, 2000 5:28 AM
Subject: [Zope-dev] Repeating a piece of HTML code


Hello, it's the first time I write here and I'm a
newbie at Zope, so maybe I'm asking a stupid
question...

Case is I retrieve from my movie database the value of
the movie from 1 to 5 stars. I would like to repeat
that n times the code img SRC="star.gif" height=15
width=15 so the number of stars would appear:

1 - *
2 - **
3 - ***
4 - 
5 - *

Is there any way to do so in Zope? Does the dtml-in
tag anything to do with it?

Thank you!

=
Saludos!!   
 _-/Txapulin\-_
[EMAIL PROTECTED]  O  \  /   ---\  /  O
http://www.geocities.com/txapulin   \/ |  \/
/  |XAP\
 ||
 ||

__
Do You Yahoo!?
Yahoo! Photos -- now, 100 FREE prints!
http://photos.yahoo.com

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




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