Re: [Zope-dev] Do I really understanding caching?

2000-09-23 Thread Paul Everitt

Andy McKay wrote:
  What problem are you trying to solve -- response time, memory usage,
  disk usage?
 
 All of the above :)

Describe some of the symptoms back on the list and let's talk about it
there.  For instance, you can trade RAM for performance by adjusting
knobs on the catalog.

--Paul

___
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] Do I really understanding caching?

2000-09-23 Thread Jim Fulton

Andy McKay wrote:
 
 We have been looking at caching in Zope as a way of tweaking performance.
 Heres an example of what I think happens:
 
 - Supposing I have a 1,000 object catalog. If one person changes an catalog
 aware object, that instance of the catalog will be pulled out of the ZODB
 and changed. It will then be written to the ZODB. That last copy will stay
 in the cache for as long as the "Cache Parameters" are set to allow.
 
 - If somebody changes another catalog aware object, that will repeat the
 above process.
 
 - However simply accessing the catalog (no changes) will pull the object
 from the cache.
 
 - What would be really nice is if the object only got written to the cache
 when it is no longer used, that way every time the catalog changed it didnt
 write to ZODB instead it changed the cached version. Of course that does
 bring up the recovering from disaster problem.
 
 So do I understand it correctly?

Not exactly.  Have you seen the ZODB paper?

  http://www.zope.org/Members/jim/Info/IPC8/ZODB3

You can think of the normal ZODB cache as being a tool that
manages the objects in memory.  Whenever an object has been
accessed, it is in the cache. The cache, together with the
database are responsible for moving objects, and their state
in and out of memory. An object can be in serveral in memory 
states. Two that are of interest, from a caching perspective, 
are the "ghost" state and the up-to-date state.  The up-to-date
state is a state in which the object and it's state are loaded.
In the ghost state, the object is in memory, but it has now state.

The cache manager tries to release an object's state and 
remove the object from memory when it is not used.  An object's
state is released when it hasn't been accessed in a long time.
It can be removed when no other objects (not counting the
cache itself) refer to it.

Note that the cache parameters are only guides for an algorithm
that is somewhat adaptive and a bit more complicated than
the parameters suggest. For example, the target cache size is a 
target, not a limit. The cache sizes are usually mich higher than
the target.

Another thing to be aware of is that large objects are generally 
designed to spread their state over many subobjects so that
they can make effective use of the cache.  A catalog may have hundreds
of sub-objects, only a small fraction of which are kept in memory
at a time.

Jim

--
Jim Fulton   mailto:[EMAIL PROTECTED]
Technical Director   (888) 344-4332  Python Powered!
Digital Creationshttp://www.digicool.com http://www.python.org

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.

___
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] Membership and Local Roles

2000-09-23 Thread Michael Bernstein

Michael Bernstein wrote:
 
 Michael Bernstein wrote:
 
  I figured out how to get this to work (finally).
 
  In the acl_users LM, add the following two Python methods:
 
 Well, I discovered another problem:
 
 For some reason, when I create a PortalMembership member, add the two
 Python methods as I described earlier, and use the local roles screen to
 give them a role, they are subsequently authenticated regardless of
 whether their password is correct.
 
 Here's an example illustrating the bug:
 
 [snip example]

This password problem is fixed with Bill Andersons new
release of Membership 0.7.6, so the local roles fix now
works generally.

There is still a platform dependent password problem with
Membership though. It affects Solaris and HPUX (possibly
other unices) but not Linux, and has to do with the crypt
module not being loaded correctly on those platforms,
causing passwords to be encrypted omly part of the time.

Here is the fix for local roles:

First, the User Source needs to support a getUserNames
method. This can be done two ways:

You can add a Python method to the LoginManager named
getUserNames that takes a 'self' parameter, and has the
following body:

 user_ids=self.UserSource.getPersistentItemIDs()

 names=[]
 for i in user_ids:
 names.append(i)
 return names

Or you can add the following code directly to the
PersistentUserSource.py file, preferably right befor or
after the getUsers method:

def getUserNames(self):
user_ids=self.getPersistentItemIDs()
names=[]
for i in user_ids:
names.append(i)
return names

(I hope this will get included in future versions of
Membership)

Next we need to provide a user_names method in the
LoginManager. Currently I only have a Python method to drop
in to the LM. it takes a 'self' parameter, and has the
following body if it's calling another Python method:

return self.getUserNames()

Or if you're calling the method in PersistentUserSource.py,
it has this body:

return self.UserSource.getUserNames()

Note that this user_names method has some disadvantages, and
it needs to be generalized to deal with multiple User
Sources that aren't all named UserSource, and that may not
all implement the getUserNames interface, and that may have
duplicate user names in them.

Suggestions on how to do this would be welcome.

I hope that this little set of instructions helps others who
are trying to integrate LM with the existing security
interface and local roles.

Comments, testing, and improvements would be welcomed.

HTH,

Michael Bernstein.

___
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] Problem with properties in inherited ZClasses

2000-09-23 Thread Steve Alexander

Stephen Simmons wrote:


 I have tried to create another ZClass, AdminTools:Task that inherits from
 AdminTools:Folder that adds some task tracking functionality and
 uses/overrides the AdminTools:Folder methods for displaying objects

I tend to try not to have ZClasses derive from other ZClasses. You'd 
find it more straightforward either to derive both ZClasses from a 
common Python base class, or to keep both ZClasses independent of each 
other.

In general, I try to avoid using inheritence. Python and Zope support 
polymorphism whether you derive classes from the same base-class or not. 
Also, I find the coupling introduced by inheritence more trouble than it 
is worth for the reduced redundancy.

I realize that I have avoided trying to answer why ZClasses work in this 
way.

   File D:\Dev\ZopeTestbed\lib\python\OFS\PropertySheets.py, line 235, in
 _setProperty
 (Object: Task)
 Bad Request: (see above)
 
 I don't understand why I can add the 'title' property to Task but not
 'description'.

Here's the code that is raising the exception:

if hasattr(aq_base(self),id):
if not (id=='title' and not self.__dict__.has_key(id)):
raise 'Bad Request', (
'Invalid property id, em%s/em. It is in use.' % id)

You can see that 'title' has a special status as a property.

 
 To conclude:
 
 (i) What is going on and how can I fix it?

Don't do things that way to start with.

 (ii) When using a ZClass as a base class, do instances inherit any
 properties, or do they just get access to the base class's methods? If
 ZClasses do inherit properties from parent ZClasses, how do I reach them via
 the property sheets?

If you add propertysheets to instances of your classes, rather than to 
the classes, then you don't get conflicts over attributes. However, 
unless you use ZPatterns or something like that, you have to refer to 
the attributes of propertysheets explicitly naming the propertysheet.

 (iii) Is there a simple way to find out what methods and properties an
 object has? I would like to see what it defines, what it inherits and what
 it acquires.

Yes. See the code above from PropertySheets.py. Use something like this 
in an external method to find out the attributes of an object. (In 
python, methods and fields are both attributes.) You can use the magic 
aq_* attributes of acquisition wrappers to walk through the objects that 
get considered during acquisition. You might also want to look at Shane 
Hathaway's Acquisition Explainer, an external method to show how 
acquisition works, that also demonstrates use of the aq_* attributes.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net





___
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 )




Re: [zope] What options exist for dealing with traceback

2000-09-23 Thread Didier Georgieff

On 23 Sep 2000, at 10:27, [EMAIL PROTECTED] [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote:

From: Skip Montanaro [EMAIL PROTECTED]
 Subject: What options exist for dealing with tracebacks?
 
 I would love it if I could set some debug environment variable, run with
 -D="[EMAIL PROTECTED]" or subclass some Error class and have tracebacks mailed
 to me.  I wouldn't even care about the flood of email.  At least I'd have
 all the inputs.

I have modified the Standard Error Message for emailing each time 
an error occurs. Works fine for me.

-
dtml-comment * MAIL a l'administrateur */dtml-comment
dtml-sendmail 
  mailhost="MailHost" 
  mailto="[EMAIL PROTECTED]" 
  mailfrom="[EMAIL PROTECTED]"
To : Zope Admin [EMAIL PROTECTED]
From : Zope Web Server ERROR [EMAIL PROTECTED]
Subject : Zope Error at dtml-var URL

URL de la page : dtml-var URL
dtml-with URLmodifiée le dtml-var "bobobase_modification_time()"/dtml-with
[other parameters, version, etc ...]

dtml-in "REQUEST.items()" sort
 dtml-var sequence-key: dtml-var sequence-item
/dtml-in

dtml-if error_message
 dtml-var error_message
dtml-else

[whatever you need]

/dtml-if
/dtml-sendmail
Valeur de l'erreur: !--#var error_value--
--- End of forwarded message ---
-- 
Divine Rites - Strasbourg, France
===
10" Storming the Citadel available via mail order only !
Check it on http://www.divinerites.com/dr_drr.htm

Radio Birdman, New Christs, Deniz Tek, Citadel Records  more ...
http://www.divinerites.com

___
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] trouble with SiteAccess; can't manage subtree mapped to inaccessible domain name

2000-09-23 Thread Fred Yankowski

I set up SiteAccess 2-0-0b3 on Zope 2.2.2 so that two virtual hosts
front-ended by Apache map to two different subtrees in Zope.  That
worked OK until the local DNS server lost the entry for one of my
domains.  I'm working on fixing that (it's out of my hands) but I find
that in the meantime I can't even get to the corresponding Zope
subtree in manage mode!  I think the SiteAccess object I created is
still mapping URLs to the domain name which now fails to resolve.

How do I get out of this jam?  I tried deleting the
Products/SiteAccess folder, restarting Zope, and deleting the
SiteAccess product from the Control_Panel/Products view, but now I'm
getting an AttributeError when I try to access the subtree that has a
SiteAccess object.  Since I can't get to that tree, I can't figure out
how to delete that object.  Is there some way to delete it by name
from a higher point in the tree?

-- 
Fred Yankowski   [EMAIL PROTECTED]  tel: +1.630.879.1312
Principal Consultant www.OntoSys.com   fax: +1.630.879.1370
OntoSys, Inc 38W242 Deerpath Rd, Batavia, IL 60510, USA

___
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 )




Re: [Zope] trouble with SiteAccess; can't manage subtree mapped to inaccessible domain name

2000-09-23 Thread Evan Simpson

From: "Fred Yankowski" [EMAIL PROTECTED]
 How do I get out of this jam?  I tried deleting the
 Products/SiteAccess folder, restarting Zope, and deleting the
 SiteAccess product from the Control_Panel/Products view, but now I'm
 getting an AttributeError when I try to access the subtree that has a
 SiteAccess object.  Since I can't get to that tree, I can't figure out
 how to delete that object.  Is there some way to delete it by name
 from a higher point in the tree?

Yow! No need for such extreme measures.  Put SiteAccess back, then open the
management interface for the subtree folder in your Zope, using:

http://your.zope/the-subtree/_SUPPRESS_SITEROOT/manage_main

...and delete the SiteRoot.

Cheers,

Evan @ digicool  4-am


___
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] Mutiple images don't always show up

2000-09-23 Thread Hung Jung Lu

Hi,

I have observed that in some Zope installations (I am using Zope 2.1.6 
through PCGI on Linux, my browser is Internet Explorer 5.5), if I have more 
than 4 or 5 images (currently I have one page with 12 GIF images), sometimes 
not all the pictures show up. If I reload the page, the problem is often 
fixed.

I have seen similar situations both with static images and dynamic images 
(images generated by Python programs.) I am not sure whether the problem is 
in the browser, in the Zope server, or in my ISP.

Has anyone seen something similar?

regards,

Hung Jung

-

PS- related to this, I also know that for Zope 2.1.x there is some thread 
competing write problem: when two threads (from different browser windows) 
compete in writing, one browser window does not receive any response. I know 
Zope is supposed to abort one of the threads and restart it, and matter of 
fact I do see that happen when I insert print statements. But it's just 
strange that the browser window does not display anything. This problem 
reportedly happens with Zope 2.1.6 and 2.1.x, both on Linux and Windows, 
with IE5 and Netscape browsers alike. This could be a different problem, 
though.

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
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 )




Re: [Zope] Mutiple images don't always show up

2000-09-23 Thread Hung Jung Lu

It kind of make me feel better to know other people have observed the same 
problem. I found the following message in the mailing list by Pierre-Julien 
Grizel around 09/04/2000, with title: [Zope] Images slow rendering problem

http://zope.nipltd.com/public/lists/zope-archive.nsf/242bb7cc2b2c343d802568ab003585d4/cb99522a7c8258f280256950002d9618?OpenDocument

So, it does seem that Zope 2.1.6 has some problems handling multiple images. 
The problem seems to happen at least with Unix flavor OS (Linux, Solaris, 
FreeBSD,) and seems to be browser-independent (Netscape and IE alike). I 
don't think it's the If-Modified-Since problem, since I have applied the 
patch in http://classic.zope.org:8080/Collector/1388/view
and it did not make a difference.

regards,

Hung Jung

PS- correction: in my previous message, where I said Zope 2.1.x, should have 
been 2.2.x.

--- In [EMAIL PROTECTED], "Hung Jung Lu" [EMAIL PROTECTED] wrote:
Hi,

I have observed that in some Zope installations (I am using Zope 2.1.6 
through PCGI on Linux, my browser is Internet Explorer 5.5), if I have more 
than 4 or 5 images (currently I have one page with 12 GIF images), 
sometimes not all the pictures show up. If I reload the page, the problem 
is often fixed.

I have seen similar situations both with static images and dynamic images 
(images generated by Python programs.) I am not sure whether the problem is 
in the browser, in the Zope server, or in my ISP.

Has anyone seen something similar?

regards,

Hung Jung

-

PS- related to this, I also know that for Zope 2.1.x there is some thread 
competing write problem: when two threads (from different browser windows) 
compete in writing, one browser window does not receive any response. I 
know Zope is supposed to abort one of the threads and restart it, and 
matter of fact I do see that happen when I insert print statements. But 
it's just strange that the browser window does not display anything. This 
problem reportedly happens with Zope 2.1.6 and 2.1.x, both on Linux and 
Windows, with IE5 and Netscape browsers alike. This could be a different 
problem, though.

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
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 )




Re: [Zope] Zope Hosting in .au

2000-09-23 Thread Terry Kerr


Yes.
Adroit Internet Solutions.
www.adroit.net
Daniel Harris wrote:
Hi,
Are there any organisations in .au that offer Zope hosting?
Thanks,
Daniel.
___
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
)

--
Terry Kerr ([EMAIL PROTECTED])
Adroit Internet Solutions Pty Ltd (www.adroit.net)
Phone: +613 9563 4461
Fax: +613 9563 3856
Mobile: +61 414 708 124
ICQ: 79303381



___
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] Zope Hosting in .au

2000-09-23 Thread Daniel Harris


Hi,

Are there any organisations in .au that offer Zope hosting?

Thanks,
Daniel.


___
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 )