Re: [Zope-dev] Return variables from a DTML Method

2000-11-30 Thread Tres Seaver

[EMAIL PROTECTED] asked:
> 
> I want to change some ZClass properties by getting return results
> from a DTML Method. Something like this:  "myzclass.propertysheets.get('Basic').manage_changeProperties(dtmlM
> eth(this(),_))">. How do I get the dtmlMeth to return a Mapping?
> (or should I be doing this a different way?)

You *could* return a dictionary from a DTML method:

DTML Method 'return_dict'::

  
   

  

   Foo: 

   Bar: 

  

  

but I can't imaging wanting to.  Try to rearrange your
stuff so that the code generating the mapping can call
'manage_changeProperties()' its own self, or else move
it to PythonScripts/PythonMethods/ExternalMethods/a Product;
you'll be glad you did.

Tres.
-- 
===
Tres Seaver[EMAIL PROTECTED]
Digital Creations "Zope Dealers"   http://www.zope.org

___
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] ZUnit - feedback convocation

2000-11-30 Thread Lalo Martins

On Thu, Nov 30, 2000 at 11:52:47AM -0800, Michel Pelletier wrote:
> 
> Where would we find this outline?

Uh, attached to my original message.

[]s,
   |alo
   +
--
  Hack and Roll ( http://www.hackandroll.org )
The biggest site for whatever-it-is-that-we-are.


http://zope.gf.com.br/lalo   mailto:[EMAIL PROTECTED]
 pgp key: http://zope.gf.com.br/lalo/pessoal/pgp

Brazil of Darkness (RPG)--- http://zope.gf.com.br/BroDar

___
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] Return variables from a DTML Method

2000-11-30 Thread Dieter Maurer

[EMAIL PROTECTED] writes:
 > I want to change some ZClass properties by getting return results 
 > from a DTML Method. Something like this:  "myzclass.propertysheets.get('Basic').manage_changeProperties(dtmlM
 > eth(this(),_))">. How do I get the dtmlMeth to return a Mapping? 
 > (or should I be doing this a different way?)




There will be people that say, you should not do such things
in DTML.


Dieter

___
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] ZPatterns: using PythonMethods from Skinscript

2000-11-30 Thread Phillip J. Eby
At 04:39 PM 11/30/00 +0100, Ulrich Eck wrote: 

I've a db_sequence specialist who serves the Framework with
db_id's for new Records like:


May I suggest calling your Specialist "Sequences" or "Counters" since it appears that it returns objects which produce sequential integer  values?



>>> newid = db_sequence.getItem('').nextid
  
The Attribute nextid is provided by a Skinscript-Method:

WITH getNextId(seq_name=self.id) 
COMPUTE seq_name=seq_name,nextid=_.int(nextid)



I would not suggest using nextid as an attribute.  This should really be a method, e.g. getNextId().  The method should then return the result of calling Counters.getNextId(seq_name=self.id).

However, if you insist on using the above approach, your SkinScript should read:

WITH 
getNextId(seq_name=self.id)
COMPUTE 
nextid=RESULT['nextid'], seq_name=RESULT['seq_name']

Notice that since your Python method returns a dictionary, RESULT is a dictionary, not an object, so you have to retrieve the elements you want in your expressions that way.  Of course, you could just have getNextId() return an integer result, and use:

WITH getNextId(seq_name=self.id) COMPUTE nextid=RESULT
WITH SELF COMPUTE seq_name=id

to achieve the same effects.


  

My Second "little" Problem:


i'm not the first one who had problems to manage data with rdbms and zpatterns. i can get Attributes through SSMethods
easily and now tried to setup ADD/CHANGE/DELETED Rules to manage data.




Here my SSMethod for this(getEventById/insertEvent/updateEvent are ZSQL-Methods):


WITH QUERY getEventById(id=self.id) COMPUTE sid=_.int(id),name,time_start
WHEN OBJECT ADDED CALL insertEvent(id=self.sid)
WHEN OBJECT ADDED,CHANGED STORE sid,name,time_start 
USING  updateEvent(id=self.sid,name=self.name,time_start=self.time_start)
  


I access the Item through loadAttribute: "sid"
I set up a ZClass derived from Dataskin which acts as Storage-Class.
  
I call  
  



and get back an empty object without any attributes (propertysheet-problem??)
the record in the database is created (but only because I reduced the ZSQL-Insert Method to id-parm only)
this again seems to be a Problem of the namespace I'm in while the _objectAdded() ... method.


Here's what you're missing.  There is no "sid" attribute when you add an object.  You need to add this to your SkinScript (assuming I'm guessing correctly what sid is supposed to be):

INITIALIZE OBJECT WITH sid=_.int(self.id)

Otherwise, your two ADDED triggers will execute with no value for the sid attribute.



- Do I need a PropertySheet when I only want to access/change/create/delete Items/Attributes from a RDBMS ??
If yes: Which one (CommonInterfaceProp/DataSkinProp)
If no: how do i Access/Change my Properties ??


Yes.  DataSkin Property sheets would be the ones you need to use.



- and another Question related to this:
Which object fires the Trigger-Event (ADDED/CHANGED/DELETED)  ..
is it the PropertySheet itself ???


When you change the attributes of the object, the action is logged for the trigger to fire at transaction commit time.  The Property Sheet is just a way to change the attributes.


___ 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] Custom Unauthorized errors...

2000-11-30 Thread John Eikenberry


With all the work going on related to Zope's authentication system has
there been any progress on allowing custom unauthorized errors? I'd refer
to the bug id in the collector, but it seems to be down at the moment.

I'm planning on using LoginManager which fixes this to a certain extent
last I heard... that is it will let you use a customized unauthorized error
when you know who the user is (ie. they've logged in), but not for
anonymous users.

Just out of curiousity (I'm looking at the source now to figure this out,
but I thought it couldn't hurt to ask), why is this? The anonymous user has
a user object, and so would seem to be a real user as far as the system
goes.

I'm tired of hacking custom unauthorized errors into zope all the time, so
I'd really like to get this fixed at some point. Any thoughts as to
directions to go, or dead ends to be avoided. I'll be looking into this as
I find time so any help would be appreciated.

-- 

John Eikenberry
[[EMAIL PROTECTED] - http://zhar.net]
__
"A society that will trade a little liberty for a little order
 will deserve neither and lose both."
  --B. Franklin

___
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] Using LoginManager with SQL and SkinScript

2000-11-30 Thread Dan L. Pierson

I've put up a writeup of a different way to use LoginManager with SQL
that I think is a bit more in keeping with the current ZPatterns at:

http://www.zope.org/Members/dlpierson/sqlLogin

Any comments?  (I would have set this up as a formal HowTo, but
couldn't find a way to upload the contents.)

Dan Pierson



___
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] ZPatterns: using PythonMethods from Skinscript

2000-11-30 Thread Ulrich Eck



hi out there,
 
this is my first posting on this list. Right now I 
think 
this is the right place to ask details about 
ZPatterns.
 
I think a ZPatterns-Mailinglist should be set up, 
where
people like me, working hard to get the "Zen of 
ZPatterns"
can discuss questions related to USING 
ZPatterns.
 
Here my first little problem:
 
I've a db_sequence specialist who serves the 
Framework with
db_id's for new Records like:
 
>>> newid = 
db_sequence.getItem('').nextid
 
The Attribute nextid is provided by a 
Skinscript-Method:

WITH getNextId(seq_name=self.id) 
COMPUTE 
seq_name=seq_name,nextid=_.int(nextid)

 
 
"getNextId()" is a PythonMethod and uses 
ZSQL-Methods to
compute the NextId while Locking the Table: 


PARAMETER:  self, seq_name


self.sql_Lock()nid = 1for cur_id in 
self.sql_NextIdGet(seq_name=seq_name): nid = cur_id.nextid + 
1 self.sql_NextIdUpdate(seq_name=seq_name,nextid=nid) break
 
else: self.sql_NextIdCreate(seq_name=seq_name,nextid=1)
 
self.sql_Unlock()
 
return {'seq_name':seq_name, 'nextid':nid} # HERE'S 
MY PROBLEM I THINK 


 
I tried to return nearly everything expect a certain instance of a 
"special getNextId-Return-Object" e.g. return nid / return (seq_name,nid) 
...
 
I tried serveral ways to reach my return values in the SSMethod:
... COMPUTE nextid=nextid or nextid=self.nextid or nextid=RESULT ...
 
Finally i tried to follow what happens during a get-call of an Attribute in 
the source .. 
no success ..
 
except  when i use some Dummy ZSQL-Method which does the following and 
works (but this is not the way to do it ..)"select  as nextid, 
 as seq_name"
 
 
can someone give some advice or enlighten me about the Namespace I'm in, at 
SSMethods Attribute providers 
at execution-time ?!?
 
 
 
 
 
 
My Second "little" Problem:
 
i'm not the first one who had problems to manage data with rdbms and 
zpatterns. i can get Attributes through SSMethods
easily and now tried to setup ADD/CHANGE/DELETED Rules to manage 
data.
 
 
Here my SSMethod for 
this(getEventById/insertEvent/updateEvent are ZSQL-Methods):
 
WITH QUERY getEventById(id=self.id) COMPUTE 
sid=_.int(id),name,time_start
WHEN OBJECT ADDED CALL insertEvent(id=self.sid)WHEN OBJECT 
ADDED,CHANGED STORE sid,name,time_start 
USING 
updateEvent(id=self.sid,name=self.name,time_start=self.time_start)
 
 
I access the Item through loadAttribute: 
"sid"
I set up a ZClass derived from Dataskin which acts 
as Storage-Class.
 
I call  
 

and get back an empty object without any attributes 
(propertysheet-problem??)
the record in the database is created (but only 
because I reduced the ZSQL-Insert Method to id-parm only)
this again seems to be a Problem of the namespace 
I'm in while the _objectAdded() ... method.
 
 
 
- Do I need a PropertySheet when I only want to access/change/create/delete Items/Attributes from a RDBMS ??
  If yes: Which one 
(CommonInterfaceProp/DataSkinProp)
  If no: how do i Access/Change my Properties 
??
 
- and another Question related to 
this:
  Which object fires the Trigger-Event 
(ADDED/CHANGED/DELETED)  ..
  is it the PropertySheet itself 
???
 
 
lots of questions still there but these are 
the points i really tried to get working .. but i did'nt..
 
hope that there is an answer ..
 
thanks in advance
 
Ulrich Eck
net-labs
 
 
 
 
 
 
 
 


Re: [Zope-dev] ZUnit - feedback convocation

2000-11-30 Thread Michel Pelletier

Lalo Martins wrote:
> 
> Hi all
> 
> I'trying to write a document on ZUnit and Unit Testing in
> general, following Michel's and Amos' documentation process. I
> wrote an outline, and now I'm stuck :-) anyone with a few free
> moments is welcome to take a look and send me some words. Also,
> anyone very interested in the subject is welcome to volunteer
> for editorial help (read the Process to know what this means).

Where would we find this outline?
 
> Thank you.
> 
> (BTW, if you can't understand what an "outline" is, read the
> process too. Oh what the heck. If you haven't read it, then
> read it, it's very cool reading anyway.)

Thanks!

-Michel

___
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] Return variables from a DTML Method

2000-11-30 Thread bentzion

I want to change some ZClass properties by getting return results 
from a DTML Method. Something like this: . How do I get the dtmlMeth to return a Mapping? 
(or should I be doing this a different way?)

Thanks.



___
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] ZUnit - feedback convocation

2000-11-30 Thread Lalo Martins

Hi all

I'trying to write a document on ZUnit and Unit Testing in
general, following Michel's and Amos' documentation process. I
wrote an outline, and now I'm stuck :-) anyone with a few free
moments is welcome to take a look and send me some words. Also,
anyone very interested in the subject is welcome to volunteer
for editorial help (read the Process to know what this means).

Thank you.

(BTW, if you can't understand what an "outline" is, read the
process too. Oh what the heck. If you haven't read it, then
read it, it's very cool reading anyway.)

[]s,
   |alo
   +
--
  Hack and Roll ( http://www.hackandroll.org )
The biggest site for whatever-it-is-that-we-are.


http://zope.gf.com.br/lalo   mailto:[EMAIL PROTECTED]
 pgp key: http://zope.gf.com.br/lalo/pessoal/pgp

Brazil of Darkness (RPG)--- http://zope.gf.com.br/BroDar


Unit testing Zope Products with ZUnit

  by Lalo Martins

  Unit Testing

What is Unit Testing

Where does it come from

How should it be done

Refactor mercilessly!

  Writing Tests
  
Importing ZUnit

The TestCase class

Interfacing with the Zope environment

Fixtures

  The persistence problem - leaving traces behind

Grouping tests in TestSuites

Wrapping it all up in a creator function
  
  Running the tests
  
The TestRunner object

TestResults objects

Leaving objects behind for debugging



Re: [Zope-dev] OracleStorage, and possibly others

2000-11-30 Thread Lalo Martins

On Thu, Nov 30, 2000 at 08:27:00AM -0500, Jim Fulton wrote:
> Lalo Martins wrote:
> > 
> > Anyway, I said "inefficient", not "slow".
> 
> I think you really mean "scalable".

No, I meant "inefficient", a purposely vague term ;-) yes, I
meant to imply it isn't scalable, but not only that, and as I
didn't have the numbers, I prefered to be vague. What you say
below for memory usage also falls under "inefficient". Eating
into swap can really make a big machine crawl.

> OTOH, FileStorage has a huge memory hit for lage databases, because
> it keeps an in memory index from oid to file position.  It currently
> uses a Python dictionary for this. We could probably reduce the memory 
> hit by about an order of magnitude by switching to a different data
> structure, but DCOracleStorage or a Berkeley DB-based storage doesn't
> need this index.

[]s,
   |alo
   +
--
  Hack and Roll ( http://www.hackandroll.org )
The biggest site for whatever-it-is-that-we-are.


http://zope.gf.com.br/lalo   mailto:[EMAIL PROTECTED]
 pgp key: http://zope.gf.com.br/lalo/pessoal/pgp

Brazil of Darkness (RPG)--- http://zope.gf.com.br/BroDar

___
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] OracleStorage, and possibly others

2000-11-30 Thread Lalo Martins

On Thu, Nov 30, 2000 at 08:10:15AM -0500, Jim Fulton wrote:
> Lalo Martins wrote:
> > 
> > Please help stamp out Data.fs! :-)
> 
> I don't think Data.fs will go away.  I do expect it to be relagated to
> initial evaluation and development projects. Use of Berkely DB in
> transactional mode requires a significant andminstration commitment.
> Log files need to be purged. Backup and recovery processes need to be in 
> place. A similar cost is associated with using Oracle and many other databases,
> I expect. People aren't going to want to deal with these issues when 
> initially trying and learning Zope (or ZODB).

Sometime it will, I hope. Or at least, be relegated to non-Zope
ZODBs where the data volume is very small. But FileStorage will
not be replaced by any of the current alternatives, I agree.

[]s,
   |alo
   +
--
  Hack and Roll ( http://www.hackandroll.org )
The biggest site for whatever-it-is-that-we-are.


http://zope.gf.com.br/lalo   mailto:[EMAIL PROTECTED]
 pgp key: http://zope.gf.com.br/lalo/pessoal/pgp

Brazil of Darkness (RPG)--- http://zope.gf.com.br/BroDar

___
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] standard_error_message does nothing?

2000-11-30 Thread The Doctor What

My site uses SiteAccess2, zope 2.2.2, etc.

If I got to one of my virtual hosts and enter a bogus URL, I get an
error message that includes *another* error message within it (both
from HTTPResponse.py's _error_html().  Example:
http://docwhat.gerf.org:9673/fish

I have modified _error_html() to put a comment at the very start
saying where it came from.

In addition, the root standard_html_message has a comment at the top
and so does the /docwhat stdandard_html_message, both saying which
it is.  /docwhat is the folder that docwhat.gerf.org's
vhost/siteroot is at.

The fish url above should generate (I thought) my
standard_html_message from /docwhat.  I don't understand this at
all.  It goes against the docs in
http://www.zope.org/Members/JohnC/StandardErrorMessage

My site includes a view_source that works fairly well, if you want
to see the various standard_html_message's.  linuxasm.gerf.org is a
non-siteaccessed version of my site, with no siteaccess rules.  Here
are the URLs:
docwhat one:
http://docwhat.gerf.org:9673/standard_error_message/view_source
root one:
http://linuxasm.gerf.org:9673/standard_error_message/view_source

Thanks for any help.

Ciao!

-- 
Those are my principles. If you don't like them I have others.
-- Groucho Marx

The Doctor What: Second Baseman  http://docwhat.gerf.org/
[EMAIL PROTECTED]   KF6VNC

___
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] Loginmanager and LDAP

2000-11-30 Thread Phillip J. Eby

At 07:17 AM 11/28/00 +0100, Magnus Heino (Rivermen) wrote:
>
>
>I'd like to authenticate users using LDAP and Active Directory. Zope is
>running on a RH7.0 box.
>
>Has anyone done this, is it possible?

Dunno about Active Directory or RH 7, but Ty and I use LDAP logins with
LoginManager all the time on several applications.  We've made a custom
UserSource for ease of installation on different apps, but we originally
developed it using a GenericUserSource and the ZopeLDAP product.  You
should be able to do the same.


___
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] OracleStorage, and possibly others

2000-11-30 Thread Jim Fulton

"Phillip J. Eby" wrote:
> 
> At 08:10 AM 11/30/00 -0500, Jim Fulton wrote:
> >
> >I don't think Data.fs will go away.  I do expect it to be relagated to
> >initial evaluation and development projects. Use of Berkely DB in
> 
> >transactional mode requires a significant andminstration commitment.
> >Log files need to be purged. Backup and recovery processes need to be in
> >place.
> 
> FWIW, Ty and I talked about using a daemonic thread in BerkeleyStorage to
> run periodic checkpoints and purge logfiles.  AFAIK, backups of BerkeleyDB
> require only that you make a copy of all the associated files.  Recovery's
> a bit trickier, of course.  (We never got around to implementing it because
> our tests showed that BerkeleyDB didn't solve the performance issue we were
> trying to solve.  So we quit working on it at that point.)

I don't think the storage should get involved with this. There are alot
of knobs and possible policies that can be used. This is all well documented
and supported by Sleepycat Software. IMO, when someone uses a Berkeley DB storage
they are using Berkeley DB and should learn how to administer it. I don't
think it's a good idea to try to hide this from people.

Jim

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

___
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] OracleStorage, and possibly others

2000-11-30 Thread Phillip J. Eby

At 08:10 AM 11/30/00 -0500, Jim Fulton wrote:
>
>I don't think Data.fs will go away.  I do expect it to be relagated to
>initial evaluation and development projects. Use of Berkely DB in

>transactional mode requires a significant andminstration commitment.
>Log files need to be purged. Backup and recovery processes need to be in 
>place.

FWIW, Ty and I talked about using a daemonic thread in BerkeleyStorage to
run periodic checkpoints and purge logfiles.  AFAIK, backups of BerkeleyDB
require only that you make a copy of all the associated files.  Recovery's
a bit trickier, of course.  (We never got around to implementing it because
our tests showed that BerkeleyDB didn't solve the performance issue we were
trying to solve.  So we quit working on it at that point.)


___
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] Re: [Geeks] Re: Interface Meta Data proposal

2000-11-30 Thread Jim Fulton

Guido van Rossum wrote:
> 
> > Is security really a part of an object's interface?  I thought this was more
> > of an implementation thing.
> 
> Good point.  Certainly in Unix I can have two things implementing the
> same interface (e.g. two named pipes) with different security
> settings (i.e. modes).
> 
> However some security stuff can be part of the interface too: e.g. the
> fact that a Foo object has Read, Write and Execute permissions is
> usefully specified as part of its interface.  Whether a particular Foo
> instance has a given permission for a certain user is up to the
> instance.

I think we're talking about a different level of security setting
here.  In unix, you have certain fixed permissions (e.g. read, write,
execute).  The OS maps these permissions onto certain low-level operations
for the few objects it knows about.  This is about mapping permissions
onto objects, rather than deciding what users or groups have 
what permissions on an object.

In Zope, the programmer defines abstract permissions and decides how to map
the abstract permissions to object operations. It is this mapping that
makes sense for interfaces.  

Like Unix, Zope has a separate mechanism for deciding what users/roles
have what permissions on objects. This should not be part of the 
object interface.  These settings are done by users/administrators.

Jim

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

___
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] Re: [Geeks] Interface Meta Data proposal

2000-11-30 Thread Jim Fulton

Chris McDonough wrote:
> 
> Is security really a part of an object's interface? 

IMO yes. I would go even farther and suggest that different
interfaces to an object represent different types of usage
and map very nicely to permissions. That is, there might
be a one-to-one mapping from interface to permission.  In this
model, you don't need to make assertions for components
of an interface (e.g. attributes and methods, which are just special
kinds of attributes), rather you simply say that the whole interface
is associated with a particular permission. 

Jim

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

___
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] OracleStorage, and possibly others

2000-11-30 Thread Jim Fulton

Lalo Martins wrote:
> 
> On Wed, Nov 29, 2000 at 07:02:50AM -0500, Chris McDonough wrote:
> > > Of course it would, for the same reasons as OracleStorage (eg
> > > FileStorage/Data.fs is inefficient)
> >
> > Actually, it's the other way around.  OracleStorage is 30-to-50 times slower
> > than FileStorage on writes.  Reads are slow too but the slowness is somewhat
> > negated by caching.
> 
> Chris, that's only true for small databases. At about 100M of
> Data.fs, OracleStorage starts being faster. It depends on
> hardware too. We made some benchmarks on a major Brazilian
> portal, and well, it's currently running OracleStorage.
> 
> Anyway, I said "inefficient", not "slow".

I think you really mean "scalable".  I suspect that
FileStorage will be faster and use less disk that OracleStorage, 
or any other storage, at least when supporting undo.

To get even comparible speed from Oracle requires substantial
optimization on the Oracle side. Our customer was able to substantially
improve DCOracleStorage performance by doing things like putting
tables and indexes on different disk *controllers*. :)

OTOH, FileStorage has a huge memory hit for lage databases, because
it keeps an in memory index from oid to file position.  It currently
uses a Python dictionary for this. We could probably reduce the memory 
hit by about an order of magnitude by switching to a different data
structure, but DCOracleStorage or a Berkeley DB-based storage doesn't
need this index.

Initial tests with my latest Berkeley DB-based storage show it to be
about three times slower than FileStorage.  I suspect that if the logs
and data files were put on separate disks, as Sleepycat Software recommends, 
that the speed difference could be reduced quite a bit.

Note that, until recently, FileStorage couldn't be used with databases
over 2GB in size, due to a bug that was fixed at around the same time that 
we released the DCOracleStorage.  We have a customer who has a 10GB 
FileStorage. You need large-file support in Python for your OS to 
be able to go over 2GB.

Jim

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

___
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] OracleStorage, and possibly others

2000-11-30 Thread Jim Fulton

Lalo Martins wrote:
> 
> Well, two betas of OracleStorage in one day, then a month and a
> half of silence. What's the status?

>From our perspective, it's what it was then.  We built it for
a customer who later decided they didn't want it. I'm
glad to hear you found it useful.

> What about the other Storage projects? BerkeleyStorage has been
> dead for an year, and I heard pretty nasty words about
> InterbaseStorage. What about someone who wanted to try to port
> OracleStorage to Postgres or some other RDBMS?

We're working on a new suite of Berkeley storages that we are
writing to the the latest Berkeley database APIs. As Chris
pointed out, these are based on a new Berkeley DB extension that 
Andrew Kuchling started and that Robin Dunn is finishing.

There are a number of interesting new features that will eventually
result from these storages:

  - A new pack/garbage collection approach.  The current storages
perform a mark-and-sweep garbage collection when packing. It turns
out that this really isn't very scalable.  I'm going two 
switch to using the same garbage-collection strategy that Python uses, 
which is reference counting supplimented by an incremental cyclic garbage
detection algorithm. I have a simple storage (no undo or versions) that
needs no packing of your data structures are free of cycles.

I'm hopeful that we can make packing automatic and incremental.

  - Undo-log generation will be much faster, at least for common
cases. Generation of undo logs (for selecting transactions to undo)
is becoming a significant performance problem with FileStorage.

  - ZEO verification, performed when a client with a persistent
cache starts up, will be much faster.

  - Policies to control whether multiple revisions are stored
or whether revisions are removed by packing on a object-by-object
or transaction-by-transaction basis.

For example, you could have a poll/votting product that didn't allow
undo of and didn't require storing multiple records for votes. This
would be cleaner than mounting a separate database with a simple
storage.

You could keep significant historical revisions for important objects, such
as Wiki pages, templates, scripts, etc., with a policy to decide
which revisions are significant.

  - The ability to set policies to implement quotas.

I expect that we'll work out a lot of these ideas for Berkeley storages and
then implement them in OrcaleStorage. Others should then be able to map the
implementation onto other storages.

I'll note, in passing, that it's much nicer working these ideas out
with the BerkelyDB API than dealing with PLSQL or Python SQL.

We are also working on ZEO storage replication. This may have a big
impact on the storage API, or lead to specialized APIs for replicated
storages.
 
> Please help stamp out Data.fs! :-)

I don't think Data.fs will go away.  I do expect it to be relagated to
initial evaluation and development projects. Use of Berkely DB in
transactional mode requires a significant andminstration commitment.
Log files need to be purged. Backup and recovery processes need to be in 
place. A similar cost is associated with using Oracle and many other databases,
I expect. People aren't going to want to deal with these issues when 
initially trying and learning Zope (or ZODB).

Jim

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

___
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] Interfaces: Specify, then implement!

2000-11-30 Thread Chris Withers

Dieter Maurer wrote:
> 
> If you do change the implementation, then the specification
> can probably be changed at the same time.

IMHO, this is the wrong way round.

If the interface doesn't cover what it needs to, update the interface
and then make sure all the implementations are updated afterwards.

cheers,

Chris

___
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] time stamp - concurrent editing

2000-11-30 Thread Ender

"Nai A. Tzeo" wrote:
> 
> Hello,
> 
> I'm a zope newbie and was wondering if anyone on the list know how to solve
> the problem of concurrent editing.  I'm using zope as a front end and SQL
> server as a back end.  Basically, I want to be able to edit a record with
> out having to lock the record so that others can use it but I want to make
> sure that when I update and save my changes that I don't overwrite someone
> elses changes.  I was thinking about time stamping the record every time a
> person grabs the records in update view.  Before the changes are written to
> the database, the timestamps on both the record that's checked out and the
> record that was modified should be compare.  If the timestamp in the
> database is more recent, meaning someone has updated the record, then I
> can't update the record with my changes.  I would need to grab the latest
> copy from the database and add in my changes.  I know this sounds really
> inefficient but I can't think of another way.  If anyone have other ideas or
> thoughts, pass it along.  It will be greatly appreciated.

thoughts,

doing programmtic merging of changes is going to be scary (perhaps
exploring the diffs command that cvs uses (rdiff?), however you do it,
you should probably do some auditing tables to make sure changes are
never discarded completely (depending on app and load). 

scenario  (extermely record dependent). assuming shared document stored
in the db for this example.

joe smoe goes to edit screen. leaves for two week vacation

jane doe goes to edit screen. types in her magnum opus. 

joe comes back, types 'vacation ruled' and saves. 

jane looks back at screen, screams, and takes two year vacation.

purely, adding in changes can't always assume nesc that a doc is always
getting bigger (again this extremely app specific).

regardless, IMO for this type app domain mysql isn't a good db for this
type of app (no transaction support, no stored procs/triggers)

ideas,

switch to a db with real mvcc where you don't have to block your readers
on writers to achieve isolation (something like... postgres). add some
triggers to create audit. use sequences instead of timestamps for
revision ids(store timestamps for human views, but programatically using
the db for ts manipulation and indexing is very db specific and limited
by that db ts internals, sequences achieve the same result, are faster,
and are ansi-sql compliant). if you do decide to do locks, allow temp
locks based on ts, check edit requests on ts of lock and
approve/deny/create new, etc.


kapil

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