[Zope-dev] RFC: ApplicationObject proposal
Please comment on the new fishbowl proposal for an "Application" object: http://dev.zope.org/Wikis/DevSite/Proposals/ApplicationObject Your input is appreciated! -- Chris McDonough Digital Creations, Publishers of Zope http://www.zope.org ___ 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] Restricting URL access to objects that are not complete web pages
Stephen Simmons wrote: My thoughts were to use an html_header that tracks how deeply components are nested so that inner components turn off the page wrapper. This achieves 1 and 2. This also achieves 3 if sections raise an exception if their page wrapper is not turned off. You only want to see standard_html_footer and so forth when REQUEST.steps[-1]!=fragment_id, so it would not be accessible directly by URL. Try something like this for standard_html_footer: dtml-if "REQUEST.steps[-1]=='standard_html_footer'" dtml-raise type="NotFound"/dtml-raise/dtml-if /BODY/HTML I think using siteaccess for this is more elegant, though. All the knowledge about what is allowed and what is not is maintained in one place, and the knowledge can be declared flexibly using regular expressions. -- 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] acl_users
In AccessControl/User.py, acl_users is used as the name of user folder objects in their classes, and in the constructor, code checks for an existing "acl_users" object to prevent dual-adding user folders. This could be changed to check whether __allow_groups__ has an id, and then checking whether that 'id' exists. I've read through all the Zope source that uses __allow_groups__, so I think I know what it is used for. What I can't work out is, why is this value called __allow_groups__ ? Can anyone offer any insight? Long ago, when the sky was dark and the earth boiled and the primordial elements of Zope were brewing, __allow_groups__ was a simple dictionary-like thing that was generally hard-coded in applications to control access (and the publisher used it directly). As the earth cooled and simple life began to emerge, the __allow_groups__ structures became manageable through the web in a relatively rudimentary way (but still looked a lot like simple dicts to the publisher). By the time the hairy mammals began walking upright and Zope assumed the general form we see today, the publisher expected __allow_groups__ to be either a dict-like object or to have a 'validate' method. In theory, it still supports the old dict behavior today. Maybe not insight, but a little history at least... 8^) Brian Lloyd[EMAIL PROTECTED] Software Engineer 540.371.6909 Digital Creations http://www.digicool.com ___ 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 a DA
Hi, i have a problem on using a DA in my Product. I have a Postgresql DA in my root-folder. If my Product is installed in the root-folder and i use: self.con_obj = DA.DA('id','','pgsql','',query) return self.con_obj() When i install my Product in a sub-folder of the root-folder and i call the function above the following error occurs. The database connection pgsql cannot be found. Who can help me, please Thanks as
Re: [Zope-dev] Please help - Persistent dictionary keys
On Thu, Sep 21, 2000 at 08:00:29AM -0500, John D. Heintz wrote: Thanks for the reply Martijn, I do want the objects of Test2 class to be compared by identity, like I'm assuming Test1 objects are. If I have to define __cmp__ and __hash__ then I will basically be making them up because the object in question are mutable - except for their identity. I don't think that in this case __cmp__ has to be implemented; you just use the default behaviour of object identity comparison. All you need to do is then implent a __hash__() method that will return a 32-bit integer that is unique to the object. You could base this on repr(self). Why do the Python class instances naturally act as dictionary keys while the ExtensionClass instances don't? ExtensionClasses pretend to be Python classes, but are not succeeding everywhere. I am not that deeply knowledgable about Extension Classes, so I cannot tell you why exactly you see this difference. Martijn Pieters wrote: From the Python Library Reference: """A dictionary's keys are almost arbitrary values. The only types of values not acceptable as keys are values containing lists or dictionaries or other mutable types that are compared by value rather than by object identity.""" ... So, if you want to be able to use a Persistent based object as keys to a dictionary, implement __cmp__ and __hash__ methods on that class: import ZODB from Persistence import Persistent class Test1: ... pass ... class Test2(Persistent): ... def __cmp__(self): return 1 ... def __hash__(self): return 1 ... dict = {} t1 = Test1() t2 = Test2() dict[t1] = 1 dict[t2] = 2 dict {Test2 instance at 80b3aa0: 2, __main__.Test1 instance at 80a3e78: 1} -- John D. Heintz DataChannel, Inc. Senior Engineer 512-633-1198 [EMAIL PROTECTED] -- Martijn Pieters | Software Engineer mailto:[EMAIL PROTECTED] | Digital Creations http://www.digicool.com/ | Creators of Zope http://www.zope.org/ - ___ 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] FYI: preliminary Zope 2.3 plan online...
In article [EMAIL PROTECTED], Brian Lloyd [EMAIL PROTECTED] wrote: Hi all - For those interested, I've finally gotten the current plan for the next planned Zope feature release online on dev.zope.org: http://dev.zope.org/Resources/zope_230_plan.html The discussion pages for at least two of the wikis are broken. This is especially troubling considering that it looks like you're planning on moving forward with a proposal with serious unaddressed issues in a (now inaccessible) discussion! ___ 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] I feel your Wiki Pain ;-)
Toby Dickenson wrote: On Fri, 15 Sep 2000 11:27:33 -0400 (EDT), Ken Manheimer [EMAIL PROTECTED] wrote: (Not sure that will scale, but creating new lists for each proposal definitely won't scale. I dont see this as a problem: You only create a new list when the traffic for that proposal gets too great for zope-dev. Threading is good enough before that point. You cant do that with todays Wikis, which need to capture the whole discussion right from the beginning (IMO) [snip] I think you could integrate both mailinglists and wikis. On the one hand, often we'd like to preserve a good posting in a mailing list as a wiki page. So we make a separate [EMAIL PROTECTED] address that's subscribed to the mailing list, that keeps listening to the list and sees things like this in postings: Wiki:StructuredTextWiki:FooBarPage This is a bunch of text that should be added to FooBarPage. Wiki:end Or I see you posted something interesting, and *I* think it should be on the list: Wiki:StructuredTextWiki:FooBarPage Something very interesting you wrote Wiki:end It should strip off the quotes automatically in such a case. Some care should be taken so that replies don't add the same text to the wiki *again*. Anyway, so that's the mailinglist to wiki gateway. Now the wiki to mailinglist gateway. There's a very interesting discussion going on about ZFoobar on the MetaSyntaxWiki. So, someone presses the 'make this page into a discussion list' button, and the following happens: * A new mailinglist is created (with some name the user could fill in) * the wiki page is posted to the mailing list as the first message (perhaps after some editing) * if there is a notification system, the existence of the mailinglist is announced (ideally to all people who posted on that page). * the mailinglist is also listed in some central list somewhere on the Zope site. As people post interesting things to the mailing list, the wiki can be informed by the mechanism I described above. There should also be a rule for the list to be shut down as soon as the discussion has died down (no postings for a while, etc). I hope these ideas contribute to the discussion. I too find it harder to keep track of wikis than of a mailing list, and editing structured text in textareas through the web is not very unpleasant. I keep tripping up over structured text rules as well. (that gives me an idea that is fairly simple to implement: [EMAIL PROTECTED] is an address you can mail to directly as well, and whatever you write is added to the wiki page you indicate; we get to use our own editors, parts can be forwarded from the list, and so on) Regards, Martijn ___ 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] FYI: preliminary Zope 2.3 plan online...
Ty Sarna wrote: Brian Lloyd [EMAIL PROTECTED] wrote: http://dev.zope.org/Resources/zope_230_plan.html The discussion pages for at least two of the wikis are broken. This is especially troubling considering that it looks like you're planning on moving forward with a proposal with serious unaddressed issues in a (now inaccessible) discussion! The discussions are fine. The links to the discussions are broken. The problem is that the links from the 230_plan page contain a trailing slash. This makes the relative links from the first wiki page fail. Brian, if you're listening, please remove the trailing slashes. :-) Shane ___ 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] FYI: preliminary Zope 2.3 plan online...
For those interested, I've finally gotten the current plan for the next planned Zope feature release online on dev.zope.org: http://dev.zope.org/Resources/zope_230_plan.html The discussion pages for at least two of the wikis are broken. This is especially troubling considering that it looks like you're planning on moving forward with a proposal with serious unaddressed issues in a (now inaccessible) discussion! Ugh - they weren't actually "broken", but some of my urls were bad :( Should be fixed now (though I noticed I had to clear my NS cache first). Brian Lloyd[EMAIL PROTECTED] Software Engineer 540.371.6909 Digital Creations http://www.digicool.com ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] [Fwd: __str__, DMTLFolder adn Squishdot]
Andy McKay wrote: Andy McKay wrote: I've given it a __call__ method, but not a __str__. Ive most problems resolve around the objects name, absolute_url, __name__, so perhaps fiddling with __str__ might be an answer. Sorry, but none of that made sense... What are the actual problems you're having with names, absolute_url and __name__? This is probably not going to make much sense but you can create a folderish DTML Document and on the surface it appears fine. However cracks appear when you: - view it in a tree - copy and paste - catalog The reason being that the absolute_url of the object is wrong, it sometimes comes out as http://fork:8080/a/b/c/ElementWithAttributes. In some cases (cut and paste) __name__ is called, and that comes out wrong too. Now that is weird. Can anyone shed any light on what's going on here? Ive given up on this now, I have an object and if I want some folderish objects created tied to that object, I create a folder and do the storage in that and it works fine. That's probably going to be your best bet in the long run, cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Observable Interface?
Does anyone know what happened to it and how far its implementation got? cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: __str__, DMTLFolder adn Squishdot]
Yeah I'll do what works for now and make a science project out of it one rainy weekend. Part of the problem could be the API for instantiation of folderish objects and DTML objects. A DTML method is created: DTMLMethod(file, __name__=id). A folder is ob = Folder() ob.id = str(id) Or something like that. Its in my source somewhere with nasty comments around it :) - Original Message - From: "Chris Withers" [EMAIL PROTECTED] To: [EMAIL PROTECTED]; "Andy McKay" [EMAIL PROTECTED] Sent: Thursday, September 21, 2000 9:44 AM Subject: [Fwd: __str__, DMTLFolder adn Squishdot] Andy McKay wrote: Andy McKay wrote: I've given it a __call__ method, but not a __str__. Ive most problems resolve around the objects name, absolute_url, __name__, so perhaps fiddling with __str__ might be an answer. Sorry, but none of that made sense... What are the actual problems you're having with names, absolute_url and __name__? This is probably not going to make much sense but you can create a folderish DTML Document and on the surface it appears fine. However cracks appear when you: - view it in a tree - copy and paste - catalog The reason being that the absolute_url of the object is wrong, it sometimes comes out as http://fork:8080/a/b/c/ElementWithAttributes. In some cases (cut and paste) __name__ is called, and that comes out wrong too. Now that is weird. Can anyone shed any light on what's going on here? Ive given up on this now, I have an object and if I want some folderish objects created tied to that object, I create a folder and do the storage in that and it works fine. That's probably going to be your best bet in the long run, cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] adding local roles to folders within a Product
I have a ZClass-based product. The folder (should I be calling this an Application Object? :-) ) that contains all the product methods and objects that are accessible via the web has some local roles defined on it. I'm making a sort of Wizard to instantiate a new application instance. This happens by copying an empty application folder from within the ZClass product, to a chosen place in the standard part of the ZODB object heirarchy. I want to define the local roles on the "prototype" folder that is inside my Product. However, when I go to Control_Panel/Products/MyProduct/prototype/manage_access, I get the "map permissions to permissions" screen, rather than the "map permissions to roles, and define local roles" screen. Can I define local roles on my prototype folder -- perhaps using an external method, or DTML API calls to do it? Or, is there some reason that local roles don't make sense within products, and so I have to copy my prototype folder to elsewhere in the ZODB, and then set the local roles? -- Steve Alexander Software Enigineer 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: adding local roles to folders within a Product
Steve Alexander wrote: I want to define the local roles on the "prototype" folder that is inside my Product. However, when I go to Control_Panel/Products/MyProduct/prototype/manage_access, I get the "map permissions to permissions" screen, rather than the "map permissions to roles, and define local roles" screen. Can I define local roles on my prototype folder -- perhaps using an external method, or DTML API calls to do it? Or, is there some reason that local roles don't make sense within products, and so I have to copy my prototype folder to elsewhere in the ZODB, and then set the local roles? Correction: I mean "user-defined roles" rather than local roles. -- Steve Alexander Software Enigineer 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] Observable Interface?
Chris Withers [EMAIL PROTECTED] asked: Does anyone know what happened to it and how far its implementation got? The preliminary implementaion, DefaultObservabale, landed as a mix-in class in Zope 2.2: $ZOPE_HOME/lib/python/OFS/DefaultObservable.py Mix it in to one of your Python base classes (be sure to get it's '__init__()' called!) and fire away. I am currenly working on the more ambitious notion of adding an event channel, which addresses some of the "MxN" problems which plague the classic Observer. See the Zope-PTK archives for August for the latest on that. Tres. -- === Tres Seaver[EMAIL PROTECTED] Digital Creations "Zope Dealers" http://www.zope.org ___ 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] sendmail
On Tue, Sep 19, 2000 at 09:05:12AM -0400, Jason Cunliffe wrote: - Original Message - From: J. Atwood [EMAIL PROTECTED] It looks like the email address you are sending (testing) to is not valid. "host not found" That can't be right. I have tried with a couple of known working email address. ..But I notice the Python error points first to /lib/python1.5/ and then /lib/python What up? Is this 'normal' for Zope 2.2.x? File /Zope-2.2.0/lib/python/Products/MailHost/MailHost.py, line 220, in send (Object: dolphinsMailHost) File /Zope-2.2.0/lib/python1.5/smtplib.py, line 452, in sendmail File /Zope-2.2.0/lib/python1.5/smtplib.py, line 303, in ehlo In a Zope binary install, Python 1.5.2 is included; it's library files are in lib/python1.5/. Zope's own modules are in lib/python. smtplib.py is a standard Python module and is thus pulled from the python lib directory. At 7:10 AM -0400 9/19/2000, Jason Cunliffe wrote: Hello Trying to automate some sendmail messages but we keep getting Error Type: error Error Value: host not found SNIP ... File /Zope-2.2.0/lib/python1.5/smtplib.py, line 452, in sendmail File /Zope-2.2.0/lib/python1.5/smtplib.py, line 303, in ehlo error: (see above) Any clues to what is wrng here? From the source of smtplib.py: """ SMTP 'ehlo' command. Hostname to send for this command defaults to the FQDN of the local host. """ smtpib first tries to send a 'EHLO' command to see if the server supports extended SMTP commands. But it will have to send the hostname of the machine from which you are contacting the SMTP server along. This is where things go wrong (line 303): name=socket.gethostbyaddr(socket.gethostname())[0] The above line _should_ return your Fully Qualified Domain Name. But the result of socket.gethostname() isn't resolvable into a full host specification; thus resulting in the 'host not found' message. I *think* that socket.gethostname() returns exactly the same result as 'hostname' on the commandline does. You may want to check that in a python interpreter (pythonCR import socketCR socket.gethostname()CR). You can use the same command (hostname) as root to set the correct hostname, or you will have to make sure your hostname is resolvable into an ip-address (edit /etc/hosts should do that I think). To illustrate, the output of the command socket.gethostbyaddr(socket.gethostname()) on my machine results in: ('localhost', ['sneek'], ['127.0.0.1']) which matches nicely with the following entry in /etc/hosts: 127.0.0.1 localhost sneek Hope this helps. -- Martijn Pieters | Software Engineer mailto:[EMAIL PROTECTED] | Digital Creations http://www.digicool.com/ | Creators of Zope http://www.zope.org/ - ___ 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] Folderish DTML Document
Andy McKay wrote: Sure it works but Im creating 2 objects a folder and a index_html for every one occurence. Im doubling my database for every object. Ugh! I really wouldn't worry about that... 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] Problem with Tree tag
Chalu Kim wrote: Has anyone seen this when running Tree? (Info: ([None, ([140894976, []],)], ['E04='])) AttributeError: 'tuple' object has no attribute 'append' Yup... It's one of the many bugs in the tree tag. I think someone posted a patch for this a while back, search the mailing list archives at http://zope.nipltd.com/public/lists.html... 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] Restricting URL access to objects that are not complete web pages
Stephen Simmons wrote: 3. Sections are only used as building blocks for other documents so it must not be possible to retrieve a section via a URL. That is not currently possible in Zope and is one of my pet peaves :-S See the 'Protocol Accessibility' proposal on dev.zope.org for a possible solution... 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] Restricting URL access to objects that are not complete web pages
Stephen Simmons wrote: Any suggestions? Something involving permissions/roles? Hacking before_bobo_traverse()? Something simpler? You could use SiteAccess for this; get it to match the allowed paths and patterns to those documents you want available directly through the web, and return a 404 to those that don't match. -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net ___ 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] Massive FTP troubles
On Thu, 21 Sep 2000 00:03:47 +0200 (CEST), Dieter Maurer [EMAIL PROTECTED] wrote: The only strange thing is, that you get told that a conflict occured for "/em/nav/aiti2.gif" rather than the folder. That is the URL of the request that caused the conflict, not the object in which the conflict occurred. Toby Dickenson [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Folderish DTML Document
On Wed, 20 Sep 2000 09:50:16 -0700, "Andy McKay" [EMAIL PROTECTED] wrote: Sure it works but Im creating 2 objects a folder and a index_html for every one occurence. Im doubling my database for every object. Ugh! In straight python you can only create methods for a class by creating function objects (using malloc, no less) and assigning them as variables in the class object. Double Urgh! ;-) Toby Dickenson [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] How to preserve context?
Within some folder I tried the following standard_html_header: dtml-with "PARENTS[1]" dtml-var standard_html_header /dtml-with ..some standard text I wanted to put on the front of all the documents... (and similar method for standard_html_footer) The intent is obvious: I wanted to preserve the standard look and feel but to add something more. Unfortunately it does not work as expected: my standard_html_header uses bobobase_modification_time and it is read from the parent context, not from my document context. What can I do to solve it? -- http://www.mk.w.pl / Marcin.Kasperski | Moje prywatne strony: http://www.kasperski.prv.pl @softax.com.pl | @bigfoot.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] __str__, DMTLFolder adn Squishdot
Andy McKay wrote: I've given it a __call__ method, but not a __str__. Ive most problems resolve around the objects name, absolute_url, __name__, so perhaps fiddling with __str__ might be an answer. Sorry, but none of that made sense... What are the actual problems you're having with names, absolute_url and __name__? I don't see how fiddling with __str__ would help this... Oh I think I see. I'll go and have another look. I can see a product coming out of this called the DMTLFolder :) Hmmm... I'd still advise against this. A normal folde with an index_html method is much more flexible and robust... Thanks! I have to say Squishdot is one of those products whose code I keep looking at to figure out how they heck things can be done Me too! :-) Most fo the 'funky' stuff was done by Butch before I got my grubby mits on it ;-) 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] Catalog Searching
On Wed, 20 Sep 2000 14:51:01 +0100, Chris Withers [EMAIL PROTECTED] wrote: Maik Roeder wrote: dtml-in "Catalog()" reverse sort=bobobase_modification_time size=50 Show stuff in Catalog here. /dtml-with That doesn't take advantage of the Catalog's lazy searching, AFAIK, and on a site with a lot of content that could be bad. Lazy searching is not an issue - that definitely happens. The catalog always uses its cached metadata for searching and sorting. A more interesting question is over sorting-by-index. Whether or not this happens depends on the relative size of two sets: a. The number of *different* *values* for the sort attribute over the whole catalog content. b. The number of matches found. If number(b)number(a) then sorting-by-index works well. This might happen for example if you are sorting by "author name", where there are more matches than there are authors. This is efficient since the catalog precomputes the matches grouped by author name, and it only needs to sort the groups. If number(a)number(b) then there is no sorting-by-index. In this case there are more groups than matches (ie many groups are empty) and it is more efficient to sort matches. This is probably the case for an index of bobobase_modification_time Toby Dickenson [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Catalog Searching
Toby Dickenson wrote: Maik Roeder wrote: dtml-in "Catalog()" reverse sort=bobobase_modification_time size=50 Show stuff in Catalog here. /dtml-with snip good points But doesn't Catalog() return all objects in the Catalog? Doesn't all the meta-data for those objects have to be loaded into memory ratehr than just the 50 that are actually needed? 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] Restricting URL access to objects that are not complete web pages
Chris, Stephen, Wouldn't an external method something like the following work for the moment? def getobj(self,url=None): if url==None: return None return self.restrictedTraverse(url) so in dtml you can do something like: dtml-var "getobj(url='/home/myfolder/index_html')" or dtml-var "getobj(url='/home/myfolder/index_html').absolute_url()" etc. maybe?!!? Phil [EMAIL PROTECTED] - Original Message - From: "Chris Withers" [EMAIL PROTECTED] To: "Stephen Simmons" [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, September 21, 2000 9:56 AM Subject: Re: [Zope] Restricting URL access to objects that are not complete web pages Stephen Simmons wrote: 3. Sections are only used as building blocks for other documents so it must not be possible to retrieve a section via a URL. That is not currently possible in Zope and is one of my pet peaves :-S See the 'Protocol Accessibility' proposal on dev.zope.org for a possible solution... cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Can someone give me a roadmap to explore Zope further
Dear all, After couple of months study, Zope attracts me very much, I would like to explore further. Can someone give me a roadmap, or points me a way. Thanks a lot. Iap ___ 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] Import class in External method
Hi, I had some weeks ago a nice discussion on " Howto import external class in an external method ". However, I use now the " http://www.zope.org/Members/4am/instancehome " method to run my site. This really cool ;) In these condition, I would like to use something similar to import modules. If I want import a class placed in **my Zope root** tree the question is : where to place this module to import it ? I put my module in " MyZopeRoot/Products/Foo/ " and the call in the external method is " from Foo.mymodule import * " or " import Foo.mymodule " but nothing works. I stress I have also created a __init__.py in " MyZopeRoot/Products/Foo/ " but nothing has changed. Any track, FR. ___ 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] Clean Zope source patch
I need to patch Zope source code to make an I18N module of my own work. The function I need to patch is Publish.py in lib/python/ZPublisher (only the publish function). I'd like to to it a 'clean' way, that is, without modifying the actual source code. To achieve this, I can copy the publish function into MyPublish.py, patch it, and, somewhere in the Zope source file hierarchy, put something the following statement : ZPublisher.publish = MyPublish Well, huh... This is theory. It doesn't work because I don't know where ZPublisher is actually imported into Zope, and, thus, where my affectation will really take effect. Does anyone knows how to do this ? Or perhaps someone knows a better way to "cleanly" patch Zope source ?. An ideal way to do "guerilla patching" like this is with a Product. This is in fact how HotFix products work. At Zope startup time, the Zope machinery tries to import each package in lib/python/Products. So you can create your own "product" which is nothing more than a package with an "__init__.py" that performs the replacement. For example, create a directory "I18NHack" in your lib/python/Products and a file therein "__init__.py" (along with your MyPublish module). The __init__.py would look something like: from MyPublish import publish import ZPublisher.Publish # replace the original publish function... ZPublisher.Publish.publish=publish This way you don't modify any Zope source and can pretty easily manage and distribute your patch. Hope this helps! Brian Lloyd[EMAIL PROTECTED] Software Engineer 540.371.6909 Digital Creations http://www.digicool.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] Restricting URL access to objects that are not complete web pages
Steve, Ideally the publishability of an object would be an internal property of that object, not something that is set externally via rules in SiteAccess. It's been a little while since I last looked at SiteAccess, but wouldn't using SiteAccess force you to store publishable objects in one part of the database hierarchy and non-publishables in another? If you wanted publishables and non-publishables all mixed up in the same folders, SiteAccess's rules might get a bit complicated. Another approach could be to: - create a folder that does a RESPONSE.setStatus(404) as the URL traversal machinery passes it. This sets up the default condition of 'NotFound' error for the URL - at the end of the URL, if the final object is publishable or the final item is a publishable method called on a publishable object, do a RESPONSE.setStatus(200) to say 'OK'. Would this be feasible without hacking HTTPResponse.py too much? Stephen ___ Stephen Simmons HealthArena B.V. phone +31 20 486 0555 [EMAIL PROTECTED] - Original Message - From: "Steve Alexander" [EMAIL PROTECTED] To: "Stephen Simmons" [EMAIL PROTECTED] Sent: Thursday, September 21, 2000 3:21 PM Subject: Re: [Zope] Restricting URL access to objects that are not complete web pages Stephen Simmons wrote: My thoughts were to use an html_header that tracks how deeply components are nested so that inner components turn off the page wrapper. This achieves 1 and 2. This also achieves 3 if sections raise an exception if their page wrapper is not turned off. You only want to see standard_html_footer and so forth when REQUEST.steps[-1]!=fragment_id, so it would not be accessible directly by URL. Try something like this for standard_html_footer: dtml-if "REQUEST.steps[-1]=='standard_html_footer'" dtml-raise type="NotFound"/dtml-raise/dtml-if /BODY/HTML I think using siteaccess for this is more elegant, though. All the knowledge about what is allowed and what is not is maintained in one place, and the knowledge can be declared flexibly using regular expressions. -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net ___ 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] Restricting URL access to objects that are not complete web pages
Stephen Simmons wrote: Steve, Ideally the publishability of an object would be an internal property of that object, not something that is set externally via rules in SiteAccess. It's been a little while since I last looked at SiteAccess, but wouldn't using SiteAccess force you to store publishable objects in one part of the database hierarchy and non-publishables in another? If you wanted publishables and non-publishables all mixed up in the same folders, SiteAccess's rules might get a bit complicated. Yes, this is not a neat solution, unless you have already designed your site to use siteaccess in this way. Another approach could be to: - create a folder that does a RESPONSE.setStatus(404) as the URL traversal machinery passes it. This sets up the default condition of 'NotFound' error for the URL - at the end of the URL, if the final object is publishable or the final item is a publishable method called on a publishable object, do a RESPONSE.setStatus(200) to say 'OK'. Even if you don't reset the status to 200 and it remains as 404, the page will still get sent to the browser. You don't want to mess with the traversal machinery on this, as you want traversal to continue to work as it does now. I think your intent is to block direct requests from a web-browser for particular objects. The easiest way of doing this is to check REQUEST.steps[-1] to see if it equals the current object's id. If you want this to be fairly transparent, perhaps based on a particular permission or property, then I think you'll need to patch part of Zope, probably HTTPRequest.py. -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net ___ 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] Using OS user database for user validation in zope?
Hello. Is it possibile to use acl_users component so that instead of using zope database to manage zope usernames i could validate them against my existing NT user database. Thanks. Roland. ___ 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] Return an object?
Hi, Can someone tell me how I can get the object with a certain 'id'? Does getObject exists or something? Tom. ___ 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] cannot access articles in Squisdot
Tomaso Scarsi wrote: Error Type: AttributeError Error Value: 'string' object has no attribute '__basicnew__' and on the console running zope 2000-09-14T14:20:37 ERROR(200) ZODB Couldn't load state for '\000\000\000\000\000\001[i' This isn't a Squishdot problem. It looks like your Zope install is fairly badly hosed. These errors don't mean a lot ot me, I wonder about anyone else? cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] FreeBSD and ZMySQLDA product
Hello, I'm trying to install the ZMySQLDA product in a virtual server of an ISP. I have had no problems with the Zope installation but I've had many problems with the product. Actually I was able to install de ZMySQLDA and the MySQLdb but Zope shows me this error when I try to make a database conection: Error Type: SuperCannotOwn Error Value: Objects cannot be owned by the superuser Can anybody help me? ___ 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] SMIL and mime types
I'm trying to use zope to create SMIL files... So I have a DTML Method with called smil.smi... smil.smi--- smil xmlns:qt="http://www.apple.com/quicktime/resources/smilextensions" qt:chapter-mode="clip" STUFF SNIPPED OUT dtml-call "RESPONSE.setHeader('Content-Type', 'application/smil' ) " If I request this document, it doesn't launch QuickTime Player or RealAudio (I have set up my browser). If I create a file with a reference to this file in an embed tag. I get... SystemError Sorry, a Zope error occurred. any ideas? tom ___ 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 trap login error ?
That works fine, but Id rather use the Zope authentication / authorization system thats there than try to write my own along with the inevitable problems that can occur. Chris - you correct the comment says something about this could use standard_error_message I did a quick hack of changing the source for that file so it looks pretty (of course its totally static). Works for me. - Original Message - From: "Tom Deprez" [EMAIL PROTECTED] To: "William JOYE" [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 21, 2000 8:54 AM Subject: Re: [Zope] How-to trap login error ? Hi, Great another Belgian Zope user. That makes 4? Ok, now to your q'n : What about dtml-unless "Authenticated_user.has_role('Manager')" dtml-call "RESPONSE.redirect('go_to_this_page_html')" /dtml-unless Regards, Tom. At 17:21 21/09/2000 +0200, William JOYE wrote: Hello, Some pages of my zope project are protected by acl_users. I would like to redirect the wrong login to another page. How to do that ? Do I need another product ? I'm using Zope 2.1.6. Is it possible to do that with the standard_error_message ? ATON Belgium Avenue Reine Astrid, 7 B-1440 Wauthier Braine Tél: +32(2)366.25.08 Fax: +32(2)366.25.14 ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope 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] Close your eyes . . .
and pretend that Zope can do this today! http://standardbrains.editthispage.com/ This is where we're headed with DAV, XML / DOM, Zope Studio, etc. Sorry the demo only works (today) with MS IE v. 5+. If you can get to a desktop with this installed, it is such a trip to swipe some content, and edit in place, without a #%@ text box! So this is what Tim Berners Lee had in mind with that funny little put method . . . Later, Jerry S. ___ 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] Version Control in Zope / Managing releases
Shane Hathaway wrote: I would say there are simply too many developments happening for anyone to keep up. I can understand why my little proposal has been overlooked--it doesn't seem very exciting. :-) There *is* too much going on, but I'm *very* excited by this proposal. Using versions to isolate development from current users is useful but only in a limited fashion. Most environments don't allow development on production servers, and if you're doing serious development you're probably working on the filesystem (at least partially) anyway. We're facing this challenge at ZapMedia, and I had the same problem at WebMD. The solution there was a bit easier because we had fewer developers working on more isolated projects. We have some tools in place for doing releases at ZapMedia, but there's still an uncomfortable feeling because we're all using the same development server. Doug ___ 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] Assigning Permissions To Roles
try: self.manage_role('myRole', ['View management screens', 'View']) You may also want to check out this document: http://www.zope.org/Members/mcdonc/PDG/6-1-Security.stx - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 21, 2000 3:01 PM Subject: [Zope-dev] Assigning Permissions To Roles I am having trouble getting Roles to work via my Python Product. Creating a local role works fine: self._addRole('myRole') But how do I tell the Role what permissions it has programmatically? After looking in Role.py, I tried the following: self.manage_role('myRole', ['View management screens, View']) but this kicks up an error. Am I calling this impoperly? kh ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope-dev] Assigning Permissions To Roles
I am having trouble getting Roles to work via my Python Product. Creating a local role works fine: self._addRole('myRole') But how do I tell the Role what permissions it has programmatically? After looking in Role.py, I tried the following: self.manage_role('myRole', ['View management screens, View']) but this kicks up an error. Am I calling this impoperly? kh ___ 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 )