[Zope-CMF] Updating skins for a product at the FS level

J C Lawrence claw@kanga.nu
Wed, 03 Jul 2002 13:59:59 -0700


On 02 Jul 2002 18:07:58 -0400 
Tres Seaver <tseaver@zope.com> wrote:

> Depends on the skin.  Each named skin is a "search path" through the
> various skin folders.  In current CMF, the "Basic" skin is defined as:

>   custom, zpt_topic, zpt_content, zpt_generic,zpt_control, topic,
> content, generic, control, Images

Gotcha.  I think I see now.  

My problem currently is that the right skin methods aren't being called
by default:

  from Products.CMFTopic import TopicPermissions
  from Products.CMFCore import CMFCorePermissions
  from Products.CMFCore.utils import _checkPermission, _getViewFor,getToolByName
  from Products.CMFCore.PortalFolder import PortalFolder

  from Globals import HTMLFile, package_home, InitializeClass
  from AccessControl import ClassSecurityInfo
  from Acquisition import aq_parent, aq_inner, aq_base
  from ComputedAttribute import ComputedAttribute
  import os

  factory_type_information = \
  ( { 'id'                : 'CalTopic'
    , 'content_icon'      : 'caltopic_icon.gif'
    , 'meta_type'         : 'Portal CalTopic'
    , 'description'       : 'CalTopics are canned queries for organizing content '
                            'with up to date queries into the catalog and a '
                            'displayed calendar overview.'
    , 'product'           : 'CalTopic'
    , 'factory'           : 'addCalTopic'
    , 'immediate_view'    : 'caltopic_edit_form'
    , 'actions'           :
      ( { 'id'            : 'view'
        , 'name'          : 'View'
        , 'action'        : 'caltopic_view'
        , 'permissions'   : (CMFCorePermissions.View, )
        }
      , { 'id'            : 'edit'
        , 'name'          : 'Edit'
        , 'action'        : 'caltopic_edit_form'
        , 'permissions'   : (TopicPermissions.ChangeTopics, )
        }
      , { 'id'            : 'criteria'
        , 'name'          : 'Criteria'
        , 'action'        : 'caltopic_criteria_form'
        , 'permissions'   : (TopicPermissions.ChangeTopics, )
        }
      , { 'id'            : 'subtopics'
        , 'name'          : 'Subtopics'
        , 'action'        : 'caltopic_subtopics_form'
        , 'permissions'   : (TopicPermissions.ChangeTopics, )
        }
      )
    }
  ,
  )

I then register the skins etc in the normal way, which seems to work.
The problem is that the methods bound to new instances of the class are
the old topic_* methods (eg topic_view) rather than my new caltopic_*
methods (eg caltopic_view).  

  Note: I can call my new methods directly from the URL, and they work
  and display properly.  However the sidebar edit/view etc links point
  to the plain topic_ versions instead of the caltopic_ ones.  

Any idea why?

-- 
J C Lawrence                
---------(*)                Satan, oscillate my metallic sonatas. 
claw@kanga.nu               He lived as a devil, eh?		  
http://www.kanga.nu/~claw/  Evil is a name of a foeman, as I live.