[Zope-CMF] Topics and (sub)topics

Tres Seaver tseaver@palladion.com
Sat, 02 Jun 2001 09:28:52 -0400


Sigve Tjora wrote:

> Hi folks.
> 
> I have a folder "Folder" with two topics:
> 
> "Topic1": Title = word1
> "Topic2": Title = word2
> 
> If I use the path
> 
> myserver/Topic1/Topic2
> 
> I would hope to get those objects that contain both "word1" and "word2" in
> their title, but instead I get all objects that fits "word2", e.g. the
> "last" topic.
> 
> This would be an intresting feature to join to different topics-trees. Can
> this be done and can I expect it impelemnted in CMFTopic any soon?


Two things:

  - Right now, Topics allow "acquiring" criteria from a parent, but only
    from a "containment" parent.  Here is how the catalog query dict is
    popluated::

         result = {}

         if self.acquireCriteria:
             try:
                 parent = aq_parent(aq_inner(self))
                 result.update(parent.buildQuery())
             except:
                 pass

    We would need to quit disabling "contextual" acquisition here to
    allow "composing" topics via URL traversal (i.e., remove the
    'aq_parent' call).  I just experimented with this a bit, and it
    isn't hard to implement;  I would like to consider implications
    a bit before committing the change, however (perhaps there should
    be another parameter, or a different setting, which allows the
    owner to turn this behavior on or off?

  - "And"-ing the acquired query with the local one seems "natural"
    to me only where the acquired query uses different indices than
    the local one.  Where the two use the same index, I would expect
    the local one to "override" the acquired one (which is, in fact,
    what happens now in containment-based, 'acquireCriteria==1' cases).
    Again, we would likely need a knob to allow the owner to configure
    whether to extend or to replace conflicting acquired criteria.

Please submit this as a "feature request" to the tracker:

    http://www.zope.org/Products/PTK/Tracker

It may be simple enough that we borrow Nike's slogan, "Just do it!"

Tres.