[CMF-checkins] CVS: CMF - Document.py:1.12 Favorite.py:1.6 File.py:1.10 Image.py:1.7 Link.py:1.4 NewsItem.py:1.6 Portal.py:1.16
tseaver@digicool.com
tseaver@digicool.com
Thu, 24 May 2001 16:19:01 -0400 (EDT)
Update of /cvs-repository/CMF/CMFDefault
In directory korak.digicool.com:/tmp/cvs-serv17931/CMFDefault
Modified Files:
Document.py Favorite.py File.py Image.py Link.py NewsItem.py
Portal.py
Log Message:
- Move 'factory_type_information' records back out to content modules.
--- Updated File Document.py in package CMF --
--- Document.py 2001/05/23 17:00:44 1.11
+++ Document.py 2001/05/24 20:19:00 1.12
@@ -98,6 +98,32 @@
from Products.CMFCore.WorkflowCore import WorkflowAction, afterCreate
from utils import parseHeadersBody, SimpleHTMLParser, bodyfinder, _dtmldir
+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' :
+ ( { 'name' : 'View'
+ , 'action' : 'document_view'
+ , 'permissions' : ('View',)
+ }
+ , { 'name' : 'Edit'
+ , 'action' : 'document_edit_form'
+ , 'permissions' : ('Modify portal content',)
+ }
+ , { 'name' : 'Metadata'
+ , 'action' : 'metadata_edit_form'
+ , 'permissions' : ('Modify portal content',)
+ }
+ )
+ }
+ ,
+ )
+
def addDocument(self, id, title='', description='', text_format='',
text=''):
""" Add a Document """
--- Updated File Favorite.py in package CMF --
--- Favorite.py 2001/03/29 15:48:59 1.5
+++ Favorite.py 2001/05/24 20:19:00 1.6
@@ -96,6 +96,31 @@
from Products.CMFCore.WorkflowCore import afterCreate
+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' :
+ ( { 'name' : 'View'
+ , 'action' : 'favorite_view'
+ , 'permissions' : ('View',)
+ }
+ , { 'name' : 'Edit'
+ , 'action' : 'link_edit_form'
+ , 'permissions' : ('Modify portal content',)
+ }
+ , { 'name' : 'Metadata'
+ , 'action' : 'metadata_edit_form'
+ , 'permissions' : ('Modify portal content',)
+ }
+ )
+ }
+ ,
+ )
def addFavorite(self, id, title='', remote_url='', description=''):
"""
--- Updated File File.py in package CMF --
--- File.py 2001/05/21 14:01:26 1.9
+++ File.py 2001/05/24 20:19:00 1.10
@@ -102,6 +102,36 @@
from Products.CMFCore.WorkflowCore import WorkflowAction, afterCreate
+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' :
+ ( { 'name' : 'View'
+ , 'action' : 'file_view'
+ , 'permissions' : ('View',)
+ }
+ , { 'name' : 'Download'
+ , 'action' : ''
+ , 'permissions' : ('View',)
+ }
+ , { 'name' : 'Edit'
+ , 'action' : 'file_edit_form'
+ , 'permissions' : ('Modify portal content',)
+ }
+ , { 'name' : 'Metadata'
+ , 'action' : 'metadata_edit_form'
+ , 'permissions' : ('Modify portal content',)
+ }
+ )
+ }
+ ,
+ )
+
import OFS.Image
def addFile( self
--- Updated File Image.py in package CMF --
--- Image.py 2001/05/21 13:49:38 1.6
+++ Image.py 2001/05/24 20:19:00 1.7
@@ -100,6 +100,31 @@
from Products.CMFCore import CMFCorePermissions
from Products.CMFCore.WorkflowCore import WorkflowAction, afterCreate
+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' :
+ ( { 'name' : 'View'
+ , 'action' : 'image_view'
+ , 'permissions' : ('View',)
+ }
+ , { 'name' : 'Edit'
+ , 'action' : 'image_edit_form'
+ , 'permissions' : ('Modify portal content',)
+ }
+ , { 'name' : 'Metadata'
+ , 'action' : 'metadata_edit_form'
+ , 'permissions' : ('Modify portal content',)
+ }
+ )
+ }
+ ,
+ )
import OFS.Image
--- Updated File Link.py in package CMF --
--- Link.py 2001/03/29 15:48:59 1.3
+++ Link.py 2001/05/24 20:19:00 1.4
@@ -96,6 +96,32 @@
from Products.CMFCore import CMFCorePermissions
from Products.CMFCore.WorkflowCore import WorkflowAction, afterCreate
+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' :
+ ( { 'name' : 'View'
+ , 'action' : 'link_view'
+ , 'permissions' : ('View',)
+ }
+ , { 'name' : 'Edit'
+ , 'action' : 'link_edit_form'
+ , 'permissions' : ('Modify portal content',)
+ }
+ , { 'name' : 'Metadata'
+ , 'action' : 'metadata_edit_form'
+ , 'permissions' : ('Modify portal content',)
+ }
+ )
+ }
+ ,
+ )
+
def addLink( self
, id
--- Updated File NewsItem.py in package CMF --
--- NewsItem.py 2001/05/23 17:00:44 1.5
+++ NewsItem.py 2001/05/24 20:19:00 1.6
@@ -98,6 +98,32 @@
from AccessControl import ClassSecurityInfo
from Products.CMFCore.WorkflowCore import WorkflowAction, afterCreate
+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' :
+ ( { 'name' : 'View'
+ , 'action' : 'newsitem_view'
+ , 'permissions' : ('View',)
+ }
+ , { 'name' : 'Edit'
+ , 'action' : 'newsitem_edit_form'
+ , 'permissions' : ('Modify portal content',)
+ }
+ , { 'name' : 'Metadata'
+ , 'action' : 'metadata_edit_form'
+ , 'permissions' : ('Modify portal content',)
+ }
+ )
+ }
+ ,
+ )
+
def addNewsItem( self
, id
, title=''
--- Updated File Portal.py in package CMF --
--- Portal.py 2001/05/18 21:29:46 1.15
+++ Portal.py 2001/05/24 20:19:00 1.16
@@ -85,128 +85,22 @@
import Globals
from Products.CMFCore.PortalObject import PortalObjectBase
-from Products.CMFCore.PortalFolder import manage_addPortalFolder
+from Products.CMFCore import PortalFolder
from Products.CMFCore.TypesTool import ContentFactoryMetadata
from Products.CMFCore.utils import getToolByName
from DublinCore import DefaultDublinCoreImpl
-members_roster = '''<dtml-return roster>'''
+import Document, Image, File, Link, NewsItem, Favorite
+
+factory_type_information = ( Document.factory_type_information
+ + Image.factory_type_information
+ + File.factory_type_information
+ + Link.factory_type_information
+ + NewsItem.factory_type_information
+ + Favorite.factory_type_information
+ )
-factory_type_information = (
- # Perhaps this ought to be in an external XML file.
- {'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_for':'newsitem',
- },
-
- {'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_for':'document',
- },
-
- {'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':
- ({'name': 'View',
- 'action': 'file_view',
- 'permissions': ('View',)},
- {'name': 'Download',
- 'action': '',
- 'permissions': ('View',)},
- {'name': 'Edit',
- 'action': 'file_edit_form',
- 'permissions': ('Modify portal content',)},
- {'name': 'Metadata',
- 'action': 'metadata_edit_form',
- 'permissions': ('Modify portal content',)},
- ),
- },
-
- {'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':
- ({'name': 'View',
- 'action': 'image_view',
- 'permissions': ('View',)},
- {'name': 'Edit',
- 'action': 'image_edit_form',
- 'permissions': ('Modify portal content',)},
- {'name': 'Metadata',
- 'action': 'metadata_edit_form',
- 'permissions': ('Modify portal content',)},
- ),
- },
-
- {'id': 'Link', 'meta_type': 'Link', 'description':
- 'Link items are URLs that come with additional information '
- 'such as a Title and a Description.', 'icon': 'link_icon.gif',
- 'product':'CMFDefault', 'factory':'addLink',
- 'immediate_view':'metadata_edit_form', 'actions_for':'link',
- },
-
- {'id': 'Folder', 'meta_type': 'Portal Folder', 'description':
- 'Use folders to put content in categories.', 'icon': 'folder_icon.gif',
- 'product':'CMFCore', 'factory':'manage_addPortalFolder',
- 'filter_content_types': 0,
- 'immediate_view':'folder_contents', 'actions':
- ({'name': 'View',
- 'action': '',
- 'permissions': ('View',),
- 'category': 'folder'},
- {'name': 'Change Folder',
- 'action': 'folder_edit_form',
- 'permissions': ('Manage properties',),
- 'category': 'folder'},
- {'name': 'Syndication',
- 'action': 'synPropertiesForm',
- 'permissions': ('Manage properties'),
- 'category': 'folder'},
- ),
- },
-
- {'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':
- ({'name': 'View',
- 'action': 'favorite_view',
- 'permissions': ('View',)},
- {'name': 'Edit',
- 'action': 'link_edit_form',
- 'permissions': ('Modify portal content',)},
- {'name': 'Metadata',
- 'action': 'metadata_edit_form',
- 'permissions': ('Modify portal content',)},
- ),
- },
-
- )
-
-for t in factory_type_information:
- ### This is a shortcut. Another reason to put the above
- ### structure in an XML file.
- af = t.get('actions_for', 0)
- if af:
- del t['actions_for']
- t['actions'] = ({'name': 'View',
- 'action': af + '_view',
- 'permissions': ('View',)},
- {'name': 'Edit',
- 'action': af + '_edit_form',
- 'permissions': ('Modify portal content',)},
- {'name': 'Metadata',
- 'action': 'metadata_edit_form',
- 'permissions': ('Modify portal content',)},
- )
+members_roster = '''<dtml-return roster>'''
class CMFSite ( PortalObjectBase
, DefaultDublinCoreImpl
@@ -350,7 +244,7 @@
id='cookie_authentication')
def setupMembersFolder(self, p):
- manage_addPortalFolder(p, 'Members')
+ PortalFolder.manage_addPortalFolder(p, 'Members')
p.Members.manage_addProduct['OFSP'].manage_addDTMLMethod(
'index_html', 'Member list', '<dtml-return roster>')
@@ -420,6 +314,7 @@
self.setupPermissions(p)
self.setupDefaultSkins(p)
self.setupTypes(p)
+ self.setupTypes(p, PortalFolder.factory_type_information)
self.setupWorkflow(p)
def create(self, parent, id, create_userfolder):