Re: [Zope-dev] Fwd: [Zope] ZCatalog + Directory product question
On Thu, 17 May 2001, Casey Duncan wrote: You should create an instance method (It will need to be a Python script, DTML methods cannot be indexed)to return the result of the value To my understanding, this is not true. DTML Methods *can* be indexed, they just can't make use of REQUEST in whatever processing they do. However, I can't think of a good reason to use a DTML Method as a Catalog index. --RDM ___ 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: [Zope] ZCatalog + Directory product question
Any hints? Best Regards, Julio Dinis Silva From: Júlio Dinis Silva [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [Zope] ZCatalog + Directory product question Date: Tue, 15 May 2001 18:29:37 +0100 Hi, supose you have a product with two classes: MyCategory | -- MyLink Both classes are CatalogAware. The ideia of this classes is to implement a Directory like yahoo (think about the Yiahw product). Now I start creating my Directory. My classes have a property active that I use to activate and deactivate some parts of my Directory. Now I want to search in my Catalog in which I have MyCategory and MyLink instances catalogued. When I do a search I want to retrieve only results with the active property on. This is ease no big deal. But I want to guarante that all PARENTS of a given Mylink are all with active property on. Yes no big deal, for each result from my search I run trough the getPath(data_record_id) or even PARENTS and check for each Parent if they are all with active==on. Well the problem arises when you have 30 results in your search and all are Mylinks in a directory depth path of 10 category... The search becomes to heavy,i.e, scalability is compromised. I'm thinking I could use the zope security engine to do the active/deactive trick, i.e, when I deactivate one MyCategory I uncheck some security entry, then listing my directory I do a dtml-in with skip-unauthorized, and when I do a search I try to getObject MyLink's results as a anonymous role and then skip_unauthorized. I think this skip_unauthorized could be the solution for this ZCatalog+Directory product scalability, because instead of running trough the PARENTS and check a property, I will be using zope's internal security mecanism. Any hints, Júlio Dinis Silva _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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 ) _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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 )
Re: [Zope-dev] Fwd: [Zope] ZCatalog + Directory product question
Júlio Dinis Silva wrote: Any hints? Best Regards, Julio Dinis Silva From: Júlio Dinis Silva [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [Zope] ZCatalog + Directory product question Date: Tue, 15 May 2001 18:29:37 +0100 Hi, supose you have a product with two classes: MyCategory | -- MyLink Both classes are CatalogAware. The ideia of this classes is to implement a Directory like yahoo (think about the Yiahw product). [snip] Well the problem arises when you have 30 results in your search and all are Mylinks in a directory depth path of 10 category... The search becomes to heavy,i.e, scalability is compromised. You should create an instance method (It will need to be a Python script, DTML methods cannot be indexed)to return the result of the value of active in the acquisition stack. Then index against this method. This puts the burden on updates, so whenever a MyCategory is changed from active to inactive, all child objects will need to be reindexed. This can be done by creating another Python script that gets called on updates to MyCategory objects. The indexed instance method could be something as simple as: return getattr(container, 'active', 0) Only set the active property on those objects that are actually active. Don't set the property at all on inactive objects. That way acquisition does the work instead of doing it manually (an probably much slower). To see if an object is active, just call the instance method. I'm thinking I could use the zope security engine to do the active/deactive trick, i.e, when I deactivate one MyCategory I uncheck some security entry, then listing my directory I do a dtml-in with skip-unauthorized, and when I do a search I try to getObject MyLink's results as a anonymous role and then skip_unauthorized. I think this skip_unauthorized could be the solution for this ZCatalog+Directory product scalability, because instead of running trough the PARENTS and check a property, I will be using zope's internal security mecanism. That is a interesting idea, but I don't think it would really make it much faster. Although I could be wrong. Basically you would make it so that users performing the query didn't have view permissions on the inactive Categories. It would be more challenging to test as well. It would however make updates less intensive. Any hints, Júlio Dinis Silva hth, -- | Casey Duncan | Kaivo, Inc. | [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 )