[Zope-dev] More ZPatterns confusion
I am trying to add a ZClass with a DataSkin Property sheet to a Virtual Rack. So I call the following: dtml-let ni="newItem(key=REQUEST['key'])" props="ni.propertysheets.get('Basic')" dtml-call "props.manage_changeProperties(REQUEST.form)" /dtml-let I assume this should call ADDED and CHANGE trigger's to place data in my SQL Database. Unfortunately this is not happening. The ADDED trigger is doing the initial creation, but the changeProperties is not effecting the right changes. It seems that the CHANGE trigger is not getting called. Is there something else I should be doing? Thanks for all the help ___ 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] How to get rid of obsolete Permissions
how can I get rid of the permissions defined for a ZClass, after I deleted the ZClass, all permissions for all ZClasses I ever created are still around and pollute my security or permission management screens. Mit freundlichen Grüßen Joachim Schmitz AixtraWare, Ing. Büro für Internetanwendungen Hüsgenstr. 33a, D-52457 Aldenhoven Telefon: +49-2464-8851, FAX: +49-2464-905163 ___ 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-Methods Through-the-FileSystem
Hi all, Does anybody have a good suggestion how to develope SQL Method ftfs (through the filesystem) rather than ttw. Perferably in someway similare to the HTMLFile way to include DTML methods in Zope classes. Regards, Johan (One problem I recently discovered was the fact that SQl methods makes "hardlinks" to SQL connection when changed. So if I move the SQL connection to some other place in the aq-path I need to update the methods. This make it hard because the SQL method seems to point to the right connection but it doesn't, in other words been very confusing for users.) torped johan carlsson birkagatan 9 113 36 stockholm [EMAIL PROTECTED] www.torped.se voice +46-(0)-8-32 31 23 mobil +46-(0)-70-558 25 24 workshop västmannagatan 67 ___ 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] SQL-Methods Through-the-FileSystem
Johan Carlsson wrote: Seb: Does anybody have a good suggestion how to develope SQL Method ftfs (through the filesystem) rather than ttw. Perferably in someway similare to the HTMLFile way try something like this: from Products.ZSQLMethods.SQL import SQL import PoPy def manage_add_user(self,email,password): conn = 'PoPy_database_connection' self.sql_add_user=SQL('sql_add_user', '', conn, 'email password', _sql_add_user) _sql_add_user = """ insert into tbl_users(email,password) values ( dtml-sqlvar email type=string, dtml-sqlvar password type=string ) """ Hi Seb, I guess I could skip putting it in a method and create the SQL instance as a attribute of the class (that I currently would be working on)? yes Why do I need to import the database module? sql methods are bound to database connections, you could instantiate one without, but than you wouldn't be able to use it. Couldn't I just try to locate/create a DA when my class is instantiated? you could, the search routine in /lib/python/Products/ZSQLMethods/SQL.py is a good starting point Would it be poor design to create a DA connection as an attribute of the class? Or would it be perferd to create it in the __init__ as a instance attribute? do you really want to create a new db connection for every instance of your class? kapil ___ 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] RFC: Python/Zope Interfaces
Michel Pelletier writes: Also, defining the interface seperately keep the two things apart, impementation and interface, and doesn't allow you to sneak in a new method unless you also sneak it into the interface, thus making a stronger "contract" with the user. I am a bit astonished by this statement: I know the "design by contract" concept from Bertrand Meyer, the Eiffel developper. In Eiffel, essential parts of the contract, among others method prototype, pre- and post-conditions as well as invariants are build directly into the language. A documentation tool extracts these parts from the source to generate the interface, for people that are only interested in how to use the class/method. Programms can be executed in a way, that the various (executable) contract parts can be checked at runtime. *THIS* provides for quite a strong contract. I cannot see, why the separation of interface and implementation should make the contract stronger. I do see, however, that it makes it more likely to be broken by the implementation. It is a very good thing to have the specification very near to the implementation -- as a permanent guide to the implementor. It is even better, when big parts of the specification becomes part of the executable code (as is the case for Eiffel's pre- and post-conditions). If you want to prevent your implementors to change the interface specification, generate the interface for the implementation and compare against your master copy. In my view, it is better to have a somewhat "weaker" contract that is met by the partners than a "stronger" contract that is violated. Or, to say it differently, it is more essential the a system's documentation describes faithfully what is rather than what should be (but is not). 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 )
Re: [Zope-dev] SQL-Methods Through-the-FileSystem
Johan Carlsson wrote: Seb: Does anybody have a good suggestion how to develope SQL Method ftfs (through the filesystem) rather than ttw. Perferably in someway similare to the HTMLFile way try something like this: from Products.ZSQLMethods.SQL import SQL import PoPy def manage_add_user(self,email,password): conn = 'PoPy_database_connection' self.sql_add_user=SQL('sql_add_user', '', conn, 'email password', _sql_add_user) _sql_add_user = """ insert into tbl_users(email,password) values ( dtml-sqlvar email type=string, dtml-sqlvar password type=string ) """ Hi Seb, I guess I could skip putting it in a method and create the SQL instance as a attribute of the class (that I currently would be working on)? yes Why do I need to import the database module? sql methods are bound to database connections, you could instantiate one without, but than you wouldn't be able to use it. What I mean is that if I acquired the DA connection, the import would be unnecessary? Couldn't I just try to locate/create a DA when my class is instantiated? you could, the search routine in /lib/python/Products/ZSQLMethods/SQL.py is a good starting point Yes, I know, for ones I turned to zope-dev before diving into the source ;-) Would it be poor design to create a DA connection as an attribute of the class? Or would it be perferd to create it in the __init__ as a instance attribute? do you really want to create a new db connection for every instance of your class? I might, if each instance should connect to its own database. For instance I could have different databases (with different user identities) for different customers sharing the same host machine. Thanks Seb and Ender, I really got a head start. Johan ___ 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] manage_addFolder unusable from DTML-call?
I have a simple DTML method: dtml-var standard_html_header h2dtml-var title_or_id dtml-var document_title/h2 p This is the dtml-var document_id Document in the dtml-var title_and_id Folder. /p p Welcome, dtml-var AUTHENTICATED_USER! You have these roles: dtml-var "_.string.join(REQUEST.AUTHENTICATED_USER.getRoles(), ', ')". /p dtml-call "manage_addFolder('Folder', 'my new folder')" p I created a folder! /p dtml-var standard_html_footer It requires "Manager" to view. When I run it with the dtml-call commented out, it correctly returns my role as "Manager". I can go through the management interface to create and destroy folders, but as soon as I view this method, (it tries to reauthenticate me and) I get: Zope Error Zope has encountered an error while publishing this resource. Unauthorized You are not authorized to access manage_addFolder. Traceback (innermost last): File /data/www/Zope/42/Zope-2.2.4b1-src/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /data/www/Zope/42/Zope-2.2.4b1-src/lib/python/ZPublisher/Publish.py, line 187, in publish File /data/www/Zope/42/Zope-2.2.4b1-src/lib/python/ZPublisher/Publish.py, line 171, in publish File /data/www/Zope/42/Zope-2.2.4b1-src/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: make_folder) File /data/www/Zope/42/Zope-2.2.4b1-src/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: make_folder) File /data/www/Zope/42/Zope-2.2.4b1-src/lib/python/OFS/DTMLMethod.py, line 172, in __call__ (Object: make_folder) File /data/www/Zope/42/Zope-2.2.4b1-src/lib/python/DocumentTemplate/DT_String.py, line 528, in __call__ (Object: make_folder) File /data/www/Zope/42/Zope-2.2.4b1-src/lib/python/DocumentTemplate/DT_Util.py, line 331, in eval (Object: manage_addFolder('Folder', 'my new folder')) (Info: manage_addFolder) File /data/www/Zope/42/Zope-2.2.4b1-src/lib/python/OFS/DTMLMethod.py, line 194, in validate (Object: make_folder) File /data/www/Zope/42/Zope-2.2.4b1-src/lib/python/AccessControl/SecurityManager.py, line 139, in validate File /data/www/Zope/42/Zope-2.2.4b1-src/lib/python/AccessControl/ZopeSecurityPolicy.py, line 183, in validate Unauthorized: (see above) I expected trouble when trying to use proxy roles for this, but it seems like running as a Manager should be simple. I see a similar DTML method in use in a message from early October. Am I missing something or did the security model change get me? Thank you. --kyler ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] ZClass within ZClass
Hi folks, I am yet another Zope newbie. I am trying to create a ZClass hierarchy. Let's say I have a CDLibrary. Every CDLibrary has a CDManager (just one) and the CDManger holds all the CDEntry items. (The CDLibrary may have parts other than the CDManager, like a label maker or something- but that's not important now...) My question is this: How do I set up such a product with ZClasses within ZClasses. I have the HOW-TO collection, the ZBook, the Zope Book and the Guides. I've tried the HOW-TO on ZClasses and ObjectManagers, and Adding ZClass Instances Programmatically with no success. I am an experienced Python programmer with strong object-oriented knowledge and good HTML. Any help will be greatly appreciated. Thanks. -- "I ain't no stewin' rabbit, I'm a fricassein' rabbit. Have you got a fricassein' rabbit license?" Daryl Stultz - python, blender, robots, really bad harmonica playing... [EMAIL PROTECTED] RedHat Linux 6.1 - Dual Pentium Pro ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Python Script demo site
From: "Steinar Rune Eriksen" [EMAIL PROTECTED] Would it be useful to (or rather, is it possible to) let one of these scripts call up another one ? Sure. From one of the Python Scripts you just write something like: answer = context.otherscript(1.3, 'foo') ...where context is bound to the Script context, and "otherscript" is the name of the other script. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Python Script comments
From: "Chris Withers" [EMAIL PROTECTED] Is there going to be a python methdos help tab eventually? Help is on the way. If I specify parameters 'wibble, fish', and then do: dtml-var "mypythonmethod('wibble',1)" ...will wibble='wibble' and fish=1 in the method? Yep. Parameters work normally. Will the bound names still be bound to what they would have been, had I just done dtml-var mypythonmethod ? Likewise, if I do: dtml-let wibble='wibble', fish="1" dtml-var mypthonmethod /dtml-let This is tied up in whether you bind the "caller's namespace" in the Bindings tab. If you do, then calling by name, as above, will automatically look the parameters up in the namespace, so your example will work. If you don't bind the namespace (it isn't bound by default) you can only call by name if there are no parameters. Go to the demo site -- try it out! Finally, I'm not sure, from a user confusion point of view that allowing bound names to also appear in the parameter list is a good idea... They shouldn't, you're right. I'll take care of that soon. Cheers, Evan @ digicool ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to checkout PythonMethod from CVS
From: "Jochen Knuth" [EMAIL PROTECTED] Products/DC/PythonMethod at the moment, i don't know if the new name will result in a new directory. I expect to check it into the Zope2 core trunk under lib/python/Products/PythonScripts when I get back from Thanksgiving vacation. Cheers, Evan @ digicool ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] PoPy and system tables
Chris Gray wrote: I can pinpoint the problem a bit more. select relname, relowner, relpages, reltuples, relhasindex, relisshared, relkind, relnatts, relchecks, reltriggers, relukeys, relfkeys, relrefs, relhaspkey, relhasrules, relacl from pg_class works fine but select reltype from pg_class select relam from pg_class select rellongrelid from pg_class all cause problems and sometimes crash my instance of Zope! These three fields all have the type oid. Apparently PoPy can't handle returned values of this type. PoPyDA has serious problems with oid fields. But I found a temporary solution. select int4(relam) from pg_class -- Andreas Heckel [EMAIL PROTECTED] UNIX is like a wigwam ...no gates ...no windows and an apache inside ;-) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] CURRENT MEMBERSHIP PRODUCT IS COOL -- was: [Zope] LoginManager / Membership / ZODB as UserSource
Hello Bill, Now this _is_ cool. I had tried 0.75 in the past and had lots of problems. Version 0.78 is a real drop-in, like what I was dreaming of. Thank you very much for your efforts so far. I recommend the Membership product to everyone looking for a ready-to-use authentication and personalization solution, though ZODB based in the first place, thanks to ZPatterns and LoginManager it is always ready for rdbms. Btw, if you maintain a Membership version outside of the PTK, why do I see the word "Portal" so often? IMHO you shouldn't narrow down the opportunities of using this product to mere portals. CU+Prost, .oO( "Du konntest mal einen bauen" ) Danny -Ursprungliche Nachricht- Von: ucntcme [mailto:ucntcme]Im Auftrag von Bill Anderson Gesendet: Samstag, 25. November 2000 19:44 An: [EMAIL PROTECTED] Betreff: Re: [Zope] LoginManager / Membership / ZODB as UserSource Danny William Adair wrote: Has somebody been able to setup this combination as for today? I guess this is an easy one for the LM experienced... I am looking for a completely ZODB based solution concerning membership, no rdbms. It it still beta, but there is a membership product, which uses loginmanager. You can get it at http://www.zope.org/Members/Bill/Products/Membership It works quite well, despite the beta label. Bill Anderson -- E PLURIBUS LINUX ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Special behavior or bug?
I've discovered another possible solution to your problem. In a DTML Method change dtml-var standard_html_header to dtml-var "standard_html_header(client=foo)" where foo is the id of a DTML Method. Then within standard_html_header, the variables title and id will refer to foo's id and title. Cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZClass within ZClass
Daryl Stultz wrote: Hi folks, I am yet another Zope newbie. I am trying to create a ZClass hierarchy. Let's say I have a CDLibrary. Every CDLibrary has a CDManager (just one) and the CDManger holds all the CDEntry items. (The CDLibrary may have parts other than the CDManager, like a label maker or something- but that's not important now...) My question is this: How do I set up such a product with ZClasses within ZClasses. I have the HOW-TO collection, the ZBook, the Zope Book and the Guides. I've tried the HOW-TO on ZClasses and ObjectManagers, and Adding ZClass Instances Programmatically with no success. I am an experienced Python programmer with strong object-oriented knowledge and good HTML. Any help will be greatly appreciated. This may just be 'any help'. g But, If you subclass OFS:Folder when building CDLibrary and CDManager then they can 'contain' other objects. A HOWTO that really helped me was the one on building a Job Board. HTH, -- Tim Cook, President -- Free Practice Management,Inc. | http://FreePM.com Office: (901) 884-4126 Censorship: The reaction of the ignorant to freedom. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: [Zope-dev] SQL-Methods Through-the-FileSystem
Hi Johan, Does anybody have a good suggestion how to develope SQL Method ftfs (through the filesystem) rather than ttw. Perferably in someway similare to the HTMLFile way try something like this: from Products.ZSQLMethods.SQL import SQL import PoPy def manage_add_user(self,email,password): conn = 'PoPy_database_connection' self.sql_add_user=SQL('sql_add_user', '', conn, 'email password', _sql_add_user) _sql_add_user = """ insert into tbl_users(email,password) values ( dtml-sqlvar email type=string, dtml-sqlvar password type=string ) """ hth, seb ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZClass within ZClass
Tim Cook wrote: But, If you subclass OFS:Folder when building CDLibrary and CDManager then they can 'contain' other objects. A HOWTO that really helped me was the one on building a Job Board. Yes, that's precisely where I started, however, the actual product is a job_board_entry. What I want is a product that IS the entire job board, contains an object that is a job_board_entry manager (holds the entries) and then, the user creates job_board_entries. In the example, the job board itself, and the "manager" are done with folders. Following the ZCMG example (Stan's InstantSite), I can clone such a setup - but I don't get full class modification cascading, i.e., once it's duplicated, only changes to the job_board_entry class will carry through existing job boards. I'll keep at it, though. I hope this is all clear. Thanks. -- "I ain't no stewin' rabbit, I'm a fricassein' rabbit. Have you got a fricassein' rabbit license?" Daryl Stultz - python, blender, robots, really bad harmonica playing... [EMAIL PROTECTED] RedHat Linux 6.1 - Dual Pentium Pro ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] getattr in Python Method problem
In the folder where dosomething_pym (Python Method) is located, is also a string property set called 'en' with the value 'English' The Python Method object is called with no parameters, but is defined with the 'self' parameter inside the Python Method object. In a DTML Method this works fine: dtml-var "_.getitem('en')" and returns "English" This is what I try in the Python Method: lang=getattr(self,'en') but this raises an error! Error Type: AttributeError Error Value: validate I have searched the mailing list but in vain. Some people say it should be lang=getattr(self,'en')(self,REQUEST) But that raises the same error. Best regards, Peter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] LoginManager Help.
hi, So I have LoginManager installed. The easy part. Now I'd like to know how to use it. To start with, I'd like to authenticate against a standard acl_users folder or a plane text file w/ username/passwords in it. I just have no idea how to get cracking on this since the documentation on LoginManager is pretty short. I don't mind doing the SQL method, if I don't have to install a 3rd party Database like mySQL or Postgres. It's a bit of an overkill so several users. Thanks, j. .. . Jason C. Leach ... University College of the Cariboo. .. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Python and EJB (J2EE)
All, I have been tracking this discussion for a while and need to point out some major facts about EJB's that seem to have been missed. Yes, EJB's are componentized and run in a container but that's not all. 1) EJB's are TRANSACTIONAL components (MTS components are also transactional) That is, the code in the EJB usually is part of some transaction. That's what all the excitement around EJB's is about. 2) The TRANSACTIONAL properties of a deployed EJB can be specified at DEPLOYMENT time. Thus the same chunk of code inside an EJB may be used by one customer as a NON-TRANSACTIONAL chunk of code while another uses it in a way that forces a TRANSACTION to begin when the code executes, while still another includes this chunk of code with some others in an all enveloping transaction whose scope is determined by the client program. All this can be specified in a deployment-descriptor - an XML "properties" file. This gives tremendous flexibility and further leverages the componentized code. 3) EJB's can participate in DISTRIBUTED TRANSACTIONS (MTS components can do the same) Thus multiple database servers at different sites on the net can participate in a single transaction. This implicitly involves TWO-PHASE COMMIT and XA/TX interfaces. In plain words, if one database engine in a distributed transaction decides to rollback, all other engines must rollback as well. This requires communication of transaction state out-of-band of the usual transaction state communication and is not done by the programmer, rather has to be supplied by the DB vendor. This requires specific support in the database interfaces and requires a specific entity called a transaction co-ordinator which keeps track of all this. JDBC 2.0 database drivers have support for distributed transactions. Hence EJB's can potentially participate in DISTRIBUTED TRANSACTIONS. 4) ENTITY EJB's allow programmatic access to database rows The ENTITY EJB mirrors (somewhat) a row in a database, with EJB attributes mapping to row columns. Thus accessing/writing data in the database can be done by get/set on the EJB attributes. ENTITY EJB's have far too many wrinkles to be able to talk about them meaningfully here. Suffice it to say that they exist and are useful (to some). EJB's make all this possible because the EJB standard specifies contracts between various players - component creator, container vendor, component user ... and SUN has periodic bake-off's to validate interoperability of components and containers. So component/container paradigm is important, but what makes EJB's fly is the transactional stuff. While Zope has tremendous power as a component container, IMHO the contracts between players are not specified and do not follow any standards. The "Zope product" is perhaps the first implicit "contract" definition. We need more of these for transactional components. However I think before that Zope will need to evolve to include the next level of sophistication in DB transaction management, especially two-phase commit, XA/TX ..., support for existing transaction co-ordinators, and/or provide one. We await that eagerly. Nitin Borwankar, Borwankar Research Inc. [EMAIL PROTECTED] Ender wrote: Hung Jung Lu wrote: From: Ender [EMAIL PROTECTED] ... Thanks for the comments. I'll reply other points in a few more days. cool, i've been waiting for this discussion:) as for distributed technologies, while xml-rpc is useful and simple its not useful (IMO) for enterprise programming, its too basic. This maybe true. However, HTML is also basic and simple, but exactly because of its simplicity, it became widely accepted and used. On the opposite end is CORBA: because it's so complicated, there is no vendor out there that can possibly implement all its features. Trading powerful features for a wider acceptance at times does work. don't forget marketing, behold windows. CORBA is complicated but its also more widely deployed in the enterprise because this problem domain needs the additional feature set. my comments regarding xml-rpc are targeted towards enterprise implementations. if all you need is simple rpc, than xml-rpc will provide 80% functionality of soap at 20% of the complexity (not my numbers) and i recommend to anyone to use xml-rpc. but if you need actual cross-platform object access/transport, than it just won't cut it and then you need the additional functonality of soap. also back to the marketing hype, if something isn't supported than it tends to wither away into a niche. while xml-rpc is used in the trenches for lots of stuff, SOAP is supported by lots of major software developers (ibm and ms come to mind) and it will become the future standard supported by interoable products (in many ways it already has). SOAP is showing symptoms of becoming complicated. And that's a bad sign. See Fredrik Lundh's implementation comment for Python SOAP at
[Zope] Instance within Instance
Hi Folks, I have a product folder called "TestClass" with 2 ZClasses: class1 and class2. The following is an exerpt from the class1 constructor: dtml-with "class1.createInObjectManager(REQUEST['id'], REQUEST)" dtml-call "REQUEST.set('id', 'myClass2')" dtml-call "class2_add(_.None, _, NoRedir=1)" /dtml-with I want class2 to be created INSIDE of the class 1 instance. Instead, class2 (always with an id of "myClass2") is created at the same level as the class1 instance. How do I change the namespace to get the class2 instance inside class1? Thanks. -- "I ain't no stewin' rabbit, I'm a fricassein' rabbit. Have you got a fricassein' rabbit license?" Daryl Stultz - python, blender, robots, really bad harmonica playing... [EMAIL PROTECTED] RedHat Linux 6.1 - Dual Pentium Pro ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZClass within ZClass
Daryl Stultz wrote: Tim Cook wrote: But, If you subclass OFS:Folder when building CDLibrary and CDManager then they can 'contain' other objects. A HOWTO that really helped me was the one on building a Job Board. Yes, that's precisely where I started, however, the actual product is a job_board_entry. What I want is a product that IS the entire job board, contains an object that is a job_board_entry manager (holds the entries) and then, the user creates job_board_entries. In the example, the job board itself, and the "manager" are done with folders. Following the ZCMG example (Stan's InstantSite), I can clone such a setup - but I don't get full class modification cascading, i.e., once it's duplicated, only changes to the job_board_entry class will carry through existing job boards. You might want to take a look at how I built the FreePMProduct. The product contains several ZClasses. One example is an EMRClass (electronic medical record) it subclasses OFS:Folder Inside the EMR I can instantiate several of the other ZClasses. Such as a Consult or an Address. Some of those subclass Folder and some Document, depending on it's actual use. A change to one of these ZClasses cascades through all existing instances. Is that not what you are trying to do? -- Tim Cook, President -- Free Practice Management,Inc. | http://FreePM.com Office: (901) 884-4126 Censorship: The reaction of the ignorant to freedom. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Python and EJB (J2EE)
1) EJB's are TRANSACTIONAL components (MTS components are also transactional) Thanks for your comments. Transaction certainly is one of the important features of EJB. But my personal opinion is that instance pooling (multi-threading) is even more important. If you have to implement a components server from scratch, and you can only do so much, which feature would you implement first? Transaction? Or Multithreading? I think the answer is Multithreading. All this can be specified in a deployment-descriptor - an XML "properties" file. Yeap. :) XML "properties" file is the way to go. For many things. Thus multiple database servers at different sites on the net can participate in a single transaction. This implicitly involves TWO-PHASE COMMIT and XA/TX interfaces. In plain words, if one database engine in a distributed transaction decides to rollback, all other engines must rollback as well. Two-phase commit is crucial. That's why I explicity mentioned it in my original message: the final commit must be done in matter of milliseconds, if not microseconds. Let's face it, the commit action takes time. There is never a 100% sure trasaction. NEVER EVER, since the transaction can fail exactly when you are performing the commit action. So the next best thing to do is to commit in two phases: (1)prepare to commit: which can take a few seconds to prepare everything up to the point of hanging all the transaction changes on one single index field (a few bytes), (2) Final commit: modify those few bytes, which on a single machine means of the order of nano-seconds, and on distributed transaction, microseconds to milliseconds. Milliseconds certainly is still not very comforting, but it beats a commit action that takes 30 or 40 seconds that is totally unacceptable in business. Hence EJB's can potentially participate in DISTRIBUTED TRANSACTIONS. Yes, totally agree with you. 4) ENTITY EJB's allow programmatic access to database rows That's the object mapper. I am not sure, though, whether it's the best approach to put the object mapper as part of the Components Server. The fact that even SUN's own people recommend against using entity beans tells me a lot. Object mapper can be used as an independent utility, outside the Components Server. We need more of these for transactional components. However I think before that Zope will need to evolve to include the next level of sophistication in DB transaction management, especially two-phase commit, XA/TX ..., support for existing transaction co-ordinators, and/or provide one. I've mentioned two-phase commit to Digicool people. Not sure whether it's already inside Zope or not, but it seems not. Zope's TM (Transaction Machinery) does not seem to be two-phase. See the TM.py file itself: it only has def _finish(self): self.db.commit() That is, I don't see the equivalent of prepare_to_commit(). If you know where to get more info on XA/TX, could you provide some pointers? thanks, Hung Jung _ Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: Re[2]: [Zope] view DTML source
Anders Eriksson writes: DM ... use "document_src" to view the source ... AFAIU there is two problems with using document_src directly 1) I can't use the html_quote param You do not need to (unless you are interested in standard wrapping for e.g. corporate identity or navigation). "document_src" sets "Content-Type: text/plain". Thus, you get the content as text, no HTML processing. 2) Anonymously users can't use this on 'standard' Zope. I tried on zope.org but it want me to log in. Using view_source I don't need to do this. You are right! I just checked: "document_src" requires the permission "View management screens". Either, you must give your annonymous users this permission for the respective objects or you must wrap "document_src" into a DTML method with an appropriate proxy role. The code of the method could just be: dtml-var "document_src(REQUEST,RESPONSE)" Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Instance within Instance
Daryl Stultz wrote: I want class2 to be created INSIDE of the class 1 instance. Instead, class2 (always with an id of "myClass2") is created at the same level as the class1 instance. How do I change the namespace to get the class2 instance inside class1? NOT TESTED, but simialr to something I do: dtml-call expr="class1.createInObjectManager(REQUEST['id'], REQUEST)" dtml-with "_.getitem(id)" dtml-call "REQUEST.set('id', 'myClass2')" dtml-call "class2_add(_.None, _, NoRedir=1)" /dtml-with HTH, -- Tim Cook, President -- Free Practice Management,Inc. | http://FreePM.com Office: (901) 884-4126 Censorship: The reaction of the ignorant to freedom. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] manage_addFolder unusable from DTML-call?
Kyler B. Laird writes: I have a simple DTML method: dtml-call "manage_addFolder('Folder', 'my new folder')" I can go through the management interface to create and destroy folders, but as soon as I view this method, (it tries to reauthenticate me and) I get: Zope Error Zope has encountered an error while publishing this resource. Unauthorized When I tried to reproduce your problem (ZopeCVS rather than Zope 2.2.4b1), everything worked as it should -- no Unauthorized exception. Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Authenticating Users.
Jason C. Leach writes: How can I authenticate a user from a form. Pretty much exactly how zope.org logges you in? I have looked at both zope.org's login and logged_in (the action for login) and don't see where it actually goes and checks the username/password? This check is performed in "UserFolder.validate" called from "ZPublisher.BaseRequest.traverse". Apparently, zope.org supports cookie based authentication. This means, it does not use the standard Zope UserFolder but another one supporting this type of authentication. Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Python and EJB (J2EE)
If you know where to get more info on XA/TX, could you provide some pointers? Search for XA on Amazon - you can buy a copy of the Spec. It takes a while to ship 2-3 weeks I think. Also look at the specs for the JTA, Java Transaction API. There are some references there. Nitin. thanks, Hung Jung _ Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Python and EJB (J2EE)
I've mentioned two-phase commit to Digicool people. Not sure whether it's already inside Zope or not, but it seems not. Zope's TM (Transaction Machinery) does not seem to be two-phase. See the TM.py file itself: it only has def _finish(self): self.db.commit() That is, I don't see the equivalent of prepare_to_commit(). I'm not sure Zope source is the place to look for this, perhaps ZEO source may be more appropriate. Nitin. If you know where to get more info on XA/TX, could you provide some pointers? thanks, Hung Jung _ Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] LoginManager Help.
* Jason C. Leach [EMAIL PROTECTED] [001126 20:46]: hi, So I have LoginManager installed. The easy part. Now I'd like to know how to use it. To start with, I'd like to authenticate against a standard acl_users folder or a plane text file w/ username/passwords in it. OK, I've just struggled with this and won. I wanted to write a How-To but it's too late in the evening to consider right now. So, here's some notes that might become a HowTo: 1) Why LoginManager "LoginManager is a User Folder workalike and replacement which solves the "N * M" problem seen with previous User Folders." (http://www.zope.org/Members/tsarna/LoginManager) Hmm, OK. What I *think* this means is that you can use LoginManager to do all the security heavy lifting for you. All you have to do is tell it how to decide if someone's authenticated or not. A bit like PAM in Linux, if you know about that. With other types of UserFolder, you're stuck with SQL or LDAP or some other flavour of user storage you decided on a couple of months ago. If you want to change the type of user store, you have to tinker with the business logic too. With LoginManager, it's more or less just a case of plugging in a new data source. You can have more than one data source and have LoginManager authentivate against each of them in order. You can do even cleverer things but I'm not sure about that yet. 2) How This is the only way I've worked out how to use it. I know there's better ways of doing it because I've seen mails to thateffect from Ty. My way is the GUF-compatability way. - Add a LoginManager to your test folder that you created so you didn't mess any other folders up in your Zope by accident. Have it generate a GenericUserSource for you. - Click on its UserSources tab. This is where you can add UserSources, like your LDAP User Source and your Plain Text File User Source. - There's a UserSource in there already for you (a GenericUserSource, indeed) - Add 4 methods to it: userAuthenticate, userDomains, userExists, and userRoles. (see example below) - That's it! Watch your folder become inaccessible because you made a mistake in your authentication methods! - The methods tab of the LoginManager has some default forms. - If you want to log in a user from another page, create a form which posts fields called __ac_name and __ac_password to a method which doesn't have anonymous user access. (see the example loginForm for an example) Here's an external method which authenticates against a SQL database with a ZSQL method that's in the UserSource. Commented out is a cheesey hardcoded username and password example: def userAuthenticate(self,REQUEST,username,password): if self.SQL_authenticate_user(username=username,password=password): #if username=='seb' and password=='boogaloo': return 1 else: return 0 def userExists(self,REQUEST,username): return 1 def userDomains(self,REQUEST,username): return [] def userRoles(self,REQUEST,username): return ['Editor','Manager'] If you want to authenticate against a plain text file, it should be fairly easy to work it out from this example. OK I've got to go to bed. If anyone who knows more wants to let me know, I'll try and compile it into a better guide. I'm sure I've got most of this wrong - but it seems to work for me, so maybe not... There's already a SQL-LoginManager Howto which I don't want to repeat, but I already have. It's at http://www.zope.org/Members/jok/SQL_based_LoginManager. seb. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] security
Can some one explain how the Define Permissions screen works. I really don't understand the concept behind it, what does it mean for a permission setting to own a permission? All I need to do is to make certain ZClass methods have a certain level of security and the other methods of the class have no security. Any tips, advice or best of all EXAMPLES most appreciated! Thanks Alex == Alex Bowyer IT Contractor, Logica Australasia Tel: +61 2 9202 8130 Fax: +61 2 9922 7466 E-mail : [EMAIL PROTECTED] WWW: http://www.logica.com.au/ == ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Instance within Instance
Tim Cook wrote: NOT TESTED, but simialr to something I do: dtml-call expr="class1.createInObjectManager(REQUEST['id'], REQUEST)" dtml-with "_.getitem(id)" dtml-call "REQUEST.set('id', 'myClass2')" dtml-call "class2_add(_.None, _, NoRedir=1)" /dtml-with Hmmm, doesn't seem to be working (also results in class1 and class2 being at same level). I'll take a look at some other examples. Thanks for the help (and quick replies). ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Python and EJB (J2EE)
Nitin Borwankar wrote: I've mentioned two-phase commit to Digicool people. Not sure whether it's already inside Zope or not, but it seems not. Zope's TM (Transaction Machinery) does not seem to be two-phase. See the TM.py file itself: it only has def _finish(self): self.db.commit() That is, I don't see the equivalent of prepare_to_commit(). I'm not sure Zope source is the place to look for this, perhaps ZEO source may be more appropriate. Nitin. this has been enlightening, i'm still coming up to speed on all the ejb stuff. zope does implement a two-phase commit and it is integrated with the transaction machinery. to see a good mix in that shows more of the transaction methods take a look at ZPatterns/Transaction.py although its not recommended for use (its deprecated in the current ZPatterns to look at you'll have to check out an older version). you can see how things get called by looking in ZopeHOME/lib/python/ZODB/Transaction.py to see the internals of a transaction mechanics. and you can see how the zodb manages these semantics for objects living in the ZODB here. zHOME/lib/python/ZODB/Connection.py kapil ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] client argument to python function calls?
I'm trying to emulate some DTML methods with python code in my (python) product. Let's say I have two Python classes, one named Foo, the other Bar. Something like this: class Foo(Folder.Folder, Persistent, Implicit): meta_type = "Foo" def magic(self, client=None): "magic method!" if client == None: client = self return client.magic_word class Bar(Folder.Folder, Persistent, Implicit): meta_type= "Bar" def __init__(self, id): self.id = id self.magic_word = 'Alacazam!" Now I create a structure like this in Zope: / foo (instance of the Foo class) bar (instance of the Bar class) Now if I goto /bar/foo/magic, I see the magic word. However, I would also like to use /foo/bar/magic, and also receive the magic word. This latter case doesn't work, the magic_word isn't set. In fact, the "client" argument is never anything but None. This is a facet of Zope I still don't quite understand... Thanks, -Randy
Re: [Zope] LoginManager Help.
hi, Those instructions got the ball roling. I have not got it going yet, but am getting close. Where do I put my login forms? In the same folder as the acl_users (LoginManager), or inside the acl_users (LoginManager)? I have just taken your example and hard coded a user in for now: def userAuthenticate(self,REQUEST,username,password): #if self.SQL_authenticate_user(username=username,password=password): if username=='demo' and password=='demo': return 1 else: return 0 And pretty much just cut'n-pasted the example form into my own page for testing. I have also added those 4 external methods and Zope seems happy enough with them. What I get when I enter my username and password is, noting really. I just get the same form asking for my user name and pw. j. .. . Jason C. Leach ... University College of the Cariboo. .. On Mon, 27 Nov 2000, seb bacon wrote: snip.. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] LoginManager Help.
hi, Also, I'm not sure what this instruction ment: - If you want to log in a user from another page, create a form which posts fields called __ac_name and __ac_password to a method which doesn't have anonymous user access. (see the example loginForm for an example) Thanks, j. .. . Jason C. Leach ... University College of the Cariboo. .. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] LoginManager Help.
You can gain some enlightenment from these two documents: http://www.zope.org/Members/Zen/GenericUserFolder/walkthrough http://www.zope.org/Members/jok/SQL_based_LoginManager --- "Jason C. Leach" [EMAIL PROTECTED] wrote: hi, So I have LoginManager installed. The easy part. Now I'd like to know how to use it. To start with, I'd like to authenticate against a standard acl_users folder or a plane text file w/ username/passwords in it. I just have no idea how to get cracking on this since the documentation on LoginManager is pretty short. I don't mind doing the SQL method, if I don't have to install a 3rd party Database like mySQL or Postgres. It's a bit of an overkill so several users. Thanks, j. .. . Jason C. Leach ... University College of the Cariboo. .. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) __ Do You Yahoo!? Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/ ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Python and EJB (J2EE)
assuming no errors, in which case you'll get rollback method calls, or subtransactions. a call to tpc_begin signals the begin of the two-phase commit. than comes a call to commit, next tpc_vote, and finally tpc_finish. kapil Ender wrote: Nitin Borwankar wrote: I've mentioned two-phase commit to Digicool people. Not sure whether it's already inside Zope or not, but it seems not. Zope's TM (Transaction Machinery) does not seem to be two-phase. See the TM.py file itself: it only has def _finish(self): self.db.commit() That is, I don't see the equivalent of prepare_to_commit(). I'm not sure Zope source is the place to look for this, perhaps ZEO source may be more appropriate. Nitin. this has been enlightening, i'm still coming up to speed on all the ejb stuff. zope does implement a two-phase commit and it is integrated with the transaction machinery. to see a good mix in that shows more of the transaction methods take a look at ZPatterns/Transaction.py although its not recommended for use (its deprecated in the current ZPatterns to look at you'll have to check out an older version). you can see how things get called by looking in ZopeHOME/lib/python/ZODB/Transaction.py to see the internals of a transaction mechanics. and you can see how the zodb manages these semantics for objects living in the ZODB here. zHOME/lib/python/ZODB/Connection.py kapil ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )