Re: [Zope-dev] Pre-process a REQUEST before Zope does anything else
[Dario Lopez-Kästen] | I need to be able do some processing for each and every request that | is sent to zope to determine some enviromental thingies, *before* | the request is processed by the main zope mechanisms. I'm not entirely sure, but you might be looking for something like this: http://www.zope.org/Members/michel/Projects/Interfaces/BeforePublishingTraverse> http://www.mit.edu/afs/sipb/project/python/doc/DevGuide/ObjectPublishing.html> __before_publishing_traverse__ (Yeah, I make an effort to find the worst URLs... ;-) ___ 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] Pre-process a REQUEST before Zope does anything else
Hello! I am, uh..., reluctant to dig thru more code that I allready have, so if some one has an easy answer for the following I'd be a gratefull :-) For my user_folder product project(*), I need to be able do some processing for each and every request that is sent to zope to determine some enviromental thingies, *before* the request is processed by the main zope mechanisms. I would like this to happen transparently (i need to check into a database and do some time-out calculations to determine whether the session is still valid). Is there such a hook in AccessControl or in any other place? How to the various sessionmanagers deal with this? Thanks, /dario (*) it's not a new one, it's a customisation of an existing, and code will be provided to the original author so he can decide if it should be or not included in the product. - Dario Lopez-Kästen Systems Developer Chalmers Univ. of Technology [EMAIL PROTECTED] ICQ will yield no hitsIT Systems & Services ___ 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] Getting Unauthorized from __bobo_traverse__.
Hi! I've have this custom __bobo_traverse__ hook: def __bobo_traverse__(self, REQUEST, name): """Intercept the traversal""" if name: if hasattr(self, name): return getattr(self, name) When I call the object like this: /objecta ie. using __call__ (I guess); everything is ok. It renders the index_html (which is a DTMLFile) as expected. However, when I do this: /objecta/index_html it raises an Unauthorized on me. I can't understand why. I thought it might have something to do with docstrings, so I tried this: def index_html(self): """we have a doc string""" return DTMLFile('index_html', globals()) And that worked (it didn't render the DTML, but I know how to fix that). Making it go back to this: index_html = DTMLFile('index_html', globals()) raised an Unauthorized on me again. Here's the full traceback: Traceback (innermost last): File /home/erik/development/zope-farm/Zope-2.3.1-src/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /home/erik/development/zope-farm/Zope-2.3.1-src/lib/python/ZPublisher/Publish.py, line 187, in publish File /home/erik/development/zope-farm/Zope-2.3.1-src/lib/python/ZPublisher/Publish.py, line 171, in publish File /home/erik/development/zope-farm/Zope-2.3.1-src/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: object_manager_index) File /home/erik/development/zope-farm/Zope-2.3.1-src/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: object_manager_index) File /home/erik/development/zope-farm/Zope-2.3.1-src/lib/python/Shared/DC/Scripts/Bindings.py, line 324, in __call__ (Object: object_manager_index) File /home/erik/development/zope-farm/Zope-2.3.1-src/lib/python/Shared/DC/Scripts/Bindings.py, line 354, in _bindAndExec (Object: object_manager_index) File /home/erik/development/zope-farm/Zope-2.3.1-src/lib/python/App/special_dtml.py, line 236, in _exec (Object: object_manager_index) File /home/erik/development/zope-farm/Zope-2.3.1-src/lib/python/OFS/DTMLMethod.py, line 182, in __call__ (Object: standard_html_footer) File /home/erik/development/zope-farm/Zope-2.3.1-src/lib/python/DocumentTemplate/DT_String.py, line 538, in __call__ (Object: standard_html_footer) File /home/erik/development/zope-farm/OtherProducts/WarpFramework/user.py, line 89, in on_access (Object: api) File /home/erik/development/zope-farm/Zope-2.3.1-src/lib/python/OFS/Traversable.py, line 223, in restrictedTraverse (Object: api) File /home/erik/development/zope-farm/Zope-2.3.1-src/lib/python/OFS/Traversable.py, line 190, in unrestrictedTraverse (Object: api) Unauthorized: index_html I also tried adding: __allow_access_to_unprotected_subobjects__ = 1 just for good measure, but that didn't help either. Any help on this is greatly appretiated. :-) ___ 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: Collector down - status and potential help request
I was wrong - the collector csv dumps apparently did not include the *body* of the items, which is, um, important. We're nearly back to square one on recovering the old issues. Aargh. Ken [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: Collector down - status and potential help request
I reported last week that we had lost the disk running the Zope bug collector - and only then discovered that our ISP was not doing backups of it. Well, the story is turning out to have some legs. Unfortunately, the precautionary copy of the host that matt burleigh, our internal systems guy, did (in great foresight!), was incomplete - and apparently missed the collector site. (Great initiative, flawed follow-through!-) Fortunately, about a month and a half ago i did a .csv dump of the collector db, in order to examine the schema for a possible project to transfer the db to a tracker. I never had time to work on the transformation, but still have the db - yay! This means we have all the records up to about 2.5 months ago. What we're planning to do at this point is develop a _minimal_ replacement for the tracker, duplicating its essential features in a way that could serve as a basis for a CMF-based tracker - a sort of minimal evolutionary prototype. We'll then be able to populate it with the items we have. (We'd rather go with a rudimentary application we can build on in the CMF than with a tracker, from which we'd later have to migrate to a preferred CMF implementation...) What, you may ask, about the issues from july 26 to last week, when the collector went away? Well, there are a couple of avenues for recovering those items - we probably have internal mailling list archives with them, and also could scrape them from google searches where they're cached, if needs be. The issue is converting them to a form we could use to populate the new collector. What we're hoping is to engage volunteers from the community to stake out some portion of the remaining items and enter them in - perhaps to some CSV-producing application, or perhaps directly to the new collector. This is a heads-up for such a request - we need to scope out exactly what we're going to do before enlisting the support (and establish how many items we're talking about, anyway). I'm not sure what we'll do - it may be easiest to collect the items from a maillist archive and use a simple transformer to convert them into csv format - i don't recall how completely the email notices covered the collector items. That's the story for now - i expect to have more details (and a start on a new collector) by the end of the week. Ken Manheimer [EMAIL PROTECTED] On Wed, 5 Sep 2001, Ken Manheimer wrote: > The Zope bug collector, normally at > http://classic.zope.org:8080/Collector, isn't at the moment... > > The machine didn't come up after some maintenance - as can happen with > long running machines - and unfortunately the service provider for that > machine didn't have a recent backup(!) Fortunately, we have a fairly > recent backup of our own(!), which we hope to get online sometime soon. > We'll be reporting back when it's back on line. Sorry about the > disruption! > > Ken Manheimer > [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Declaring interfaces for Products
> > In order to be able to publish a method TTW, they need to have a docstring, > > right? > There is a project proposal to eliminate this DocString abuse :-) sounds nice :-) > > > Now, in my interface defintion I want to provide doc-strings for all methods > > that are exposed (the interface), but not all them are to be publishable > > TTW. Can I achieve this by using docstrings for my methods in the Interface, > > but not in the Implementation, or do I need to omit the doc-string in both > > the Interface and the Implementation? > It should be enough to omit the doc string from the implementation. excellent, thank you Dieter. /Dario ___ 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] Declaring interfaces for Products
=?iso-8859-1?Q?Dario=5FLopez-K=E4sten?= writes: > I am making a product using the Interface approach described in the ZDG. > > As I understand it, Interfaces should expose all methods that provide > funtionality for my product, with the possible exception of internal methods > used as utility methods in the class itself. Is this correct? You could have different interfaces, targeting different "audiences": TTW interfaces, scripting interfaces, programming interfaces. > Apart from using security declarations, I want to make some of the methods > available thru the web (TTW), and some of the methods not publishable TTW. > In order to be able to publish a method TTW, they need to have a docstring, > right? There is a project proposal to eliminate this DocString abuse > Now, in my interface defintion I want to provide doc-strings for all methods > that are exposed (the interface), but not all them are to be publishable > TTW. Can I achieve this by using docstrings for my methods in the Interface, > but not in the Implementation, or do I need to omit the doc-string in both > the Interface and the Implementation? It should be enough to omit the doc string from the implementation. Dieter ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Password encryption--calling on the community
Following the Zope 2.5 plan, I have just added to CVS the capability for user passwords to be encrypted in the standard user folder. Please try it out. If it works correctly there should be no outwardly visible differences. I'm also soliciting the assistance of developers and users of custom user folders (like LDAPUserFolder, LoginManager, GUF, etcUserFolder, NTUserFolder, etc.) We need you to test whether the added feature has any bad effects on your user folder. It's much easier to apply a fix now than it will be after a release. Shane P.S. I may have inadvertently sent this twice, please excuse. :-) ___ 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] Password encryption--calling on the community
Following the Zope 2.5 plan, I have just added to CVS the capability for user passwords to be encrypted in the standard user folder. Please try it out. If it works correctly there should be no outwardly visible differences. I'm also soliciting the assistance of developers and users of custom user folders (like LDAPUserFolder, LoginManager, GUF, etcUserFolder, NTUserFolder, etc.) We need you to test whether the added feature has any bad effects on your user folder. It's much easier to apply a fix now than it will be after a release. 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] Alternative acquisition workarounds
After much reading, ive found the Chameleon Folder Product, which is more or less what i was looking for. But, unfortunately i could not make it work. Has someone used it? Maybe someone can help me to make something similar? Thanx. Em Thursday 06 September 2001 18:46, you wrote: > Hello everyone! > > This is my first posting to this list, so, excuse me if im asking a question > that has already been asked by someone. > > Ok, lets go to the point: > > I have the following structure at my site: > > /-- >| >--/Template1 > | > --/header > --/footer > --/images > | > --/image1.jpg > --/image2.jpg > --/image3.jpg >| >--/Section > | > --/Template 2 > | > --/images > | > --/image1.jpg > > And I tried using Transparent folders to make documents using the Template2 > acquire Images and Methods from the Template1, but when i use a DTML document > that references "images/something", my document uses the images dir from the > Templates2 and ignores that from Templates1. > > Ive seen an example like this in some acquisition tutorial out there, but it > just said that this was hard to implement and shows some example in DTML. > > I was hoping someone implemented anything like this in a Python product, or > if someone has an idea of how this could be implemented in Python. > > Thanx for your patience. > > -- > Sidnei da Silva > X3ng Consultoria e Desenvolvimento Ltda. > [EMAIL PROTECTED] > > ___ > Zope-Dev maillist - [EMAIL PROTECTED] > http://lists.zope.org/mailman/listinfo/zope-dev > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope ) > > -- Sidnei da Silva X3ng Consultoria e Desenvolvimento Ltda. [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Where to send patches?
Michel Pelletier wrote: >On Mon, 10 Sep 2001 12:16:51 -0400 > Jim Washington <[EMAIL PROTECTED]> wrote: > >>Hi, All >> >>Since the Collector is down, where do we send patches if we are not >>cvs-authorized? I just discovered a not-too-clever hack to make the >>Find tab recurse through methods of Z Classes, which the margin of >>this >>e-mail is too small to contain. >> > >Dude, don't jinx yourself. I'm sure you don't want us to refer to this as Jim >Washington's last patch. ;) > Ack! I deserve that for playing the cleverness card. Fortunately, I am not planning any duels anytime soon :) The requested change does seem to work, and does not seem to break anything. And it is probably bad to admit that Z Classes are somehow different enough to require special treatment in base Zope code. FWIW, my patch (against FindSupport.py in 2.4.1) is attached. Consume at your leisure. -- Jim Washington *** FindSupport.py.orig Mon Sep 10 11:31:20 2001 --- FindSupport.py Mon Sep 10 11:55:19 2001 *** *** 152,168 if hasattr(obj, 'aq_base'): base=obj.aq_base ! if not hasattr(base, 'objectItems'): return result try:items=obj.objectItems() except: return result try: add_result=result.append except: raise AttributeError, `result` for id, ob in items: ! if pre: p="%s/%s" % (pre, id) else: p=id dflag=0 --- 152,179 if hasattr(obj, 'aq_base'): base=obj.aq_base ! if not hasattr(base, 'objectItems') and not base.meta_type == 'Z Class': return result + + if hasattr(base, 'objectItems'): try:items=obj.objectItems() except: return result + if base.meta_type == 'Z Class': + try:items=obj.propertysheets.methods.objectItems() + except: return result + + try: add_result=result.append except: raise AttributeError, `result` for id, ob in items: ! if pre: ! if base.meta_type == 'Z Class': ! p = "%s/propertysheets/methods/%s" % (pre,id) ! else: ! p="%s/%s" % (pre, id) else: p=id dflag=0 *** *** 194,201 ): add_result((p, ob)) dflag=0 ! ! if search_sub and hasattr(bs, 'objectItems'): self.ZopeFind(ob, obj_ids, obj_metatypes, obj_searchterm, obj_expr, obj_mtime, obj_mspec, --- 204,211 ): add_result((p, ob)) dflag=0 ! #small edit here to add the or ! if search_sub and (hasattr(bs, 'objectItems') or bs.meta_type == 'Z Class'): self.ZopeFind(ob, obj_ids, obj_metatypes, obj_searchterm, obj_expr, obj_mtime, obj_mspec,
RE: [Zope-dev] Problems with CatalogAware?
Right now I only call index_object() after an edit, as I was assuming that after adding things would be automatically taken care fo for me, but obviously this is not the case. There are, indeed, default values in some properties within the class __init__ method. I think what is happening is that I am indexing methods (not properties), and since my factory method doesn't call an explicit reindex_object() after some properties are changed (code below) I am having problems. I wonder if I call self[id].index_object() after self._setObject(id, ad) if that will do the trick? Thanks for the reply, Sean def manage_addAdItem(self, id, title, REQUEST=None): """Zope managment interface create method for AdItem""" ad=AdItem(id) ad.setId(id) ad.setTitle(title) if REQUEST is not None: ad.setAdBody(REQUEST['adBody']) if (len(REQUEST['keywords']) > 0): ad.setKeys(REQUEST['keywords']) ad.setAdDateMulti(=REQUEST['Ad'], mm=REQUEST['Admm'], dd=REQUEST['Addd']) ad.setRtDateMulti(=REQUEST['Rt'], mm=REQUEST['Rtmm'], dd=REQUEST['Rtdd']) ad.featureURL=REQUEST['featureURL'] self._setObject(id, ad) if REQUEST is not None: return self.manage_main(self, REQUEST) -Original Message- From: Toby Dickenson [mailto:[EMAIL PROTECTED]] Sent: Monday, September 10, 2001 6:28 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [Zope-dev] Problems with CatalogAware? On Fri, 31 Aug 2001 15:17:27 -0700, [EMAIL PROTECTED] wrote: >I have a python product that has a class derived from CatalogAware and >Folder. I programmatically add instances of these (1000s of them) on an >automated basis every day in the early morning. > >My problem is that whenever I do this, the Catalog is updated with some >problems: >1 - Metadata is skewed: DateTime objects are cataloged, and they end up with >the wrong date ('2001/01/01') instead of today's date, even though the >actual property contains today's date. The index in question is built from >a property. >2 - Text indexes only get a portion of their text stored in the metadata, >not all of it. The index in question is built from a class method in the >product code. > Appologies if you already know this. CatalogAware will automatically reindex if an object is added, deleted, or moved. However it does not automatically reindex if properties are changed. It sounds like your index might contain the default (initial) values for these properties. Do you need to add a call to reindex_object() after changing them from the defaults? Toby Dickenson [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Where to send patches?
On Mon, 10 Sep 2001 12:16:51 -0400 Jim Washington <[EMAIL PROTECTED]> wrote: > Hi, All > > Since the Collector is down, where do we send patches if we are not > cvs-authorized? I just discovered a not-too-clever hack to make the > Find tab recurse through methods of Z Classes, which the margin of > this > e-mail is too small to contain. Dude, don't jinx yourself. I'm sure you don't want us to refer to this as Jim Washington's last patch. ;) -Michel ___ 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] Where to send patches?
Just post them onto this list... someone from DC will read it. Cheers. -- Andy McKay. - Original Message - From: "Jim Washington" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, September 10, 2001 9:16 AM Subject: [Zope-dev] Where to send patches? > Hi, All > > Since the Collector is down, where do we send patches if we are not > cvs-authorized? I just discovered a not-too-clever hack to make the > Find tab recurse through methods of Z Classes, which the margin of this > e-mail is too small to contain. > > -- Jim Washington > > > ___ > Zope-Dev maillist - [EMAIL PROTECTED] > http://lists.zope.org/mailman/listinfo/zope-dev > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope ) > ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Where to send patches?
Hi, All Since the Collector is down, where do we send patches if we are not cvs-authorized? I just discovered a not-too-clever hack to make the Find tab recurse through methods of Z Classes, which the margin of this e-mail is too small to contain. -- Jim Washington ___ 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 )