Re: [Zope-dev] PythonLibraries Product

2003-09-12 Thread seb bacon
Tres Seaver wrote:
Evan Simpson wrote:
Seb Bacon wrote:
Could you provide a brief summary of why this is better than a
folder of python scripts?  Perhaps a use case which illustrates the
problems of the current way of doing things?

It isn't *better* than a Folder of Scripts, it's *different* :-) I
have two weak use-cases, a longstanding I'm going to write that some
day itch, and some aesthetic arguments.

Actually, the restricted case is the one which has the real win;  the
free-floating library is pretty, but not semanticaally needed.  An
added argument:  a ZPT with its own private library becomes, in effect,
a Zope3 view component;  adopting such beasts will ease migration to
Zope3.
Well, I'm completely convinced :-)  I'm not quite sure about the 
metaphor for binding a library to a template yet, though.

Could libraries be added to folders as first-class objects (you want to 
be able to share them between templates easily, no?) and bound to the 
templates using a tab on either them or the templates?  Their icons 
would be overlaid with a visual indication of if they are bound or not.

Or, could you bind them at run-time using a new tal directive?  (not 
likely to be a popular suggestion, I know)

seb

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


[Zope-dev] [Summary] Caching prob with AHCM and headers

2003-09-12 Thread Bjorn Stabell
Just for the record to help others in the same situation...

PROBLEM
Apache (1.3.28 and 2.0.47) will not cache content with just an Expires
header, but it will correctly cache content with a Last-Modified header.
This problem has been reported before in 1999 by James Cooper, but the
bug request seems to have been forgotten/ left behind.

It makes sense for dynamic content to produce Expires headers, not
Last-Modified headers, so this is a problem.

Looking at the code for Zope, it seems that the standard HTTP
accelerator product used to produce a Last-Modified header, but no
longer does so, thus making it useless with the current versions of
Apache.

The problem has been re-reported to the Apache group with patches:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23129 (for Apache
1.3.28)
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23130 (for Apache
2.0.47)


WORK-AROUNDS
1) Produce a Last-Modified header yourself by using
2) Patch Zope's standard HTTP accelerator product so that it produces a
Last-Modified header (the line is commented out now)

SOLUTIONS
3) Patch Apache (see bug report links above for patches)
4) Wait until the problem is hopefully fixed in Apache


Bye,
-- 
Bjorn Stabell [EMAIL PROTECTED]
Tel +86 (10) 65918490

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


[Zope-dev] AW: [Summary] Caching prob with AHCM and headers

2003-09-12 Thread Germer, Carsten
Thanks Bjorn, now I remember the last-modified issue.
As I remember it, someone said that the line is commented out for a reason
not known... that's why I didn't change it :)
/Carsten


 -Urspr√ľngliche Nachricht-
 Von: Bjorn Stabell [mailto:[EMAIL PROTECTED]
 Gesendet: Freitag, 12. September 2003 12:14
 An: [EMAIL PROTECTED]
 Cc: Janko Hauser; [EMAIL PROTECTED]; [EMAIL PROTECTED]; 
 Germer, Carsten
 Betreff: [Summary] Caching prob with AHCM and headers
 
 
 Just for the record to help others in the same situation...
 
 PROBLEM
 Apache (1.3.28 and 2.0.47) will not cache content with just an Expires
 header, but it will correctly cache content with a 
 Last-Modified header.
 This problem has been reported before in 1999 by James Cooper, but the
 bug request seems to have been forgotten/ left behind.
 
 It makes sense for dynamic content to produce Expires headers, not
 Last-Modified headers, so this is a problem.
 
 Looking at the code for Zope, it seems that the standard HTTP
 accelerator product used to produce a Last-Modified header, but no
 longer does so, thus making it useless with the current versions of
 Apache.
 
 The problem has been re-reported to the Apache group with patches:
 http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23129 (for Apache
 1.3.28)
 http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23130 (for Apache
 2.0.47)
 
 
 WORK-AROUNDS
 1) Produce a Last-Modified header yourself by using
 2) Patch Zope's standard HTTP accelerator product so that it 
 produces a
 Last-Modified header (the line is commented out now)
 
 SOLUTIONS
 3) Patch Apache (see bug report links above for patches)
 4) Wait until the problem is hopefully fixed in Apache
 
 
 Bye,
 -- 
 Bjorn Stabell [EMAIL PROTECTED]
 Tel +86 (10) 65918490
 

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


Re: [Zope-dev] Catalog performance

2003-09-12 Thread Chris Withers
John Barratt wrote:
Chris Withers wrote:

John Barratt wrote:

docs = container.portal_catalog(meta_type='Document', ...)
for doc in docs:
obj = doc.aq_parent.unrestrictedTraverse(doc.getPath())
was_ghost = obj._p_changed is None
value = obj.attr
if was_ghost:obj._p_deactivate()
Bear in mind though, that you can only do this in an external method...
..or product code ;-)

Why can you only do this in an external method?  This idea (deactivating 
objects) is used quite a extensively in many parts of core zope such as 
OFS.ObjectManager as I mentioned in another post, and we use it in our 
product code quite a bit as well.
Nguyen was asking about a python script, you can't do these things there as the 
necessary methods don't have security declarations, and the methods start with 
'_', which I think the Zope Security Policy denies access to...

Chris

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


Re: [Zope-dev] Cache growing during single REQUEST

2003-09-12 Thread Chris Withers
Tim Peters wrote:
Multiversion concurrency control (MVCC for short) is the next step.  If no
other crises intervene, Jeremy and I will start implementing that on the
ZODB3 3.2 branch (most likely that branch -- can't swear to it) soon
(ditto).
From Jeremy's recent notes, I think it'll be the Zope 2.6 branch...

You can google on the phrase to get a ton of more-or-less abstract overviews
of the concept.  The short course in ZODB is that, when MVCC is in effect, a
read will return the state of the object as of the time the current
transaction began, even if the object has subsequently been modified by some
other transaction.
Sounds great :-) If you need any implementations testing, do let me know!

The overriding concern in all schemes is that you don't see inconsistent
data.
Yep.

The current ReadConflictError prevents you from seeing inconsistent
data by preventing you from loading objects that have changed since your
current transaction began.  
Indeed, butthat could eb a lot of things, and often in situations where ti 
wouldn't matter, as long as the data is consistent...

MVCC prevents it by (possibly) delivering
non-current object states.  I don't think either can be viewed as a pure
win.  The ways in which ReadConflictError loses are obvious to people here
because they've experienced them.  The ways in which MVCC loses will become
obvious later 0.9 wink.
Any ideas what they'll be yet?

Chris

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


Re: [Zope-dev] Cache growing during single REQUEST

2003-09-12 Thread Tres Seaver
On Fri, 2003-09-12 at 07:34, Chris Withers wrote:
 Tim Peters wrote:
  Multiversion concurrency control (MVCC for short) is the next step.  If no
  other crises intervene, Jeremy and I will start implementing that on the
  ZODB3 3.2 branch (most likely that branch -- can't swear to it) soon
  (ditto).
 
  From Jeremy's recent notes, I think it'll be the Zope 2.6 branch...

Nope.  The 'ZODB3-3_1-branch' has retired;  all future ZODB3 3.1.x
work will take place on the 'Zope-2_6-branch'.  MVCC, however, is new
feature work, and will take place on the 3.2 branch (which may be the
Zope-2_7-branch :)

 
  You can google on the phrase to get a ton of more-or-less abstract overviews
  of the concept.  The short course in ZODB is that, when MVCC is in effect, a
  read will return the state of the object as of the time the current
  transaction began, even if the object has subsequently been modified by some
  other transaction.
 
 Sounds great :-) If you need any implementations testing, do let me know!
 
  The overriding concern in all schemes is that you don't see inconsistent
  data.
 
 Yep.
 
  The current ReadConflictError prevents you from seeing inconsistent
  data by preventing you from loading objects that have changed since your
  current transaction began.  
 
 Indeed, butthat could eb a lot of things, and often in situations where ti 
 wouldn't matter, as long as the data is consistent...
 
  MVCC prevents it by (possibly) delivering
  non-current object states.  I don't think either can be viewed as a pure
  win.  The ways in which ReadConflictError loses are obvious to people here
  because they've experienced them.  The ways in which MVCC loses will become
  obvious later 0.9 wink.
 
 Any ideas what they'll be yet?

Some applications will have no downside at all;  for instance, requests
that will do no writing the the database are pure wins for MVCC (e.g.,
long-running report requests).  Requests that write to the database on
the basis of stale-but-consistent data *may* still be OK, but that will
need to be a policy set by the application.

Tres.
-- 
===
Tres Seaver[EMAIL PROTECTED]
Zope Corporation  Zope Dealers   http://www.zope.com


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


Re: [Zope-dev] AW: [Summary] Caching prob with AHCM and headers

2003-09-12 Thread Shane Hathaway
Germer, Carsten wrote:
Thanks Bjorn, now I remember the last-modified issue.
As I remember it, someone said that the line is commented out for a reason
not known... that's why I didn't change it :)
It has always been commented out in CVS.  That may have been a 
mistake--it may have been a temporary debugging edit that I accidentally 
slipped in.  I suggest we uncomment it and see what happens! ;-) 
Ideally, we should allow the user to choose policies for particular 
headers in the management interface.

Shane

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


Re: [Zope-dev] AW: [Summary] Caching prob with AHCM and headers

2003-09-12 Thread Tres Seaver
On Fri, 2003-09-12 at 09:51, Shane Hathaway wrote:
 Germer, Carsten wrote:
  Thanks Bjorn, now I remember the last-modified issue.
  As I remember it, someone said that the line is commented out for a reason
  not known... that's why I didn't change it :)
 
 It has always been commented out in CVS.  That may have been a 
 mistake--it may have been a temporary debugging edit that I accidentally 
 slipped in.  I suggest we uncomment it and see what happens! ;-) 
 Ideally, we should allow the user to choose policies for particular 
 headers in the management interface.

The CMF's CachingPolicyManger, which is specialized for caching skin
methods, already has such customizations:  it allows spelling the
'Last-Modified' header using a TALES expression, and also has checkboxes
for the 'no-cache', 'no-store', and 'must-revalidate' options of the
'Cache-Control' header.

Tres.
-- 
===
Tres Seaver[EMAIL PROTECTED]
Zope Corporation  Zope Dealers   http://www.zope.com



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


[Zope-dev] Zope.org maintenance update afternoon EST

2003-09-12 Thread Brian Lloyd
Hi all - 

I will be doing some maintenance on the zope.org database, packing 
it and performing a reindex to get rid of some duplicate search 
results that we've been seeing.

There should be little to no interruption of service, but the 
pack / reindex / replace will take an hour or so. 

Please avoid adding new content to the site for this afternoon (EST), 
as I may need to take a copy of the db to do these operations in 
order to avoid impacting performance on the main site.

thanks,


Brian Lloyd[EMAIL PROTECTED]
V.P. Engineering   540.361.1716  
Zope Corporation   http://www.zope.com 


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


Re: [Zope-dev] AW: [Summary] Caching prob with AHCM and headers

2003-09-12 Thread Fred Yankowski
On Fri, Sep 12, 2003 at 10:13:44AM -0400, Tres Seaver wrote:
 The CMF's CachingPolicyManger, which is specialized for caching skin
 methods, already has such customizations:  it allows spelling the
 'Last-Modified' header using a TALES expression, and also has checkboxes
 for the 'no-cache', 'no-store', and 'must-revalidate' options of the
 'Cache-Control' header.

Based on that note I decided to try CachingPolicyManager for the first
time, and I'm confused about how it's supposed to work.

In a CMF/Plone portal instance (CMF 1.4) I created a CMF Caching
Policy Manager object.  If I create a policy instance with default
Predicate and Mod. Time values and a Max age of 999, FSImage objects
are then published with appropriate cache control headers so that they
expire after 999 seconds.  Cool.

But I can't see how to create more restrictive Predicate.  My initial
attempt was to set Predicate like so:

python: content.meta_type == 'Filesystem Image'

But that predicate never seems to return true.  Looking at
_setCacheHeaders() in CMFCore/utils.py, 'content' is set to
'aq_parent(obj)'.  Because of that, any tests against 'content' in the
Predicate apply to the Filesystem Directory View that contains the
particular FSImage objects, rather than to the FSImage object itself.
What good is that?

-- 
Fred Yankowski  [EMAIL PROTECTED]   tel: +1.630.879.1312
OntoSys, IncPGP keyID: 7B449345fax: +1.630.879.1370
www.ontosys.com 38W242 Deerpath Rd, Batavia, IL 60510-9461, USA

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