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 

[Zope] SAP DB with Zope?

2000-11-07 Thread Jonathan (ListServ Account)

Hi all,

Will be testing it myself shortly, but has anyone already hooked up Zope to 
SAP DB? It has been open sourced recently, and there are Python interfaces 
available (as well as Perl, JDBC, PHP, ODBC and C/C++). For those who are 
not familiar with it: it's a high end database used for example with SAP 
R/3 and has its roots in ADABAS D.

Check it out:
http://www.sap-ag.de/solutions/technology/sapdb/index.htm

Cya,
Jonathan


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




Re: [Zope] ISPs that host zope

2000-11-07 Thread Jens Grewen

Hi Keith,

check out http://www.zope.org/Resources/ZSP

Jens Grewen

- Original Message -
From: "Keith Alperin" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 07, 2000 2:43 AM
Subject: [Zope] ISPs that host zope


 Greetings.  I am a complete zope newbie but am enthralled by the
technology.
 I am about to begin working on a personal web project and would like to
 build it in/with zope.  Can anyone recommend a good ISP that will:
 -host and support zope
 -give me access to an RDBMS (MySQL or any other system would more than
 suffice)
 -give me a reasonable amount of space (50MB)
 -not break my budget ($30.00 per month.)

 Does such an animal exist?  Please let me know what your experiences are
 with zope-friendly ISPs regardless of whether they meet my aforementioned
 criteria.

 Thank you so much.

 Keith R. Alperin
 Sr. Web Developer
 Ignite Sports Media
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]


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



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




[Zope] variable length forms...

2000-11-07 Thread zope

Hi.

I have tried to implement a variable length form.

Yes, I have read 
http://www.zope.org/Members/jpenny/variable_length_forms/index_html.!

I a form, I'm using following form fields:

dtml-in "_.range(1, _.string.atoi(form_numpages)+1, 1)"
tr align="center" valign="middle"
tddtml-var sequence-number/td
tdinput type="text" name="form_time_out" size="6" 
maxlength="4"/td
tdinput type="radio" name="radiobdtml-var sequence-number"/td
tdinput type="radio" name="radiobdtml-var sequence-number"/td
/tr
/dtml-in

where form_numpages is a variable that i got from a previous form.
This form works fine and generates me form_numpages lines with always one 
textfield and a group of 2 radiobuttons named per line.

form_time_out  radiob1   radiob1
form_time_out  radiob2   radiob2
form_time_out  radiob3   radiob3
...

The contents of this form is submitted and I want to interpret the data 
with following method:

1: dtml-in "_.range(1, _.string.atoi(form_numpages)+1, 1)"
2:  dtml-var sequence-number:
3:  dtml-var "_['radiob'+_['sequence-number']]"
4: /dtml-in

This returns the following Zope error:

Error Type: TypeError
Error Value: illegal argument type for built-in operation

If I'm replacing the third line with dtml-var "_['sequence-number']", the 
sequence-number is printed out. So I'm sure that it exits.

How can I get the contents of radiob1, radiob2, radiob3, ...

Thanks a lot for your help!

Marc Ludwig


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




Re: [Zope] catalog DTML Document

2000-11-07 Thread Chris Withers

Wolfgang Strobl wrote:
 There is a How-To "Adding ZClass Instances Programmatically",
 and a lot of gobbledigoop about when, how and why. But I haven't
 found anything about how to "index" or "reindex" a plain and
 simple DTML Document.

In Python:

your_catalog.catalog_object(your_dtml_document,your_dtml_document.absolute_url())

This sort of thing shouldn't be done in DTML! :P

cheers,

Chris

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




RE: [Zope] images in directories

2000-11-07 Thread Pete Prodoehl


I was sort of hoping it would be easier. It would be ideal to have this:

  dtml-with imagesdtml-var image.gif/dtml-with

boiled down to one simple tag that works when I store images in a subfolder
*and* use file extensions.

But from what I've read so far, it can't be done...

Someone suggested the following:

   dtml-var "images.getitem('image.gif',1)"

but that didn't work for some reason, and still seems a little complex for
just inserting an image.


Pete



 --
 Subject:  Re: [Zope] images in directories
 
 hi,
 
 Sure they are.  If you ftp a jpg to the server it comes up with an id of
 bla.jpg, you can then refrence it in html just like you would on an Apache
 server or whaterver img src="../../bla.jpg"
 
 

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




[Zope] uploading to Zope with Mac Browser

2000-11-07 Thread rlanham

Zope list:

This zope method for uploading images to server:

dtml-call
expr="manage_addImage(
id=title, file=file, title=title)"

...works great from a PC. But from a Mac (netscape And IE) it does not work.

Sometime a file is uploaded, but it is garbage. Apparently the Mac browsers have a 
totally different way of packaging data from an input type=file element.

Does anyone on this list know how to deal with this? Is there a Zope product?

Thanks in advance for any help with this fundamental problem using Zope.

Richard



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




RE: [Zope] Cookies Expiration

2000-11-07 Thread Eric Walstad

Oops, forgot to send this one to the list...

-Original Message-
From: Eric Walstad [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 03, 2000 3:40 PM
To: Steve Drees
Subject: RE: [Zope] Cookies  Expiration


Newbie_Alert
Hi Steve,
Your solution is very cool!  I'm going to use it in the following
form...
(maybe a bit more flexible?, change the default days to suit your needs)

ID: expireInNDays
Parameter List: self, days=1.0
_BODY__
t = self.ZopeTime() + days # user defined duration
t = t.toZone('GMT')

return t.strftime("%A, %d-%b-%Y %H:%M:%S GMT")
___
 On the page you want to set the cookie put:
 dtml-call "RESPONSE.setCookie('cookiename','cookievalue', path='/',
expires=expireInNDays(this(), 7.0))"
 or, to use the default of 1 day:
 dtml-call "RESPONSE.setCookie('cookiename','cookievalue', path='/',
expires=expireInNDays())"
Thanks  -Eric.
/Newbie_Alert



// -Original Message-
// From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Steve
// Drees
// Sent: Friday, November 03, 2000 2:02 PM
// To: Kit O'Connell; [EMAIL PROTECTED]
// Subject: RE: [Zope] Cookies  Expiration
//
//
//  However, I'd like to have this cookie set to expire one week
// from the date
//  of the current visit. i.e., if its 12:30 on 11/3 when a surfer
// visits my
//  site, I want Zope to set their lastVisited cookie to expire on 12:30 on
//  11/10.
//
// Have a pythonmethod
//
// ID expireIn1Week
// Parameter List self
// _BODY__
// t = self.ZopeTime() + 7.0 # 1 week in the future
// t = t.toZone('GMT')
//
// return t.strftime("%A, %d-%b-%Y %H:%M:%S GMT")
// ___
//
//
// On the page you want to set the cookie put
// dtml-call "RESPONSE.setCookie('cookiename','cookievalue', path='/',
// expires=expireIn1Week())"
//
//
//
//
// ___
// Zope maillist  -  [EMAIL PROTECTED]
// http://lists.zope.org/mailman/listinfo/zope
// **   No cross posts or HTML encoding!  **
// (Related lists -
//  http://lists.zope.org/mailman/listinfo/zope-announce
//  http://lists.zope.org/mailman/listinfo/zope-dev )
//


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




[Zope] Can't access management page.

2000-11-07 Thread Joel Janosky

I have a small internal site I have been running for about a year.

Starting today, when I browse to the base /manage page, I get the normal
tree display in the left hand pane. The right hand pane, however, displays
the base page in its presentation form rather than showing the list of
objects in the base folder.

Any ideas on what may have been changed to cause this behavior ?? 

Any ideas on how to get it back to normal??

Thanks for the help.

Joel

[EMAIL PROTECTED]


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




[Zope] Stupid Question but...

2000-11-07 Thread Julian

Hi! I'm a new user and I sort of successfully installed the program on
my stand-alone computer. But now I'm wondering how do I install the
program on a webserver. Actually, I would like to ask for example, I
would like to use the KnowledgeKit developed by Bill on my webserver, do
I need to install the Zope main program? If yes, how do I go about it?

Thank you.

Julian


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




Re: [Zope] Your thoughts about Zope-based database apps

2000-11-07 Thread J. Atwood

 From: "Alonso Rhenals" [EMAIL PROTECTED]
 Subject: [Zope] Your thoughts about Zope-based database apps
 
 1. Is Zope a good tool to quicky build an efficient  effective user interface
 for a database application?

Yes. Once you get the hang of it it is all quite easy. I have at least one
(building another) site that is about 90% driven by the data from a
PostgreSQL database.

 2. In particular, what would be the best way to implement the inserting and
 updating of records along with input data validation? (Retrieving data from a
 database to show on a web page using Zope is straightforward as you know.)

ZSQL Methods.

 3. In several cases I'd like to implement a main form/subform, where the
 subform allows the user to enter several items related to only one record in
 the main form. Since every item might have many fields (say 20) I'd like to
 present just the most important fields on a table, and allow the user to
 view/enter/update all the fields for each item in a different web page. Those
 of you familiar with Microsoft Access know that in Access it is
 straightforward to implement this main form/subform interface. I wonder what
 would be the best way of implementing this using Zope?

You would have to build it. Not that it would be that tough. You could also
use a Zope Wizard if you want to do a couple of forms.

 4. Do you know of any existing Zope-based app similar to this?. Obviously, the
 back-end doesn't have to be MySQL.

http://fundraising.gotschool.com  - Although you can't see the management
interface which has lots of ways of extracting and updating data through
forms and ZSQL Methods. All PostgreSQL 6.5.3.

J




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




[Zope] CGI

2000-11-07 Thread Nicholas Lo



Hi,

My problem here seems obvious, but I really dont 
know how to solve it. I want to use some of my old CGI programs and I dont have 
much time to convert them into Zope. Does anyone know how to pass a request to a 
CGI program and get the results back in Zope?I know client.py may be 
useful, but it further worsen the fork tax CGI would pay.

Thanks

-- Nick


Re: [Zope] Stupid Question but...

2000-11-07 Thread Andy McKay

 Hi! I'm a new user and I sort of successfully installed the program on
 my stand-alone computer.

Installed what program?

 But now I'm wondering how do I install the
 program on a webserver.  Actually, I would like to ask for example, I
 would like to use the KnowledgeKit developed by Bill on my webserver, do
 I need to install the Zope main program? If yes, how do I go about it?

If KnowledgeKit is a Zope product so yes you will need Zope. Go to Zope.org
and click on download. There are installation instructions for your platform

 Thank you.

 Julian


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



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




[Zope] Persistence triggering

2000-11-07 Thread Max M

When appending to a list in Zope In a persistent class I cannot just do:

self.list.append(item)

As it will not trigger the persistence mechanism.

I can treat it like an imutable, but that is rather tedious:

_list = self.list
_list.append(item)
self.list = _list

But can I also do?

self.list = self.list + [item]

Regards
Max M


Max M. W. Rasmussen,Denmark.   New Media Director
private: [EMAIL PROTECTED] work: [EMAIL PROTECTED]
-
Specialization is for insects.  -  Robert A. Heinlein

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




Re: [Zope] CGI

2000-11-07 Thread Andy McKay

Are these CGI programs written in perl? If so there is perl for Zope
available...

--
  Andy McKay, Developer.
  ActiveState.

- Original Message -
From: "Nicholas Lo" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 07, 2000 8:43 AM
Subject: [Zope] CGI


Hi,

My problem here seems obvious, but I really dont know how to solve it. I
want to use some of my old CGI programs and I dont have much time to convert
them into Zope. Does anyone know how to pass a request to a CGI program and
get the results back in Zope? I know client.py may be useful, but it further
worsen the fork tax CGI would pay.

Thanks

-- Nick



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




Re: [Zope] Can't access management page.

2000-11-07 Thread Aleksander Salwa

On Tue, 7 Nov 2000, Joel Janosky wrote:

 Starting today, when I browse to the base /manage page, I get the normal
 tree display in the left hand pane. The right hand pane, however, displays
 the base page in its presentation form rather than showing the list of
 objects in the base folder.
 
 Any ideas on what may have been changed to cause this behavior ?? 
 
 Any ideas on how to get it back to normal??

Try to switch your browser to 'direct connection' instead of using Proxy
server.

[EMAIL PROTECTED]

/--\
| `long long long' is too long for GCC |
\--/




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




Re: [Zope] CGI

2000-11-07 Thread Nicholas Lo

Thanks, Andy.
Well, they are all written in C. Mostly by my collegues :p That's why I dont
want to touch them in the mean time.

--Nick

- Original Message -
From: "Andy McKay" [EMAIL PROTECTED]
To: "Nicholas Lo" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, November 08, 2000 1:04 AM
Subject: Re: [Zope] CGI


 Are these CGI programs written in perl? If so there is perl for Zope
 available...

 --
   Andy McKay, Developer.
   ActiveState.

 - Original Message -
 From: "Nicholas Lo" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, November 07, 2000 8:43 AM
 Subject: [Zope] CGI


 Hi,

 My problem here seems obvious, but I really dont know how to solve it. I
 want to use some of my old CGI programs and I dont have much time to
convert
 them into Zope. Does anyone know how to pass a request to a CGI program
and
 get the results back in Zope? I know client.py may be useful, but it
further
 worsen the fork tax CGI would pay.

 Thanks

 -- Nick




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




[Zope] PythonMethod and accessing objects in the ZODB

2000-11-07 Thread Hannes Grund

I'm using the PythonMethod product (latest Version) and Zope2.2.2.
The method lives inside a ZClass, which has an common instance 
propertysheet. Also the method gets an 'self' as argument.
  
Question 1:
How do i access the attributes stored within this propertysheet 
within the method,
while self.title and self.id gives the desired results. 
self.propertysheet.propertyname (among other experiments) 
raises an error.

Question 2:
How do I access objects stored elsewhere in the ZODB,
for example
self.REQUESTpath_to_object.object 

will raise an error..

Thanks in advance.

Hannes.

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




[Zope] [Ann] PathHandler 0.9.0 Released!

2000-11-07 Thread Chris Withers

The Path Handler product lets you handle URLs which don't correspond to
objects.

For example, if 'ph' is a Path Handler, then, in the following URL:

http://a.server/ph/1/2/3/4

1, 2, 3 and 4 don't have to be Zope objects, and the '/1/2/3/4' part of
the URL will be handled by the method
specified in the Path Handler.

The Product download and more information can be found at:

http://www.zope.org/Members/NIP/PathHandler 

cheers,

Chris

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




[Zope] Checking for ID's before creating ZClass

2000-11-07 Thread Ivan Cornell

Hello from rainy England,

In my constructor for a ZClass I want to auto generate an ID consisting
of a name followed by a incrementing sequence (port0, port1, port2...).
How do I check for all existing id's in a folder? I tried doing it in a
PythonMethod (or whatever they are called now!), calling hasattr() but
failed. Another possibilty would be to loop on a
try..createInObject..raise until successful, but that doesn't seem
very zopish. In the source code for createInObjectManager I can see it
getting the folder, but can't figure how to acheive that directly,

Ivan


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




RE: [Zope] Your thoughts about Zope-based database apps

2000-11-07 Thread Eric Walstad

Hi Alonso,

FYI, some of the list members have great difficulty in reading HTML
formatted messages.  It's best if you set your format to "Plain Text" before
submitting to the list.

I haven't yet implemented what you are considering, but I am interested in
doing so soon.  So, I am very interested in what you discover.  If you don't
mind, if/when you receive any emails that don't get CC'd to the Zope mailing
list, please forward them on to me, too.

I am an Access programmer and have a bit of experience with MySQL.  I've
given a lot of thought about how one would handle an Access-like interface
with Zope and MySQL over the web.  I'm anticipating a lot more development
time building the interface, but saving a bunch of time by not having to
keep multiple copies of the same DB up to date.  If you feel like
brainstorming on the "whats" and "hows" of such an application, I'ld love to
join in.

Thanks,
Eric.

2. In particular, what would be the best way to implement the inserting and
updating of records along with input data validation? (Retrieving data from
a database to show on a web page using Zope is straightforward as you know.)

I have a set of java script functions that I use for form field validation.
I like this approach because it puts the burden on the client.  However,
there are Zope products available that handle it on the server side.  Search
Zope.org for "Smarter Forms"


3. In several cases I'd like to implement a main form/subform, where the
subform allows the user to enter several items related to only one record in
the main form. Since every item might have many fields (say 20) I'd like to
present just the most important fields on a table, and allow the user to
view/enter/update all the fields for each item in a different web page.
Those of you familiar with Microsoft Access know that in Access it is
straightforward to implement this main form/subform interface. I wonder what
would be the best way of implementing this using Zope?

Using Zope to mimic a form / subform combination means that Zope will have
to generate a the input form and subform elements together before they get
sent to the user.  The user will then update the data sent by Zope.  When
the form is submitted, Zope will have to update the main form data, then
iterate thru the subform elements, modifying the subform data with each
iteration.  If records are to be added, it will require a client server
transaction for each record added (unless something is done with javascript,
where the form is generated dynamically.  Then, the user could add many
records and when the dynamically built form is submitted, Zope will have to
figure out how many records the user added).


4. Do you know of any existing Zope-based app similar to this?. Obviously,
the back-end doesn't have to be MySQL.

I haven't seen any yet, but I'm sure they're out there!


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




Re: [Zope] Persistence triggering

2000-11-07 Thread Chris McDonough

 But can I also do?

 self.list = self.list + [item]

Yes... this works because you're treating it immutably.  Although this is
likely much slower than an .append because the interpreter needs to make a
copy of self.list before tacking on your item.

You can also do:

self.list.append(item)
self._p_changed = 1

This explicitly tells the ZODB to include the object represented by self in
the current transaction.


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




RE: [Zope] Persistence triggering

2000-11-07 Thread Max M

From: Chris McDonough [mailto:[EMAIL PROTECTED]]

You can also do:

self.list.append(item)
self._p_changed = 1

This explicitly tells the ZODB to include the object represented by self in
the current transaction.

Yes but I have avoided using it as I wanted to make a class that is "Pure"
Python so I can edit and debug it without zope, and then write a "small"
wrapper class to make it a product.

Somehow I had gotten it into my head that I could not do that with,
self._p_changed = 1 because it isn't defined in my class but inherited.
Funny how you can get your head the wrong way around things. Naturally it
will have no effect on my own class if I set that value. So I guess I will
use that.

Thanks for the help.

Regards Max M



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




[Zope] SiteAccess2: How do I suppress all when managing?

2000-11-07 Thread Danny William Adair

How can I suppress the URL generation in the management screens? I've seen
the "Z" folder example but it didn't work for me. Everything is fine except
the management interface.

tia,

CU+Prost,


 .oO( "Du k├Ânntest mal einen bauen" )
Danny


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




[Zope] XMLRPC accessing Zope DTML/SQL methods

2000-11-07 Thread Mayers, Philip J

I'm planning on using Zope as some middleware to an SQL database backend.
Zope will implement the per-row ACL checking and such for the database
application, and there are two clients - a simple web-based Zope frontend,
and a larger standalone Java application. I'd like the Java app to
communicate with Zope using XMLRPC, so that I can re-use the middleware
portion, and take advantage of SSL'd HTTP, along with all the other bonuses
such as not trusting the client :o)

But: I'm having problems that indicate I don't understand how External
Methods or the XMLRPC call support works.

I have an SQL query method backed by a persistent DB connection. I want to
call that method over XMLRPC remotely. How do I do that? Namely, how do I
pass named arguments to the SQL method?

Also, I did some simple External Method examples, and acquisition doesn't
seem to work as advertised: This:

def testf(self, REQUEST):
return self.index_html()

Gives an error "standard_html_header not found". What's going on?

Regards,
Phil

+--+
| Phil Mayers, Network Support |
| Centre for Computing Services|
| Imperial College |
+--+  

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




[Zope] Re: XMLRPC accessing Zope DTML/SQL methods

2000-11-07 Thread Red Pineseed

Since XML-RPC is already built into Zope, you do not need to
work about that. You need however to write a java client to
access your ZOPE method. There is information and a JAVA
client on the xml-rpc site http://www.xmlrpc.com/. You can
find enough info to start with.


Philip







 Message: 3
 From: "Mayers, Philip J" [EMAIL PROTECTED]
 To: "'[EMAIL PROTECTED]'" [EMAIL PROTECTED]
 Subject: [Zope] XMLRPC accessing Zope DTML/SQL methods
 Date: Tue, 7 Nov 2000 19:49:54 -
 charset="iso-8859-1"
 
 I'm planning on using Zope as some middleware to an SQL database backend.
 Zope will implement the per-row ACL checking and such for the database
 application, and there are two clients - a simple web-based Zope frontend,
 and a larger standalone Java application. I'd like the Java app to
 communicate with Zope using XMLRPC, so that I can re-use the middleware
 portion, and take advantage of SSL'd HTTP, along with all the other bonuses
 such as not trusting the client :o)
 
 But: I'm having problems that indicate I don't understand how External
 Methods or the XMLRPC call support works.
 
 I have an SQL query method backed by a persistent DB connection. I want to
 call that method over XMLRPC remotely. How do I do that? Namely, how do I
 pass named arguments to the SQL method?
 
 Also, I did some simple External Method examples, and acquisition doesn't
 seem to work as advertised: This:
 
 def testf(self, REQUEST):
 return self.index_html()
 
 Gives an error "standard_html_header not found". What's going on?
 
 Regards,
 Phil
 
 +--+
 | Phil Mayers, Network Support |
 | Centre for Computing Services|
 | Imperial College |
 +--+

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




Re: [Zope] Checking for ID's before creating ZClass

2000-11-07 Thread Andy McKay

Perhaps it might be easier just to generate one you know will be unique, eg
date-time or use a counter. Anyway dtml-in "objectIds()" should give you a
list of ids of the current folder where the object is being created.

--
  Andy McKay, Developer.
  ActiveState.

- Original Message -
From: "Ivan Cornell" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 07, 2000 10:45 AM
Subject: [Zope] Checking for ID's before creating ZClass


 Hello from rainy England,

 In my constructor for a ZClass I want to auto generate an ID consisting
 of a name followed by a incrementing sequence (port0, port1, port2...).
 How do I check for all existing id's in a folder? I tried doing it in a
 PythonMethod (or whatever they are called now!), calling hasattr() but
 failed. Another possibilty would be to loop on a
 try..createInObject..raise until successful, but that doesn't seem
 very zopish. In the source code for createInObjectManager I can see it
 getting the folder, but can't figure how to acheive that directly,

 Ivan


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



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




[Zope] [Fwd: [Zope-dev] Vote on the new name for Python Methods!]

2000-11-07 Thread Michel Pelletier


Please vote folks!

-Michel

Shane Hathaway wrote:
 
 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 maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] importing data

2000-11-07 Thread James Sintz

I have created a simple zclass product for a web based newsletter. Each
day's newsletter is input into a form and added into the ZODB as instances
of this newsletter zclass. My question is... how do I import 2 years worth
of newsletters from tab delimited files exported from another database?

I searched the archives and how-to section and could not find the answer. Is
this possible to do?

Thanks!!

Jamey



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




Re: [Zope] Checking for ID's before creating ZClass

2000-11-07 Thread Dieter Maurer

Ivan Cornell writes:
  
  How do I check for all existing id's in a folder? 
The method "objectIds" of a folder returns the list of ids in
that folder.


Dieter

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




Re: [Zope] PythonMethod and accessing objects in the ZODB

2000-11-07 Thread Dieter Maurer

Hannes Grund writes:
  I'm using the PythonMethod product (latest Version) and Zope2.2.2.
  The method lives inside a ZClass, which has an common instance 
  propertysheet. Also the method gets an 'self' as argument.

  Question 1:
  How do i access the attributes stored within this propertysheet 
  within the method,
  while self.title and self.id gives the desired results. 
  self.propertysheet.propertyname (among other experiments) 
  raises an error.
There are API's for "PropertySheetManager" and "PropertySheets".
Use them for access.

  Question 2:
  How do I access objects stored elsewhere in the ZODB,
  for example
  self.REQUESTpath_to_object.object 
That looks a bit strange.

You can either access objects from self via acquisition:

(e.g.) self.o.child 

or use the method "restricted_traverse" (-- API documentation).


Dieter

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




Re: [Zope] Cloning a ZClass-Instance

2000-11-07 Thread Dieter Maurer

[EMAIL PROTECTED] writes:
  Hallo,
  'news'is a zclass and when I'm using a hardcoded value for x it's working.
  
  that's the cloning-method:
  --
  dtml-in "objectValues(['news'])"
  dtml-let x=sequence-item
  
  dtml-if "now.isCurrentDay()"
   dtml- call "manage_clone(_.getitem('x',0),'firstclone', [REQUEST])" 
  
  Copied!
  dtml-else
  Not needed to clone!!
  /dtml-if
  /dtml-let
  /dtml-in
  --
  And the traceback:
  ---
  The object one  does not support this operation 
Whereever you use a name in DTML, the referenced object
is called, if it is callable.

In your case, you use the name "sequence-item" in the "dtml-let".
Apparently, your "news" instances are callable.
If I am right, then "x" is a string (which of cause does not
support cloning).

Try:

  dtml-let x="_.getitem('sequence-item')"

  /dtml-let


Dieter

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




RE: [Zope] images in directories

2000-11-07 Thread Dieter Maurer

Pete Prodoehl writes:
  I was sort of hoping it would be easier. It would be ideal to have this:
  
dtml-with imagesdtml-var image.gif/dtml-with
  
  boiled down to one simple tag that works when I store images in a subfolder
  *and* use file extensions.
  
  But from what I've read so far, it can't be done...
I had this opinion till some days ago.

Then Chris Withers wrote: use

dtml-with imagesdtml-var image.gif/dtml-with

I did not believe him and tried it out...
... it works in Zope 2.2.2.


Dieter


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




Re: [Zope] XMLRPC accessing Zope DTML/SQL methods

2000-11-07 Thread Dieter Maurer

Mayers, Philip J writes:
  I have an SQL query method backed by a persistent DB connection. I want to
  call that method over XMLRPC remotely. How do I do that? Namely, how do I
  pass named arguments to the SQL method?
I have looked at XMLRPC some time ago, but I forgot most details:

  If XMLRPC supports keyword (i.e. named) parameters,
  then Zope will handle the parameter passing transparently
  for you. You must use the same keyword parameters your
  have defined in the ZSQL method.

  If XMLRPC supports only positional (i.e. unamend) parameters
  then you must use as a wrapper a method type
  that supports positional parameters (Python method/External method).

  Also, I did some simple External Method examples, and acquisition doesn't
  seem to work as advertised: This:
  
  def testf(self, REQUEST):
  return self.index_html()
  
  Gives an error "standard_html_header not found". What's going on?
When you call DTML objects yourself, you must pass the context
explicitely:

   return self.index_html(self,REQUEST)



Dieter

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




Re: [Zope] catalog DTML Document

2000-11-07 Thread Dieter Maurer

Wolfgang Strobl writes:
  I asked about how to perform this function (to spell it out again: 
  _adding_ a _DTML Document_) programmatically, i.e. via DTML, 
  of from Python code.
ZCatalog.manage_catalogObjects(self, REQUEST, RESPONSE, URL1, urls=None)
   """ index all Zope objects that 'urls' point to """

You can use "ZopeFind" (-- ZQR) to "find" the objects
and the "absolute_url" method to obtain the URL.


Dieter

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




Re: [Zope] importing data

2000-11-07 Thread Andy McKay

Im trying to finish a Product that does a very simplified version of what
you want, just sucks all txt html stuff from a file. This can be most easily
accomplished using Python reading straight off the file system or xml-rpc or
some other system. If you are comfortable with Python its not too bad

--
  Andy McKay, Developer.
  ActiveState.

- Original Message -
From: "James Sintz" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 07, 2000 1:26 PM
Subject: [Zope] importing data


 I have created a simple zclass product for a web based newsletter. Each
 day's newsletter is input into a form and added into the ZODB as instances
 of this newsletter zclass. My question is... how do I import 2 years worth
 of newsletters from tab delimited files exported from another database?

 I searched the archives and how-to section and could not find the answer.
Is
 this possible to do?

 Thanks!!

 Jamey



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



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




[Zope] acessing parameters in a helper class

2000-11-07 Thread Max M

I have the below class "mxm_guestbook_base" that is subclassed by a zClass.
So far so good.

But when in a "index_html" dtml-method I try to acces the value "author" of
the "aComment" class returned in the "getAllComments" method like so:

dtml-in getAllComments
dtml-var author
dtml-var comment fmt=structured-text
/dtml-in

I get the following traceback:

---

Traceback (innermost last):
  File C:\mxmZope\lib\python\ZPublisher\Publish.py, line 222, in
publish_module
  File C:\mxmZope\lib\python\ZPublisher\Publish.py, line 187, in publish
  File C:\mxmZope\lib\python\ZPublisher\Publish.py, line 171, in publish
  File C:\mxmZope\lib\python\ZPublisher\mapply.py, line 160, in mapply
(Object: index_html)
  File C:\mxmZope\lib\python\ZPublisher\Publish.py, line 112, in call_object
(Object: index_html)
  File C:\mxmZope\lib\python\OFS\DTMLMethod.py, line 172, in __call__
(Object: index_html)
  File C:\mxmZope\lib\python\DocumentTemplate\DT_String.py, line 528, in
__call__
(Object: index_html)
  File C:\mxmZope\lib\python\DocumentTemplate\DT_In.py, line 691, in
renderwob
(Object: comments)
  File C:\mxmZope\lib\python\OFS\DTMLMethod.py, line 194, in validate
(Object: index_html)
  File C:\mxmZope\lib\python\AccessControl\SecurityManager.py, line 139, in
validate
  File C:\mxmZope\lib\python\AccessControl\ZopeSecurityPolicy.py, line 159,
in validate
Unauthorized: author

---

It seems that I have a problem accessing values in the objects inserted in
self.comments list.

If I just self.append('some comment') directly as a string I have no
problems acessing the comments as "sequence-item". It is only when inserting
an object into the list I cannot access it.

Anybody has any ideas?

---

index_html (dtml-method):

---

dtml-var standard_html_header
[a href="add_comment"Ny kommentar/a]br
dtml-in getAllComments
idtml-var author/ibr
dtml-var comment fmt=structured-textp
centerhr height=1 noshade width=90%/center
/dtml-inbr
[a href="add_comment"Ny kommentar/a]br
dtml-var standard_html_footer

---

class aComment:
' '
def __init__(self, comment, author):
self.comment = comment
self.author  = author

class mxm_guestbook_base:

"""
A base class for guestbook products
"""

def __init__(self):
self.comments = []

def addComment(self, comment='', author='' , RESPONSE=None):
"Adds a comment"
self.comments.append(aComment(comment, author))
self._p_changed = 1 # Trigger persistence
RESPONSE.redirect('index_html')

def deleteAllComments(self, RESPONSE=None):
"Deletes all comments"
self.comments = []
RESPONSE.redirect('index_html')

def deleteComment(self, id, RESPONSE=None):
"Deletes a single comment"
del(self.comments[id])
self._p_changed = 1 # Trigger persistence
RESPONSE.redirect('index_html')

def getAllComments(self):
"returns a list of all comments"
return self.comments
---

Regards

Max M

Max M. W. Rasmussen,Denmark.   New Media Director
private: [EMAIL PROTECTED] work: [EMAIL PROTECTED]
-
Specialization is for insects.  -  Robert A. Heinlein


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




[Zope] OO and ZClasses ?

2000-11-07 Thread Douglas Daniel Del Frari

My main doubt using the Zope, is as to implement the OO concepts using
the Zclasses. In the Z Classes, the attributes will be created in the "
Property Sheets "? The  operations will be created in the border "
Methods "? The aggregation concept will be used using " Subobjects "?

Question 2 is my main doubt.

I am thankful all


--
-
Douglas Daniel Del Frari
-
Brazil, RS
-
mailto:[EMAIL PROTECTED]
http://labinf.detec.unijui.tche.br/~gaucho
-



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




Re: [Zope] re: uploading to Zope with Mac Browser

2000-11-07 Thread Richard Lanham

Jeffrey,
Thank you soo much. And, yesyes, I was wrong about Mac netscape, that seems
to upload fine, I was just not used to how stubbornly mac netscape will
cache a page. It's an old mahine too and does wierd things, not a good lab
box.

oh, sorry to all for accidentally sending that zip file to the list instead
of to myself from work.


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




[Zope] asked a million times again...

2000-11-07 Thread Chris Trowbridge



Okay, I got the dtml-var filename to work 
right assuming that that files are arranged properly according to aquistion, but 
then when I try to get the file from another folder like

  dtml-var 
"folder.filename" 

It displays the code of that page rather thatn 
recognizing that it is content. What should I do?


Thanks;
Chris


[Zope] How about create another method other than index_html to get content in OFS::File?

2000-11-07 Thread iap_y2fun.com

Dear all,
My problem is that : I have a ZClass based on OFS::File.
I need to override the default index_html for my own purpose.
After I created my own index_html, I found myself can't access the content
of that object.
Since:
1. I have no way to access the original method index_html of the base class
2. In OFS::File, There is no other method than index_html to access the
content of this object.
That's why I modify Image.py and add one line:
getContent=index_html
It's work for me.
I don't think it's a good idea, since it's quick and dirty.
Is there any better way to do this?

Thanks

Iap, Singuan







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