Re: [Zope-dev] ZPatterns: DropZone example

2000-07-04 Thread Phillip J. Eby

At 02:21 AM 7/5/00 +, Scott Parish wrote:
>
>Does anybody out there have even the slightest clue about how to go about
>using AttributeProviders and SheetProviders?  A select few terse hints on
>this subject would really help us (me) figure it out enough to start working
>on some howto's.

You might look at some of the recent posts which included an example of
using GenericAttributeProviders to read from a MySQL database, and my reply
explaining how to use a GenericTrigger to update that same database.


>Am i wrong in thinking that DatabaseAPI is a completely separate solution to
>the same problem that ZPatters is suppose to address?  Personally i have to 
>give DatabaseAPI props for being quite easy to understand and use, while
>not sacrificing power.

Peter Coad's design approach (which ZPatterns is heavily based on/biased
towards) emphasizes four major layers of classes in an application:

1) User Interface (GUI, forms, etc.)
2) Problem Domain (the actual application purpose)
3) Data Management (object persistence/lifecycle management)
4) System Interaction (interfaces w/hardware or other software)

ZPatterns is focused on providing tools for transparent mappings between
layers 2 and 3, while DatabaseAPI, as far as I can see (and I actually did
play around with it today to get a feel for it), is focused on tools for
building clean mappings between layers 3 and 4.  In my mind, this makes
them complementary tools, rather than competitors in any real sense.

Indeed, looking at DatabaseAPI has shown me that there are some features
I'd planned for ZPatterns (or already started) that I can scrap because
DatabaseAPI has them and can easily interoperate.  (Personally, I'd like to
see a version of DatabaseAPI using PlugIns to structure its user interface,
which I think could easily make it even cleaner and easier to use than it
already is.  It might then also be possible to reuse some of its plug-ins
for functionality in areas of ZPatterns.  But I digress.)

So where do DatabaseAPI and ZPatterns overlap?  DatabaseConnector has some
functional overlap with Specialist.  If you ignore the attribute, sheet,
and trigger providing aspects of ZPatterns (and also look only at the raw
functionality), the primary difference between a Specialist and a
DatabaseConnector is that DatabaseConnectors will probably have methods to
delete objects or change their data, which is a no-no for a Specialist
because it's an encapsulation breach.

Beyond this, there's a significant difference in intent between a
Specialist and a DatabaseConnector (IMHO).  A Specialist serves as a broker
to access objects which fill a certain role in a framework, while a
DatabaseConnector represents an object which manipulates "records" which
are of "record types" and have "fields".  Specialists use Racks to
explicitly distinguish between problem-domain and data-domain concerns; you
can probably do this with nested DatabaseConnectors but you'll have to do
some additional work to support it.

ZPatterns could definitely benefit from some ideas found in DatabaseAPI,
primarily in the aspect of documenting API's and supporting better design
contracts.  For example, it would be nice for a Specialist to be able to
define the API expected from its Racks, and a for an application framework
to somehow define the API expected from the Specialists it will interact
with.  One could of course use the existing DatabaseAPI product to do these
things, but the integration would be less than smooth, since you'd have to
make the Specialist ask the Racks for their DatabaseConnectors, or else
have a Rack class that delegated to a DatabaseConnector, or something like
that.  Anyway, I'm going to have to give these possibilities some more
thought.


___
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: DropZone example

2000-07-04 Thread Scott Parish

Thus spake Phillip J. Eby ([EMAIL PROTECTED]):

>
> That's all quite true, but it would probably be simplest to do such a thing
> using AttributeProviders and SheetProviders in the white-box specialists.
> It does seem reasonable to have those providers talk to an
> AccountingProcessor object if you want to make your framework talk to
> different back-ends, but I think it is misleading and incorrect to call
> AccountingProcessor a specialist, as it's not an application-level service
> object, but a private implementation helper.
> 

Does anybody out there have even the slightest clue about how to go about
using AttributeProviders and SheetProviders?  A select few terse hints on
this subject would really help us (me) figure it out enough to start working
on some howto's.

> Interestingly, you've just given me what may be a motivating example for
> using Shane Hathaway's DatabaseAPI in conjunction with ZPatterns, assuming
> of course that I've correctly understood his most recent explanation of the
> DatabaseAPI product.

Am i wrong in thinking that DatabaseAPI is a completely separate solution to
the same problem that ZPatters is suppose to address?  Personally i have to 
give DatabaseAPI props for being quite easy to understand and use, while
not sacrificing power.

sRp

-- 
Scott Parish
http://srparish.net/

 PGP signature


Re: [Zope-dev] ZCatalog lexicon bug is back?

2000-07-04 Thread Chris Withers

Dieter Maurer wrote:
> I am very interested in ZCatalog.
> 
> I promiss that I will look into it, when I come to 2.2.

Thanks,

Documentation of the cool stuff which is already there, and making it
work 100% reliably are the two main things...

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] Help needed: why is this DTML not working in zope 2 ?

2000-07-04 Thread Steve Alexander

Steve Alexander wrote:
> 
> 
> An external method for automated change from old syntax to new syntax
> follows.
> 
>  * Use at your own risk
>  * No warranty implied or given
>  * Use on a copy of your main Zope site
>  * Back up data.fs three times before starting
>  * Not guarenteed not to spin your processor and never terminate
>  * Run on a copy of Zope in debug mode (-D) to see the print statements
>  * Barely tested, if at all
> 
> _convert_regex = re.compile('')

Actually, I missed something in the original regex, above. (Funny how I
noticed just after I pressed the 'send' button!)

It should read like this:

_convert_regex =
re.compile('')


The whole thing again -- same disclaimers apply, only more so :-)



import re

def convert_dtml(self):
"""Convert DTML Methods and DTML Documents from old syntax to 
   new syntax.
   Warning: recursive!
   This assumes that DTML Method and DTML Document haven't been
   subclassed.
"""
print 'convert_dtml: id=%s' % self.title_and_id()
if hasattr(self, 'meta_type') and \
  (self.meta_type == 'DTML Method' or \
   self.meta_type == 'DTML Document'):
convert(self)

# should this be "isPrincipiaFolderish"?
if hasattr(self, 'isAnObjectManager') and self.isAnObjectManager:
for v in self.objectValues():
v.convert_dtml()

_convert_regex =
re.compile('')

def convert(dtml_item):
print 'converting...'
title = dtml_item.title
   # like document_src, but doesn't require RESPONSE
data = dtml_item.PrincipiaSearchSource()
print 'data'
print data
newdata = _convert_regex.sub('<\g<1>dtml-\g<2>>', data)
print 'newdata'
print newdata
print 'end'
dtml_item.manage_edit(newdata, title)




--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net

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




Re: [Zope-dev] Help needed: why is this DTML not working in zope 2 ?

2000-07-04 Thread Steve Alexander

Steve Alexander wrote:
> 
> Gilles Lavaux wrote:
> >
> > Argh!!!
> >
> > no, I made a typo error : it was .the syntax was good.
> > Ok, I will use the new syntax in my new sites. But for my old site, I will
> > not modify my ~500 dtml methods, except if there is a way to automate the
> > change.
> 
> You can write a pretty simple external method to walk your Zope object
> heirarchy looking for DTML Methods and DTML documents, then altering the
> syntax. Shouldn't take more than an hour to write and debug and test and
> document, if you've written stuff in Python before.
> 
> I'm off to a meeting for a few hours, but harrass me later and I'll send
> to the list a proof-of-concept external method to get you started.

An external method for automated change from old syntax to new syntax
follows.

 * Use at your own risk
 * No warranty implied or given
 * Use on a copy of your main Zope site
 * Back up data.fs three times before starting
 * Not guarenteed not to spin your processor and never terminate
 * Run on a copy of Zope in debug mode (-D) to see the print statements
 * Barely tested, if at all



import re

def convert_dtml(self):
"""Convert DTML Methods and DTML Documents from old syntax to 
   new syntax.
   Warning: recursive! Might just eat all your stack.
   Does not work on subclasses of DTML Method and DTML Document.
   Preserves normal comments, and handles instances of "-->" in 
   quotes.
"""
print 'convert_dtml: id=%s' % self.title_and_id()
if hasattr(self, 'meta_type') and \
  (self.meta_type == 'DTML Method' or \
   self.meta_type == 'DTML Document'):
convert(self)

# should this be "isPrincipiaFolderish"?
if hasattr(self, 'isAnObjectManager') and self.isAnObjectManager:
for v in self.objectValues():
v.convert_dtml()

_convert_regex = re.compile('')

def convert(dtml_item):
print 'converting...'
title = dtml_item.title
   # like document_src, but doesn't require RESPONSE
data = dtml_item.PrincipiaSearchSource()
print 'data'
print data
newdata = _convert_regex.sub('<\g<1>dtml-\g<2>>', data)
print 'newdata'
print newdata
print 'end'
dtml_item.manage_edit(newdata, title)




--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net

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




Re: [Zope-dev] ZCatalog lexicon bug is back?

2000-07-04 Thread Dieter Maurer

Chris Withers writes:
 > I seem to remember Michel being a little less than happy when he saw
 > that code.
 > 
 > Quite frankly, I still don't have much confidence in (Z)Catalog (still
 > no docs for all the cool stuff, dodgy bugs and few responses when
 > they're raised...) which is a shame since it's Zope full text searching
 > mechanism...
 > 
 > Chris
 > 
 > PS: If that doesn't get a response, I give up ;-)
I am very interested in ZCatalog.

I promiss that I will look into it, when I come to 2.2.
Currently, we are building a Zope 2.1.6 production site.
So, I still stay focused with 2.1.6.

My contributions to ZCatalog probably will not be ready
for 2.2 final, but, if necessary, I will provide patches
later.


Dieter

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




[Zope-dev] ZEO Replication/Cache

2000-07-04 Thread Monty Taylor

I just installed an instance of ZEO Storage Server with a client on the 
same machine and a client on a different machine. So far, it seems to 
work reasonably well, with one exception. None of the changes I've made 
on one client seem to propagate to the other client unless I restart the 
other client. This can't be the intended modus operendi. Have I missed 
something obvious, or is the proactive notification from server to client 
not implemented yet?

Monty

___
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] Help needed: why is this DTML not working in zope 2 ?

2000-07-04 Thread Steve Alexander

Gilles Lavaux wrote:
> 
> Argh!!!
> 
> no, I made a typo error : it was .the syntax was good.
> Ok, I will use the new syntax in my new sites. But for my old site, I will
> not modify my ~500 dtml methods, except if there is a way to automate the
> change.

You can write a pretty simple external method to walk your Zope object
heirarchy looking for DTML Methods and DTML documents, then altering the
syntax. Shouldn't take more than an hour to write and debug and test and
document, if you've written stuff in Python before.

I'm off to a meeting for a few hours, but harrass me later and I'll send
to the list a proof-of-concept external method to get you started.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net

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




[Zope-dev] Re: [Zope-PTK] Roles, Groups, Security and Group Membership

2000-07-04 Thread Monty Taylor



>> Original Message <<

On 7/4/00, 1:22:04 PM, Chris Withers <[EMAIL PROTECTED]> wrote regarding 
[Zope-PTK] Roles, Groups, Security and Group Membership:


> Monty Taylor wrote:
> > Am I making any sense at all? Does anyone see either a need for doing
> > this or a way to do it? If it requires changes to PTK core, would anyone
> > be interested in those, or should I throw them in my pile of dirty little
> > secrets that no one should really know exist?

> You're making perfect sense and I think it's a Zope problem partly, and
> also a PTK problem.

Good point. I think as ZEO becomes more prevelant and Zope wants to 
compete in the 
realm of big systems, group based interaction could serve to iron some 
things out.

> The Zope problem is that Zope security has no idea about Groups.
> As in Users/Members exist
> There may have roles
> They may also be members of Groups.
> Groups may also be members of Groups.
> Groups may also have roles associated with THEM.

> Other major security systems I can think of (LDAP, Unix, NT, Notes) all
> have this concept but Zope does not :(

> Should this part of the discussion be moved to zope-dev?

Probably so. I've forwarded the original email there and I'm sending this 
one to zope-dev.
Any comments from the zope-dev world?

Monty

___
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] Help needed: why is this DTML not working in zope 2 ?

2000-07-04 Thread Gilles Lavaux

Argh!!!

no, I made a typo error : it was .the syntax was good.
Ok, I will use the new syntax in my new sites. But for my old site, I will
not modify my ~500 dtml methods, except if there is a way to automate the
change.

Gilles

-Original Message-
From: Chris Withers <[EMAIL PROTECTED]>
To: Gilles Lavaux <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Tuesday, July 04, 2000 1:33 PM
Subject: Re: [Zope-dev] Help needed: why is this DTML not working in zope 2
?


>Gilles Lavaux wrote:
>> But I found something: In my 'PUBLIC_Doc' document I display image with a
>>  tag,  my problem disappear if I use
>> ,  someone can explain this??
>
>Are you sure the space after the # isn't your problem?
>
>I would STRONGLY recommend moving your code to the new syntax,
>especially if you are having problems.
>
>You should be aware that plans are afoot to remove the old syntax...
>
>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 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] Fwd: [Zope-PTK] Area based roles?

2000-07-04 Thread Monty Taylor



>> Original Message <<

On 7/4/00, 12:45:29 PM, Monty Taylor <[EMAIL PROTECTED]> wrote 
regarding [Zope-PTK] Area based roles?:


> Hi all. I've got an idea of something I'm trying to implement, and I'm
> wondering if the concept is of use to anyone else.

> I've got an Intranet up in PTK. (What a shock, as I'm posting here. :) )
> I'm slowly getting people to use it for internal collaboration, et al.
> But the main things people are wanting to do are internal to their own
> department, with some overlap. So you've got:

> +PTKRoot
>  |
>  +-Members
>  | +-John
>  | +-Sue
>  |
>  +-Marketing
>  +-Technology

> Say John is in Technology and Sue is in Marketing. What I want is for
> John to have Contributor rights in the context of Technology, and Sue in
> Marketing, i.e. John adds a News Item and Publishes it. It shows up in
> Technology but not Marketing.

> I thought about creating a Technolgy Item ("Release Notes") and a
> Marketing one ("Press Release") and then just having a catalog search on
> the meta-type of each in the appropriate folder's index_html and give
> them all Contributor. But that strikes me as unclean. It would be nice to
> have anyone be able to create a Press Release or Release Notes, but only
> have them published in their department's context, and merely pending in
> others.

> Am I making any sense at all? Does anyone see either a need for doing
> this or a way to do it? If it requires changes to PTK core, would anyone
> be interested in those, or should I throw them in my pile of dirty little
> secrets that no one should really know exist?

> Thanks,
> Monty

> ___
> Zope-PTK maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope-ptk

> See http://www.zope.org/Products/PTK/Tracker for bug reports and feature 
requests

___
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] Help needed: why is this DTML not working in zope 2 ?

2000-07-04 Thread Chris Withers

Gilles Lavaux wrote:
> But I found something: In my 'PUBLIC_Doc' document I display image with a
>  tag,  my problem disappear if I use
> ,  someone can explain this??

Are you sure the space after the # isn't your problem?

I would STRONGLY recommend moving your code to the new syntax,
especially if you are having problems.

You should be aware that plans are afoot to remove the old syntax...

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] Help needed: why is this DTML not working in zope 2 ?

2000-07-04 Thread Gilles Lavaux

Hello Lee

 doesn't change anything, same error.
(you are right, I can use the name directly , but I have some other piece of
code where I have to use the _[_['']] construction, so it has to work...)


But I found something: In my 'PUBLIC_Doc' document I display image with a
 tag,  my problem disappear if I use
,  someone can explain this??

Thanks anyway for the replies

Gilles
-Original Message-
From: LEE, Kwan Soo <[EMAIL PROTECTED]>
To: Gilles Lavaux <[EMAIL PROTECTED]>; [EMAIL PROTECTED]
<[EMAIL PROTECTED]>
Date: Tuesday, July 04, 2000 12:32 PM
Subject: Re: [Zope-dev] Help needed: why is this DTML not working in zope 2
?


>Not an answer, but a question.
>>   
>>   
>> ##
>> 
>>   
>> 
>You seems to "call" PUBLIC_Doc, then why don't you just 
>instead of the ?
>
>LEE Kwan Soo
>
>___
>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] Help needed: why is this DTML not working in zope 2 ?

2000-07-04 Thread LEE, Kwan Soo

Not an answer, but a question.
>   
>   
> ##
> 
>   
> 
You seems to "call" PUBLIC_Doc, then why don't you just 
instead of the ?

LEE Kwan Soo

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




[Zope-dev] Re: [Zope] site versions with zope

2000-07-04 Thread Diny van Gool

At 10:38 4-7-00 +0200, Nathalie Bernier wrote:
>Hello,
>
>I'd like to modify a live site, instead of working on a mirror copy. Could
>someone explain me, step by step, how sessions work?

Hi,

At http://www.zope.org/Documentation/Guides/ZCMG (Zope Content Manager's
Guide) you'll find a section called 'Working with versions'. May be this is
what you are looking for.

Diny.



DIVA
Faculty of Veterinary Medicine
The Netherlands
http://www.vet.uu.nl

___
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] Help needed: why is this DTML not working in zope 2 ?

2000-07-04 Thread Chris Withers

You could try moving stuff to the new dtml style for starters:
 and the like.

That might help, if not let us know..

cheers,

Chris

Gilles Lavaux wrote:
> 
> Hello,
> 
> I am a little bit disappointed not getting any echo from my previous
> question, so I report it.
> Maybe my dtml is wrong for zope2, but I would appreciate to have some
> explanation from more experienced peoples.
> If I can not find a solution, we will have to keep our zope1 production
> server, and it will be the end of the Zope story in my company :-(
> 
> So my question was :
> 
> I want to display the content of a site starting from a folder called 'Site'
> with a tree tag.
> I want also to render immediately inside the tree the documents with an
> ID=='PUBLIC_Doc'.
> In Zope 1.x I have a working dtml method like this:
> 
> 
> 
>   
>   
> ##
> 
>   
> 
>   
> 
> ##
>   
> 
> 
> 
> Unfortunatly for me , with zope 2.1.6 i get an error when I try to render
> the 'PUBLIC_Doc' document:
> .
> PUBLIC_Doc !#
> Error type:AttributeError
> Error Message:
> Error Message:__call__
> Error TB:Traceback (innermost last): File
> "/usr/lib/python1.5/site-packages/DocumentTemplate/DT_Try.py", line 221, in
> render_try_except result = render_blocks(self.section, md) File
> "/usr/lib/python1.5/site-packages/DocumentTemplate/DT_Util.py", line 335, in
> eval return eval(code,globals,d) File "", line 0, in ? File
> "/usr/lib/python1.5/site-packages/DocumentTemplate/DT_Util.py", line 161, in
> careful_getitem v=mapping[key] File
> "/usr/share/zope/lib/python/OFS/DTMLMethod.py", line 146, in __call__
> r=apply(HTML.__call__, (self, client, REQUEST), kw) File
> "/usr/lib/python1.5/site-packages/DocumentTemplate/DT_String.py", line 502,
> in __call__ try: return render_blocks(self._v_blocks, md) AttributeError:
> __call__
> 
> has someone a solution ??
> 
> Thanks,
> 
> Gilles
> 
> ___
> 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] Help needed: why is this DTML not working in zope 2 ?

2000-07-04 Thread Gilles Lavaux

Hello,

I am a little bit disappointed not getting any echo from my previous
question, so I report it.
Maybe my dtml is wrong for zope2, but I would appreciate to have some
explanation from more experienced peoples.
If I can not find a solution, we will have to keep our zope1 production
server, and it will be the end of the Zope story in my company :-(

So my question was :

I want to display the content of a site starting from a folder called 'Site'
with a tree tag.
I want also to render immediately inside the tree the documents with an
ID=='PUBLIC_Doc'.
In Zope 1.x I have a working dtml method like this:



  
  
##

  

  

##
  



Unfortunatly for me , with zope 2.1.6 i get an error when I try to render
the 'PUBLIC_Doc' document:
.
PUBLIC_Doc !#
Error type:AttributeError
Error Message:
Error Message:__call__
Error TB:Traceback (innermost last): File
"/usr/lib/python1.5/site-packages/DocumentTemplate/DT_Try.py", line 221, in
render_try_except result = render_blocks(self.section, md) File
"/usr/lib/python1.5/site-packages/DocumentTemplate/DT_Util.py", line 335, in
eval return eval(code,globals,d) File "", line 0, in ? File
"/usr/lib/python1.5/site-packages/DocumentTemplate/DT_Util.py", line 161, in
careful_getitem v=mapping[key] File
"/usr/share/zope/lib/python/OFS/DTMLMethod.py", line 146, in __call__
r=apply(HTML.__call__, (self, client, REQUEST), kw) File
"/usr/lib/python1.5/site-packages/DocumentTemplate/DT_String.py", line 502,
in __call__ try: return render_blocks(self._v_blocks, md) AttributeError:
__call__

has someone a solution ??

Thanks,

Gilles



___
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] site versions with zope

2000-07-04 Thread Nathalie Bernier

Hello,

I'd like to modify a live site, instead of working on a mirror copy. Could
someone explain me, step by step, how sessions work?
Thanks

Nathalie Bernier
*
Développeur web

multiThématiques
Centre Jean Monet
Longlaville
54400 LONGWY

http://multithematiques.com
Chaînes thématiques sur câble et satellite
*




___
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] bug in zpatterns-0.4 ?

2000-07-04 Thread Jephte CLAIN

"Phillip J. Eby" wrote:
> Nope.  The two levels of methods (get/retrieve and new/create) are there to
> seperate Rack-level concerns from implementation concerns.  getItem() and
> newItem() handle maintenance of Rack-level invariants such as the retrieval
> cache, while retrieveItem() and createItem() deal with object-level
> invariants.  If you called retrieveItem() instead of getItem(), the code
> would bypass the rack-level invariants managed by getItem(), which would
> mean in this case that the per-transaction cache would be bypassed.
yes, this is a bit more clear to me now.

> Hm.  Seems to me that you should just use two GAP's, one for each DB table,
> each using "self.id[0]" and "self.id[1]" respectively to determine their
> primary keys.
(cough) why didn't I think about it???

> >Also, my racks
> >are specialized to have a searchResults method, and a editItem method
> >(until I can find the time to write a decent SQL Attribute setter
> >provider)
> 
> A reasonable approach.  Although, in the case of SQL attribute setting, see
> my other e-mail from this evening about the use of Generic Triggers to do
> SQL attribute setting.
> 
> >btw, the genericattributeprovider has saved me a great deal of time.
> >thanks very much!
> 
> No problem.  Did you ever try re-casting your CatalogAwareness replacement
> to use GenericTrigger instead of a specific Agent plug-in?
I did not have the time to do so. I still stick to Zope-2.1.6 for now,
and I was afraid of the issues with transaction commit order. and the
motto is 'if it ain't break, don't fix it'. I have a contract to upgrade
the product in august though. I will look at it at that time.

regards,
[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] bug in zpatterns-0.4 ?

2000-07-04 Thread Phillip J. Eby

At 10:33 AM 7/4/00 +0400, Jephte CLAIN wrote:
>
>Back to my first question: is it intended that Rack.createItem (a IMHO
>low level method) calls Rack.getItem (a IMHO higher level method) to
>check the existence of the item?

Yes.  It is perfectly valid OO design (and common framework-building
practice) for a private method to call a public one, and that is all that
is taking place here.


> Shouldn't it be Rack.retrieveItem
>instead? That's why I asked the question in the first place.

Nope.  The two levels of methods (get/retrieve and new/create) are there to
seperate Rack-level concerns from implementation concerns.  getItem() and
newItem() handle maintenance of Rack-level invariants such as the retrieval
cache, while retrieveItem() and createItem() deal with object-level
invariants.  If you called retrieveItem() instead of getItem(), the code
would bypass the rack-level invariants managed by getItem(), which would
mean in this case that the per-transaction cache would be bypassed.


>About my applications now. The primary keys in the SQL database may be
>integers, or tuple of integers, or strings (depending on the project, I
>have several to deal with right now). I want to merge results from
>several databases from a single rack.
>For example I have a Site table (with SiteKey as the primary key) and a
>Subdivision table (with SubdivisionKey as the primary key) which I want
>to merge into the LocationRack (with the key being the tuple (SiteKey,
>SubdivisionKey))
>This is why I mess with the implementation of the rack.

Hm.  Seems to me that you should just use two GAP's, one for each DB table,
each using "self.id[0]" and "self.id[1]" respectively to determine their
primary keys.


>Also, my racks
>are specialized to have a searchResults method, and a editItem method
>(until I can find the time to write a decent SQL Attribute setter
>provider)

A reasonable approach.  Although, in the case of SQL attribute setting, see
my other e-mail from this evening about the use of Generic Triggers to do
SQL attribute setting.


>btw, the genericattributeprovider has saved me a great deal of time.
>thanks very much!

No problem.  Did you ever try re-casting your CatalogAwareness replacement
to use GenericTrigger instead of a specific Agent plug-in?


___
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 lexicon bug is back?

2000-07-04 Thread Chris Withers

"R. David Murray" wrote:
> This is distressing.  I'm building a new shopping cart site, and
> doing it under 2.2.0 CVS (as of 7/1).  I've added four items.
> If I search for certain keywords that I know only appear on one
> item, I get two items returned.  The other item has no trace of
> the specified keyword.  This sounds very much like the bug that
> Michel Pelletier found and fixed in Lexicon.py a while back.  As
> someone on the list pointed out, Michel's fix was overwritten in
> the CVS by another version of the routine, which it *looked* as if
> would also fix the bug.  This is the code I now see in my image.

I seem to remember Michel being a little less than happy when he saw
that code.

Quite frankly, I still don't have much confidence in (Z)Catalog (still
no docs for all the cool stuff, dodgy bugs and few responses when
they're raised...) which is a shame since it's Zope full text searching
mechanism...

Chris

PS: If that doesn't get a response, I give up ;-)

___
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 Specialist Question

2000-07-04 Thread Phillip J. Eby

At 11:54 AM 7/3/00 +0100, Chris Withers wrote:
>Just a quickie:
>
>If, as the the ZPatterns Wiki states, 'Specialists are not classes',
>then why is there a 'Specialist' python class in the ZPatterns
>distribution?
>

Specialists are instances of the class "Specialist".  They are not
themselves classes.  The reason for emphasizing that point is that it is a
common misconception of people beginning to use the ZPatterns design
approach - they conflate or confuse specialists with the class of the
things which they intend to use the specialist to gain access to.  In other
words, they assume that a specialist called "Customers" would always
manipulate "Customer" instances, when in fact it might manipulate
"SkyDiver" instances.  Most of the point of having a specialist is to have
a binding point which allows you to decouple your intended use of a thing,
from the specific implementation of it.  If one misses this point, one will
be blind to a wide variety of ZPatterns' useful applications, and at the
same time likely to ask why both Racks and Specialists are needed.  They
are both needed because the Specialist deals with a particular
problem-domain aspect of a thing, and the Rack deals with implementation
aspects.


___
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: DropZone example

2000-07-04 Thread Phillip J. Eby

At 05:26 PM 6/28/00 +0100, Steve Alexander wrote:
>
>The suggested specialists in the Accounting framework are:
>
>  Invoices
>  Orders
>  Customers
>  Products
>
>What I'm finding is that these are just the White-box specialists. A
>clean design would seem to want all the specialists above, plus at least
>one Black-box specialist to do the "heavy lifting. Let's call it the
>"AccountingProcessor" specialist.

Keep in mind that a Specialist doesn't just "store" a bunch of objects, it
also provides *methods for dealing with sets of objects*.  So an Invoices
specialist could usefully contain a wide variety of reporting methods, for
example.  Similarly, the Customers specialist might have a method to post
balances forward on all customer accounts whose statement cycle is in a
certain date range.  These are all "heavy lifting" from an accounting point
of view, but perfectly valid to have in the white-box specialists.
White-box doesn't mean that there's no implementation; it just means that
the implementation is intended to be extensible or integratable by someone
other than the framework's original developer.


>Now, if I had a third-party accounts package (something by Sage
>perhaps), I could make the AccountingProcessor specialist expose various
>functions to the four other White-box specialists. It would implement
>these by making equivalent calls on the underlying accounting package.
>
>I could also swap the heavy-lifting portion of my framework by swapping
>the black-box AccountingProcessor specialist for one that talks to some

>software by Quicken, or perhaps some software that is written in Python
>as a conventional Zope product.

That's all quite true, but it would probably be simplest to do such a thing
using AttributeProviders and SheetProviders in the white-box specialists.
It does seem reasonable to have those providers talk to an
AccountingProcessor object if you want to make your framework talk to
different back-ends, but I think it is misleading and incorrect to call
AccountingProcessor a specialist, as it's not an application-level service
object, but a private implementation helper.

Interestingly, you've just given me what may be a motivating example for
using Shane Hathaway's DatabaseAPI in conjunction with ZPatterns, assuming
of course that I've correctly understood his most recent explanation of the
DatabaseAPI product.


>The same goes for the Resource Scheduling framework. We have some
>White-box specialists, ripe for customisation:
>
>  Resources
>  Reservations
>  ResourceUsers
>
>And then for the heavy-lifting we have the black-box ResourceScheduler
>specialist. Again, this might be a Zope Python Product, or it might be
>an interface to some application written on top of Microsoft Exchange.

Again, look to what these specialist would do besides look up objects.  For
example, utilization or load-balancing reports.  Generating bills for
usage.  Generating calendars for individual resources.  Checking for
conflicts.  Etc.


>Are specialists intended to be placed inside other specialists, as
>"contents"? 

You *can* do this, but I've not yet encountered a real-life situation where
I *would* do this.  (Mike has given some examples that suggest it might be
useful under some circumstances, however.)


>So in this case, would the white-box specialists live inside
>the black-box specialist -- so they become the customisable aspects of
>the overall framework? Or would both black-box and white-box specialists
>live inside an uber-specialist?

If anything, the black box should be inside the white.  Otherwise, you are
creating confusion between heaven and earth.  :)  Seriously, the white
boxes are the parts you will reference in URL's most often, so why have
/AccountingProcessor/Invoices/ when you can just have /Invoices/?  If you
have to share a black box among white boxes, acquire it.  If your "root"
gets too messy, then make an "Accounting" folder and put Invoices,
AccountingProcessor, and the rest inside of 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 )