CMF integration now working, albeit imperfectly.

This commit is contained in:
david 2002-11-05 17:43:10 +00:00
parent a6fe1d841a
commit f143581e6c
4 changed files with 39 additions and 26 deletions

View File

@ -9,6 +9,8 @@ class OMF(DefaultDublinCoreImpl):
"""Mix-in class that provides OMF metadata, based on Dublin Core.
"""
__implements__ = DefaultDublinCoreImpl.__implements__
security = ClassSecurityInfo()
def __init__(self,

View File

@ -25,6 +25,7 @@ from Products.CMFCore.DynamicType import DynamicType
# OFS imports
from OFS.SimpleItem import SimpleItem
from OFS import Image
# OMF imports
from OMF import OMF
@ -117,20 +118,25 @@ def manage_lampadas(self, action, REQUEST=None):
# CVSFile class
################################################################
class PloneCVSFile(CVSFile, PortalContent, OMF):
# PortalContent brings in: DynamicType, CMFCatalogAware, SimpleItem
class PloneCVSFile(CVSFile, Image.File, PortalContent, OMF):
"""Extended from CVSFile
"""
def __init__(self, id, title='', description='', relativeFilePath='foo.html'):
CVSFile.__init__(self, id, title, description, relativeFilePath)
OMF.__init__(self)
# , title=title, description-description)
__implements__ = (CVSFile.__implements__,
PortalContent.__implements__,
OMF.__implements__)
isPortalContent = 1
_isPortalContent = 1
meta_type = 'CMF CVS File' # This is the name Zope will use for the Product in
# the "addProduct" list
__implements__ = ICVSFile
_isDiscussable = 1
# This tuple defines a dictionary for each tab in the management interface
# label = label of tab, action = url it links to
@ -166,7 +172,7 @@ class PloneCVSFile(CVSFile, PortalContent, OMF):
# CMF ATTRIBUTES
portal_type = 'CVS File'
portal_type = 'CMF CVS File'
set = _security.setPermissionDefault
set('Edit CVS File', ('Owner', 'Manager', 'Authenticated'))
set('FTP Access', ('Owner', 'Manager', 'Authenticated'))
@ -177,6 +183,11 @@ class PloneCVSFile(CVSFile, PortalContent, OMF):
manage_metadata = DTMLFile('dtml/omf_metadata', globals())
def __init__(self, id, title='', description='', relativeFilePath='foo.html'):
CVSFile.__init__(self, id, title, description, relativeFilePath)
Image.File.__init__(self, id, title, relativeFilePath)
OMF.__init__(self)
def inCMF(self):
"""Return true if this object is in a CMF portal.
"""

View File

@ -8,36 +8,36 @@ from Products.ExternalFile.CreationDialog import manage_add_via_gui, \
create_standard_formpart, create_externalfile_formpart
from Products.CMFCore.DirectoryView import registerDirectory
from Products.CMFCore import utils
from Products.CMFCore import utils, CMFCorePermissions
from socket import gethostname
factory_type_information = (
{'id': 'CMF CVS File',
'content_icon': 'www/fish.gif',
'meta_type': 'CMF CVS File',
'description': 'A file in a CVS repository.',
'content_icon': 'file_icon.gif',
'icon': 'file_icon.gif',
'product': 'PloneCVSFile',
'factory': 'addPloneCVSFile',
'immediate_view': 'index_html',
'immediate_view': 'metadata_edit_form',
'actions': ({'id': 'view',
'name': 'View',
'action': 'wikipage_view',
'permissions': ('View CVS File',)},
{'id': 'comment',
'name': 'Comment',
'action': 'wikipage_comment_form',
'permissions': ('Add CVS File Comment',)},
'action': 'file_view',
'permissions': (CMFCorePermissions.View,)},
{'id': 'download',
'name': 'Download',
'action': '',
'permissions': (CMFCorePermissions.View,)},
{'id': 'edit',
'name': 'Edit',
'action': 'wikipage_edit_form',
'permissions': ('Edit CVS File',)},
{'id': 'create',
'name': 'Create',
'category': 'folder',
'action':'wikipage_create_form',
'permissions': ('Create CVS File',),
'visible': 0 },
),
'action': 'file_edit_form',
'permissions': (CMFCorePermissions.ModifyPortalContent,)},
{'id': 'metadata',
'name': 'Metadata',
'action': 'metadata_edit_form',
'permissions': (CMFCorePermissions.ModifyPortalContent,)},
)
},
)

View File

@ -1,2 +1,2 @@
0.0.18
0.0.19