[Zope-dev] Re: [Zope3-dev] ZScheduler

2004-04-01 Thread Ulrich Eck
Hi Nikolay, Alan

I also did some work done while and after the Rotterdam Sprint in Dez.
2002. The packages didn't get refactored since before NameGeddon and are
not at all usable with a current cvs-checkout.

The overall design (Interfaces, Structure) and the implementation of the
Schedule/Task might be of interest, allthough one might use utitlities
instead of Services to .

I attached the sources of the prototype that worked with Zope3 early
2003 for refactoring or as example if anyone is interested.

i'm online as [EMAIL PROTECTED]/#zope3-dev for any questions
about the prototype.


cheers Ulrich


On Thu, 2004-04-01 at 06:29, Nikolay Kim wrote:
 Hi Alan, 
 
 i'm author of ZopeScheduler product, lets coordinate our work
 
 
 
 
 ___
 Zope3-dev mailing list
 [EMAIL PROTECTED]
 http://mail.zope.org/mailman/listinfo/zope3-dev


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


Re: [Zope-dev] Idea: Awaking Zope to Life

2002-10-14 Thread Ulrich Eck

Hi Chris,

thanks for your hint ..


 You may also be interested in http://cvs.zope.org/Products/Scheduler/
 (it has a dependency on http://cvs.zope.org/Products/Event/ and a Zope
 = than 2.6b1).

 It relies on an external clock process to tickle it every so often,
 but you could of course kick off a Zope thread to do this...


I have looked over the sources. this Product avoids much of the trouble
through calling from an external-xmlrpc-source .. that behaves like
a normal http-request (auth, contexts, threading,...)
I think i want a higher resolution timer with less overhead (main-loop).

.. I will explore this territory during the next weeks .. thanks


Ulrich Eck

net-labs Systemhaus GmbH
Ebersberger Str. 46
85570 Markt Schwaben
fon:   +49-8121-4747-11
fax:   +49-8121-4747-77
email: [EMAIL PROTECTED]
http://www.net-labs.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] Idea: Awaking Zope to Life

2002-10-14 Thread Ulrich Eck

Hi Leonardo,

 Check your transaction boundaries. One of the reasons that most
 solutions are based on an external request is that the Zope request
 handler starts a transaction in the begining of the request and commits
 it at the end (or rolls it back if there's an exception).

this is basically done by get_transaction().begin/commit/rollback + cleanup
per executed MicroThread. We have played a lot with Zope-Transactions
I think this is manageable .. Thanks for the Hint :)


 Nice idea. It certainly opens a lot of possibilities (and maybe a huge
 can of worms :-). Hope you can pull it off :-)

Thats one of the points I could think of too .. to really make all this
work, one must probably simulate different users, that run the processes
and plug into the security-machinery .. I haven't explored this in detail 
yet.

thank for your reply


Ulrich Eck

net-labs Systemhaus GmbH
Ebersberger Str. 46
85570 Markt Schwaben
fon:   +49-8121-4747-11
fax:   +49-8121-4747-77
email: [EMAIL PROTECTED]
http://www.net-labs.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] ZPT Plain Text

2001-12-05 Thread Ulrich Eck

Hi out there :)


 How would you do repeating texts or conditional texts like this? I mean,
 perhaps it's obvious; I haven't played enough with ZPT yet.


Just for your info:

there is one product that tries to address this problem: TERRY
http://www.zope.org/Members/lalo/TextTemplates

It is a modified version of TAL that doesn't use XML but
a custom syntax:

%(tal:content=here/fgcolor black)%

I don't now, if this makes things easier, but it would
ensure at least the use of TALES and has similar usage.


 I also think this looks rather unnatural when doing email templates or
 SQL templates.

 I used to think that, I'm quickly changing positions. Perhaps the only
 option I'd like is a check box somewhere on the template object saying
 something like always include tal:omit-tag by default. Then I reckon it
 could do for everything :-)

 cheers,

 Chris -- more and more a ZPT-ONLY! fan each day...


YES :)))  One Template-Language for all: ZPT
.. and one Expression Syntax as well: TALES ..

cheers

Ulrich Eck
---
net-labs Systemhaus GmbH
Ebersberger Str. 46
85570 Markt Schwaben
fon:   +49-8121-4747-11
fax:   +49-8121-4747-77
email: [EMAIL PROTECTED]
http://www.net-labs.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] Patching Zope Products .. next Question

2001-07-12 Thread Ulrich Eck



 Would this approach be appropriate?

 http://dev.zope.org/Members/Caseman/Dynamic_HotFix_News/Dynamic_Hotfix



 You can hotpatch the __bases__ attribute of the derived class.



ok .. I tried several different versions of patching ..

1st Try: Created a new class in the patch that subclassed the ZPatterns-Stuff directly:

### CMFCore.PortalFolder ###


import CMFCore

class PortalFolder( CustomizerFolder, CMFCore.PortalFolder.PortalFolder):

Implements portal content management, but not UI details.

meta_type = 'Portal Folder'
portal_type = 'Folder'


def __init__( self, id, title='' ):
CustomizerFolder.__init__(self,id)
self.id = id
self.title = title


CMFCore.PortalFolder.PortalFolder = PortalFolder
InitializeClass(CMFCore.PortalFolder.PortalFolder)

This works fine except the DataSkin-derived classes don't show up in
the CustomizerFolder for customization (they're not properly initialized)

2nd Try: modify __bases__ directly ..


### CMFCore.PortalFolder ###


def PortalFolder__init__( self, id, title='' ):
CustomizerFolder.__init__(self,id)
self.id = id
self.title = title


import Products.CMFCore.PortalFolder
Products.CMFCore.PortalFolder.PortalFolder.__bases__ = tuple((CustomizerFolder,) +
Products.CMFCore.PortalFolder.PortalFolder.__bases__)
# the next line works only if i use the im_func
# otherwise i get this error:
# Error Type: TypeError
# Error Value: unbound Python method must be called with PlugInContainer 1st argument
Products.CMFCore.PortalFolder.PortalFolder.__init__ = PortalFolder__init__.im_func

InitializeClass(Products.CMFCore.PortalFolder.PortalFolder)

this one doesn't do anything ...

do you see the failure .. have a hint what I'm doing wrong ???

thanks for your patience

Ulrich Eck
net-labs


___
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] Patching Zope Products .. again

2001-07-12 Thread Ulrich Eck

sorry for bothering you again .. 
I'ld like to release the CMFZPatternsPatch as Patch but still have troubles with that.

I have this in my __init__.py of the PatchProduct:


### CMFCore.PortalFolder ###


import Products.CMFCore.DynamicType

def PortalFolder__init__( self, id, title='' ):
CustomizerFolder.__init__(self,id)
self.id = id
self.title = title

import Products.CMFCore.PortalFolder
Products.CMFCore.PortalFolder.PortalFolder.__bases__ = 
tuple([CustomizerFolder,Products.CMFCore.DynamicType.DynamicType])
Products.CMFCore.PortalFolder.PortalFolder.__init__ = PortalFolder__init__

reload(Products.CMFCore)
raise testerror,str(Products.CMFCore.PortalFolder.PortalFolder.__bases__)

I tried this with and without the reload 

and when I start zope to see the bases I get:

2001-07-12T12:59:44 ERROR(200) Zope Couldn't import Products.CMFZPatternsPatch
Traceback (innermost last):
  File /usr/share/zope/lib/python/OFS/Application.py, line 528, in import_products
(Object: string)
  File /usr/share/zope/lib/python/Products/CMFZPatternsPatch/__init__.py, line 140, in 
?
testerror: (extension class OFS.Folder.Folder at 83e9620, class 
Products.CMFCore.DynamicType.DynamicType at 855e5f8) 

so .. the __bases__ don't get updated .. or did i miss something ??

thanks for your help

Ulrich Eck
net-labs



___
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] HowTo: Make an Image/File a DataSkin ???

2001-07-11 Thread Ulrich Eck

 
 You might need to do it like this:
 
DataSkin.inheritedAttribute('__init__')(self, id)
 

can you give me a hint what this actually does or
where it comes from (ExtensionClass.Base or Persistence...)?

when do I need to use this and how is it compareable to 

DataSkin.__init__(self,id)
or
DataSkin.__init__.im_func(self,id) ??

I have tried the above and it didn't work in this case .. now I
have the DataSkin Method the first that a PortalImage is
subclassed from and needed to overlay _setId() to coop
with Image.__name and DataSkin.id .. it works .. but I
have no idea what drawbacks this could have.

thanks for your help .. I nearly got it ..

cu
Ulrich Eck




___
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] Patching Zope Products Question

2001-07-11 Thread Ulrich Eck


 Ulrich Eck wrote:
  
  I'm not shure however, what format this should be distributed .. for unix a 
  CMF-ZPatterns-Patch
  would probably be best .. other plattforms do not have this .. any comments ??
 
 Make it into a Product that patches the CMF classes at runtime.
 
 See Zope Hotfixes fot a template to work from.
 


I have for example this modification of PortalContent:

## added for ZPatterns
from Products.ZPatterns.DataSkins import DataSkin

## changed for ZPatterns
class PortalContent(DataSkin, DynamicType, SimpleItem):

Base class for portal objects.
  
.

so I need to completely replace the 
Products.CMFCore.PortalContent.PortalContent
with a new class defined (mainly copied from original)
 in the __init__ of the Patch?

can I do this with:
--
import Products.CMFCore.PortalContent

define myclass here 

InitializeClass(myclass)
Products.CMFCore.PortalContent.PortalContent = myclass
--

Is it the same to replace a class  in a module than replacing 
a method/attribute in a Class ??

thanks

Ulrich Eck


___
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] Patching Zope Products .. next Question

2001-07-11 Thread Ulrich Eck

 can I do this with:
 --
 import Products.CMFCore.PortalContent
 
 define myclass here 
 
 InitializeClass(myclass)
 Products.CMFCore.PortalContent.PortalContent = myclass
 --

ok this works but there is another tricky thing now ... 

I need to patch two products: CMFCore and CMFDefault.

first i patch CMFCore and I think this works (at least a portalfolder
is a customizerfolder :)

I have now 2 new Classes PortalFolder and PortalContent ..

but 

the CMFDefault.Document for example is still subclassed from 
CMFCore.PortalContent (the default) and therefore doesn't behave
like a dataskin ..

any ideas ?

is the order in wich the modules are loaded known or changeable ??

if this doesn't work .. I need to release the patches as diffs or tarballs
replacing CMFDefault and Core .. not as nice as just patching them ..

thanks

Ulrich Eck


___
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] HowTo: Make an Image/File a DataSkin ???

2001-07-10 Thread Ulrich Eck

Hello .. sorry I bother you again with my ZPatterns
related Questions .. 

I just try it once again ;-)

I have a Folder w/Customizer in that I want to store Objects
of type Image or File (CMFDefault.Image to be correct) in it.

The inline doku of CMFDefault.File/Image says the following:

--
class File(OFS.Image.File
  , PortalContent
  , DefaultDublinCoreImpl
  ):

A Portal-managed File


# The order of base classes is very significant in this case.
# Image.File does not store it's id in it's 'id' attribute.
# Rather, it has an 'id' method which returns the contents of the
# instnace's __name__ attribute.  Inheriting in the other order
# obscures this method, resulting in much pulling of hair and
# gnashing of teeth and fraying of nerves.  Don't do it.
#
# Really.
# 
# Note that if you use getId() to retrieve an object's ID, you will avoid
# this problem altogether. getId is the new way, accessing .id is
# deprecated.

--

this is fairly true. I needed to make the DataSkin the first subclass
of File to ensure the datamanager-machinery will work (not_found v_dm)

for example:
class File(DataSkin
  , OFS.Image.File
  , PortalContent
  , DefaultDublinCoreImpl
  ):

this basically works fine except when I rename this object the different behaviour
of Dataskin (stores its id in self.id) and Image/File (stores its id in self.__name__ 
and recommends the use of ob.getId() to get the id).

Has anyone used a Image/File/ExtFile class for combining it with ZPatterns.DataSkin
and perhaps give me a hint ??

thanks 

Ulrich Eck
net-labs


___
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] Using Threads in Zope-Product

2001-06-07 Thread Ulrich Eck

Hi zopistas,

I currently work on a PythonProduct called JobManager.

The purpose of this Product is, that one can define a hierachical set of
PythonScripts (Jobs with SubJobs)
that are executed in seperate Threads by call or scheduled.

This is intended for use with expensive Database-Update or my ServiceManager
(XML-RPC Server/Client)
which need to much time to complete, that a user can't / doesn't want to
wait for completion.

Now there is some trikyness in programming Threads in zope ..
because I wanted the thread-instances to be accessible throug zope as long
as they are running

- ZODB uses the module thread (start_new_thread, aquire/release_lock)
- Scheduler (i found it in DC-CVS) is probably not finished and uses thread
as well.
  the thread instance is not accessible from Zope as far as i can see

- ZExternalNewManager uses the module threading (Thread(...))
   the thread-instance is stored as volatile attribute (_v_threadinstance)

Using the threading library would be most convinient but the Objects from
threading are not pickable.

I need Locks and would like to have Conditions to control the behavior of
the JobManager,
so I tried to make a copy of threading and added Persistence ..
(derived all classes from ZODB.Persistent, but doesn't work)

 with no success.


Is it basically possible .. does it make sense to store the instance of a
Thread as an attribute of
a ZODB-stored Object ???

If yes .. what changes are neccesary to make threading persistant

If no .. has anybody else done such a thing with success ??

any comment welcome

thanks
Ulrich Eck
net-labs


___
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] xmlrpc: Syntax error at line 34: illegal character in content -- Look at what I found out

2001-05-15 Thread Ulrich Eck

Hi chris, hi dieter,

I also have this problem with using xmlrpc from a python client
with zope.

  RuntimeError: Syntax error at line 34: illegal character in content

 This was the bane of one of our projects to the point where Andy re-wrote
 ZMailIn to no-longer use XML-RPC.

 It's to do with stuff-which-should-probably-be-entities but we never
tracked
 down what wasn't encoding something when it should have done.
 I'd blame the marshalling code in xmlrpclib.py myself.

 If you ever fix this, do let us know :-)


I have a Zope 2.3.1 server running as well as a Zope 2.3.2.
I developed an Service-Framework on the first and then
tried to install it on the 2.3.2 .. it failed

I printed out the raw data of the transmission and they differ:

When I call the function on Zope-2.3.1 i get this response:
-
?xml version='1.0'?
methodResponse
params
param
valuestringOK/string/value
/param
/params
/methodResponse
-

when I call the same function on the same backend on Zope-2.3.2 I get the
following:
-
X-Powered-By: Zope (www.zope.org), Python (www.python.org)
Content-Length: 128
Connection: close
Content-Type: text/xml

?xml version='1.0'?
methodResponse
params
param
valuestringOK/string/value
/param
/params
/methodResponse
-

There is some header-information in the body (that perhaps shoudn't be
there)

Where there any changes in Zope 2.3.1 - 2.3.2 in the Publishing part ??

With the second response the xmllib-parser won't work as we see.

any suggestions to that ??

did you guy's updated to Zope-2.3.2 recently ??

thanks for any response and hope this helps a bit ..

Ulrich Eck
net-labs



___
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] BTrees Documentation avaliable ??

2001-04-05 Thread Ulrich Eck

Is documentation for the new BTrees available ?? 

thanks

Ulrich Eck



___
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] Trouble with ZODB when switching betweenZope-releases with Python 1.5 and Python2.0

2001-04-05 Thread Ulrich Eck

yes I removed all .pyc files with rm -Rf *.pyc :)

thanks

Ulrich Eck

- Original Message -
From: "Bill Anderson" [EMAIL PROTECTED]
To: "ZOPE-DEV Mailingliste" [EMAIL PROTECTED]
Sent: Thursday, April 05, 2001 4:43 PM
Subject: Re: [Zope-dev] Trouble with ZODB when switching
betweenZope-releases with Python 1.5 and Python2.0


 On 05 Apr 2001 12:28:34 +0200, Ulrich Eck wrote:
  hi out there,
 
  I recently tried Zope-2.3.1b3 with Python 2.0 and it worked so far ...
  except some of the known issues at compile time ..
 
  I had trouble with a few products including ParsedXML so I switched back
  to Python 1.5.2 and updated to Zope-2.3.1
 
  I did not replace my Data.fs.
 
  Everything works fine .. except when i want to browse one of my
  test-directories
  where I have many Instances of different Products I get this Error:



 When you switched python versions, did you use a cleanzope tree?

 if not (or just to clean it out) try deleting all the .pyc files in your
 zope tree. I've seen this error when distributing .pyc files from 2.0
 machines to 1.52 machines.

 cd $ZOPEHOME
 find * |grep .pyc$ |xargs rm

 i use thiswhenever I seem to be having an issue, just to clear out
 potential problems there (have had that before).

 Bill



 ___
 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] Need Help: Can I use Folder w/Customizer to implement a ImapClient ???

2001-03-15 Thread Ulrich Eck

hi ZPattern-Freaks out there,

i want to write an ImapClient for CyrusImap as Zope-Product.
- Handle several Mailboxes
- Use Zope-Management for IMAP-Folder-Management and ACL/Security
- Use Custom-Interface as Mailclient

The Final Structue I want to have. It should act like a standart Zope
Folder-Tree:

- ImapClient ( holds Connection-Objects toIMAP-Mailboxes, Storage=ZODB)
  |- ImapRootFolder ( Connection-Object and Root-Folder , Storage=ZODB)
  |  |-ImapFolder (a folder  on the imapserver, not persitantly stored)
  |  |   |-ImapFolder (..)
  |  |   |   | ...
  |  |   |-ImapMessage (a message on the imapserver, not persitantly stored)
  |  |-ImapMessage (..)
  |- ImapRootFolder (..)
  |  |-ImapFolder (..)
  |  |   |-ImapFolder (..)
  |  |   |   | ...
  |  |   |-ImapMessage (..)
  |  |-ImapMessage (..)


after big thougths about whether to use an Implementation like
- ZLDAPConnection
  * A Root Connection Object
 class ZLDAPConnection (Acquisition.Implicit,Persistent,
OFS.SimpleItem.Item,...)
  * the nodes ar stored in a Tree of Entries
 class Entry(Acquisition.Implicit,OFS.SimpleItem.Item)
or LocalFS does quite the same ...

BUT:
I want to be able to "skin" every meta_type separately, but I cannot just
use Acquisition because
of duplicates like "index_html"
---

- Use a Specialist
AFAIK a Rack can only serve one meta-type
It's hard to implement the Folder Structure in racks
---

- Use a Folder w/Customizer

this pretty looks like the one to use ...

but phillip told me some time ago,that
I can use it only with persistant ZODB-Storage like other zope-objects -
just use Dataskins with factory.

So I decided to give it a try.

I now have an ImapClient (CustomizerFolder)
which stores ImapRootFolder(Dataskin,Acquisition.Implicit,Folder)
the RootFolder emulates an ObjectManager to serve the Folders
retrieved from the IMAP-Server.

The ImapFolder-Objects are stored in an Attribute Children which is a List.

and are created like this:

def IMAPFolderFactory(client,Name,FullName="", PaddedName=""):
 handle = ImapDataSkins.ImapFolder(Name)
 handle._setRack(client.aq_inner.aq_parent._getDataManagerFor(handle))
 handle.__dict__['_rackMounted'] = 0
 handle = handle.__of__(client)
 handle.setup(Name,FullName,PaddedName)
 return handle

Now I have an Tree I can browse in the ZMI ... BUT ...

"I lose contact to Zope" when i browse down into the
first object wich is not persistantly stored.
I allthough don't get the "mapped Attributes/Methods" from the Customizer.

Is there a possiblity to use the CustomizerFolder with not ZODB-Objects
- What Methods need to be implemented that this could work

any help appreciated .. don't want to stop halfway ;-) ..

thanks Ulrich Eck




___
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: persistant objects hold DataSkin-Items - KeyError: _v_dm_

2000-12-14 Thread Ulrich Eck


 I'm searching for something that handles a newItem(meta_type,key)
function
 that is provided
 from the FwCS who decides which object-type is created and gets those
 attributes from the customizer

 Just use the normal Zope "add list" to create one manually, or call the
 appropriate constructors (e.g. SomeZClass.createInObjectManager()).



after a while I think I got it now.

I use a FcWS as a Folder like usual in Zope and if i create an object
of a type which is "customized" certain attributes will be set through
the customizer. so for a database app that handles multiple tables
it isnt useful to handle with a FwCS.

First I thought there is the same "magic" as if i ..getItem() with a
specialist .. in a FwCS

Due to the Folders Rules, there can only by one object with the same id
at a time in one FwCS ..

I'll switch back to a Specialist which has many racks as data-providers
which i can choose the right one with a method that has a "meta-type"
parameter.

is this right so far ??

Ulrich Eck


___
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: persistant objects hold DataSkin-Items - KeyError: _v_dm_

2000-12-13 Thread Ulrich Eck

after one more day of source-code-reading i got that far:

When I want to use a Folder /w Customizer (FwCS) I cannot/don't need to use
Specialists.

i create a FwCS and put my 'Framework' in it.
if i want to access (get/new) an object handled by a customizer
i can ask FwCS._getDataManagerFor(client,default) for my datamanager (DM)

Do I need to implement methods like
createItem/retrieveItem/_v_itemConstructor as well
or how do i "get" my objects ??

If I have an object whose metatype is handled via
customizer/skinscript/sqlmethod it'll
probably work managing attributes ..

I'm searching for something that handles a newItem(meta_type,key) function
that is provided
from the FwCS who decides which object-type is created and gets those
attributes from the customizer

did I get this right so far ??

is there an example those newItem(meta_type,key) -
getItem(meta_type,key) ??


thanks
Ulrich Eck

 
 a) tell my TransactionManager that my attribute "ds_object" is not
pickeable
 (e.g. call it  _v_ds_object)
  and how to know if zope is restarted ?!?!?
 or
 b) store this object persistantly in my TO without showing it in the
 folder-structure but behave like a DSO
  set/get attributes through Skinscripts

 Yes.  Use a Folder w/Customization Support above your transactions.  When
 you access TO.ds_object, the DataSkin will search for a DataManager and
 find one in the FwCS, assuming you've configured one.

 Note that this is mutually exlcusive to using Specialists to store the
 DataSkins.  In the FwCS approach, you configure Customizers for each
 meta_type of objects you'll be dealing with.  You can then give them
 SkinScript, etc. to configure behaviors.  Also, this approach requires use
 of the ZODB to store at least the "shell" (class reference and ID) of each
 DataSkin.  But since your application is ZODB-dependent already, this is
 not an issue.

 Personally, I'd suggest that if you want to take advantage of ZPatterns'
 database independence, you should instead restructure your app so that
your
 TO's are themselves DataSkins, stored in a Specialist.  Right now, you
have
 a very heavy dependence on the ZODB.



___
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: persistant objects hold DataSkin-Items - KeyError: _v_dm_

2000-12-12 Thread Ulrich Eck

hi out there,

i use zpatterns/specialists for a Network-Documentation Tool.

I'm writing a Product which controls the relations between specialists
and manages multible actions (edit/new/delete) for ZPatterns DataSkinObjects
(DSO).

I have a Product-Instance of ZTWM (ZTransactionWorkflowManager) in my
application root which is a Folder by itself and holds as folder-objects its
'Transactions' (in this case a Transaction starts at the first edit-action
and lasts
til the last submit of a form with valid entries - e.g finish transaction.)

It behaves like a Wizard (PTK) with next/back/cancel/finish buttons and
reads
out the DataSkinPropertysheet for creating the edit/new forms on the fly.

One can also define relations between the specialists an they are used to
edit
Foreign Keys.

small painting here:

\application-root
--\Person(specialist for persons)
--\Komponent (specialist for komponents)
--\ZTWM(my TransactionWorkflowMangager - Folder)
 \1(first transaction -Folder)
---\1 (first transaction object - Folder)
| ds_object (attribute which references the DSO)
| more info on the current Transaction object
---\2 (second Transaction object)
| ds_object (attribute which references the DSO)
| more info on the current Transaction object
\2 (second Transaction)
...

so far about how it should work  ..

For each TransactionObject (TO) I save the Object I retrieved with
"specialist.getItem(id) == DataSkinObject(DSO)"
as attribute "ds_object" to the TransactionObject.

After I restarted Zope and want to replay/finish a transaction,

i get an KeyError, Value _v_dm_

the prefix _v_ stands for not pickeable (afaik)
dm for datamanager ?!?

ok .. i put a TO in the Transaction, get the actual DSO,
call the transactionmanagers editor function and a form with correct values
is displayed,
 i can  edit this form and call the DSO manage_changeProperties method from
the
transactionmanager.

when i don't finish a transaction and restart zope i still have my
transactions with proper
values saved in my TransactionManager - except the property "ds_object" wich
was assigned
to the DSO at TO-creation

when i try to set/get an attribute i get the KeyError of  "_v_dm " ...

I can deal arround that if i reget the DSO from the specialist in every
function which deals with DSO's.

is there a better way to

a) tell my TransactionManager that my attribute "ds_object" is not pickeable
(e.g. call it  _v_ds_object)
 and how to know if zope is restarted ?!?!?
or
b) store this object persistantly in my TO without showing it in the
folder-structure but behave like a DSO
 set/get attributes through Skinscripts

hope that i described clearly enough where my problem is ...

thanks for your reply

Ulrich Eck
net-labs


___
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: using PythonMethods from Skinscript

2000-11-30 Thread Ulrich Eck



hi out there,

this is my first posting on this list. Right now I 
think 
this is the right place to ask details about 
ZPatterns.

I think a ZPatterns-Mailinglist should be set up, 
where
people like me, working hard to get the "Zen of 
ZPatterns"
can discuss questions related to USING 
ZPatterns.

Here my first little problem:

I've a db_sequence specialist who serves the 
Framework with
db_id's for new Records like:

 newid = 
db_sequence.getItem('sequence_name').nextid

The Attribute nextid is provided by a 
Skinscript-Method:

WITH getNextId(seq_name=self.id) 
COMPUTE 
seq_name=seq_name,nextid=_.int(nextid)



"getNextId()" is a PythonMethod and uses 
ZSQL-Methods to
compute the NextId while Locking the Table: 


PARAMETER: self, seq_name


self.sql_Lock()nid = 1for cur_id in 
self.sql_NextIdGet(seq_name=seq_name):nid = cur_id.nextid + 
1self.sql_NextIdUpdate(seq_name=seq_name,nextid=nid)break

else:self.sql_NextIdCreate(seq_name=seq_name,nextid=1)

self.sql_Unlock()

return {'seq_name':seq_name, 'nextid':nid} # HERE'S 
MY PROBLEM I THINK 



I tried to return nearly everything expect a certain instance of a 
"special getNextId-Return-Object" e.g. return nid / return (seq_name,nid) 
...

I tried serveral ways to reach my return values in the SSMethod:
... COMPUTE nextid=nextid or nextid=self.nextid or nextid=RESULT ...

Finally i tried to follow what happens during a get-call of an Attribute in 
the source .. 
no success ..

except when i use some Dummy ZSQL-Method which does the following and 
works (but this is not the way to do it ..)"select value as nextid, 
value as seq_name"


can someone give some advice or enlighten me about the Namespace I'm in, at 
SSMethods Attribute providers 
atexecution-time ?!?






My Second "little" Problem:

i'm not the first one who had problems to manage data with rdbms and 
zpatterns. i can get Attributes through SSMethods
easily and now tried to setup ADD/CHANGE/DELETED Rules to manage 
data.


Here my SSMethod for 
this(getEventById/insertEvent/updateEventareZSQL-Methods):

WITH QUERY getEventById(id=self.id) COMPUTE 
sid=_.int(id),name,time_start
WHEN OBJECT ADDED CALL insertEvent(id=self.sid)WHEN OBJECT 
ADDED,CHANGED STORE sid,name,time_start 
USING 
updateEvent(id=self.sid,name=self.name,time_start=self.time_start)


I access the Item through loadAttribute: 
"sid"
I set up a ZClass derived from Dataskin which acts 
as Storage-Class.

I call

dtml-let 
ni="newItem(key=db.getItem('data_event').nextid)" 
nips="ni.propertysheets.get('Basic')"dtml-var 
"nips.manage_changeProperties(REQUEST=REQUEST)"/dtml-let
and get back an empty object without any attributes 
(propertysheet-problem??)
the record in the database is created (but only 
because I reduced the ZSQL-Insert Method to id-parm only)
this again seems to be a Problem of the namespace 
I'm in while the _objectAdded() ... method.



- Do I need a PropertySheet when I only want to access/change/create/delete Items/Attributes from a RDBMS ??
 If yes: Which one 
(CommonInterfaceProp/DataSkinProp)
 If no: how do i Access/Change my Properties 
??

- and another Question related to 
this:
 Which object fires the Trigger-Event 
(ADDED/CHANGED/DELETED) ..
 is it the PropertySheet itself 
???


lots of questions still there but these are 
thepoints i really tried to get working .. but i did'nt..

hope that there is an answer ..

thanks in advance

Ulrich Eck
net-labs