[CMF-checkins] CVS: CMF/CMFDefault - DiscussionItem.py:1.31.8.1 Document.py:1.54.8.1 Favorite.py:1.18.20.1 File.py:1.24.18.1 Image.py:1.21.20.1 Link.py:1.25.20.1 NewsItem.py:1.17.20.1 SkinnedFolder.py:1.12.20.1

Tres Seaver tseaver@zope.com
Mon, 10 Mar 2003 18:50:31 -0500


Update of /cvs-repository/CMF/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv2028/CMFDefault

Modified Files:
      Tag: tseaver-ti_apb_redux-branch
	DiscussionItem.py Document.py Favorite.py File.py Image.py 
	Link.py NewsItem.py SkinnedFolder.py 
Log Message:


  Landing 'tseaver-typeinfo_as_apb-branch' against current HEAD, using
  a new integration branch:

  - Merged the branch and fixed up all conflicts;  all tests pass.

  - Updated all the 'factory_type_information' structures to make the
    'action' key a TALES expression (e.g., "document_view" ->
    "string:document_view").

  Remaining TODOs:

  - Write an external method for converting existing type info objects
    (they all have dictionaries, instead of ActionInformation objects,
    stored in the ZODB).  Otherwise, all existing type info objects are
    *toast*.

  - Perhaps someone can think of a clever way to avoid the need for this
    conversion?


=== CMF/CMFDefault/DiscussionItem.py 1.31 => 1.31.8.1 ===
--- CMF/CMFDefault/DiscussionItem.py:1.31	Thu Feb 13 03:35:28 2003
+++ CMF/CMFDefault/DiscussionItem.py	Mon Mar 10 18:49:58 2003
@@ -35,27 +35,27 @@
 from Products.CMFCore.interfaces.Discussions import Discussable
 
 
-factory_type_information = ( { 'id'             : 'Discussion Item'
-                             , 'meta_type'      : 'Discussion Item'
-                             , 'description'    : """\
+factory_type_information = (
+  { 'id'             : 'Discussion Item'
+  , 'meta_type'      : 'Discussion Item'
+  , 'description'    : """\
 Discussion Items are documents which reply to other content.
-They should *not* be addable through the standard 'folder_factories'
-interface."""
-                             , 'icon'           : 'discussionitem_icon.gif'
-                             , 'product'        : '' # leave blank to suppress
-                             , 'factory'        : ''
-                             , 'immediate_view' : ''
-                             , 'actions'        :
-                                ( { 'id'            : 'view'
-                                  , 'name'          : 'View'
-                                  , 'action'        : 'discussionitem_view'
-                                  , 'permissions'   : (View,)
-                                  }
-                                ,
-                                )
-                             }
-                           ,
-                           )
+They should *not* be addable through the standard 'folder_factories' interface.
+"""
+  , 'icon'           : 'discussionitem_icon.gif'
+  , 'product'        : '' # leave blank to suppress
+  , 'factory'        : ''
+  , 'immediate_view' : ''
+  , 'actions'        : ( { 'id'            : 'view'
+                         , 'name'          : 'View'
+                         , 'action'        : 'string:discussionitem_view'
+                         , 'permissions'   : (View,)
+                         }
+                       ,
+                       )
+  }
+,
+)
 
 
 def addDiscussionItem(self, id, title, description, text_format, text,


=== CMF/CMFDefault/Document.py 1.54 => 1.54.8.1 ===
--- CMF/CMFDefault/Document.py:1.54	Thu Feb 13 03:35:28 2003
+++ CMF/CMFDefault/Document.py	Mon Mar 10 18:49:58 2003
@@ -31,34 +31,36 @@
 from utils import html_headcheck
 from DocumentTemplate.DT_Util import html_quote
 
-factory_type_information = ( { 'id'             : 'Document'
-                             , 'meta_type'      : 'Document'
-                             , 'description'    : """\
-Documents can contain text that can be formatted using 'Structured Text.'"""
-                             , 'icon'           : 'document_icon.gif'
-                             , 'product'        : 'CMFDefault'
-                             , 'factory'        : 'addDocument'
-                             , 'immediate_view' : 'metadata_edit_form'
-                             , 'actions'        :
-                                ( { 'id'            : 'view' 
-                                  , 'name'          : 'View'
-                                  , 'action'        : 'document_view'
-                                  , 'permissions'   : (View,)
-                                  }
-                                , { 'id'            : 'edit'
-                                  , 'name'          : 'Edit'
-                                  , 'action'        : 'document_edit_form'
-                                  , 'permissions'   : (ModifyPortalContent,)
-                                  }
-                                , { 'id'            : 'metadata'
-                                  , 'name'          : 'Metadata'
-                                  , 'action'        : 'metadata_edit_form'
-                                  , 'permissions'   : (ModifyPortalContent,)
-                                  }
-                                )
-                             }
-                           ,
-                           )
+factory_type_information = (
+  { 'id'             : 'Document'
+  , 'meta_type'      : 'Document'
+  , 'description'    : """\
+Documents contain text that can be formatted using 'Structured Text.'
+They may also contain HTML, or "plain" text.
+"""
+  , 'icon'           : 'document_icon.gif'
+  , 'product'        : 'CMFDefault'
+  , 'factory'        : 'addDocument'
+  , 'immediate_view' : 'metadata_edit_form'
+  , 'actions'        : ( { 'id'            : 'view' 
+                         , 'name'          : 'View'
+                         , 'action'        : 'string:document_view'
+                         , 'permissions'   : (View,)
+                         }
+                       , { 'id'            : 'edit'
+                         , 'name'          : 'Edit'
+                         , 'action'        : 'string:document_edit_form'
+                         , 'permissions'   : (ModifyPortalContent,)
+                         }
+                       , { 'id'            : 'metadata'
+                         , 'name'          : 'Metadata'
+                         , 'action'        : 'string:metadata_edit_form'
+                         , 'permissions'   : (ModifyPortalContent,)
+                         }
+                       )
+  }
+,
+)
 
 def addDocument(self, id, title='', description='', text_format='',
                 text=''):


=== CMF/CMFDefault/Favorite.py 1.18 => 1.18.20.1 ===
--- CMF/CMFDefault/Favorite.py:1.18	Sat Aug  3 15:25:00 2002
+++ CMF/CMFDefault/Favorite.py	Mon Mar 10 18:49:58 2003
@@ -27,34 +27,35 @@
 from DublinCore import DefaultDublinCoreImpl
 from Link import Link
 
-factory_type_information = ( { 'id'             : 'Favorite'
-                             , 'meta_type'      : 'Favorite'
-                             , 'description'    : """\
-A Favorite is a Link to an intra-portal resource."""
-                             , 'icon'           : 'link_icon.gif'
-                             , 'product'        : 'CMFDefault'
-                             , 'factory'        : 'addFavorite'
-                             , 'immediate_view' : 'metadata_edit_form'
-                             , 'actions'        :
-                                ( { 'id'            : 'view'
-                                  , 'name'          : 'View'
-                                  , 'action'        : 'favorite_view'
-                                  , 'permissions'   : ( View, )
-                                  }
-                                , { 'id'            : 'edit'
-                                  , 'name'          : 'Edit'
-                                  , 'action'        : 'link_edit_form'
-                                  , 'permissions'   : ( ModifyPortalContent, )
-                                  }
-                                , { 'id'            : 'metadata'
-                                  , 'name'          : 'Metadata'
-                                  , 'action'        : 'metadata_edit_form'
-                                  , 'permissions'   : ( ModifyPortalContent, )
-                                  }
-                                )
-                             }
-                           ,
-                           )
+factory_type_information = (
+  { 'id'             : 'Favorite'
+  , 'meta_type'      : 'Favorite'
+  , 'description'    : """\
+A Favorite is a Link to an intra-portal resource.
+"""
+  , 'icon'           : 'link_icon.gif'
+  , 'product'        : 'CMFDefault'
+  , 'factory'        : 'addFavorite'
+  , 'immediate_view' : 'metadata_edit_form'
+  , 'actions'        : ( { 'id'            : 'view'
+                         , 'name'          : 'View'
+                         , 'action'        : 'string:favorite_view'
+                         , 'permissions'   : ( View, )
+                         }
+                       , { 'id'            : 'edit'
+                         , 'name'          : 'Edit'
+                         , 'action'        : 'string:link_edit_form'
+                         , 'permissions'   : ( ModifyPortalContent, )
+                         }
+                       , { 'id'            : 'metadata'
+                         , 'name'          : 'Metadata'
+                         , 'action'        : 'string:metadata_edit_form'
+                         , 'permissions'   : ( ModifyPortalContent, )
+                         }
+                       )
+  }
+,
+)
 
 def addFavorite(self, id, title='', remote_url='', description=''):
     """


=== CMF/CMFDefault/File.py 1.24 => 1.24.18.1 ===
--- CMF/CMFDefault/File.py:1.24	Mon Nov 18 04:53:22 2002
+++ CMF/CMFDefault/File.py	Mon Mar 10 18:49:58 2003
@@ -28,39 +28,40 @@
 from Products.CMFCore.WorkflowCore import WorkflowAction
 
 
-factory_type_information = ( { 'id'             : 'File'
-                             , 'meta_type'      : 'Portal File'
-                             , 'description'    : """\
-File objects can contain arbitrary downloadable files."""
-                             , 'icon'           : 'file_icon.gif'
-                             , 'product'        : 'CMFDefault'
-                             , 'factory'        : 'addFile'
-                             , 'immediate_view' : 'metadata_edit_form'
-                             , 'actions'        :
-                                ( { 'id'            : 'view'
-                                  , 'name'          : 'View'
-                                  , 'action'        : 'file_view'
-                                  , 'permissions'   : (View,)
-                                  }
-                                , { 'id'            : 'download'
-                                  , 'name'          : 'Download'
-                                  , 'action'        : ''
-                                  , 'permissions'   : (View,)
-                                  }
-                                , { 'id'            : 'edit'
-                                  , 'name'          : 'Edit'
-                                  , 'action'        : 'file_edit_form'
-                                  , 'permissions'   : (ModifyPortalContent,)
-                                  }
-                                , { 'id'            : 'metadata'
-                                  , 'name'          : 'Metadata'
-                                  , 'action'        : 'metadata_edit_form'
-                                  , 'permissions'   : (ModifyPortalContent,)
-                                  }
-                                )
-                             }
-                           ,
-                           )
+factory_type_information = (
+  { 'id'             : 'File'
+  , 'meta_type'      : 'Portal File'
+  , 'description'    : """\
+File objects can contain arbitrary downloadable files.
+"""
+  , 'icon'           : 'file_icon.gif'
+  , 'product'        : 'CMFDefault'
+  , 'factory'        : 'addFile'
+  , 'immediate_view' : 'metadata_edit_form'
+  , 'actions'        : ( { 'id'            : 'view'
+                         , 'name'          : 'View'
+                         , 'action'        : 'string:file_view'
+                         , 'permissions'   : (View,)
+                         }
+                       , { 'id'            : 'download'
+                         , 'name'          : 'Download'
+                         , 'action'        : 'string:'
+                         , 'permissions'   : (View,)
+                         }
+                       , { 'id'            : 'edit'
+                         , 'name'          : 'Edit'
+                         , 'action'        : 'string:file_edit_form'
+                         , 'permissions'   : (ModifyPortalContent,)
+                         }
+                       , { 'id'            : 'metadata'
+                         , 'name'          : 'Metadata'
+                         , 'action'        : 'string:metadata_edit_form'
+                         , 'permissions'   : (ModifyPortalContent,)
+                         }
+                       )
+  }
+,
+)
 
 import OFS.Image
 


=== CMF/CMFDefault/Image.py 1.21 => 1.21.20.1 ===
--- CMF/CMFDefault/Image.py:1.21	Tue Aug  6 20:53:16 2002
+++ CMF/CMFDefault/Image.py	Mon Mar 10 18:49:58 2003
@@ -26,34 +26,35 @@
 from Products.CMFCore.CMFCorePermissions import ModifyPortalContent
 from Products.CMFCore.WorkflowCore import WorkflowAction
 
-factory_type_information = ( { 'id'             : 'Image'
-                             , 'meta_type'      : 'Portal Image'
-                             , 'description'    : """\
-Image objects can be embedded in Portal documents."""
-                             , 'icon'           : 'image_icon.gif'
-                             , 'product'        : 'CMFDefault'
-                             , 'factory'        : 'addImage'
-                             , 'immediate_view' : 'metadata_edit_form'
-                             , 'actions'        :
-                                ( { 'id'            : 'view'
-                                  , 'name'          : 'View'
-                                  , 'action'        : 'image_view'
-                                  , 'permissions'   : (View,)
-                                  }
-                                , { 'id'            : 'edit'
-                                  , 'name'          : 'Edit'
-                                  , 'action'        : 'image_edit_form'
-                                  , 'permissions'   : (ModifyPortalContent,)
-                                  }
-                                , { 'id'            : 'metadata'
-                                  , 'name'          : 'Metadata'
-                                  , 'action'        : 'metadata_edit_form'
-                                  , 'permissions'   : (ModifyPortalContent,)
-                                  }
-                                )
-                             }
-                           ,
-                           )
+factory_type_information = (
+  { 'id'             : 'Image'
+  , 'meta_type'      : 'Portal Image'
+  , 'description'    : """\
+Image objects can be embedded in Portal documents.
+"""
+  , 'icon'           : 'image_icon.gif'
+  , 'product'        : 'CMFDefault'
+  , 'factory'        : 'addImage'
+  , 'immediate_view' : 'metadata_edit_form'
+  , 'actions'        : ( { 'id'            : 'view'
+                         , 'name'          : 'View'
+                         , 'action'        : 'string:image_view'
+                         , 'permissions'   : (View,)
+                         }
+                       , { 'id'            : 'edit'
+                         , 'name'          : 'Edit'
+                         , 'action'        : 'string:image_edit_form'
+                         , 'permissions'   : (ModifyPortalContent,)
+                         }
+                       , { 'id'            : 'metadata'
+                         , 'name'          : 'Metadata'
+                         , 'action'        : 'string:metadata_edit_form'
+                         , 'permissions'   : (ModifyPortalContent,)
+                         }
+                       )
+  }
+,
+)
 
 import OFS.Image
 


=== CMF/CMFDefault/Link.py 1.25 => 1.25.20.1 ===
--- CMF/CMFDefault/Link.py:1.25	Sat Aug  3 23:51:56 2002
+++ CMF/CMFDefault/Link.py	Mon Mar 10 18:49:58 2003
@@ -31,34 +31,35 @@
 from DublinCore import DefaultDublinCoreImpl
 from utils import formatRFC822Headers, parseHeadersBody, _dtmldir
 
-factory_type_information = ( { 'id'             : 'Link'
-                             , 'meta_type'      : 'Link'
-                             , 'description'    : """\
-Link items are URLs that come with additional information."""
-                             , 'icon'           : 'link_icon.gif'
-                             , 'product'        : 'CMFDefault'
-                             , 'factory'        : 'addLink'
-                             , 'immediate_view' : 'metadata_edit_form'
-                             , 'actions'        :
-                                ( { 'id'            : 'view'
-                                  , 'name'          : 'View'
-                                  , 'action'        : 'link_view'
-                                  , 'permissions'   : (View,)
-                                  }
-                                , { 'id'            : 'edit'
-                                  , 'name'          : 'Edit'
-                                  , 'action'        : 'link_edit_form'
-                                  , 'permissions'   : (ModifyPortalContent,)
-                                  }
-                                , { 'id'            : 'metadata'
-                                  , 'name'          : 'Metadata'
-                                  , 'action'        : 'metadata_edit_form'
-                                  , 'permissions'   : (ModifyPortalContent,)
-                                  }
-                                )
-                             }
-                           ,
-                           )
+factory_type_information = (
+  { 'id'             : 'Link'
+  , 'meta_type'      : 'Link'
+  , 'description'    : """\
+Link items are annotated URLs.
+"""
+  , 'icon'           : 'link_icon.gif'
+  , 'product'        : 'CMFDefault'
+  , 'factory'        : 'addLink'
+  , 'immediate_view' : 'metadata_edit_form'
+  , 'actions'        : ( { 'id'            : 'view'
+                         , 'name'          : 'View'
+                         , 'action'        : 'string:link_view'
+                         , 'permissions'   : (View,)
+                         }
+                       , { 'id'            : 'edit'
+                         , 'name'          : 'Edit'
+                         , 'action'        : 'string:link_edit_form'
+                         , 'permissions'   : (ModifyPortalContent,)
+                         }
+                       , { 'id'            : 'metadata'
+                         , 'name'          : 'Metadata'
+                         , 'action'        : 'string:metadata_edit_form'
+                         , 'permissions'   : (ModifyPortalContent,)
+                         }
+                       )
+  }
+,
+)
 
 
 def addLink( self


=== CMF/CMFDefault/NewsItem.py 1.17 => 1.17.20.1 ===
--- CMF/CMFDefault/NewsItem.py:1.17	Sat Aug  3 23:51:56 2002
+++ CMF/CMFDefault/NewsItem.py	Mon Mar 10 18:49:58 2003
@@ -22,34 +22,36 @@
 from AccessControl import ClassSecurityInfo
 from Products.CMFCore.WorkflowCore import WorkflowAction
 
-factory_type_information = ( { 'id'             : 'News Item'
-                             , 'meta_type'      : 'News Item'
-                             , 'description'    : """\
-News Items contain short text articles and carry a title as well as an optional description."""
-                             , 'icon'           : 'newsitem_icon.gif'
-                             , 'product'        : 'CMFDefault'
-                             , 'factory'        : 'addNewsItem'
-                             , 'immediate_view' : 'metadata_edit_form'
-                             , 'actions'        :
-                                ( { 'id'            : 'view'
-                                  , 'name'          : 'View'
-                                  , 'action'        : 'newsitem_view'
-                                  , 'permissions'   : (View,)
-                                  }
-                                , { 'id'            : 'edit'
-                                  , 'name'          : 'Edit'
-                                  , 'action'        : 'newsitem_edit_form'
-                                  , 'permissions'   : (ModifyPortalContent,)
-                                  }
-                                , { 'id'            : 'metadata'
-                                  , 'name'          : 'Metadata'
-                                  , 'action'        : 'metadata_edit_form'
-                                  , 'permissions'   : (ModifyPortalContent,)
-                                  }
-                                )
-                             }
-                           ,
-                           )
+factory_type_information = (
+  { 'id'             : 'News Item'
+  , 'meta_type'      : 'News Item'
+  , 'description'    : """\
+News Items contain short text articles and carry a title as well as
+an optional description.
+"""
+  , 'icon'           : 'newsitem_icon.gif'
+  , 'product'        : 'CMFDefault'
+  , 'factory'        : 'addNewsItem'
+  , 'immediate_view' : 'metadata_edit_form'
+  , 'actions'        : ( { 'id'            : 'view'
+                         , 'name'          : 'View'
+                         , 'action'        : 'string:newsitem_view'
+                         , 'permissions'   : (View,)
+                         }
+                       , { 'id'            : 'edit'
+                         , 'name'          : 'Edit'
+                         , 'action'        : 'string:newsitem_edit_form'
+                         , 'permissions'   : (ModifyPortalContent,)
+                         }
+                       , { 'id'            : 'metadata'
+                         , 'name'          : 'Metadata'
+                         , 'action'        : 'string:metadata_edit_form'
+                         , 'permissions'   : (ModifyPortalContent,)
+                         }
+                       )
+  }
+,
+)
 
 def addNewsItem( self
                , id


=== CMF/CMFDefault/SkinnedFolder.py 1.12 => 1.12.20.1 ===
--- CMF/CMFDefault/SkinnedFolder.py:1.12	Sat Aug  3 22:31:31 2002
+++ CMF/CMFDefault/SkinnedFolder.py	Mon Mar 10 18:49:58 2003
@@ -26,38 +26,39 @@
 from Products.CMFCore.CMFCatalogAware import CMFCatalogAware
 from Acquisition import aq_base
 
-factory_type_information = ( { 'id'             : 'Skinned Folder'
-                             , 'meta_type'      : 'Skinned Folder'
-                             , 'description'    : """\
-Skinned folders can define custom 'view' actions."""
-                             , 'icon'           : 'folder_icon.gif'
-                             , 'product'        : 'CMFDefault'
-                             , 'factory'        : 'addSkinnedFolder'
-                             , 'filter_content_types' : 0
-                             , 'immediate_view' : 'folder_edit_form'
-                             , 'actions'        :
-                                ( { 'id'            : 'view' 
-                                  , 'name'          : 'View'
-                                  , 'action'        : ''
-                                  , 'permissions'   : (View,)
-                                  , 'category'      : 'folder'
-                                  }
-                                , { 'id'            : 'edit'
-                                  , 'name'          : 'Edit'
-                                  , 'action'        : 'folder_edit_form'
-                                  , 'permissions'   : (ManageProperties,)
-                                  , 'category'      : 'folder'
-                                  }
-                                , { 'id'            : 'foldercontents'
-                                  , 'name'          : 'Folder contents'
-                                  , 'action'        : 'folder_contents'
-                                  , 'permissions'   : (ListFolderContents,)
-                                  , 'category'      : 'folder'
-                                  }
-                                )
-                             }
-                           ,
-                           )
+factory_type_information = (
+  { 'id'             : 'Skinned Folder'
+  , 'meta_type'      : 'Skinned Folder'
+  , 'description'    : """\
+Skinned folders can define custom 'view' actions.
+"""
+  , 'icon'           : 'folder_icon.gif'
+  , 'product'        : 'CMFDefault'
+  , 'factory'        : 'addSkinnedFolder'
+  , 'filter_content_types' : 0
+  , 'immediate_view' : 'folder_edit_form'
+  , 'actions'        : ( { 'id'            : 'view' 
+                         , 'name'          : 'View'
+                         , 'action'        : 'string:folder_view'
+                         , 'permissions'   : (View,)
+                         , 'category'      : 'folder'
+                         }
+                       , { 'id'            : 'edit'
+                         , 'name'          : 'Edit'
+                         , 'action'        : 'string:folder_edit_form'
+                         , 'permissions'   : (ManageProperties,)
+                         , 'category'      : 'folder'
+                         }
+                       , { 'id'            : 'foldercontents'
+                         , 'name'          : 'Folder contents'
+                         , 'action'        : 'string:folder_contents'
+                         , 'permissions'   : (ListFolderContents,)
+                         , 'category'      : 'folder'
+                         }
+                       )
+  }
+,
+)
 
 
 class SkinnedFolder(CMFCatalogAware, PortalFolder):