RE: [Zope-dev] (no subject)

2000-06-06 Thread Chris McDonough

I was kicking the idea of making one around, but I don't think I'll have
time to do it.

There's a document on how to write a Zope database adapter by Chris
Petrilli at:

http://www.zope.org/Members/petrilli/WritingADA

Since the Python layer has been (well) done by Alex, it shouldn't be too
hard to make one if you're OK with Python.

Good luck!

> -Original Message-
> From: kyn [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 07, 2000 12:34 AM
> To: '[EMAIL PROTECTED]'
> Subject: [Zope-dev] (no subject)
> 
> 
> Hi Zope-developers,
> 
> I try out Zope last week and was greatly impressed with the 
> flexiblity of the zope system.  Now, I am thinking of porting 
> my Company intranet to zope but I have one problem.  Our 
> company backend database servers (for items catelogs, leave 
> application ...etc) sits on Inprise Interbase server.   I 
> check through all the mailing list and unable to find an 
> adapter to it.
> 
> Currently, I notice that Inprise has made Interbase an open 
> source database system on linux. Is there anyone looking into 
> coming out with an adapter on Interbase ?
> 
> Or someone in the developing labs can give me guidelines on 
> how to write an adapter for Inprise Interbase on linux.  I 
> manage to get a copy python code that can access Interbase 
> server on linux.  Credit has to be given to Alexandra (email 
> :'[EMAIL PROTECTED]').
> 
> Need advise ...
> 
> 
> bye ... kyn
> 
> 
> 
> 
> ___
> 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 )




[Zope-dev] (no subject)

2000-06-06 Thread kyn

Hi Zope-developers,

I try out Zope last week and was greatly impressed with the flexiblity of the zope 
system.  Now, I am thinking of porting my Company intranet to zope but I have one 
problem.  Our company backend database servers (for items catelogs, leave application 
...etc) sits on Inprise Interbase server.   I check through all the mailing list and 
unable to find an adapter to it.

Currently, I notice that Inprise has made Interbase an open source database system on 
linux. Is there anyone looking into coming out with an adapter on Interbase ?

Or someone in the developing labs can give me guidelines on how to write an adapter 
for Inprise Interbase on linux.  I manage to get a copy python code that can access 
Interbase server on linux.  Credit has to be given to Alexandra (email 
:'[EMAIL PROTECTED]').

Need advise ...


bye ... kyn




___
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] Interfaces Wiki Changes

2000-06-06 Thread Chris Withers

Hi Michel,

I've been good and documented what I learned from the docs discussion in
the interfaces wiki.

Can you check and correct as appropriate please:
http://www.zope.org/Members/michel/Projects/Interfaces/ACPermissions
http://www.zope.org/Members/michel/Projects/Interfaces/QueryObject

Also, could the case sensitivity of each of the index types
(text|keyword|field) be documented in the Wiki?

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] transaction support for ordering transactions.

2000-06-06 Thread Anthony Baxter


>>> "Phillip J. Eby" wrote
> There is an error in your patch, however. _prepend should use
> self._objects.insert(0,object), as the way you're doing it now will break
> the _append method.  (Because _append is a reference to _objects.append,
> and you're replacing the old _objects with a new list.  Subsequent calls to
> _append will append the object to the old _objects list, not the new one
> you've just added.)  

Darn. That'll teach me to make a quick patch like this. Still, getting the
feedback is the key thing - I wasn't sure if the approach I was taking was
the right one.

> There is also a *second* problem with your patch, which is more serious and
> less correctable.  If a _prepend takes place *during* a commit operation,
> the current implementation of the commit operation will be blown all to

Ugh. Ok, how about then just doing something like not allowing a prepend
once the committings already started?

> Anyway...  I'm very much in favor of solving the same problem that you
> are...  But it requires a rather more complex patch (so that
> transaction.commit() could deal with prepends during commit) and first we'd
> need to convince Jim that it's the right thing to do.  :)  (Not only that,
> but he might come up with a better way to do it than prepending...)

He does tend to do that. I'd very much like a way to fix this - at the
moment, the only workaround for me is for SQLSessions to have an entirely
different database connection to themselves.

> Ironically, I'm not sure your problem actually *needs* this fix to be
> solved.  You probably need to tie your session object's behavior to an
> earlier transaction event (the "_p_jar.commit()" operation rather than
> tpc_finish()), and you can then be guaranteed that the SQL connection has
> not yet seen a tpc_finish() either.

I'm not sure I understand this - are you suggesting hooking it to the 
database connector's commit?

> *My* problem, on the other hand, is that even if I do this, ZODB does not
> allow objects to be _p_jar.commit()ed twice; if you modify an object which
> has already been _p_jar.commit()ed in the same transaction, you will get an
> unresolvable ConflictError (because the ZODB thinks another transaction
> modified the object before you). 

Ugh. Nasty nasty. But hey, isn't the whole point of ZPatterns to expose 
all the nasty corners of the Zope innards to light?

> Thus, I need to ensure that DataManagers
> which are saving things up 'till a _p_jar.commit() operation, get
> registered ahead of any modification to an object that they might need to
> modify again later.  So a fully functional "prepend" capability would be of
> great benefit to ZPatterns, but I'm not sure that your problem actually
> needs it, and your patch, unfortunately, does not achieve it.

Thanks for the feedback - time for me to hit the source code again. :)

Anthony 

___
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] Getting to container from a method called by the factory

2000-06-06 Thread Kevin Dangoor

I'm trying to check if the container from which the user selected a
product from the add menu has an "acl_users" folder. When the user selects
the option from the add menu, they get a form. When they submit the form,
the method (a PythonMethod) does this:

folder=self.Destination()
if hasattr(folder, 'acl_users'):
  ...do something...
else:
  ...complain...

Even though I know the folder has an acl_users (and having this function
return folder.objectIds() proves it), the above code will always complain.
Is there a problem with using hasattr in this context?

Kevin
http://www.byproducts.com - Humor and Novelties


___
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] LM and user objects

2000-06-06 Thread Lalo Martins

On Tue, Jun 06, 2000 at 04:03:50PM -0600, Bill Anderson wrote:
> 
> Cool. I tried the ZClass route (less restarts ;) gave it Fname,Lname,and
> zpasswd as fields. (ISTR something about the password needing to be a
> field)

Running the risk of repeating myself:

if the password is a ZClass property, any DTML method can read
any user's password. It's ok if you don't plan to allow users
to edit DTML (recommended), but anyway it's a hole I don't want
to leave open in my site because I know I will forget it later.

[]s,
   |alo
   +
--
  Hack and Roll  ( http://www.hackandroll.org )
News for, uh, 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] LM and user objects

2000-06-06 Thread Bill Anderson

"Phillip J. Eby" wrote:
> 
> At 04:03 PM 6/6/00 -0600, Bill Anderson wrote:
> >
> >I am using the deafult UserSource that comes with LM for the moment (one
> >step at a time ;)
> 
> LM or PTK?

LM

(Waiting for Dan's changes before trying _any_ LM with PTK ;)

> 
> >When I try to add through the manage interface, I get:
> >Error Type: KeyError
> >Error Value: _v_rack
> 
> Eh?  What manage interface?  Nothing Ty or I put out has a manage interface
> to add a user.


The management interface, a sin click through Lm to UserSouorce, select
LM User object from the  select-box. Sorry, in ahurry I left off 'ment'
:/
 
> >So I judge that this interface to be a no-workie.
> 
> I guess so.  :)
> 
> >So I tried the form->method method, and I get:
> >Error Type: NotFound
> >Error Value: None
> >
> >And no help in the traceback. :(
> 
> The what method?  I'm sorry, I'm completely lost.

I made a form that took an input for id , and called the newItem(id)
method.

>  If you're using the
> PTK's PersistentUserSource, I don't know anything helpful to tell you,
> 'cause I haven't had time to look at it yet (too busy on ZPatterns, not to
> mention non-Zope work).

Yeah, I hear you. I am finally getting the time to start doing some
heavy work with LM and PTK later this month, so I am trying to get
caught up, so to speak. figured since i knew more abot pTK than LM, that
LM would be a good thing to start with. :)

___
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] LM and user objects

2000-06-06 Thread Phillip J. Eby

At 04:03 PM 6/6/00 -0600, Bill Anderson wrote:
>
>I am using the deafult UserSource that comes with LM for the moment (one
>step at a time ;)

LM or PTK?


>When I try to add through the manage interface, I get:
>Error Type: KeyError
>Error Value: _v_rack

Eh?  What manage interface?  Nothing Ty or I put out has a manage interface
to add a user.

>So I judge that this interface to be a no-workie.

I guess so.  :)


>So I tried the form->method method, and I get:
>Error Type: NotFound
>Error Value: None
>
>And no help in the traceback. :(

The what method?  I'm sorry, I'm completely lost.  If you're using the
PTK's PersistentUserSource, I don't know anything helpful to tell you,
'cause I haven't had time to look at it yet (too busy on ZPatterns, not to
mention non-Zope work).


___
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] LM and user objects

2000-06-06 Thread Bill Anderson

Kevin Dangoor wrote:
> 
> - Original Message -
> From: "Bill Anderson" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, June 06, 2000 4:21 PM
> Subject: [Zope-dev] LM and user objects
> 
> > Once I get that set up, I add property sheets for the user where? The
> > ZClass?
> > Once I get that set up, how do I add a user? Would one method be to go
> > into the acl_users(LM) and add a User? What about adding them
> > programmatically? I looled at the API.txt, but it wasn't helpful in this
> > regard. :(
> 
> If you're not in a blazing hurry on this, I'm working right now on breaking
> Membership out of the PTK (after which, I'll put it back in :)
> This will basically come in the form of a product that adds a LoginManager
> and configures it with high level methods. No ETA at the moment, because I'm
> wrestling with syntax within my method that is called by the factory. I
> expect things to move fairly quickly, though, because Mike Pelletier and Dan
> Pierson already did the hard work to get things to where they are now.

Ooo
I would like to get it up in the next day or so, I have a site waiting
for it (http://gaming.activeboise.com) that pretty much needs membership
to progress to the next level. So I will probably need to forge ahead,
although I have places (and the will) for testing ;) 

wink-wink-nudge-nudge-ly y'rs Bill

___
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] LM and user objects

2000-06-06 Thread Bill Anderson

"Phillip J. Eby" wrote:
> 
> At 02:21 PM 6/6/00 -0600, Bill Anderson wrote:
> >
> >I beleive I have the basic LM concept grasped. I understand that I need
> >a 'User' Object, ostensibly can be done in Python or ZClasses. For now,
> >I will look at ZClasses for experimentation.
> >
> >So, I beleive that to set up a ZODB-based User for LM, I need to create
> >the UserObject's ZClass. What do I need to subclass, if any, from?
> 
> >From Python: Products.LoginManager.LoginUser
> >From Zope:   "ZClass_for_LoginUser"


Cool. I tried the ZClass route (less restarts ;) gave it Fname,Lname,and
zpasswd as fields. (ISTR something about the password needing to be a
field)


> >Once I get that set up, I add property sheets for the user where? The
> >ZClass?
> 
> To add sheets for the class, do it in the ZClass.  You will then need
> AttributeProvider support for the properties (which if you're doing a
> Persistent user source, means simply that you leave the default "Persistent
> Internal Attribute Provider" active for all attributes).  Alternatively,
> you can programmatically add a propertysheet to an individual user at
> "runtime", but you will have to create the schema for it at the same time.

OK.
 
> >Once I get that set up, how do I add a user? Would one method be to go
> >into the acl_users(LM) and add a User? What about adding them
> >programmatically? I looled at the API.txt, but it wasn't helpful in this
> >regard. :(
> 
> I think if you derive your UserSource from the BasicUserSource or
> UserSource class in LoginManager, you should be able to simply call the
> usersource's newItem(id) method to get a new, empty user object.
> Manipulating propertysheets on it will then let you set properties.


I am using the deafult UserSource that comes with LM for the moment (one
step at a time ;)

When I try to add through the manage interface, I get:
Error Type: KeyError
Error Value: _v_rack

So I judge that this interface to be a no-workie.

So I tried the form->method method, and I get:
Error Type: NotFound
Error Value: None

And no help in the traceback. :(


What am I missing?

___
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] LM and user objects

2000-06-06 Thread Kevin Dangoor

- Original Message -
From: "Bill Anderson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 06, 2000 4:21 PM
Subject: [Zope-dev] LM and user objects


> Once I get that set up, I add property sheets for the user where? The
> ZClass?
> Once I get that set up, how do I add a user? Would one method be to go
> into the acl_users(LM) and add a User? What about adding them
> programmatically? I looled at the API.txt, but it wasn't helpful in this
> regard. :(

If you're not in a blazing hurry on this, I'm working right now on breaking
Membership out of the PTK (after which, I'll put it back in :)
This will basically come in the form of a product that adds a LoginManager
and configures it with high level methods. No ETA at the moment, because I'm
wrestling with syntax within my method that is called by the factory. I
expect things to move fairly quickly, though, because Mike Pelletier and Dan
Pierson already did the hard work to get things to where they are now.

Kevin


___
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] LM and user objects

2000-06-06 Thread Phillip J. Eby

At 02:21 PM 6/6/00 -0600, Bill Anderson wrote:
>
>I beleive I have the basic LM concept grasped. I understand that I need
>a 'User' Object, ostensibly can be done in Python or ZClasses. For now,
>I will look at ZClasses for experimentation.
>
>So, I beleive that to set up a ZODB-based User for LM, I need to create
>the UserObject's ZClass. What do I need to subclass, if any, from?

>From Python: Products.LoginManager.LoginUser
>From Zope:   "ZClass_for_LoginUser"


>Once I get that set up, I add property sheets for the user where? The
>ZClass?

To add sheets for the class, do it in the ZClass.  You will then need
AttributeProvider support for the properties (which if you're doing a
Persistent user source, means simply that you leave the default "Persistent
Internal Attribute Provider" active for all attributes).  Alternatively,
you can programmatically add a propertysheet to an individual user at
"runtime", but you will have to create the schema for it at the same time.


>Once I get that set up, how do I add a user? Would one method be to go
>into the acl_users(LM) and add a User? What about adding them
>programmatically? I looled at the API.txt, but it wasn't helpful in this
>regard. :(

I think if you derive your UserSource from the BasicUserSource or
UserSource class in LoginManager, you should be able to simply call the
usersource's newItem(id) method to get a new, empty user object.
Manipulating propertysheets on it will then let you set properties.


___
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] BerkeleyStorage.py is broken?

2000-06-06 Thread Ty Sarna

In article <[EMAIL PROTECTED]>,
nw_moriarty   <[EMAIL PROTECTED]> wrote:
> There are many admonitions to use BerkeleyStorage.py if you don't
> require versions in a database.  However, I have tried without success
> to get it to work with TCS.bsddb.db and BerkeleyDB 2.7.7 in a stand
> alone application. 
> 
> How ANYBODY got it to work?  

Sorry for not replying earlier...

What sort of problems are you having? It would help if you could
describe in detail what problems you are seeing. 


___
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] transaction support for ordering transactions.

2000-06-06 Thread Phillip J. Eby

At 02:34 PM 6/6/00 +1000, Anthony Baxter wrote:
>  As part of making SQLSession transaction-sane, I'd like to be able
>to specify that something can register itself to be committed or
>aborted earlier in the list of objects rather than just being put on
>the end of the list. The reason for this: 
>
>  I want SQLSession to just use a normal DB connection, and have the
>commits &c to "just work". The new code now only does the SQL statements
>in SQLSessionObj's _finish() method - unfortunately, by that time, the
>database's '_finish()' method has sometimes already been called (if there's
>a different database call before the Session object is created, then the 
>database adaptor will be registered first).
>
>  I thought about various ways of dealing with this, such as being able
>to say 'register me _before_ that object', but ended up going simply with
>a flag to say 'put me on the front of the list, rather than the back.'
>
>  This way, anything that needs to say 'no, put me before the standard
>ones' can do so. 
>
>
>Thoughts? Alternatives?
>

Interesting.  I have a similar problem with triggers and index agents in
ZPatterns 0.4.0.  It would be solvable by the same general approach you've
presented (giving the transaction.register() method an option to register
for "early" commit).

There is an error in your patch, however. _prepend should use
self._objects.insert(0,object), as the way you're doing it now will break
the _append method.  (Because _append is a reference to _objects.append,
and you're replacing the old _objects with a new list.  Subsequent calls to
_append will append the object to the old _objects list, not the new one
you've just added.)  

There is also a *second* problem with your patch, which is more serious and
less correctable.  If a _prepend takes place *during* a commit operation,
the current implementation of the commit operation will be blown all to
hell, because it relies on knowing how far along it has gone in the
_objects list.  Instead of committing your newly prepended object, it will
re-commit the object it committed last, and if there's an error, the newly
prepended object will not be aborted.  Yuck.

Anyway...  I'm very much in favor of solving the same problem that you
are...  But it requires a rather more complex patch (so that
transaction.commit() could deal with prepends during commit) and first we'd
need to convince Jim that it's the right thing to do.  :)  (Not only that,
but he might come up with a better way to do it than prepending...)

Ironically, I'm not sure your problem actually *needs* this fix to be
solved.  You probably need to tie your session object's behavior to an
earlier transaction event (the "_p_jar.commit()" operation rather than
tpc_finish()), and you can then be guaranteed that the SQL connection has
not yet seen a tpc_finish() either.

*My* problem, on the other hand, is that even if I do this, ZODB does not
allow objects to be _p_jar.commit()ed twice; if you modify an object which
has already been _p_jar.commit()ed in the same transaction, you will get an
unresolvable ConflictError (because the ZODB thinks another transaction
modified the object before you).  Thus, I need to ensure that DataManagers
which are saving things up 'till a _p_jar.commit() operation, get
registered ahead of any modification to an object that they might need to
modify again later.  So a fully functional "prepend" capability would be of
great benefit to ZPatterns, but I'm not sure that your problem actually
needs it, and your patch, unfortunately, does not achieve it.


___
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] LM and user objects

2000-06-06 Thread Bill Anderson

Pardon my denseness (politics can do that to you I guess ;)...

I beleive I have the basic LM concept grasped. I understand that I need
a 'User' Object, ostensibly can be done in Python or ZClasses. For now,
I will look at ZClasses for experimentation.

So, I beleive that to set up a ZODB-based User for LM, I need to create
the UserObject's ZClass. What do I need to subclass, if any, from?

Once I get that set up, I add property sheets for the user where? The
ZClass?
Once I get that set up, how do I add a user? Would one method be to go
into the acl_users(LM) and add a User? What about adding them
programmatically? I looled at the API.txt, but it wasn't helpful in this
regard. :(

I swear if nobody beats me to it, I'll write all this up and post it to
Zope.org when I get it done. :) (If nothing else, for my own reference
;)

___
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-0.4 ?

2000-06-06 Thread Phillip J. Eby

At 08:21 PM 6/6/00 +0400, Jephte CLAIN wrote:
>Hello,
>
>I have used ZPatterns-0.3.0 to complete a project that I shipped
>yesterday.

Congratulations, you're even braver than I am.  ;)


>Although I had to write a CatalogAwareRack/Specialist to allow me to
>search for rackmountables, I can say that ZPatterns has saved my life! I
>would like to thanks Philip for this great contribution. (too bad I no
>longer remember the url of that site where you can send so-called
>"virtual beers" to fellows on the internet :-))

That's okay, I don't drink.  :)


>Now, for a project I have to ship by the end of june, I would like to
>use zpatterns-0.4.0. I especially want to use the new search interface.
>Does Philip know when ZPatterns-0.4.0 is out? If it is until the middle
>of june, I can certainly wait. In the other case, I wonder if the search
>plugin (in the case it has already be written) can be used with
>zpatterns-0.3. In that case, I can do the work of adapting the code to
>zpatterns-0.3

I'm shooting for release by the end of next week.  Search plugins have not
been finished yet, but in any case they will NOT work with prior versions;
there is no place to plug them in, nor will any of the old code call them. :)


>Also, for that project, I will have to write a sql attribute provider.
>If one can give me advices on how Ty wants to implement SQL Attribute
>Provides after he's done with LDAP Attribute Provider, perhaps I can
>start the work (since I have a use for it) and let Ty continue the work
>when he has more time / have finished LDAP Attribute Provider. I already
>have some ideas on how to do it, but I lack to view how far the concept
>have to be pushed. Without any help, I will end up writing a SQL
>Attribute Provider that work only for me...

Ty and I just finished the first "real" attribute provider, an "ExprGetter"
provider, which is designed to work with SQL, LDAP, and other "method"
objects available in Zope.  It takes a "source expression" and a list of
"target expressions".  The source expression is evaluated whenever any of
the attributes provided by the provider are requested.  Then the target
expressions are evaluated in order, each one having the variable RESULT
equal to the result of the source expression.  An example:

Source expression:
  (SomeSQLMethod(searchkey=self.id) or [NOT_FOUND])[0]

Target expressions:
  myAttr1=RESULT.field1
  myAttr2="(%s)" % RESULT.field2
  myAttr3=RESULT.field3 * self.someOtherAttr

The above example will call SomeSQLMethod() (searched for in the Rack or
Customizer's acquisition tree) whenever myAttr1, myAttr2, or myAttr3 are
requested for the DataSkin/RackMountable.  It will be passed the DataSkin's
"id" attribute (note the self.attr notation for referencing data from the
skin in the source expression).  If the SQLMethod returns no rows, the
special NOT_FOUND value will be substituted, which tells the attribute
provider to pretend none of the attributes exist.  If it returns rows, the
first row ([0]) will be returned as RESULT for use in the target
expressions as shown.  The results of all three expressions will be cached
in the DataSkin's attribute cache for the remainder of the current
transaction, thus preventing a recurring call to the database.

"NOT_FOUND" and "self" are also available for use in the target
expressions, so one can conditionally simulate the existence or
non-existence of a given attribute, as well as do "computed attributes".
All expressions are VSEval-based (DocumentTemplate expr's) and "safely"
editable through the web.  Also, "self" is in its acquisition context
(either its folder or its Specialist) and you can freely reference other
provider-driven attributes or propertysheets (from the same or different
providers) in your expressions so long as you don't create an infinite
recursion loop.

This particular expression-based attribute provider is the first of a set
of defined mappings from attributes and events into expression calls.  We
have in fact designed a "little language" (tentatively called SkinScript)
which will let you render statements like the above as:

USE (SomeSQLMethod(searchkey=self.id) or [NOT_FOUND])[0]
TO COMPUTE
  myAttr1=RESULT.field1,
  myAttr2="(%s)" % RESULT.field2,
  myAttr3=RESULT.field3 * 10

And other things like:

NOTIFY some_expression AFTER ADDING, CHANGING, DELETING

USE expr TO SET attr1,attr2,attr3 

etc.

But it's not clear whether an actual SkinScript compiler will make it into
0.4.0.  The plan is to first make a provider class for each of the
SkinScript constructs, to debug them.  We can then replace them later with
a single "SkinScript provider".

We came up with SkinScript because we realized that configuring a gazillion
individual Attribute and SheetProviders was terribly tedious and messy, not
to mention that it was hard to see what was going on with your object in
one place.  Also, it eliminates the need for having specific kinds of
Providers for different databases.  (Note: we are not eliminati

Re: [Zope-dev] New Help System in 2.2

2000-06-06 Thread Dan L. Pierson

Jimmie Houchin writes:
 > I was considering at one point jumping up and writing a documentation
 > system for Python/Zope. Unfortunately my notes, not many, are at work.
 > But some things I had in mind were based on something like JavaDoc. I am
 > not a Java expert and have not really used JavaDoc much but have seen
 > some of its documentation.
 > 
 > I was thinking it would be nice to have a parser which could extract
 > documentation from source to create external documentation files which
 > could be generated into multiple formats, html, xml, etc. I would have
 > needed to create a documentation format which could be used in source
 > but extracted. I was not going to use docstrings as they are intended
 > for a different purpose and are compiled into the bytecode.

You might want to take a look at the bottom of http://www.lfw.org/python/...

___
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 ProperySheet usage example?

2000-06-06 Thread Phillip J. Eby

At 08:47 PM 6/5/00 -0600, Bill Anderson wrote:
>"Phillip J. Eby" wrote:
>> 
>> At 05:07 PM 6/5/00 +0800, Mike wrote:
>> >Hello people,
>> >
>> >could anybode give an example (in code) on subject?
>> >
>> 
>> This isn't exactly code, but...
>> 
>> Set up a LoginManager with a GenericUserSource, and set up the GUS to have
>> users. 
>
>Is there documentation on how to do this part available yet?
>

No, unless you count the docs from GenericUserFolder, which works the same
way.  Sorry.


___
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] ReiserStorage 0.01 alpha

2000-06-06 Thread Petru Paler

  Hello all,

   Attached you can find the code for a preliminary ZODB storage manager
which is designed to take adventage of the reiserfs filesystem
(http://devlinux.com/namesys). While it is usable on other filesystems
too, the performance will decrease as the number of objects in your
database increases.
   Comments:

1. This is as alpha as it can be. While it is usable to do some testing on
a spare Zope, you must be insane to even try to use this on a production
system.
2. A generic DirectoryStorage is comming soon, with the diference being
splitting files by directory (and, of course, being slower than the
reiserfs version).
3. As you can see in the source, I/O errors in critical points can corrupt
the storage.
4. It currently does not support versioning and undo. I'm working first on
getting it stable and fast, and then add these features.

Feedback is not only welcome, but wanted :)

-Petru


##
# 
# Zope Public License (ZPL) Version 1.0
# -
# 
# Copyright (c) Digital Creations.  All rights reserved.
# Copyright (c) 2000 Petru Paler ([EMAIL PROTECTED]) All rights reserved.
# 
# This license has been certified as Open Source(tm).
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# 
# 1. Redistributions in source code must retain the above copyright
#notice, this list of conditions, and the following disclaimer.
# 
# 2. Redistributions in binary form must reproduce the above copyright
#notice, this list of conditions, and the following disclaimer in
#the documentation and/or other materials provided with the
#distribution.
# 
# 3. Digital Creations requests that attribution be given to Zope
#in any manner possible. Zope includes a "Powered by Zope"
#button that is installed by default. While it is not a license
#violation to remove this button, it is requested that the
#attribution remain. A significant investment has been put
#into Zope, and this effort will continue if the Zope community
#continues to grow. This is one way to assure that growth.
# 
# 4. All advertising materials and documentation mentioning
#features derived from or use of this software must display
#the following acknowledgement:
# 
#  "This product includes software developed by Digital Creations
#  for use in the Z Object Publishing Environment
#  (http://www.zope.org/)."
# 
#In the event that the product being advertised includes an
#intact Zope distribution (with copyright and license included)
#then this clause is waived.
# 
# 5. Names associated with Zope or Digital Creations must not be used to
#endorse or promote products derived from this software without
#prior written permission from Digital Creations.
# 
# 6. Modified redistributions of any form whatsoever must retain
#the following acknowledgment:
# 
#  "This product includes software developed by Digital Creations
#  for use in the Z Object Publishing Environment
#  (http://www.zope.org/)."
# 
#Intact (re-)distributions of any official Zope release do not
#require an external acknowledgement.
# 
# 7. Modifications are encouraged but must be packaged separately as
#patches to official Zope releases.  Distributions that do not
#clearly separate the patches from the original work must be clearly
#labeled as unofficial distributions.  Modifications which do not
#carry the name Zope may be packaged in any form, as long as they
#conform to all of the clauses above.
# 
# 
# Disclaimer
# 
#   THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS ``AS IS'' AND ANY
#   EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
#   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
#   PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL DIGITAL CREATIONS OR ITS
#   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
#   USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
#   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
#   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
#   OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
#   SUCH DAMAGE.
# 
# 
# This software consists of contributions made by Digital Creations and
# many individuals on behalf of Digital Creations.  Specific
# attributions are listed in the accompanying credits file.
# 
##


# To-do list:
# Critical:
#- Most I/O operations are not atomic. This means that I/O errors (and, for
#  

[Zope-dev] BerkeleyStorage.py is broken?

2000-06-06 Thread nw_moriarty

There are many admonitions to use BerkeleyStorage.py if you don't require versions in 
a database.  However, I have tried without success to get it to work with TCS.bsddb.db 
and BerkeleyDB 2.7.7 in a stand alone application.

How ANYBODY got it to work?  

Nigel


--== Sent via Deja.com http://www.deja.com/ ==--
Before you buy.

___
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] [Ann] Zope 2.1.6 ZCatalog patches: "and not", "near"

2000-06-06 Thread Dieter Maurer

Zope 2.1.6's ZCatalog contains a small bug in its handling
of "and not" searches.

  URL:http://www.handshake.de/~dieter/pyprojects/zope/andnot.pat

fixes this bug.


"near" searches do not work.
As Michel pointed out, the relevant indexes have been removed
for space considerations.
The patch at

  URL:http://www.handshake.de/~dieter/pyprojects/zope/near.pat

enables "near" searches. Instead of saving a word position index,
word positions are determined dynamically during near searches
(by reading the relevant document part).
Of cause, this is much slower than an index based search.
Moreover, it works only for persistent objects.
It does not work e.g. for LocalFS objects (for them "near" is
equivalent to "and").
For these reasons, you may not want to apply this patch.

The score function for near searches is currently very ad hoc
and should probably replaces by a more sensible function.


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 )




[Zope-dev] Re: [Zope] highly available Zope thread; our hanging problem

2000-06-06 Thread Brian Takashi Hooper


On Tue, 6 Jun 2000 15:19:29 +0200 
Marcus Collins <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I'd like to comment on this, and summarise some references below. Much of
> this discussion took place on the zope-dev list (see references), so I'm
> cc'ing the zope-dev list. You might also wish to add to the Wiki:
> http://www.zope.org/Members/tseaver/Projects/HighlyAvailableZope/.
OK, that's a good suggestion!

> 
> > -Original Message-
> > From: Brian Takashi Hooper [mailto:[EMAIL PROTECTED]]
> > Sent: 06 June 2000 12:11
> > To: [EMAIL PROTECTED]
> > Subject: [Zope] highly available Zope thread; our hanging problem
> > 
> > Hi all -
> > 
> > I was looking at the discussion from April that was posted on the
> > HighlyAvailableZope Wiki about problems with Zope hanging; we had a
> > similar situation here at Digital Garage which seemed to be alleviated
> > by changing the zombie_timeout to be really short (like, 1 minute). 
> > Before changing the zombie_timeout, the server would periodically hang
> > and not give any responses to requests, sometimes recovering after a
> > short time.
> 
> Some questions at this point:
> 1. Were you running with multiple threads, and if so, how many?
Yes; Zope is set to run with 16 threads (-t 16), and we've increased the
pool_size parameter in ZODB/DB.py to 16 also (guess this is all
right... :-P )

> 
> 2. If you were using multiple threads, would *all* the threads periodically
> hang, or was the hanging isolated to a single thread at a time?
All the threads hang.  One interesting thing is, we looked at vmstat and
whenever the system is having trouble, the number of system calls drops
dramatically, when the server is doing well it's normally up in the
1000s, but when it's in trouble there are like 20-30 system calls per
second, and they're all either lwp_* or poll s.

> 
> 3. Could you possibly comment on the operating system used?
Solaris, 2.6, on netras.  Our Zope is still v. 2.1.4.

> 
> 4. Which zombie_timeout did you twiddle -- the one in the zhttp_channel in
> ZServer.py, or that in http_channel in medusa/http_server.py?
The one in zhttp_channel.  As far as I can tell, since zhttp_channels
are actually used instead of http_channels, the number in zhttp_channel
is the one that matters.  The kill_zombies method, and the code that
calls it, is inherited from the medusa code... kill_zombies looks at the
timeout value of all the channels in the select list, and since all of
those instances happen to be zhttp_channels in the case of Zope, they
all use the zhttp_channel timeout.

> 
> > At this point, I don't have anything more than just an empirical
> > observation - changing this parameter seemed to help our server.  Has
> > anyone else noticed anything similar, or can explain this observation?
> 
> Concerning the zombie_timeout suggestion, here are some references when I
> posed the question of whether reducing the value would be beneficial:
> 
> Amos Lattier wrote in
> http://lists.zope.org/pipermail/zope-dev/2000-April/004194.html:
> > The ZServer zombie stuff is to get rid of zombie client 
> > connections, not zombie publishing threads. These are quite 
> > different beasts.
> 
> Michel Pelletier wrote in 
> http://lists.zope.org/pipermail/zope-dev/2000-April/004229.html:
> > What the Zombie timeout means is that after a publishing thread gets
> > done answering a request, the socket may not go away.  This many for a a
> > number of reasons, the client 'hung' and is not 'putting down the phone
> > after the converstation is over' (so to speak) or network troubles may
> > prevent the connection from closing properly.  This means that there is
> > a 'zombie' connection laying around.  This zombie will probably end up
> > going away on its own, but if not, ZServer will kill it after a period
> > of time.
> > 
> > The only reasorce laying around during the life of a Zombie is an tiny
> > little unused open socket, the Mack truck of a Zope thread that served
> > the request for the zombie socket does not 'hang' for that entire period
> > of time, but goes on after it has completed the request to serve other
> > requests.
> > 
> > Amos is correct in that these problems are almost always at the
> > Application level, and not at the ZServer level.  The fact that Pavlos
> > can prevent hanging by inserting a print statement in the asyncore loop[*]
> > is suspicious, but we do not have enough information yet to point
> > fingers anywhere.
> 
> [* references http://lists.zope.org/pipermail/zope/2000-April/023697.html]
Yeah, I saw this... like I said, I haven't gathered enough information
yet to be able to say anything that sounds like an explanation; all I
have is a vague experimental observation.

I found out about the mpstat command on Solaris, didn't know about it
before, it gives you info on thread activity and multiprocessor
behavior, so maybe I can get some more info from that.

Hmm.

--Brian Hooper

___
Zope-Dev maillist  -  

[Zope-dev] RE: [Zope] highly available Zope thread; our hanging problem

2000-06-06 Thread Marcus Collins

Hi,

I'd like to comment on this, and summarise some references below. Much of
this discussion took place on the zope-dev list (see references), so I'm
cc'ing the zope-dev list. You might also wish to add to the Wiki:
http://www.zope.org/Members/tseaver/Projects/HighlyAvailableZope/.

> -Original Message-
> From: Brian Takashi Hooper [mailto:[EMAIL PROTECTED]]
> Sent: 06 June 2000 12:11
> To: [EMAIL PROTECTED]
> Subject: [Zope] highly available Zope thread; our hanging problem
> 
> Hi all -
> 
> I was looking at the discussion from April that was posted on the
> HighlyAvailableZope Wiki about problems with Zope hanging; we had a
> similar situation here at Digital Garage which seemed to be alleviated
> by changing the zombie_timeout to be really short (like, 1 minute). 
> Before changing the zombie_timeout, the server would periodically hang
> and not give any responses to requests, sometimes recovering after a
> short time.

Some questions at this point:
1. Were you running with multiple threads, and if so, how many?

2. If you were using multiple threads, would *all* the threads periodically
hang, or was the hanging isolated to a single thread at a time?

3. Could you possibly comment on the operating system used?

4. Which zombie_timeout did you twiddle -- the one in the zhttp_channel in
ZServer.py, or that in http_channel in medusa/http_server.py?

> At this point, I don't have anything more than just an empirical
> observation - changing this parameter seemed to help our server.  Has
> anyone else noticed anything similar, or can explain this observation?

Concerning the zombie_timeout suggestion, here are some references when I
posed the question of whether reducing the value would be beneficial:

Amos Lattier wrote in
http://lists.zope.org/pipermail/zope-dev/2000-April/004194.html:
> The ZServer zombie stuff is to get rid of zombie client 
> connections, not zombie publishing threads. These are quite 
> different beasts.

Michel Pelletier wrote in 
http://lists.zope.org/pipermail/zope-dev/2000-April/004229.html:
> What the Zombie timeout means is that after a publishing thread gets
> done answering a request, the socket may not go away.  This many for a a
> number of reasons, the client 'hung' and is not 'putting down the phone
> after the converstation is over' (so to speak) or network troubles may
> prevent the connection from closing properly.  This means that there is
> a 'zombie' connection laying around.  This zombie will probably end up
> going away on its own, but if not, ZServer will kill it after a period
> of time.
> 
> The only reasorce laying around during the life of a Zombie is an tiny
> little unused open socket, the Mack truck of a Zope thread that served
> the request for the zombie socket does not 'hang' for that entire period
> of time, but goes on after it has completed the request to serve other
> requests.
> 
> Amos is correct in that these problems are almost always at the
> Application level, and not at the ZServer level.  The fact that Pavlos
> can prevent hanging by inserting a print statement in the asyncore loop[*]
> is suspicious, but we do not have enough information yet to point
> fingers anywhere.

[* references http://lists.zope.org/pipermail/zope/2000-April/023697.html]

I'd be _very_ interested in hearing more on this! Our Zope installation has
been pretty stable of late (isn't it strange that, when you want to find out
what's causing things to break, they play nice?), with uptime of
thirty-something days, but I'm still very keen to get to the bottom of this,
since I don't believe it was some ephemeral problem.

hth, and thanks again!

-- Marcus

___
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-0.4 ?

2000-06-06 Thread Jephte CLAIN

Hello,

I have used ZPatterns-0.3.0 to complete a project that I shipped
yesterday.
Although I had to write a CatalogAwareRack/Specialist to allow me to
search for rackmountables, I can say that ZPatterns has saved my life! I
would like to thanks Philip for this great contribution. (too bad I no
longer remember the url of that site where you can send so-called
"virtual beers" to fellows on the internet :-))

Now, for a project I have to ship by the end of june, I would like to
use zpatterns-0.4.0. I especially want to use the new search interface.
Does Philip know when ZPatterns-0.4.0 is out? If it is until the middle
of june, I can certainly wait. In the other case, I wonder if the search
plugin (in the case it has already be written) can be used with
zpatterns-0.3. In that case, I can do the work of adapting the code to
zpatterns-0.3
Also, for that project, I will have to write a sql attribute provider.
If one can give me advices on how Ty wants to implement SQL Attribute
Provides after he's done with LDAP Attribute Provider, perhaps I can
start the work (since I have a use for it) and let Ty continue the work
when he has more time / have finished LDAP Attribute Provider. I already
have some ideas on how to do it, but I lack to view how far the concept
have to be pushed. Without any help, I will end up writing a SQL
Attribute Provider that work only for me...

regards,
jephte clain
[EMAIL PROTECTED]

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