Re: [Zope-dev] Fw: 2gb file size

2000-11-07 Thread Itamar Shtull-Trauring

Shane Hathaway wrote:

 Not long ago I created a wrapper around File objects which automatically
 splits the file before it reached a predefined limit.  It could handle
 any number of partitioned file segements.

Yes please! Perhaps it could be integrated into the ZODB codebase while
you're at 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 )




RE: [Zope-dev] Fw: 2gb file size

2000-11-07 Thread Andy Dawkins

Shane

This would be very helpfull to share.

One of the reasons I tried the Berkeley Database was because I kept blowing
this 2Gb limit.

Prehaps if this was released I could finally finish the zope mail archives.
:-)

Cheers

-Andy

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
 Behalf Of Shane Hathaway
 Sent: 06 November 2000 21:51
 To: Andy McKay; [EMAIL PROTECTED]
 Subject: Re: [Zope-dev] Fw: 2gb file size


 Andy McKay wrote:
 
  I did do a How-to as well http://www.zope.org/Members/andym/2gig

 Not long ago I created a wrapper around File objects which automatically
 splits the file before it reached a predefined limit.  It could handle
 any number of partitioned file segements.  I tried it with FileStorage
 and even integrated it in.  That's how we were able to find and fix some
 arithmetic errors that occurred in FileStorage when reaching the 2GB
 barrier.  If there's interest in the community I can release the code
 (in fact, there is no dependency on Zope and it's pretty fast.)

 OTOH, I can verify there are production sites that have succesfully
 reached around 10 GB in Data.fs size.

 Shane

  --
Andy McKay, Developer.
ActiveState.
  - Original Message -
  From: "Andy McKay" [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, November 06, 2000 9:26 AM
  Subject: Re: [Zope-dev] Fw: 2gb file size
 
   Thank you everyone for your help. I truncated the file and
 restarted Zope
   successfully. I had a brief period of problems when I forgot
 use binary
  mode
   for truncating the file - duh. Anyway, I am running 2.2.1 and
 it doesnt
  work
   with a 2gb file. I didnt analyse where the problem lies, however I do
   believe its a python issue.
  
   Thanks.
   --
 Andy McKay, Developer.
 ActiveState.
   - Original Message -
   From: "Itamar Shtull-Trauring" [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Sunday, November 05, 2000 2:37 AM
   Subject: Re: [Zope-dev] Fw: 2gb file size
  
  
Shane Hathaway wrote:
   
 Are you running Zope 2.2.1 or later?  There were pointer
 arithmetic
 errors that occurred on earlier versions, even with
 operating systems
 that support 2 GB files.
   
So on W2K, Zope can have 2GB databases? I'd really like to
 hear if you
   get
it to work Andy (or if anyone else did.)
   
--
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C
   
___
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 )

 ___
 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] Segmentation fault when adding new objects

2000-11-07 Thread Morten W. Petersen

I'm having trouble with the adding of new objects;  specifically
it's adding of rfc822_address objects (contained within the
ZopeGUM distribution, http://www.zope.org/Members/morphex/ZopeGUM).

I haven't really got a clue what's wrong, have any of you?

-- Start debugging session

 /usr/local/Zope/lib/python/SearchIndex/UnTextIndex.py(244)index_object()
- old = d.has_key
pdb
 /usr/local/Zope/lib/python/SearchIndex/UnTextIndex.py(245)index_object()
- last = None
pdb
 /usr/local/Zope/lib/python/SearchIndex/UnTextIndex.py(253)index_object()
- src = self.getLexicon(self._lexicon).Splitter(k)
pdb
 /usr/local/Zope/lib/python/SearchIndex/UnTextIndex.py(186)getLexicon()
- def getLexicon(self, vocab_id):
pdb
 /usr/local/Zope/lib/python/SearchIndex/UnTextIndex.py(192)getLexicon()
- """
pdb
 /usr/local/Zope/lib/python/SearchIndex/UnTextIndex.py(193)getLexicon()
- if type(vocab_id) is not type(""):
pdb
 /usr/local/Zope/lib/python/SearchIndex/UnTextIndex.py(196)getLexicon()
- vocab = getattr(self, vocab_id)
pdb
 /usr/local/Zope/lib/python/SearchIndex/UnTextIndex.py(197)getLexicon()
- return vocab.lexicon
pdb
--Return--
 /usr/local/Zope/lib/python/SearchIndex/UnTextIndex.py(197)getLexicon()-Globbin... 
89f3e28
- return vocab.lexicon
pdb
 /usr/local/Zope/lib/python/SearchIndex/GlobbingLexicon.py(242)Splitter()
- def Splitter(self, astring, words=None):
pdb
 /usr/local/Zope/lib/python/SearchIndex/GlobbingLexicon.py(243)Splitter()
- """ wrap the splitter """
pdb
 /usr/local/Zope/lib/python/SearchIndex/GlobbingLexicon.py(248)Splitter()
- return Splitter(astring)
pdb
--Return--
Segmentation fault
morten@slakka:/usr/local/Zope/lib/python 

-- End debugging session

-Morten






___
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] Adding properties in __init__

2000-11-07 Thread Chris Withers

Hi,

I have a product class that subclasses SimpleItem and PropertyManager.

If I try and add a property in __init__ as so:

self.manage_addProperty('AProperty','1\n2\n3','lines')

I get the following wonderful error:

Error Type: AttributeError
Error Value: aq_base

I'm guessing that this is because self isn't an acquisition wrapper in
__init__ (even though SimpleItem is Acquisition.Implicit) but what am I
supposed to do to add a property in __init__?

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] timezone for IST

2000-11-07 Thread Philip S Tellis

I've edited DateTime.py and added a timezone for IST:

Line 166: (_zlst)
was: 'Iran','Israel','Jamaica','Japan','Mexico/BajaNorte',
now: 'Iran','Israel','IST','Jamaica','Japan','Mexico/BajaNorte',

Line 223: (_zmap)
was: inserted new line
now: 'ist':'IST',

My apps seem to be working, but I am only testing with IST.  Will this
break anything else?  If not, can it be added to the next release?

Thanks,

Philip

-- 
Often statistics are used as a drunken man uses lampposts -- for support
rather than illumination.

Visit my webpage at http://www.ncst.ernet.in/~philip/
Read my writings at http://www.ncst.ernet.in/~philip/writings/


___
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] Patch to fix problem

2000-11-07 Thread Chris Withers

Chris Withers wrote:
 
 If I try and add a property in __init__ as so:
 
 self.manage_addProperty('AProperty','1\n2\n3','lines')
 
 I get the following wonderful error:
 
 Error Type: AttributeError
 Error Value: aq_base

I made this go away with a patch to PropertyManager.py:

===
RCS file: /cvs-repository/Zope2/lib/python/OFS/PropertyManager.py,v
retrieving revision 1.30
diff -r1.30 PropertyManager.py
199c199
or hasattr(self.aq_base, id):
---
or hasattr(getattr(self,'aq_base',self), id):

I'm sticking this in the collector so please tell me if my patch is
wrong ;-)

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] Adding properties in __init__

2000-11-07 Thread Itamar Shtull-Trauring

Chris Withers wrote:

 self.manage_addProperty('AProperty','1\n2\n3','lines')

 I'm guessing that this is because self isn't an acquisition wrapper in
 __init__ (even though SimpleItem is Acquisition.Implicit) but what am I
 supposed to do to add a property in __init__?

I usually override _properties in the subclass, with the new property
definition, and then doing 

self.Aproperty = '1\n2\n3'

works nicely.

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
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] Bad General Try and Except

2000-11-07 Thread Chris Withers

Hi Again,

Management.py (around line 148) contains one of those nasty general try:
except: clauses which mask real problems

Anyone know why it's there?

With some additions, I found out it was masking an 'index out of range'
error in the product I'm developing. I wonder why this was presented as
an unauthorized error?

confusedly,

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] Adding properties in __init__

2000-11-07 Thread Toby Dickenson

On Tue, 07 Nov 2000 11:54:57 +, Chris Withers [EMAIL PROTECTED]
wrote:

I have a product class that subclasses SimpleItem and PropertyManager.

If I try and add a property in __init__ as so:

self.manage_addProperty('AProperty','1\n2\n3','lines')

I get the following wonderful error:

Error Type: AttributeError
Error Value: aq_base

I'm guessing that this is because self isn't an acquisition wrapper in
__init__ (even though SimpleItem is Acquisition.Implicit) but what am I
supposed to do to add a property in __init__?

__init__ has no idea of context, so its less useful in Zope than you
might usually expect.

Your object must have a factory method somewhere I suggest adding
an extra method to your object (I always name it '_after_create') and
arrange for it to be called by your factory once the new object is
installed in its container.

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] Adding properties in __init__

2000-11-07 Thread Chris Withers

Toby Dickenson wrote:
 
 Your object must have a factory method somewhere I suggest adding
 an extra method to your object (I always name it '_after_create') and
 arrange for it to be called by your factory once the new object is
 installed in its container.

...yurch! ;-)

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] ZCatalog index error

2000-11-07 Thread Christopher Petrilli

How are you getting things indexed and reindexed in the Catalog, if I might
ask?

Chris
- Original Message -
From: "Andy McKay" [EMAIL PROTECTED]
To: "Chris McDonough" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, November 06, 2000 6:42 PM
Subject: Re: [Zope-dev] ZCatalog index error


 Thanks, will look forward to 2.2.3!

 I deleted an index and metadata, re created them and recatalogued the
 affected objects. That seem to solve it in my initial tests... keeping my
 fingers crossed.

 --
   Andy McKay, Developer.
   ActiveState.

 - Original Message -
 From: "Chris McDonough" [EMAIL PROTECTED]
 To: "Andy McKay" [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Monday, November 06, 2000 3:49 PM
 Subject: Re: [Zope-dev] ZCatalog index error


  Andy,
 
  This is a known issue with the catalog (searching the collector for "key
  error" will show you how common it has been).  Chris Petrilli should be
  checking in some changes to the CVS 2.2 branch (and the trunk?) tomorrow
  that resolves it.  The problem is evidently related to the way
  catalog.index_object() and catalog.unindex_object() do their thing.  I'd
  advise you live with the issue until 2.2.3 comes out (which should be
  sometime this week, AFAIK).
 
  - Original Message -
  From: "Andy McKay" [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, November 06, 2000 4:17 PM
  Subject: [Zope-dev] ZCatalog index error
 
 
   Im running into an odd bug with ZCatalog:
  
   I have am running a catalog query and Im getting this message.
  
 File D:\zope\lib\python\Products\ZCatalog\Lazy.py, line 193, in
   __getitem__
 File D:\zope\lib\python\Products\ZCatalog\Catalog.py, line 197, in
   __getitem__
   KeyError:
   52536
  
   This is the line where it seems to be setting all the scores to one,
and
 I
   guess it can find the item 52536.
  
   else:
   # otherwise no score, set all scores to 1
  
  r=self._v_result_class(self.data[index]).__of__(self.aq_parent)
   r.data_record_id_ = index
   r.data_record_score_ = 1
   r.data_record_normalized_score_ = 1
  
   The thing is my catalog is only 17,000 records in size, I have no item
  52536
   (no wonder it cant find it). I guess my best plan would be somehow to
  remove
   that the record for that item if I could... hmm...
  
   Any other ideas?
  
   --
 Andy McKay, Developer.
 ActiveState.
  
  
   ___
   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 )




___
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 and Properties that are objects

2000-11-07 Thread Phillip J. Eby

At 01:01 PM 11/7/00 +0200, Roch'e Compaan wrote:

I created a couple of ZClasses based on Dataskin.

In the way I grok ZOPE, properties that are objects can not go onto property
sheets.  So if I have a Customer ZClass that has a property Address (a
property that is an object) then I would create the address object as a
"method" of the Customer that makes references like Customer.Address.Street
possible.

The way Ty and I usually handle "object" properties is to give an object
setter methods (e.g. "setAddress()") that simply set the property (e.g.
self.Address = addr).  The only downside is that you have to do this in a
Python base class or an External method.  Later, we expect to replace this
approach with PropertyHandlers, and we already have a primitive form of
PropertyHandler we have used with some success, but it's too crude at this
point for a product release.


To achieve this without ZPatterns I would base my ZClass on a objectmanager
so that I can create an instance of an Address object within Customer.  So
how does one do this with ZPatterns.  In one posting I picked up that one
does not have much joy with ZPatterns and the ObjectManger base class?

I have created ObjectManager and Folder dataskins before and had them work,
but at the time I was testing with Zope 2.1.6, and it was an older version
of ZPatterns.  I haven't done much lately with them.  If people are
experiencing problems, perhaps someone could send me a bug report?


___
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] DataSkins containing DataSkins

2000-11-07 Thread Phillip J. Eby

At 05:39 PM 11/6/00 -0800, John Eikenberry wrote:

The base DataSkin will be in a Rack. Would there be any issues in making
the embedded DataSkins (contained on the base DataSkins) use this Rack as
well?  Seems like it might result in the confusion about which DataSkin a
PlugIn on the Rack worked with.

Yes, it would, if you persistently stored the DataSkins in the other
DataSkins.  If you use an Attribute Provider, however, that loads them from
a different Specialist+Rack, you'd be fine.


Would it be better to use Customizers in some way... either have the base
Dataskin or perhaps the Specialist also inherit from the Customizer?

Ugh.  Well, you might be able to make the DataSkin a Folder w/Customization
Support...  but I don't know if it would work.  I've never tried mixing a
DataSkin with the classes that support DataSkins.  I think there might be
some horrible method naming conflicts.


Phillip, I think you've considered this (didn't you once mention converting
PropertySheets to DataSkins). What issues do you think I should be aware of
in planning for this.

Doing DataSkin propertysheets would be done by having the propertysheets
come from a different Specialist.

Thing is, if you want to store DataSkins arbitrarily nested within one
another, you can do it in the regular Zope management structure, without
using a Specialist/Rack combo.  On the other hand, if you have a structured
nesting, (e.g. object type A contains some number of object type B), then
you should be using attribute providers/SkinScript to define how those
sub-objects get stored.

To use ZPatterns for its intended purpose, it is critical that you step
back and NOT think in terms of how you'd implement a solution in Zope
without ZPatterns.  In fact, it is important that you not think of
implementation *at all*, because it will distract you from the real
question, which is how to segment the responsibilities of your application.
 Once those responsibilities are segmented, implementation is simply a
matter of writing the necessary methods and SkinScript.

In this case, segmenting according to the RIPP model means that objects are
never truly "contained" in other objects.  An object just gives you ways to
get at related objects.  And if there is a relationship between objects,
that means that the object on the "other end" of the relationship plays
some role in your system, and where there's a role there almost always
needs to be a Specialist.

Now, it may seem that this is needlessly constraining, because it is more
restrictive than Zope.  After all, Zope lets you put anything in anything
-- just like Basic lets you go to any line in the program.  :)  ZPatterns,
however, exists to make interconnectable frameworks possible.  You can
still do the kinds of things Zope can, but you must explicitly think
through your application's role model, and seperate the responsibilities
accordingly.  The payoff of this more rigorous design approach is that your
application can be backed by *anything* that can support the data,
including combinations of different kinds of data stores.  And, your
application will be a potentially re-usable framework.


___
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] Zope Permission's Adjustment

2000-11-07 Thread Keith . Larson

Hello,

Does anyone know the file that I can edit to adjust the layout of the
Security Tab?

I would like to be able to add the Roles Headers to the bottom of the list
as well as the top.

Keith Larson
Web Developer



___
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] Questions about implementing object models with ZPatterns

2000-11-07 Thread Phillip J. Eby

At 05:19 PM 11/1/00 +1100, Itai Tavor wrote:

Ok... I think I get the "Specialist per role, not per class" part. 
But I still can't make the jump from a class diagram to a 
ZClass/Specialist setup.

A class diagram contains all the roles - they're the lines between the
classes.  :)

Look at it this way...  if an object has a particular association role that
it needs filled, and there is more than one kind of object that can fill
that role, then presumably those objects must all implement a certain
interface, right?  You need to create a Specialist for that interface.

In other words, there is usually one Specialist per collaboration interface
-- which is NOT a one-to-one mapping with classes, since some classes may
implement multiple interfaces, and some classes may all implement the same
interface.


I can solve some of it by subclassing ZClasses. So, if I need 
Customers and Resellers, I'll make a Specialist for each, and a 
Customer and Reseller ZClasses, both subclassed from Person which 
stores common properties for a person. This part is ok. 

What *role* do Customer and Reseller objects play in your system?  It
sounds to me like perhaps they play the role of "thing that places orders"
or "thing that orders are shipped to".  Depending on your application's
functions, you could need as many as FOUR specialists:

Customers
Resellers
BillableEntities
ShippingDestinations

Where the latter two specialists would contain a pair of Racks that mapped
back to the Customers and Resellers specialists, respectively.


But it gets 
more complex than that. Take this example: Every OrderLineItem object 
can have one or more Payment objects associated with it. There are 3 
possible payment types - Check, Charge and BankDeposit, so I make a 
ZClass for each one, all subclassed from a general Payment ZClass. I 
create one Payments Specialist with 3 Racks. Where do I store methods 
that are specific to one payment type? In the Rack? I can't store 
them in the Specialist - it would be a mess, and I can't store them 
in the ZClass, because the ZClass doesn't know about the rest of the 
application. 

Huh?  What do you mean by "methods that are specific to one payment type"
in this context?  What do payments do that requires knowledge of the rest
of the application?  If it's a problem-domain method, it belongs in the
ZClass.


Actually, writing this down makes me realize that it 
could work... would Payments.getItem(some_payment_id).someMethod() 
call someMethod in the Rack if one exists, and the one in the 
Specialist if not?

No.  DataSkins acquire only from the Specialist, not the Rack.  However,
you can use ClassExtenders in the Rack to provide methods to an object.
But you *can't* override methods that already exist on the ZClass.  This
should not ordinarily be an issue since you should only be doing problem
domain methods on your ZClasses anyway, and there should be no need to
override them.


Another problem I'm having is how to store id's for different objects 
in the the same field. In the Payments example above this is not a 
problem, because all payments are supplied by the Payments 
specialist. But what about another example - Customers and Resellers 
are two totally different roles, so they each get a Specialist. the 
Payment object has from_id and to_id fields, and each of those can 
hold the id of a customer or reseller, or some special code to 
indicate the store. I could add from_type and to_type fields, or I 
could prefix the id with a code letter, but neither seem like a good 
solution. Is there a recommended approach for solving this problem?

See above, where I mention BillableEntities and ShippingDestinations.
Having only one specialist per role means that you never have to worry
about ambiguous identities.

Please note, however, that at this stage of design you shouldn't be looking
at how the references are going to be stored.  At the abstract design
stage, you would just have "Payor" and "Payee" attributes that are the
actual related objects.  When you write your SkinScript later, you can set
up how the linkages work, using ID fields, or SQL columns, or whatever.


___
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 Permission's Adjustment

2000-11-07 Thread Andy McKay

/lib/python/AccessControl/access.dtml contains the dtml for that page.
Fiddle away.

--
  Andy McKay, Developer.
  ActiveState.

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 07, 2000 7:54 AM
Subject: [Zope-dev] Zope Permission's Adjustment


 Hello,

 Does anyone know the file that I can edit to adjust the layout of the
 Security Tab?

 I would like to be able to add the Roles Headers to the bottom of the list
 as well as the top.

 Keith Larson
 Web Developer



 ___
 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] ZCatalog index error

2000-11-07 Thread Andy McKay

Well im not sure how much deleting the index and then recreating the index
throught the management interface actually does. But I wrote an external
method to basically do a find and apply to recatalog bunches of objects.

--
  Andy McKay, Developer.
  ActiveState.

- Original Message -
From: "Christopher Petrilli" [EMAIL PROTECTED]
To: "Andy McKay" [EMAIL PROTECTED]; "Chris McDonough"
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, November 07, 2000 7:27 AM
Subject: Re: [Zope-dev] ZCatalog index error


 How are you getting things indexed and reindexed in the Catalog, if I
might
 ask?

 Chris
 - Original Message -
 From: "Andy McKay" [EMAIL PROTECTED]
 To: "Chris McDonough" [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Monday, November 06, 2000 6:42 PM
 Subject: Re: [Zope-dev] ZCatalog index error


  Thanks, will look forward to 2.2.3!
 
  I deleted an index and metadata, re created them and recatalogued the
  affected objects. That seem to solve it in my initial tests... keeping
my
  fingers crossed.
 
  --
Andy McKay, Developer.
ActiveState.
 
  - Original Message -
  From: "Chris McDonough" [EMAIL PROTECTED]
  To: "Andy McKay" [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Sent: Monday, November 06, 2000 3:49 PM
  Subject: Re: [Zope-dev] ZCatalog index error
 
 
   Andy,
  
   This is a known issue with the catalog (searching the collector for
"key
   error" will show you how common it has been).  Chris Petrilli should
be
   checking in some changes to the CVS 2.2 branch (and the trunk?)
tomorrow
   that resolves it.  The problem is evidently related to the way
   catalog.index_object() and catalog.unindex_object() do their thing.
I'd
   advise you live with the issue until 2.2.3 comes out (which should be
   sometime this week, AFAIK).
  
   - Original Message -
   From: "Andy McKay" [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Monday, November 06, 2000 4:17 PM
   Subject: [Zope-dev] ZCatalog index error
  
  
Im running into an odd bug with ZCatalog:
   
I have am running a catalog query and Im getting this message.
   
  File D:\zope\lib\python\Products\ZCatalog\Lazy.py, line 193, in
__getitem__
  File D:\zope\lib\python\Products\ZCatalog\Catalog.py, line 197, in
__getitem__
KeyError:
52536
   
This is the line where it seems to be setting all the scores to one,
 and
  I
guess it can find the item 52536.
   
else:
# otherwise no score, set all scores to 1
   
   r=self._v_result_class(self.data[index]).__of__(self.aq_parent)
r.data_record_id_ = index
r.data_record_score_ = 1
r.data_record_normalized_score_ = 1
   
The thing is my catalog is only 17,000 records in size, I have no
item
   52536
(no wonder it cant find it). I guess my best plan would be somehow
to
   remove
that the record for that item if I could... hmm...
   
Any other ideas?
   
--
  Andy McKay, Developer.
  ActiveState.
   
   
___
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 )
 
 


 ___
 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] Vote on the new name for Python Methods!

2000-11-07 Thread Shane Hathaway

Being Election Day in the United States, now is a good time to vote on
the new name for Python Methods.

Python Methods are a relatively new concept for Zope. They give you the
features of DTML, such as through-the-web editing and security, while
providing a familiar, refined syntax.

But before we can fold them into the Zope core, you need to help us
choose the right name for them. Some have voiced the opinion that the
name "Python Method" is confusing because it can just as easily refer to
methods in standard Python modules.

There are some interesting alternatives, so please cast your vote!

http://www.zope.org/Members/hathawsh/poll

___
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] SiteAccess + ZCatalog Project

2000-11-07 Thread Evan Simpson

Those of you who use SiteAccess, or any other virtual hosting solution, with ZCatalog 
(including
Squishdot, ZUBB, and other ZCatalog-dependent products) should check out this new 
project:

http://dev.zope.org/Wikis/DevSite/Projects/ZCatalogVirtualHostFix

This proposes a set of changes and an upgrade path for ZCatalog to make it robust in 
the presence of
virtual hosts.

We really want to get this resolved, so this project won't be open for long.  
Contribute soon, if
you can.

Cheers,

Evan @ digicool


___
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] ZCatalog index error

2000-11-07 Thread Christopher Petrilli


 Well im not sure how much deleting the index and then recreating the index
 throught the management interface actually does. But I wrote an external
 method to basically do a find and apply to recatalog bunches of objects.

Actually i meant originally, not the second time.  Are you using
CatalogAware to get objects to automatically index themselves?  What exactly
are you doing to get them in the Catalog in the first place?

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] ZCatalog index error

2000-11-07 Thread Andy McKay

Ah sorry, I have custom CatalogAware class thats been a bit hacked but was
written by Mike Pelletier... when he was hanging around at ActiveState for a
few days. Theres a link to wiki on it somewhere

--
  Andy McKay, Developer.
  ActiveState.

- Original Message -
From: "Christopher Petrilli" [EMAIL PROTECTED]
To: "Andy McKay" [EMAIL PROTECTED]; "Chris McDonough"
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, November 07, 2000 10:13 AM
Subject: Re: [Zope-dev] ZCatalog index error



  Well im not sure how much deleting the index and then recreating the
index
  throught the management interface actually does. But I wrote an external
  method to basically do a find and apply to recatalog bunches of objects.

 Actually i meant originally, not the second time.  Are you using
 CatalogAware to get objects to automatically index themselves?  What
exactly
 are you doing to get them in the Catalog in the first place?

 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] JPython Product?

2000-11-07 Thread Casey Duncan

I have been toying with the idea of creating a Zope product for creating
JPython applets within Zope. I thought this might be a way to increase the
capabilities of Zope on the client-side while remaining firmly grounded in
Python and simultaneously giving me an excuse to play with JPython and maybe
create a useful Zope product too.

I wanted to throw this out to the group to see if others thought this was a
worthwhile capability.

The basic idea would be to write JPython scripts and applets in Zope either
via the web or otherwise and automagically "compile" them into transparent
.jar files that are served to the client on request. Sounds so simple!
Right?? Somehow I doubt it will be, but...

From what I see no one has done this so I figure at least one of following
is true:

1. Nobody thought of it or felt compelled to act on the thought.
2. Its gonna be hard to do.
3. Somebody else already did it and I don't know about it.
4. The idea blows.

Any thoughts on this idea, + or - are appreciated.

-Casey D.





___
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] dreamWeaver encoding

2000-11-07 Thread Robin Becker

A colleague and I find that the request encoding of dreamWeaver is
causing us problems and we can coorect by passing the DW encoded request
through urllib.unquote and quote.
-- 
Robin Becker

___
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] Questions about implementing object models withZPatterns

2000-11-07 Thread Itai Tavor

Phillip J. Eby wrote:

At 05:19 PM 11/1/00 +1100, Itai Tavor wrote:

Ok... I think I get the "Specialist per role, not per class" part.
But I still can't make the jump from a class diagram to a
ZClass/Specialist setup.

A class diagram contains all the roles - they're the lines between the
classes.  :)

That's a great statement :) It really helps me decipher my object model.

Look at it this way...  if an object has a particular association role that
it needs filled, and there is more than one kind of object that can fill
that role, then presumably those objects must all implement a certain
interface, right?  You need to create a Specialist for that interface.

In other words, there is usually one Specialist per collaboration interface
-- which is NOT a one-to-one mapping with classes, since some classes may
implement multiple interfaces, and some classes may all implement the same
interface.

How do you decide where to create collaboration Specialists? You 
wouldn't have one for every line in the object model, right? Do you 
use one only where there is more than one kind of object that can 
fill a role? How do you determine if a collaboration interface 
requires a collaboration Specialist, or can be done with a direct 
connection between the two class Specialists?

For example, take an OrderLineItem object and a ShipmentLineItem 
object (one describes a quantity of a certain product added to an 
order, and the other that quantity of product being shipped). In the 
interface between OrderLineItem and ShipmentLineItem,  an OrderLine 
can be seen as filling the role "thing that is shipped". 
OrderLineItem also fills the role "thing that is purchased" when it 
is added to an order. Would you create Specialists for each of these 
roles?

Or, in the case of BillableEntities below, would you still use this 
Specialist if there were only Customers in the system (so, only one 
participant filling the "thing that places orders" role)?

Are collaboration Specialists only used to interface participant-type objects?


  I can solve some of it by subclassing ZClasses. So, if I need
Customers and Resellers, I'll make a Specialist for each, and a
Customer and Reseller ZClasses, both subclassed from Person which
stores common properties for a person. This part is ok.

What *role* do Customer and Reseller objects play in your system?  It
sounds to me like perhaps they play the role of "thing that places orders"
or "thing that orders are shipped to".  Depending on your application's
functions, you could need as many as FOUR specialists:

Customers
Resellers
BillableEntities
ShippingDestinations

Where the latter two specialists would contain a pair of Racks that mapped
back to the Customers and Resellers specialists, respectively.

The collaboration Specialist won't actually *do* anything, would 
they? They would only abstract the retrieval of participant objects, 
so that any object which requires a "ship_to" property will not have 
to know or care what kind of participant is referred to. Am I getting 
this right? (Of course, I could add PD methods to 
ShippingDestinations if I wanted to, like printShippingLabel, but in 
a basic application this Specialist doesn't seem to need to do 
anything at all).

Also, these collaboration Specialists seem to serve to hide the fact 
that there are two types of participants. So, for example, a Payment 
object would just know "things that get billed". So how would I ask 
the Payments Specialist for "all payments made to resellers"?


  But it gets
more complex than that. Take this example: Every OrderLineItem object
can have one or more Payment objects associated with it. There are 3
possible payment types - Check, Charge and BankDeposit, so I make a
ZClass for each one, all subclassed from a general Payment ZClass. I
create one Payments Specialist with 3 Racks. Where do I store methods
that are specific to one payment type? In the Rack? I can't store
  them in the Specialist - it would be a mess, and I can't store them
  in the ZClass, because the ZClass doesn't know about the rest of the
  application.

Huh?  What do you mean by "methods that are specific to one payment type"
in this context?  What do payments do that requires knowledge of the rest
of the application?  If it's a problem-domain method, it belongs in the
ZClass.


Ok, I get this now. This question was based on my lack of 
understanding of how a ZPatterns application is structured.

A Payment object needs to access other parts of the application - for 
example, to get a UI snippet from BillableEntities. I thought that 
ZClasses are supposed to be self-contained, without links to the rest 
of the app, while methods that link parts of the app together belong 
in the Specialists. I can see I was totally wrong in this.


Please note, however, that at this stage of design you shouldn't be looking
at how the references are going to be stored.  At the abstract design
stage, you would just have "Payor" and "Payee" attributes