[Zope-CMF] Discussion-geddon

Tres Seaver tseaver@digicool.com
Thu, 14 Jun 2001 16:09:25 -0400 (EDT)


I am ready to check in a rather large patch to the discussions
machinery in CMFDefault.  The patch does the following:

  - Adds a set of baseline unit tests for the discussions
    machinery, including tests for:

    o policy checks (whether discussions are allowable)

    o nested replies

    o cataloguing of replies

    o propagation of 'manage_beforeDelete' from the host content
      object, and correct un-cataloguing.

  - Cleans up a lot of cruft, including fossilized inheritance,
    old-style security declarations, etc., in
    CMFDefault.DiscussionItem.  In particular, DiscussionItem
    now implements the DiscussionResponse interface directly,
    instead of mixing in the older implementation.

  - Replaces the current "path-based" 'in_reply_to' with a simpler,
    more robust scheme.
    
    o The old version was a legacy of the much older usage, which
      had discussion items in users' "Correspondence" folders, and
      assembled them into threads using catalog queries;  it was
      fragile in the face of moves or renames of the "host"
      content object.

    o The new scheme stores 'None' in the 'in_reply_to' field to
      indicate that the item is a "top-level" reply to the host
      content object, or the simple ID of the sibling, for
      threaded replies.

  - Refactors the skins for discussions a bit, moving the "above
    in thread" logic into a separate method, and adding a special
    view for DiscussionItems which uses it.

  - Adds an 'upgrade_discussion' ExternalMethod to CMFDefault;
    this method:

     1. Installs (if one isn't already there) a
        FactoryTypeInformation object for DiscussionItems.  This
        FTI is "crippled" for adding objects (no factory/product),
        but provides a hook on which to hang the custom view, and
        set other type-specific policies.

     2. Removes the "(default)" workflow for DiscussionItems, so
        as not to present the "Retract", etc. actions;  later, we
        might add a special workflow, to permit sufficiently
        privileged users to delete replies.

     3. Updates existing DiscussionItems to conform to the new
        scheme.

My only reluctance to check this in now is that it will break
sites which have discussions enabled until they can run the
'upgrade_discussion' script.  Also, that script is relatively
lightly tested;  I want to run it on the dogbowl to verify the
fix, as well as to allow us to re-enable discussions there.

Can anyone "show good cause" why I shouldn't go ahead and check
it in?

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@digicool.com
Digital Creations     "Zope Dealers"       http://www.zope.org