[Zope-dev] How do I create entries in another folder

2001-06-05 Thread r . laarhoven

I am new with zope and i am trying to foundout something i found in the
zope book on www.zope.org.

From the zope book i found this piece of code to create an entry in a guest
book

   
  Create a guest book entry.
  
  # create a unique document id
  id='entry_%d' % len(context.objectIds())

  # create the document
  context.manage_addProduct['OFSP'].manage_addDTMLDocument(id,
   title=, file=comments)

  # add a guest_name string property
  doc=getattr(context, id)
  doc.manage_addProperty('guest_name', guest_name, 'string')

My questions are: what does OFSP means and how do I create the entry in
another folder eg. GuestBookEntries?
Please help me.




___
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] memory eating Zope..

2001-06-05 Thread Toby Dickenson

   Note that this is likely caused by some sort of brainbending circular
   reference problem that might be helped by Python 2.X's cyclic garbage
   collector.
 
  Well, will also try out python 2.x then... (btw. are all 2.x python versions
  working without problems with Zope? Don't want to get a new problem when
  resolving the old one ;-)
 
 Sort of in a bad state at the moment.  2.4 requires Python 2.1, but it's
 in alpha.  2.3.2 isn't guaranteed to work with Python 2.X.  So you're
 sort of screwed if you want support.  OTOH, 2.3.2 is reported to work
 fine with Python 2.X, although if you post Python release-related
 weirdnesses here with 2.3.2, they'll likely be ignored in favor of
 directing you to 2.4 when it's out.

We're currently using python 2.1 to run zope 2.3.2 with no ill effects. We
have written our own product that uses some OFS stuff, Catalog and ZPT. Not
much else...

The most serious problem with Zope 2.3.x on Python 2.0 that I have
discovered so far is that Zope's xml-formatted export doesnt handle
unicode objects. If you find anything that doesnt work, it will have
to be fixed for Zope 2.4, and it shouldnt be too hard to back-port
that fix into 2.3.x.

Having said that, Python's garbage collector *needs* support from
container objects. Acquisition wrappers dont implement this support
(yet), and therefore I suspect a Python upgrade will not help you with
this memory leak problem.

Toby Dickenson
[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 )



Re: [Zope-dev] Zope Server hanging :-(

2001-06-05 Thread Erik Enge

On Sun, 29 Apr 2001, Erik Enge wrote:

 I'll try to do an hour or so of analysing this tomorrow, and I'll get back
 to you.  :-)

Well, now we all know what vikings believe an hour or so mean, don't we?

I figured it out, I think.  Let's say I have these two methods:

 def a():
b()

 def b():
a()

If I call a(), then Zope dies and restarts without giving me any error
at all.  Anyone got a clue?  Makes debugging a bit tedious sometimes.
I added a couple of print's in the methods and it seem to call them both
many times before dying.

I seem to remeber some ExessiveRecursion or some such error that popped up
on me a year or two ago, has that left for happier hunting fields?


___
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] aq_explicit bug?

2001-06-05 Thread Chris Withers

This code from a python script gets called when iterating over either a list
of objects or catalog brains:

  obj = _.getitem('sequence-item', 0).aq_explicit
  url = getattr(obj,'getURL',obj.absolute_url)()

  folderish = obj.isPrincipiaFolderish

I would always expect to get an attribute error on the last line, since
brains don't have that method, but I don't, folderish is always true since
it appears to acquire the catalog's 'isPrincipiaFolderish'...

What's going on here?

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] Request for a Pluggin Index (NameIndex)

2001-06-05 Thread Chris Withers

 Looks like you should write your own index type. Zope 2.4
 comes with an PlugableIndex interface to allow third-party
 indexes to be integrated into the Catalog.

Yeah, I know all that, and I'm very much looking forward to playing with
this. :-)
However, the email was an invitation for anyone who's interested and
currently has time on their hands (yeah, I know, there's lots of us like
that ;-) to have a go at writing the index type for me...

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] Request for a Pluggin Index (NameIndex)

2001-06-05 Thread Matt Hamilton

On Tue, 5 Jun 2001, Chris Withers wrote:

  Looks like you should write your own index type. Zope 2.4
  comes with an PlugableIndex interface to allow third-party
  indexes to be integrated into the Catalog.
 
 Yeah, I know all that, and I'm very much looking forward to playing with
 this. :-)
 However, the email was an invitation for anyone who's interested and
 currently has time on their hands (yeah, I know, there's lots of us like
 that ;-) to have a go at writing the index type for me...

I would like to help if I had time :)  I think the most efficient way of
doing what you want is to construct an index based on a 'Suffix Trie' this
essentially allows matching of arbitrary substrings very quickly, the only
problem is that it takes up a fair amount of space.  The upside is that it
can be updated and incrementally added to quite easily (unlike many
inverted list implementations).

I confess I have not had the chance to look at the pluggable index types
in 2.4, but would really like to as I would like to port over some
indexing code I was working on for another project that allows compressed
storage of inverted lists for indexes.  On average you can store a 32-bit
document id/ref in around 4 bits, which means you save a lot of space and
can keep stopwords in the lexicon (as an example try searching for 'to be
or not to be' in an index that removes stopwords :).  Not only do you save
space, but due to the way the inverted list is read and decompressed you
save time on disk access for large indexes as there is less to physically
read.

-Matt

-- 
Matt Hamilton [EMAIL PROTECTED]
Netsight Internet Solutions, Ltd.  Business Vision on the Internet
http://www.netsight.co.uk   +44 (0)117 9090901
Web Hosting | Web Design  | Domain Names  |  Co-location  | DB Integration



___
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] Request for a Pluggin Index (NameIndex)

2001-06-05 Thread Andreas Jung


- Original Message - 
From: Chris Withers [EMAIL PROTECTED]
To: Andreas Jung [EMAIL PROTECTED]
Cc: zope-dev [EMAIL PROTECTED]
Sent: Tuesday, June 05, 2001 11:30 AM
Subject: Re: [Zope-dev] Request for a Pluggin Index (NameIndex)


  Looks like you should write your own index type. Zope 2.4
  comes with an PlugableIndex interface to allow third-party
  indexes to be integrated into the Catalog.
 
 Yeah, I know all that, and I'm very much looking forward to playing with
 this. :-)
 However, the email was an invitation for anyone who's interested and
 currently has time on their hands (yeah, I know, there's lots of us like
 that ;-) to have a go at writing the index type for me...
  

 I think it should not be a large problem to write such an index because 
it looks like you can subclass the TextIndex class and replace/extend
the needed functionality.

Andreas


___
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] SOAP again (or, xml-rpc client for MSIE)

2001-06-05 Thread Adrian Hungate
Title: RE: [Zope-dev] SOAP again (or, xml-rpc client for MSIE)





What are you actually trying to achive?


Adrian...



Phil Harris wrote:
 
 Brad,
 
 There are a few COM/COM+ components around that do xml-rpc.
 
 I use them with MS Word to write Word files directly to Zope for instance.
 
 Some are better than others, but ymmv so I'll hesitate to recommend one.
 
 At least one of them is listed on xmlrpc.com.
 
 Having them you could script them via jscript, and basically open up the
 connection easily.





RE: [Zope-dev] dtml-in batching improved

2001-06-05 Thread Adrian Hungate
Title: RE: [Zope-dev] dtml-in batching improved





Back before the zope.org product directory became so easy to navigate I wrote an index
that I used to use which has batch links top and bottom:


http://www.zope.org/Members/haqa/productlist/view_source


Dunno if this helps...


Adrian...


-Original Message-
From: Chris Withers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 30 May 2001 22:03
To: Ivo van der Wijk; [EMAIL PROTECTED]; [EMAIL PROTECTED]; Simon Coles
Subject: Re: [Zope-dev] dtml-in batching improved



 When using batching in dtml-in, why is 'previous-sequence' only defined at
 the first iteration of the current batch? And why is 'next-sequence' only
 defined at the last iteration of the current batch?


I know this problem ;-)


I had it too, and stuck something in the collector about it. I did manage to
get the layout you're after without modifying Zope though (see the search
page on www.nipltd.com)


If you want the code, maybe someone at NIP could fish it out, if you can
wait until next Thursday, I'll grab it myself :-)


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 )





[Zope-dev] DCOracle2 Beta 1 Announcement

2001-06-05 Thread Matthew T. Kromer

Description
DCOracle2 is a replacement for DCOracle, written primarily in C. DCOracle 1
uses OCI 7 bindings for most Oracle calls, with OCI 8 mixed in for LOB
support. Oracle 8i disallows mixing of calls within a statement, and so
breaks LOB support. DCO2 uses entirely OCI 8 calls, and thus can use LOBs.

New in this Release
Beta 1
Stored procedure input works properly, cycles in stored procedures removed.
Stored procedures now have meaningful docstrings (describing their
parameters). Type coercion change from a tuple kludge to a TypeCoercion
object. Set ability (and default) to do static binding for BindingArrays,
working around dynamic fetch occasional NULL bug on Linux. Batch
executemany(). Add backward compatable dbiRaw and execute modes.

Alpha 6
Nested Cursors, e.g. SELECT ENAME, CURSOR(SELECT ENAME FROM EMP WHERE
MGR=7908) FROM EMP WHERE EMPNO=7908). API 2.0 type objects. Add trim() to
LobLocators. Wrap LOB permissions for Zope in ZOracleDA. Change result on
execute w/o results to None, not []. Return statement type code after
execute().

Alpha 5
Stored procedure fixes, and debugging enhancements.

Alpha 4
Stored procedure IN/OUT variables, changes to executemany()

Alpha 3
Changed ZOracleDA to not use method call to connect(). Partial stored
procedure work

Alpha 2
Bug fixes, largely packaging, from Alpha 1. Added SQLT_AFC handler, SPARC
alignment fixes.

Alpha 1
First www.zope.org release

Contents
This release contains both DCOracle2 and a slightly modified ZOracleDA; it
will register as ZOracleDA would (to silently upgrade Oracle connections)
and thus cannot be run concurrently with ZOracleDA/DCOracle.

Installation
To replace ZOracleDA, untar into lib/python/Products and make, move
ZOracleDA out of lib/python/Products, and rename lib/python/Products/DCO2 to
lib/python/Products/ZOracleDA.

Usage
This release is intended for testing with ZOracleDA feature compatibility
(including LOB support) and is also intended for general use.

Platforms
NT support has been tested, Microsoft Visual Studio project files are
included; this has only received testing with Oracle 8.0 and Oracle 8.1 on
Linux, Solaris, and Windows NT; a wider variety of platform experience is
welcomed.

Download
The product is available at http://www.zope.org/Members/matt/dco2.




___
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] context bindings in python products

2001-06-05 Thread Bernd Dorn

hi

isn't there some mixin class to provide bindings to python products like in
python scripts?
so that i have some objects like: context, container ...

i searched through the zope site, but there is nothing which can do such
stuff

am i the only one who needs this, or is it a sign for wrong coding practice
in zope?

the only thing i found was this:
http://www.zope.org/Members/htrd/howto/FunctionTemplate
but it seems very complicated in argument passing

wouldn't it be nice to have something like this

if there is nothing out there, has anybody some sugestions how to implement
it
so i would write it by myself

maybe with the REQUEST Class or so?

thanks in advance, bernd

___
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] context bindings in python products

2001-06-05 Thread Chris McDonough

context = self
container = self.aq_inner.aq_parent

Bernd Dorn wrote:
 
 hi
 
 isn't there some mixin class to provide bindings to python products like in
 python scripts?
 so that i have some objects like: context, container ...
 
 i searched through the zope site, but there is nothing which can do such
 stuff
 
 am i the only one who needs this, or is it a sign for wrong coding practice
 in zope?
 
 the only thing i found was this:
 http://www.zope.org/Members/htrd/howto/FunctionTemplate
 but it seems very complicated in argument passing
 
 wouldn't it be nice to have something like this
 
 if there is nothing out there, has anybody some sugestions how to implement
 it
 so i would write it by myself
 
 maybe with the REQUEST Class or so?
 
 thanks in advance, bernd
 
 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )

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



Re: [Zope-dev] context bindings in python products

2001-06-05 Thread Bernd Dorn

thx, but i tried this already

self always returns the instance of the class in which the method is
defined, instead of the container/object from which it is called

example:
two classes,
class x with method example(): return self
class y with no method and is a subobject of x

http://www.foo.bar/xInstance/yInstance/method
returns xInstance instead of yInstance
???

- Original Message -
From: Chris McDonough [EMAIL PROTECTED]
To: Bernd Dorn [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, June 05, 2001 9:56 PM
Subject: Re: [Zope-dev] context bindings in python products


 context = self
 container = self.aq_inner.aq_parent

 Bernd Dorn wrote:
 
  hi
 
  isn't there some mixin class to provide bindings to python products like
in
  python scripts?
  so that i have some objects like: context, container ...
 
  i searched through the zope site, but there is nothing which can do such
  stuff
 
  am i the only one who needs this, or is it a sign for wrong coding
practice
  in zope?
 
  the only thing i found was this:
  http://www.zope.org/Members/htrd/howto/FunctionTemplate
  but it seems very complicated in argument passing
 
  wouldn't it be nice to have something like this
 
  if there is nothing out there, has anybody some sugestions how to
implement
  it
  so i would write it by myself
 
  maybe with the REQUEST Class or so?
 
  thanks in advance, bernd
 
  ___
  Zope-Dev maillist  -  [EMAIL PROTECTED]
  http://lists.zope.org/mailman/listinfo/zope-dev
  **  No cross posts or HTML encoding!  **
  (Related lists -
   http://lists.zope.org/mailman/listinfo/zope-announce
   http://lists.zope.org/mailman/listinfo/zope )


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



Re: [Zope-dev] context bindings in python products

2001-06-05 Thread Chris McDonough

Oops, sorry... roughly,

context = self.aq_parent
container = self.aq_inner.aq_parent

Bernd Dorn wrote:
 
 thx, but i tried this already
 
 self always returns the instance of the class in which the method is
 defined, instead of the container/object from which it is called
 
 example:
 two classes,
 class x with method example(): return self
 class y with no method and is a subobject of x
 
 http://www.foo.bar/xInstance/yInstance/method
 returns xInstance instead of yInstance
 ???
 
 - Original Message -
 From: Chris McDonough [EMAIL PROTECTED]
 To: Bernd Dorn [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Tuesday, June 05, 2001 9:56 PM
 Subject: Re: [Zope-dev] context bindings in python products
 
  context = self
  container = self.aq_inner.aq_parent
 
  Bernd Dorn wrote:
  
   hi
  
   isn't there some mixin class to provide bindings to python products like
 in
   python scripts?
   so that i have some objects like: context, container ...
  
   i searched through the zope site, but there is nothing which can do such
   stuff
  
   am i the only one who needs this, or is it a sign for wrong coding
 practice
   in zope?
  
   the only thing i found was this:
   http://www.zope.org/Members/htrd/howto/FunctionTemplate
   but it seems very complicated in argument passing
  
   wouldn't it be nice to have something like this
  
   if there is nothing out there, has anybody some sugestions how to
 implement
   it
   so i would write it by myself
  
   maybe with the REQUEST Class or so?
  
   thanks in advance, bernd
  
   ___
   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 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] context bindings in python products

2001-06-05 Thread Bernd Dorn

this doesnt work either

my test funtion:

def test_htm(self):
 just test 
context = self.aq_parent
return context.absolute_url()

returns always the absolute_url of the parent object of the class instance

is there something wrong with my product??

it inherits from ofs.folder

i think i have to write context aware stuff in HTMLFile objects ? :-(





- Original Message -
From: Chris McDonough [EMAIL PROTECTED]
To: Bernd Dorn [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, June 05, 2001 10:20 PM
Subject: Re: [Zope-dev] context bindings in python products


 Oops, sorry... roughly,

 context = self.aq_parent
 container = self.aq_inner.aq_parent

 Bernd Dorn wrote:
 
  thx, but i tried this already
 
  self always returns the instance of the class in which the method is
  defined, instead of the container/object from which it is called
 
  example:
  two classes,
  class x with method example(): return self
  class y with no method and is a subobject of x
 
  http://www.foo.bar/xInstance/yInstance/method
  returns xInstance instead of yInstance
  ???
 
  - Original Message -
  From: Chris McDonough [EMAIL PROTECTED]
  To: Bernd Dorn [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Sent: Tuesday, June 05, 2001 9:56 PM
  Subject: Re: [Zope-dev] context bindings in python products
 
   context = self
   container = self.aq_inner.aq_parent
  
   Bernd Dorn wrote:
   
hi
   
isn't there some mixin class to provide bindings to python products
like
  in
python scripts?
so that i have some objects like: context, container ...
   
i searched through the zope site, but there is nothing which can do
such
stuff
   
am i the only one who needs this, or is it a sign for wrong coding
  practice
in zope?
   
the only thing i found was this:
http://www.zope.org/Members/htrd/howto/FunctionTemplate
but it seems very complicated in argument passing
   
wouldn't it be nice to have something like this
   
if there is nothing out there, has anybody some sugestions how to
  implement
it
so i would write it by myself
   
maybe with the REQUEST Class or so?
   
thanks in advance, bernd
   
___
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 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] context bindings in python products

2001-06-05 Thread Chris McDonough

Bernd Dorn wrote:
 
 this doesnt work either
 
 my test funtion:
 
 def test_htm(self):
  just test 
 context = self.aq_parent
 return context.absolute_url()
 
 returns always the absolute_url of the parent object of the class instance

I think I understand what you mean.

Yes, you're right.  To make it work differently, you're right in saying
you need to create an HTMLFile instance (or another methodish thing).

- C

___
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] context bindings in python products

2001-06-05 Thread Bernd Dorn

either way - thx

maybe such a bindings implementation is worth a proposal sometime ...

- Original Message -
From: Chris McDonough [EMAIL PROTECTED]
To: Bernd Dorn [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, June 05, 2001 11:18 PM
Subject: Re: [Zope-dev] context bindings in python products


 Bernd Dorn wrote:
 
  this doesnt work either
 
  my test funtion:
 
  def test_htm(self):
   just test 
  context = self.aq_parent
  return context.absolute_url()
 
  returns always the absolute_url of the parent object of the class
instance

 I think I understand what you mean.

 Yes, you're right.  To make it work differently, you're right in saying
 you need to create an HTMLFile instance (or another methodish thing).

 - C

 ___
 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] manage_main modification time wrong

2001-06-05 Thread Andrew Sydelko


Our Zope installation has this really strange
problem associated with the displayed 
Modification Time shown for each file in
the /manage_main of a folder. The time that
is shown is exactly one-hour later than 
the system time. I think I've tracked down 
this to the bobobase_modification_time 
variable.

Both reference to dtml-var ZopeTime()
and dtml-var _.DateTime() show the
system time.

dtml-var _.DateTime().timezone() shows
US/Eastern. This is really not our correct
timezone, since we are in West Lafayette, 
Indiana, which has it's own timezone: 
US/East-Indiana, but where does Zope/python
get this from?

Any ideas why bobobase_modification_time
is off by one hour?

--andy.
Purdue Engineering Computer Network

___
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] SOAP again (or, xml-rpc client for MSIE)

2001-06-05 Thread Brad Clements

I have an IE 5.5 one-page web application that manages related database tables 
exposed as ADO recordsets from a Zope/Interbase/Linux server.

I would like to use either the webservices behavior in IE5 or find an XML-RPC client 
component for IE 5.5 so I can make RPC calls into Zope in a standard, controlled 
manner without hand-coding all my calls into HTTP object PUT methods.

I'd like to send structured types (or dicts), and get back a structured response, 
errors as 
exceptions (or not).. I want to avoid re-implementing this stuff.

SOAP, WSDL and UDDI are coming in a big way. I think Zope/Python can compete 
against MS .Net Services on the server side, but it does make sense to use .Net 
components on the client, such as the webService behavior for IE.



On 5 Jun 2001, at 9:41, Adrian Hungate wrote:

 What are you actually trying to achive?
 
 Adrian...
 
 
 Phil Harris wrote:
  
  Brad,
  
  There are a few COM/COM+ components around that do xml-rpc.
  
  I use them with MS Word to write Word files directly to Zope for instance.
  
  Some are better than others, but ymmv so I'll hesitate to recommend one.
  
  At least one of them is listed on xmlrpc.com.
  
  Having them you could script them via jscript, and basically open up the
  connection easily.
 


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements


___
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] Zope Server hanging :-(

2001-06-05 Thread richard

Erik Enge wrote:
 On Sun, 29 Apr 2001, Erik Enge wrote:
 I figured it out, I think.  Let's say I have these two methods:
 
  def a():
 b()
 
  def b():
 a()
 
 If I call a(), then Zope dies and restarts without giving me any error
 at all.  Anyone got a clue?

There are many places in Zope where errors such as this (RuntimeError - try
it in an interactive interpreter) are silently swallowed by too-broad
except: clauses (except in this case, the exception is eaten, but the
interpreter process exits anyway...).

When we find that our code is dying without notice, we usually try to
narrow down the area of code that could be to blame, and then wrap it in
our own try/except like:

  try:
do possibly bad stuff
  except:
import traceback
traceback.print_exc()
raise

... at least then we know what the exception is.


 I seem to remeber some ExessiveRecursion or some such error that popped up
 on me a year or two ago, has that left for happier hunting fields?

Again - try that code in an interactive interpreter if you really want to
find out what's going on...


Richard

-- 
Richard Jones
[EMAIL PROTECTED]
Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)

___
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] RDBM Connections per User

2001-06-05 Thread Jim Penny

On Tue, Jun 05, 2001 at 11:47:18PM +0200, Christian Theune wrote:
 Hello out there.
 
 I had following problem:
 
 In a software, using zope as appserver, we needed to have every user
 a single connection to the database (postgres 7.1) to have access-
 checks on database level.

I think that this is not a very good idea.  

Consider, you are moving from a realm where there is one object
(The database adapter) that needs to be tightly controlled to one
that has many objects that must be tightly controlled (the database
adapters, the database user ids, their passwords and ACL's).

What happens when a db is accessed by someone with insufficient
authority?  A Zope error is raised and (unless you have caught it),
a nasty looking traceback is triggered.

It is just as much work to catch the tracebacks as it is to prevent
them from occurring.  So, you are not saving any application 
development time.

Given the propensity of people to reuse passwords, and the general
ease of finding user level passwords, you probably have a situation
with many weak passwords rather than one strong one.

No, in general, I recommend that you prevent people who have
insufficient authority from accessing the database in the first
place, and that you log CRUD events so that you know who is
responsible for database damage.

[Yes, this is a classic tradeoff.  There is one position stated
as defense in depth.  Check the user at the Zope stage, check
him again at db access time, etc.  There is another that can be
summarized as put all your eggs in one basket - and watch that
basket carefully.  In general, I support defense in depth,
but my experience with users is that they simply do not help you
with security.  For the same reason, I will not give any users 
accounts on my firewall.]

Jim Penny


 
 I hacked into the Connection code and found, that the interfaces are
 really hard to be used for this feature.
 
 The thing is, that many people are accessing the database connection
 handle directly whether I am using now a wrapper function getConnection()
 to get the current connection or open one.
 
 I am reading the current user out of the REQUEST[AUTHENTICATED_USER] and
 am storing the handles in an _v_connections Dictionary, which is explicitly
 not stored in database, but lets every user have exactly one connection.
 
 Any comments on this?
 
 -- 
 Christian Theune - [EMAIL PROTECTED]
 gocept gmbh  co.kg - schalaunische strasse 6 - 06366 koethen/anhalt
 tel.+49 3496 3099112 - fax.+49 3496 3099118 mob. - 0178 48 33 981
 
 reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))
 
 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists - 
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )
 

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



Re: [Zope-dev] Zope Server hanging :-(

2001-06-05 Thread Dieter Maurer

  Erik Enge wrote:
   On Sun, 29 Apr 2001, Erik Enge wrote:
   I figured it out, I think.  Let's say I have these two methods:
   
def a():
   b()
   
def b():
   a()
   
   If I call a(), then Zope dies and restarts without giving me any error
   at all.  Anyone got a clue?
This is an infinite recursion.

I once had such a situation.

   Usually Python protects itself against such recursions by limiting
   the depth of its runtime stack. It raises a RuntimeError: runtime
   stack limit exceeded when its stack overflows.

   But in my case, the thread's runtime stack (maintained
   by the C runtime not Python) was more limited
   than the Python stack limit. When the thread's stack overflew,
   the process was killed by Solaris.
   Python did not have any chance to raise an exception
   as the death was immediate.


We may need to ask the Python maintainers to increase the
thread stack size or to more severely restrict the
Python runtime stack.


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] Zope Server hanging :-(

2001-06-05 Thread richard

Dieter Maurer wrote:
 
   Erik Enge wrote:
On Sun, 29 Apr 2001, Erik Enge wrote:
I figured it out, I think.  Let's say I have these two methods:
   
 def a():
b()
   
 def b():
a()
   
If I call a(), then Zope dies and restarts without giving me any error
at all.  Anyone got a clue?
 This is an infinite recursion.
 
 I once had such a situation.
 
Usually Python protects itself against such recursions by limiting
the depth of its runtime stack. It raises a RuntimeError: runtime
stack limit exceeded when its stack overflows.
 
But in my case, the thread's runtime stack (maintained
by the C runtime not Python) was more limited
than the Python stack limit. When the thread's stack overflew,
the process was killed by Solaris.
Python did not have any chance to raise an exception
as the death was immediate.
 
 We may need to ask the Python maintainers to increase the
 thread stack size or to more severely restrict the
 Python runtime stack.

This can be done manually in your site.py - sys.setrecursionlimit()


 Richard

-- 
Richard Jones
[EMAIL PROTECTED]
Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)

___
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] RDBM Connections per User

2001-06-05 Thread Stephan Richter


  In a software, using zope as appserver, we needed to have every user
  a single connection to the database (postgres 7.1) to have access-
  checks on database level.

You might want to check out DBObjects, since they are automatically 
implementing all the permission stuff on the Zope side! This way you also 
have the object safety covered as well, and you implement the security only 
once.

More on DBObjects at: http://demo.iuveno-net.de

Regards,
Stephan

--
Stephan Richter
CBU - Physics and Chemistry Student
Web2k - Web Design/Development  Technical Project Management


___
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] __init__.py of ZServer is diff format?

2001-06-05 Thread Sin Hang Kin

I update zope from cvs this morning. The ZServer/__init__.py contain

 __init__.py

is it in diff format?


Rgs,

Kent Sin
-
kentsin.weblogs.com
kentsin.imeme.net


___
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] Personalization (was RE: [Zope-CMF] List of subject/metadata sets?)

2001-06-05 Thread Bjorn Stabell

Ok, time to throw in my RMB 0.166 (US$ 0.02).


SITE VOCABULARY

In other CMS's, e.g., SiteServer, Spectra (Cold Fusion), and Vignette
the main use of the subject/keywords is for user profiling and
personalization; although they call it Vocbulary, Site Categories, and
Category:Keywords respectively.  I see the restriction of
subject-keywords in CMF as the beginning of standard personalization in
Zope... something we sorely lack.  Vignette's category:keywords are only
two-level, whereas the others are usually multi-level, i.e., a tree.
Have a look at http://www.siteserver101.com/book/chapter7/pm16.asp and
related pages for info on how SiteServer does it.

Basically, you're right in that each site's keywords will be different,
depending on its use (intranet, vertical of some sort, etc).  An example
of this is the DocumentLibrary product that has a legal hierarchical
index.  Over time we should collect example indexes to easy
personalization for websites.


USER PROFILING

Obviously, we know quite a lot about the visitor before they do anything
on the website; we know which languages they prefer (or we think we do
from Accept-Language), we know what time they accessed the website, if
they have accessed our website before (if we put a cookie on their
browser), we know where they accessed from (not for sure, of course)
etc.  This is good, but it doesn't really give us any indication of what
the interests of this visitor are, so we can't make our site a good shop
keeper recommending things.  We need to create a user profile.

One way to do user profiling is to tag the visitor with the keywords of
all the pages he or she views, probably also tracking how many times a
visitor has seen pages with this or that keyword.  This kind of data
gathered from the visitors behavior is called implicit data.  It is very
useful, especially since the visitor doesn't have to log in for it to be
effective (you can just use cookies to give the user a 'psudo user').
Later, when the visitor logs in, we can merge the profile of the pseudo
user with the real user.

Another way is to simply ask a logged in user to fill out a form
selecting which information he or she is interested in.  Data gathered
through forms in this way is called explicit data.

In any case, you end up with a list of keywords that the user is
interested in, maybe even weighted (if it is implicitly collected).


PERSONALIZATION RULES

Now we need a set of rules, hopefully editable by a normal content
manager, to control the personalization on miscellaneous pages.  The
fact that business rules were editiable by normal users, especially
useful for shops that want to run many different types of promotions,
was one of the major selling points of Broadvision.

The personalization rules are basically different queries on the user
profiles.  Let's say we have a sports site with a (stripped down) site
subject vocabulary like this:

/sports/
/sports/basketball/
/sports/basketball/redbulls
/sports/football/
/sports/football/manchesterunited
/sports/golf

Let's say a visitor has an implicitly gathered (through tracking
browsing) user profile like this:

KEYWORD HITS
/sports/11
/sports/basketball/ 4
/sports/basketball/redbulls 4
/sports/football6
/sports/football/manchesterunited   6
/sports/golf1

We can have rule like this:

Show [the sport the visitor likes the most]
= which of /sports/* have the most hits = football
(I'm from Europe)

Based on this we can have an area on our site template dedicated to
promoting products that fit the user profile, in this case it would
probably show footballs and football collectibles etc.  We could even go
as far as show collectibles for the team we know he or she is interested
in.


IMPLEMENTATION IDEAS

I'd like to see a new CMF tool, portal_pzn, that would store the
personalization keyword hierarchy and the business rules.  I think that
in the beginning, we can just let personalization rules be small python
expressions returning some results.  We could also group rules into rule
sets, a la SiteServer, to make them more manageable.

Let's say the tool was like this:

portal_pzn/
vocabulary/
/sports/
basketball/
redbulls
football/
manchesterunited
golf/
rules/
set1/
favorite_3_sports = return
user.behavior.top('/sports/*', 3)
discount = if user.type == 'VIP': return 20
etc.

And in our code we would write:

dtml-in portal_pzn.set1.favorite_3_sports(user)
dtml-var promotions[_['sequence-index']
/dtml-in

Each user object 

[Zope-dev] 60GB Data.fs?

2001-06-05 Thread Bjorn Stabell

Hi there,

We're planning a Yahoo! Clubs like system that should scale to about 30,
000 users.  Assuming about 3,000 groups and 20MB per group (group
functionality includes photo albums), gives a database size of 60GB.
Assuming on average 3,000 users per day, 20 page views per users, gives
about 60,000 page views (not a lot, but if it's all dynamically
generated?).

We'd like to use Zope for this, if it is possible.  Other options are ok
too; anyone have any experience with other ready-made systems?

At this scale, how would ZODB hold up with respect to memory use and
speed?  I've heard rumors that it loads an index into memory on
start-up.

How would using Oracle as a Storage (ZODB semantics) help?

Going full-scale RDBMS means we'd have to reimplement a lot of existing
useful tools, so we'd rather not do that if using Zope.

I know we'll have to play with cacheing as well, and as I see there are
these options:

- SQL method cacheing

- Using StandardCacheManagers to cache Python and DTML methods

- Using StandardCacheManagers to cache pages (using, e.g., Squid as an
HTTP accelerator)

- ZEO client object cacheing

Any other ideas?


Bye,
-- 
Bjorn Stabell [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 )



[Zope-dev] A simple dtml-if question...

2001-06-05 Thread Jeff Nielsen / UgoFast

How do I construct a dtml-if statement with two conditions joined by and
logic? I want to do something like this:

dtml-if expr=LoginResults=='Pass' .and. expr=PATH_INFO=='/'

Jeff Nielsen / UgoFast
http://www.UgoFast.com
[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 )



Re: [Zope-dev] SOAP again (or, xml-rpc client for MSIE)

2001-06-05 Thread Hannu Krosing

Brad Clements wrote:
 
 SOAP, WSDL and UDDI are coming in a big way. I think Zope/Python can compete
 against MS .Net Services on the server side, but it does make sense to use .Net
 components on the client, such as the webService behavior for IE.

Does it really exist (the webService behavior for IE) or is it jet
another vapor
coming in a big way ?

If it does exist, where can I read amout it ?

-
Hannu

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