Re: [Zope-dev] Announce: ZScheduler alpha Version 0.0.7

2000-07-27 Thread Loren Stafford

The problem noted below with the Trigger tab occurs only when Zope is
limited to a single thread. The problem is due to contention for the single
thread. The workaround is to avoid using the Trigger tab on single threaded
Zope's. Or change ZEvent.py like this:

  def manage_triggerZEvent(self, client=None, REQUEST=None, RESPONSE=None,
**kw):
"""For use by the Trigger tab on ZEvent management page.
Use for testing the ZEvent in a context that mimics that of Dispatcher.
"""
aurl=REQUEST['URL1']
furl=string.join((aurl, 'trigger'), '/')
RESPONSE.redirect(furl)

With this fix, the product is fully functional, as far as I know, tho it
remains an alpha product simply because it hasn't received a thorough
shakedown.

I'll have a new release out soon with this fix and other changes.

-- Loren



> ZScheduler Version 0.0.7 Date: 2000/07/02
>
>  1. Fixed a bug that caused ZEvents to execute in the wrong context.
>
>  2. If the action method of a ZEvent raises an error, a traceback is
written
> in the log.
>
>  3. Added a Trigger tab to the management screen for ZEvents which fires
the
> event in the same context that the Dispatcher does, but without regard to
> the schedule. This helps immensely in debugging the DTML in the ZEvent.
>
> I've tested on:
>Win98 Zope 2.2.0b3
>Solaris 2.6 Zope 2.1.4
>Linux ?.? Zope 2.1.3
>
> On the Linux configuration (my account at CodeIt Computing), most features
> work; however, the new Trigger tab does not behave correctly. Though the
> ZEvent method eventually executes correctly, it doesn't return anything to
> the client and Zope seems to lock up temporarily -- that is, it doesn't
> respond to other client requests. I don't have a Linux development system
> with which to track this down. Any help would be appreciated.
>
[...snip...]
>
> Otherwise, ZScheduler is looking good. Let me know how it works for you.
>
> http://www.zope.org/Members/lstaffor/ZScheduler
>
> -- Thanks
> -- Loren
>



___
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] PROPOSAL: Splitting ZPatterns into two products

2000-07-27 Thread Phillip J. Eby

Many people have suggested splitting out the PlugIns part of ZPatterns as a
seperate product for general Zope use.  In addition to this, it is becoming
clearer to me as I work on docs, etc., that there really is only one thing
left in ZPatterns after you take out PlugIns, and that is DataSkins.
(Pretty much everything else in ZPatterns only has meaning in relation to
DataSkins.)

So, I am thinking perhaps I should split ZPatterns into two products:
PlugIns and DataSkins.  The DataSkins product would require the PlugIns
product.  LoginManager would require both.  For backward compatibility,
there would need to be a "final release" of ZPatterns which contained stubs
to load in classes from their new locations, so that existing objects
stored in ZODB's would not be "broken".  Newly created objects, of course,
would refer to the new products automatically.

The term "ZPatterns" would then go away, which is just as well because it
doesn't really mean anything, anyway.  :)

Please let me know if you have any comments or questions on this.

  _
   _/__)
___/


___
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] Re: [Zope-PTK] ZPatterns Documentation

2000-07-27 Thread Phillip J. Eby

At 10:58 PM 7/27/00 +0100, Steve Alexander wrote:
>"Phillip J. Eby" wrote:
>> 
>> Just comment, please, preferably in e-mail via Zope-dev.
>> Thanks.
>
>Generally very clear and helpful. Tomorrow, I'll try it out on someone
>who hasn't been looking at ZPatterns a great deal, and see what she gets
>from it.

Thanks.


>A few suggestions. I feel sad that these seem to come across as
>criticisms. Really, I'm very glad that you've found some time to work on
>more accessible documentation.
>

Hm.  Well, your comments have convinced me that 1) I'm not really qualified
to write good beginner docs, and 2) I shouldn't try to combine a design
document with beginner documentation in any event.  :)

Probably the doc needs to be split into seperately focused documents for
"What are DataSkins (for)?" and "How do they work?".  I was trying to
capture all the things that happen in the interactions between DataSkins
and their primary collaborators in order to have that documentation later.
Unfortunately, a lot of that "how" detail is extraneous to the "how do I"
and "why" questions.

Probably as written, the doc is more useful as an introduction to ZPatterns
innards than it is as an intro to ZPatterns itself.


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




[Zope-dev] ZPatterns 0.4.1snap

2000-07-27 Thread Bill Anderson

"Phillip J. Eby" wrote:
> 
> At 08:06 PM 7/27/00 +0400, Jephte CLAIN wrote:
> >By the way, besides new features like skinscript and proxy settings, did
> >you fix any bugs from 0.4.0a5 in 0.4.1a5 that would make me have to
> >upgrade my current ZPatterns?
> >
> 
> IIRC, nothing that would affect you on 2.1.6.  I vaguely recall some fixes
> for 2.2 stuff, but I think they were all out in 0.4.0a5 anyway.


Just a note:
I sent an email earlier to Phillip about this, but it may be a good isea to get it out
here too.

I used a fresh install of zope, and the new ZPatterns snap for testing. 
The latest LM (0.8.7a1) does not seem compatible. It errors out complaining about not
being able to import stuff, Like Rack (IIRC), and one other.



--
Do not meddle in the affairs of sysadmins, for they are easy to annoy,
and have the root password.

___
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] ZPatterns Documentation

2000-07-27 Thread Steve Alexander

"Phillip J. Eby" wrote:
> 
> Just comment, please, preferably in e-mail via Zope-dev.
> Thanks.

Generally very clear and helpful. Tomorrow, I'll try it out on someone
who hasn't been looking at ZPatterns a great deal, and see what she gets
from it.

A few suggestions. I feel sad that these seem to come across as
criticisms. Really, I'm very glad that you've found some time to work on
more accessible documentation.


You don't seem to say anything like "You make your own domain-specific
classes derive from DataSkin. These can be ZClasses or Python classes".
This may be obvious, but I think it is an important part of how data
skins are intended to be used.

"""A data manager helps data skins by:

Providing them access to their Data Plug-ins, including propagating
transaction events and DataManagementEvents to the Data Plug-ins"""

Still very jagon-filled. That's ok, if it is accompanied by some
real-world explanation.
Perhaps add something like "You can use Data plug-ins for indexing
Dataskins in a catalog, or in many catalogs, or [another different
familiar example]".

"""Keeping track of their canonical or "normalized" forms for
acquisition management"""

You almost lost me there :-)

"""Or, if a data skin is retrieved from any other Zope object, its
__of__ method will try to find a Customizer or "Folder With
Customization Support" in the acquisition path, then ask it for a data
manager to bind with. Once this is done, the skin remains bound to that
manager until the next such occurrence."""

Pretty clear, except the end -- next what occurrence? The next time the
data skin is retrieved from a Zope object? So, every time a dataskin is
retrieved from a zope object (that isn't a Rack), it uses acquisition to
look for a customizer.

--
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] ZPatterns Documentation

2000-07-27 Thread Phillip J. Eby

Despite the implications of the bait-and-switch subject line, I have not
yet written any substantial amounts of documentation.  I have, however,
written this:


http://www.zope.org/Members/pje/Wikis/ZPatterns/DataSkinsOverview

DataSkins (formerly known as RackMountables) are central to the operation
of ZPatterns, and I decided to take a whack at explaining them at an
introductory (I hope) level, complete with a diagram.

Could anyone who gets a chance please give me some feedback?  I'd like to
know if this is the kind of stuff that people would like to see more of, or
whether it's too much detail, not enough, right questions, wrong
questions...  Just comment, please, preferably in e-mail via Zope-dev.
Thanks.

  _
   _/__)
___/


___
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] Interaction between new (2.2) ZCatalog and Renderable

2000-07-27 Thread Jeff Sasmor

Hi Zdevs,

I posted a message to [EMAIL PROTECTED] and then later
figured out the problem and now feel that the issue
belongs in Zope-Dev, so here it goes.

Submitted for your approval...


I think that I have found an interaction between changes made in
manage_addZCatalog (lib/python/Products/ZCatalog/ZCatalog/py)
and the Renderable ZClass product.  It's also possible that this
interaction will affect other things as well.

The new version of method 'manage_addZCatalog' has calls to str()
near its beginning.  The older (2.1.6) does not.  The Renderable
product overrides str to do its work.  This gets _very_ messy
when you initialize a catalog in the xxx_add dtml method for a
ZClass (that is, if you create an instance of the ZClass and the _add
method instantiates a ZCatalog instance.) and the ZClass itself is
renderable.

The manage_addZCatalog method ends up invoking the str() method
that's in the Renderable product.  This code attempts to publish(?) the
a dtml method named render (this is what it does by default).
In my case, the dtml method tries to query the created ZCatalog instance.

This does not work! since the ZC instance isn't actually created since the
_add method has not completed(?).
So the render dtml method borks with an attribute error.
Correct me if I have reverse-engineered these conclusions from looking
at the traceback and made a logic error

As one can see from the traceback attached to the end of this email,
the manage_add methof (I put X near where this mess begins)
warps into the render dtml method at line 112 of manage_addZCatalog,
which is the first str() (can be seen in the src).  This ends up in
an External Method, rendercal.py (last line of traceback).  If you were
to look there you'd se that it's doing a Catalog.searchResults().

**SO** it appears as if you cannot instantiate a ZCatalog in the _add
dtml method of a ZClass IFF the ZClass inherits from Renderable AND
if the render dtml method of the class (required by Renderable) uses
the ZCatalog.

This interaction may very well affect other products as well. But right now
my brain hurts.  Excuse me if someone else reported this, but I haven't
seen mention of it so far.

This should be easy to reproduce.  On a 2.2 system that has the Renderable
ZClass product installed, install EventFolder (it's on Zope.org, there's a .zexp
and some External Methods in the tgz file, just untar it in the Zope root and
copy the .zexp to the import dir and import it).  Try to create an
instance and you should get this error.

It seems to me the only solution is to recreate the class without the
Renderable inheritance.  Not a big deal to lose  But what other
schizoZopia is waiting in the future.


Jeff Sasmor
[EMAIL PROTECTED]


Traceback (innermost last):
  File /usr/local/Zope220/lib/python/ZPublisher/Publish.py, line 222, in publish_module
  File /usr/local/Zope220/lib/python/ZPublisher/Publish.py, line 187, in publish
  File /usr/local/Zope220/lib/python/Zope/__init__.py, line 221, in 
zpublisher_exception_hook
(Object: RoleManager)
  File /usr/local/Zope220/lib/python/ZPublisher/Publish.py, line 171, in publish
  File /usr/local/Zope220/lib/python/ZPublisher/mapply.py, line 160, in mapply
(Object: EventFolder_add)
  File /usr/local/Zope220/lib/python/ZPublisher/Publish.py, line 112, in call_object
(Object: EventFolder_add)
  File /usr/local/Zope220/lib/python/OFS/DTMLMethod.py, line 167, in __call__
(Object: EventFolder_add)
  File /usr/local/Zope220/lib/python/DocumentTemplate/DT_String.py, line 502, in 
__call__
(Object: EventFolder_add)
  File /usr/local/Zope220/lib/python/DocumentTemplate/DT_Let.py, line 147, in render
(Object: folder="EventFolder.createInObjectManager(REQUEST['id'], REQUEST)")
  File /usr/local/Zope220/lib/python/DocumentTemplate/DT_With.py, line 146, in render
(Object: folder)
  File /usr/local/Zope220/lib/python/DocumentTemplate/DT_Util.py, line 337, in eval
(Object: 
manage_addProduct['ZCatalog'].manage_addZCatalog(this(),'Catalog','EventCatalog' ))
(Info: this)
  File , line 0, in ?
 it begins
  File /usr/local/Zope220/lib/python/Products/ZCatalog/ZCatalog.py, line 112, in 
manage_addZCatalog
how did we get here 
  File /usr/local/Zope220/lib/python/Products/Renderable/Renderable.py, line 17, in 
__str__
(Object: Renderable)
  File /usr/local/Zope220/lib/python/OFS/DTMLMethod.py, line 167, in __call__
(Object: render)
  File /usr/local/Zope220/lib/python/DocumentTemplate/DT_String.py, line 502, in 
__call__
(Object: render)
  File /usr/local/Zope220/lib/python/DocumentTemplate/DT_With.py, line 146, in render
(Object: ZopeTime)
  File /usr/local/Zope220/lib/python/DocumentTemplate/DT_Let.py, line 147, in render
(Object: tdate="'%s/%s/1' % (tyear,tmonth) "
  this_month="'%s/%s' % (tyear,tmonth) "
  ddate="_.DateTime(tdate)")
  File /usr/local/Zope220/lib/python/DocumentTemplate/DT_Let.py, line 14

Re: [Zope-dev] Re: zpatterns-0.4.0a5: problemwithunregistering transactionals

2000-07-27 Thread Phillip J. Eby

At 08:06 PM 7/27/00 +0400, Jephte CLAIN wrote:
>By the way, besides new features like skinscript and proxy settings, did
>you fix any bugs from 0.4.0a5 in 0.4.1a5 that would make me have to
>upgrade my current ZPatterns?
>

IIRC, nothing that would affect you on 2.1.6.  I vaguely recall some fixes
for 2.2 stuff, but I think they were all out in 0.4.0a5 anyway.


___
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] Re: [Zope] Bi-directional update of Data.fs

2000-07-27 Thread Bill Anderson

Chris Withers wrote:
> 
> Steve Alexander wrote:
> > Don't see why not. When an object is changed, the new object is just
> > appended to the end of Data.fs. Unless you use undo, or you pack the
> > Data.fs.
> 
> You missed the problem ;-)
> 
> Technically, there is no problem...
> 
> Logically, what happens if one user updates and object on one machien
> and another user on another machines, after which you merge the
> data.fs's?

That's what the 'your version is canonical' qualifier handles :-)



--
Do not meddle in the affairs of sysadmins, for they are easy to annoy,
and have the root password.

___
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] Re: zpatterns-0.4.0a5: problemwithunregistering transactionals

2000-07-27 Thread Jephte CLAIN

> Okay, that makes sense.  2.1.6 has a weirdness in the ZPublisher exception
> hook that begins a new transaction instead of aborting the old one cleanly,
I did notice this.

> and that ultimately causes the objects to get aborted twice.  I reported
> this a month or two ago and it got fixed in 2.2.
rahhh, is Zope 2.2 the only way to go? :-)

> You're going to have to
> go with your patch, though, because there's not a simple patch you can
> apply to 2.1.6 to fix the problem in Zope itself.  Unfortunately, it is
> hard for me to tell whether your patch has any other repercussions.  :(  I
> will try to review the structure of my Transactional class and see if there
> are any side effects (besides the one you've found) of an object being
> aborted twice.
Thanks a lot.
By the way, besides new features like skinscript and proxy settings, did
you fix any bugs from 0.4.0a5 in 0.4.1a5 that would make me have to
upgrade my current ZPatterns?

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] Re: zpatterns-0.4.0a5: problem withunregistering transactionals

2000-07-27 Thread Phillip J. Eby

At 07:12 PM 7/27/00 +0400, Jephte CLAIN wrote:
>"Phillip J. Eby" a écrit :
>> 
>> Question...  Are you on 2.1.x or 2.2?
>I'm still on 2.1.6. I cannot afford a migration of my product now since
>it is still in developpement and my customer wants it to work as soon as
>possible.

Okay, that makes sense.  2.1.6 has a weirdness in the ZPublisher exception
hook that begins a new transaction instead of aborting the old one cleanly,
and that ultimately causes the objects to get aborted twice.  I reported
this a month or two ago and it got fixed in 2.2.  You're going to have to
go with your patch, though, because there's not a simple patch you can
apply to 2.1.6 to fix the problem in Zope itself.  Unfortunately, it is
hard for me to tell whether your patch has any other repercussions.  :(  I
will try to review the structure of my Transactional class and see if there
are any side effects (besides the one you've found) of an object being
aborted twice.


>> Also, in your example, tpc_entered
>> is not set because tpc_entered is only true if the transaction commit
>> process (tpc = two-phase commit) has been started.
>I thought that tpc_entered would go back to 0 when the transaction is
>over. It is clear that I don't know how the transaction machinery really
>works.

It's probably because of the double-abort weirdness.  :(


___
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] Quickie on ZPatterns ... I promise :)

2000-07-27 Thread Phillip J. Eby

At 09:15 AM 7/27/00 +0100, Steve Alexander wrote:
>Bill Anderson wrote:
>> 
>> Let's say I have an object I will store in a rack. Let us say I want
this object to be
>> cataloged in a ZCatalog. Any caveats I need to know about
>> ..such as "Don't do that!" ?
>> ?;^)=
>
>Make one of the object's base-classes DataSkin.
>
>Don't make it CatalogAware.
>
>Use triggers to index and unindex the object from a catalog. You'll
>probably want to store the catalog in Specialist.
>
>By the way, Phillip Eby has released a new development snapshot:
>
> 
>http://www.zope.org/Members/pje/ZPatterns/ZPatterns-0-4-1snap1.tgz/view
>
>I'll be trying it later today.
>

FYI, the snapshot really only adds proxy roles support for generic
providers/triggers, and adds a first-cut version of SkinScript.  If you're
adventurous, you can look at SkinScript/Compiler.py and have a look at the
grammar in order to figure out what the language does.  So far I've
successfully tested a SkinScript method that does the work of four
GenericAttributeProviders and two GenericTriggers, just by using the
appropriate statements.  Here's a SkinScript snippet you might use for
CatalogAwareness:

WHEN OBJECT ADDED 
CALL somecatalog.catalog_object(self)

WHEN OBJECT CHANGED
CALL somecatalog.recatalog_object(self)

WHEN OBJECT DELETED
CALL somecatalog.uncatalog_object(self)

(Replace the incorrect catalog API calls with ones that are correct...  I'm
sure I'm missing some parameters and probably getting the names wrong...)

Note that "somecatalog" must be in the acquisition context of the
SkinScript method itself.  If you want to use a catalog in the context of
the DataSkin, you need to say "self.somecatalog...".

Some other SkinScript snippets:

# Store attribs persistently - replaces 
# Persistent Internal Attribute Provider
STORE attrib1,attrib2 IN SELF

# Computed attributes
WITH SELF COMPUTE 
  attrib1=attrib2+attrib3,
  attrib4=attrib6*10

# Generic attrib provider
WITH (SomeSQLMethod(key=self.id) or [NOT_FOUND])[0] COMPUTE
  field1, field2, somefield=field3+field4,
  fancy_id = '*(%s%s)%' % (otherfield,self.id)

# Generic trigger
WHEN OBJECT ADDED,CHANGED,DELETED
CALL someexpr(self.id)
SAVING foo,bar, baz=spam, widget=diddly+id

# Attribute provider
STORE attr1,attr2
USING somefunc(self)
SAVING attr1,attr2

# Conditional attrib provider
WHEN OBJECT ADDED
STORE attr2
USING otherfunc(self)

That about covers it for what's implemented so far.  The goal is to
ultimately replace the majority of providers and triggers with SkinScript.
But it will still be possible to write and use custom plug-ins that provide
attributes or handle events in other ways.  But SkinScript will be quite
handy for most things.


___
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] Re: zpatterns-0.4.0a5: problem withunregistering transactionals

2000-07-27 Thread Jephte CLAIN

"Phillip J. Eby" a écrit :
> 
> Question...  Are you on 2.1.x or 2.2?
I'm still on 2.1.6. I cannot afford a migration of my product now since
it is still in developpement and my customer wants it to work as soon as
possible.


> Also, in your example, tpc_entered
> is not set because tpc_entered is only true if the transaction commit
> process (tpc = two-phase commit) has been started.
I thought that tpc_entered would go back to 0 when the transaction is
over. It is clear that I don't know how the transaction machinery really
works.

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] Re: zpatterns-0.4.0a5: problem with unregistering transactionals

2000-07-27 Thread Phillip J. Eby

Question...  Are you on 2.1.x or 2.2?  Also, in your example, tpc_entered
is not set because tpc_entered is only true if the transaction commit
process (tpc = two-phase commit) has been started.

At 11:53 AM 7/27/00 +0400, Jephte CLAIN wrote:
>
>Ok, so ZPatterns.Transactional._unregistered method is called twice for
>a ZPatterns.Transactional object when an exception is raised and the
>ZPatterns.Transactional object has not be freed: once from the
>ZODB.Transaction.abort method, once from the ZODB.Transaction.__del__
>method which call abort if objects to be aborted remain in the zodb
>transaction aware object
>The call is made twice for DataSkins and for TransientMapping (as far as
>I know, they are at the moment the only Transactional objects in
>zpatterns)
>
>for example, try this DTML code in a specialist:
>
>
>
>
>
>
>without my patch, Zope should display 'uncatched exceptions in
>Transation object'
>
>so what now? I'm lost. Is this normal or not? Is my patch sufficient
>(ignore attempts to abort the object twice by trapping exceptions in
>_unregister). What about Transactional.abort which check for
>tpc_entered? Why is tpc_entered never set to 0?
>


___
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] Visual studio compilation ....

2000-07-27 Thread * Lucky

I'm trying to tweak Splitter.c in order handle french
specific characters. It seems to work fine with gcc under
Linux but it doesn't work with MS Visual C. Even compiling
the original source code under windows results in a
different module behaviour.
   Which compiler is required to compile Splitter.c under
Windows ?
   If any, could you send me the project file ?


___
Vendez tout... aux enchères - http://www.caraplazza.com




[Zope-dev] [Zope] App isolation

2000-07-27 Thread Jacques Exelrud

Not sure if this list is the best place to put such question but here it
is...
I need to develop what would be a product if only Zope was the target.
As it´s not I was thinking what could I do to not need to build such app
twice:
I came to 2 options both involving building a server of some kind and
using Python to connect to this server.

1st
Build the app as a COM server (the target OS is Windows) and using
Python support build an interface to this COM server as a Zope
product

2nd
Build the app as a XMLRPC server and using Python support build an
interface to this XMLRPC server

The second options is better because I´m not attached to any platform
but, as I said, that´s not an issue right now.

Good options would be having a JVM running "inside" Zope so that jave
objects could be accessed by it or SOAP Zope support beeing ready...

Any sugestions on any of those or a 3rd option ?

Thanks in advance,
Jacques


___
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] Bi-directional update of Data.fs

2000-07-27 Thread Steve Alexander

Chris Withers wrote:
> 
> > Use Jim's new conflict resolution
> > algorithm to try to settle conflicts.
> 
> Urm? First I heard of this and it sounds like just the right sort of
> thing...
> 
> Where can I find out more?

http://www.zope.org/Members/jim/ZODB/ApplicationLevelConflictResolution

See also:

http://www.zope.org/Members/jim/ZODB/ReverseDiffVersioning

--
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] Bi-directional update of Data.fs

2000-07-27 Thread Chris Withers

Steve Alexander wrote:
> What does Lotus Notes offer to do if you get such a conflict?

Save both versions and ask the user to delete the one which isn't
needed, or merge the changes...

> Use Jim's new conflict resolution
> algorithm to try to settle conflicts. 

Urm? First I heard of this and it sounds like just the right sort of
thing...

Where can I find out more?

> If a conflict can't be settled,
> ask interactively, or apply some sort of policy (like "chris always
> wins" for example) and log the lost changes.

Heh... I like the sound of that ;-)

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] ZMySQLDA - errors during compilation...

2000-07-27 Thread Holger Lehmann

This is a confirmation,

I did the same stuff to get the module to compile :-)

- Holger

Am Don, 27 Jul 2000 schrieb Phil Harris:
> Jon,
> 
> If I remember correctly all you have to do is remove the & from the lines in
> question.
> 
> So on line 384 of MySQLModule.c find the & and remove it, just the &.
--snipp--
-- 
---
catWorkX GmbH Hamburg
Dipl.-Ing. Holger Lehmann
Stresemannstr. 364
22761 Hamburg
Tel: +49 40 890 646-0
Fax: +49 40 890 646-66
mailto:[EMAIL PROTECTED]
http://www.catworkx.de
http://www.catbridge.de

___
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] Re: [Zope] Bi-directional update of Data.fs

2000-07-27 Thread Chris Withers

Steve Alexander wrote:
> Don't see why not. When an object is changed, the new object is just
> appended to the end of Data.fs. Unless you use undo, or you pack the
> Data.fs.

You missed the problem ;-)

Technically, there is no problem...

Logically, what happens if one user updates and object on one machien
and another user on another machines, after which you merge the
data.fs's?

I'm thinkthing of the things which result in Notes Replication/Save
conflicts...

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] Re: [Zope] Bi-directional update of Data.fs

2000-07-27 Thread Steve Alexander

Chris Withers wrote:
> 
> Steve Alexander wrote:
> > Don't see why not. When an object is changed, the new object is just
> > appended to the end of Data.fs. Unless you use undo, or you pack the
> > Data.fs.
> 
> You missed the problem ;-)
> 
> Technically, there is no problem...
> 
> Logically, what happens if one user updates and object on one machien
> and another user on another machines, after which you merge the
> data.fs's?
> 
> I'm thinkthing of the things which result in Notes Replication/Save
> conflicts...

What does Lotus Notes offer to do if you get such a conflict?

I'm probably talking rubbish in what follows, because I don't have much
of an idea how these things really work...


The server has a data.original.

You take a copy of this, called data.chris. You use this for a while,
and data gets appended to data.chris.

Someone else is using the server, and data.original gets appended to.

Later, you want to recombine the changes, so you do as follows:

Create a data.original.before_fork that is the data.original just before
you took the copy data.chris. (You can work this out by looking at the
modified data.original and data.chris).

Create a list of the combined transactions (in order of time, I guess)
that happened on the server, and to data.chris. Within one monsterous
transaction, apply the list of combined transactions using the usual
under-the-hood ZODB machinery. Use Jim's new conflict resolution
algorithm to try to settle conflicts. If a conflict can't be settled,
ask interactively, or apply some sort of policy (like "chris always
wins" for example) and log the lost changes.


--
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] Re: [Zope] Bi-directional update of Data.fs

2000-07-27 Thread Steve Alexander

chrisw wrote:
> 
> Bill Anderson wrote:
> > Since the Data.fs is appended to, and that your disconnected version is
> > canonical, why  couldn't you basically look for the last common
> > transaction, and append all transactions in the canonocial to the main
> > one?
> 
> Hwo would that handle the situation where an object has been modified in
> data.fs?
> Not too well I'd guess... :(

Don't see why not. When an object is changed, the new object is just
appended to the end of Data.fs. Unless you use undo, or you pack the
Data.fs.

--
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] Bi-directional update of Data.fs

2000-07-27 Thread chrisw

Bill Anderson wrote:
> Since the Data.fs is appended to, and that your disconnected version is
> canonical, why  couldn't you basically look for the last common
> transaction, and append all transactions in the canonocial to the main
> one?

Hwo would that handle the situation where an object has been modified in
data.fs?
Not too well I'd guess... :(

> (thinking this might need to be moved to dev ...)

And so it was ;-)

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] Quickie on ZPatterns ... I promise :)

2000-07-27 Thread Bill Anderson

Itamar Shtull-Trauring wrote:
> 
> Bill Anderson wrote:
> >
> > Let's say I have an object I will store in a rack. Let us say I want this object 
>to be
> > cataloged in a ZCatalog. Any caveats I need to know about
> > ..such as "Don't do that!" ?
> > ?;^)=
> 
> You can't have them inherit from CatalogAware, you'll need to use a trigger
> that does this for you.  I'm uploading a Product that gives this capability
> - and unlike CatalogAware, it recatalogs *automatically* whenever the object
> changes.  No more object_reindex! (I only tested extensively with DataSkins,
> though).
> 
> http://www.zope.org/Members/itamar/ZPAddons

Cool! I'll check it out today/tomorrow.



Now if only I could figure out how to change user.__roles in Membership, I'd have a 
really
cool Memebrship Release ready :-)

--
Do not meddle in the affairs of sysadmins, for they are easy to annoy,
and have the root password.

___
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] SQL and customise screen

2000-07-27 Thread Vincent

Hi,

I would like to use an SQL request to search some data in an access
database.

The request need to be executed when somebody clic on a button (onclick="")

The result need to be displayed on the screen, but not on one line. I must
be able to place the results in different places on the document.

If somebody has any idea.

Vincent - Thanks

PS : At least, I must be able to customise the array display with the search
zope wizard


___
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] Quickie on ZPatterns ... I promise :)

2000-07-27 Thread Bill Anderson

Steve Alexander wrote:
> 
> Bill Anderson wrote:
> >
> > Let's say I have an object I will store in a rack. Let us say I want this object 
>to be
> > cataloged in a ZCatalog. Any caveats I need to know about
> > ..such as "Don't do that!" ?
> > ?;^)=
> 
> Make one of the object's base-classes DataSkin.
> 
> Don't make it CatalogAware.

that was my hunch ...

> 
> Use triggers to index and unindex the object from a catalog. You'll
> probably want to store the catalog in Specialist.

OK, guess it's sime to learn triggers ;-)

> 
> By the way, Phillip Eby has released a new development snapshot:
> 
> 
> http://www.zope.org/Members/pje/ZPatterns/ZPatterns-0-4-1snap1.tgz/view
> 
> I'll be trying it later today.

Likewise.

Gotta see how/if it works with membership.

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

--
Do not meddle in the affairs of sysadmins, for they are easy to annoy,
and have the root password.

___
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] Quickie on ZPatterns ... I promise :)

2000-07-27 Thread Steve Alexander

Bill Anderson wrote:
> 
> Let's say I have an object I will store in a rack. Let us say I want this object to 
>be
> cataloged in a ZCatalog. Any caveats I need to know about
> ..such as "Don't do that!" ?
> ?;^)=

Make one of the object's base-classes DataSkin.

Don't make it CatalogAware.

Use triggers to index and unindex the object from a catalog. You'll
probably want to store the catalog in Specialist.

By the way, Phillip Eby has released a new development snapshot:

 
http://www.zope.org/Members/pje/ZPatterns/ZPatterns-0-4-1snap1.tgz/view

I'll be trying it later today.

--
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] ZMySQLDA - errors during compilation...

2000-07-27 Thread Phil Harris

Jon,

If I remember correctly all you have to do is remove the & from the lines in
question.

So on line 384 of MySQLModule.c find the & and remove it, just the &.

Then repeat for any line with the same error and hey presto, Bob is now
married to your mothers sister.

hth

Phil
[EMAIL PROTECTED]

- Original Message -
From: "Jon Franz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, July 26, 2000 8:44 PM
Subject: [Zope-dev] ZMySQLDA - errors during compilation...


> Hello,
> I'm trying to install ZMySQLDA onto a Linux machine with
> Zope 2.2.0, python 1.5.2, and a newly installed (from source)
> copy of MySQL 3.22.23 (latest stable).  I had to modify the
> include paths in Setup.in so it could find the include files,
> but now I get the following errors when running make:
>
> >>>
> gcc -fpic  -I/usr/local/mysql/include/mysql -I/usr/include/mysql -g -O2
> -I/usr/local/include/python1.5 -
> I/usr/local/include/python1.5 -DHAVE_CONFIG_H -c ./MySQLmodule.c
> ./MySQLmodule.c: In function `pythonify_row':
> ./MySQLmodule.c:238: warning: assignment from incompatible pointer type
> ./MySQLmodule.c: In function `pythonify_res_fields':
> ./MySQLmodule.c:384: invalid lvalue in unary `&'
> ./MySQLmodule.c: In function `STH_fetchdict':
> ./MySQLmodule.c:1125: invalid lvalue in unary `&'
> ./MySQLmodule.c:1147: invalid lvalue in unary `&'
> make: *** [MySQLmodule.o] Error 1
> <<<
>
> any suggestions?  I've had errors installing ZMySQLDA before,
> but nothing like this...
>
> Thanks in advance.
>
> ~  Jonathan M. Franz ~ Senior Developer/Technical Leader  ~
> ~ SW-Dev Division, Springdale, Ohio Office ~ 513.618.2248 ~
> ~ OneNet Communications (A USNet/MDM Company) www.one.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 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: zpatterns-0.4.0a5: problem with unregistering transactionals

2000-07-27 Thread Jephte CLAIN

Jephte CLAIN wrote:
> I have a case where Transactional._unregister is called without
> Transactional._register being called, raising an exception in
> Transaction._unregister and then in
> ZODB.Transaction.Transaction.__del__, causing Zope to dump core when it
> is run as a daemon (because python notifies of the unhandled exception
> by writin to stderr)
> 
> I have not yet found why (and how?) an object is
> Transactional._unregistered without being Transactional._registered
> before. (I even did not know about the existence of these methods!) But
> until I understand, this patch allow me to stay alive:

Ok, so ZPatterns.Transactional._unregistered method is called twice for
a ZPatterns.Transactional object when an exception is raised and the
ZPatterns.Transactional object has not be freed: once from the
ZODB.Transaction.abort method, once from the ZODB.Transaction.__del__
method which call abort if objects to be aborted remain in the zodb
transaction aware object
The call is made twice for DataSkins and for TransientMapping (as far as
I know, they are at the moment the only Transactional objects in
zpatterns)

for example, try this DTML code in a specialist:






without my patch, Zope should display 'uncatched exceptions in
Transation object'

so what now? I'm lost. Is this normal or not? Is my patch sufficient
(ignore attempts to abort the object twice by trapping exceptions in
_unregister). What about Transactional.abort which check for
tpc_entered? Why is tpc_entered never set to 0?

please help

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] Quickie on ZPatterns ... I promise :)

2000-07-27 Thread Itamar Shtull-Trauring

Bill Anderson wrote:
> 
> Let's say I have an object I will store in a rack. Let us say I want this object to 
>be
> cataloged in a ZCatalog. Any caveats I need to know about
> ..such as "Don't do that!" ?
> ?;^)=

You can't have them inherit from CatalogAware, you'll need to use a trigger
that does this for you.  I'm uploading a Product that gives this capability
- and unlike CatalogAware, it recatalogs *automatically* whenever the object
changes.  No more object_reindex! (I only tested extensively with DataSkins,
though).

http://www.zope.org/Members/itamar/ZPAddons

-- 
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] Quickie on ZPatterns ... I promise :)

2000-07-27 Thread Bill Anderson

Let's say I have an object I will store in a rack. Let us say I want this object to be
cataloged in a ZCatalog. Any caveats I need to know about
..such as "Don't do that!" ? 
?;^)=


Bill

--
Do not meddle in the affairs of sysadmins, for they are easy to annoy,
and have the root password.

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