[CMF-checkins] CVS: CMF - Portal.py:1.19
tseaver@digicool.com
tseaver@digicool.com
Tue, 29 May 2001 14:57:52 -0400 (EDT)
Update of /cvs-repository/CMF/CMFDefault
In directory korak.digicool.com:/tmp/cvs-serv6262/CMFDefault
Modified Files:
Portal.py
Log Message:
- Create initial mimetype registry.
--- Updated File Portal.py in package CMF --
--- Portal.py 2001/05/26 04:39:13 1.18
+++ Portal.py 2001/05/29 18:57:44 1.19
@@ -295,7 +295,32 @@
for t in initial_types:
cfm = apply(ContentFactoryMetadata, (), t)
tool._setObject(t['id'], cfm)
+
+ def setupMimetypes(self, p):
+ p.manage_addProduct[ 'CMFCore' ].manage_addRegistry()
+ reg = p.content_type_registry
+ reg.addPredicate( 'link', 'extension' )
+ reg.getPredicate( 'link' ).edit( extensions="url, link" )
+ reg.assignTypeName( 'link', 'Link' )
+
+ reg.addPredicate( 'news', 'extension' )
+ reg.getPredicate( 'news' ).edit( extensions="news" )
+ reg.assignTypeName( 'news', 'News Item' )
+
+ reg.addPredicate( 'document', 'major_minor' )
+ reg.getPredicate( 'document' ).edit( major="text", minor="" )
+ reg.assignTypeName( 'document', 'Document' )
+
+ reg.addPredicate( 'image', 'major_minor' )
+ reg.getPredicate( 'image' ).edit( major="image", minor="" )
+ reg.assignTypeName( 'image', 'Image' )
+
+ reg.addPredicate( 'file', 'major_minor' )
+ reg.getPredicate( 'file' ).edit( major="application", minor="" )
+ reg.assignTypeName( 'file', 'File' )
+
+
def setupWorkflow(self, p):
tool = getToolByName(p, 'portal_workflow', None)
if tool is None:
@@ -317,6 +342,7 @@
self.setupTypes(p)
self.setupTypes(p, PortalFolder.factory_type_information)
self.setupTypes(p, Topic.factory_type_information)
+ self.setupMimetypes(p)
self.setupWorkflow(p)
def create(self, parent, id, create_userfolder):