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. """Mix-in class that provides OMF metadata, based on Dublin Core.
""" """
__implements__ = DefaultDublinCoreImpl.__implements__
security = ClassSecurityInfo() security = ClassSecurityInfo()
def __init__(self, def __init__(self,

View File

@ -25,6 +25,7 @@ from Products.CMFCore.DynamicType import DynamicType
# OFS imports # OFS imports
from OFS.SimpleItem import SimpleItem from OFS.SimpleItem import SimpleItem
from OFS import Image
# OMF imports # OMF imports
from OMF import OMF from OMF import OMF
@ -117,20 +118,25 @@ def manage_lampadas(self, action, REQUEST=None):
# CVSFile class # CVSFile class
################################################################ ################################################################
class PloneCVSFile(CVSFile, PortalContent, OMF): # PortalContent brings in: DynamicType, CMFCatalogAware, SimpleItem
class PloneCVSFile(CVSFile, Image.File, PortalContent, OMF):
"""Extended from CVSFile """Extended from CVSFile
""" """
def __init__(self, id, title='', description='', relativeFilePath='foo.html'): __implements__ = (CVSFile.__implements__,
CVSFile.__init__(self, id, title, description, relativeFilePath) PortalContent.__implements__,
OMF.__init__(self) OMF.__implements__)
# , title=title, description-description)
isPortalContent = 1
_isPortalContent = 1
meta_type = 'CMF CVS File' # This is the name Zope will use for the Product in meta_type = 'CMF CVS File' # This is the name Zope will use for the Product in
# the "addProduct" list # the "addProduct" list
__implements__ = ICVSFile _isDiscussable = 1
# This tuple defines a dictionary for each tab in the management interface # This tuple defines a dictionary for each tab in the management interface
# label = label of tab, action = url it links to # label = label of tab, action = url it links to
@ -166,7 +172,7 @@ class PloneCVSFile(CVSFile, PortalContent, OMF):
# CMF ATTRIBUTES # CMF ATTRIBUTES
portal_type = 'CVS File' portal_type = 'CMF CVS File'
set = _security.setPermissionDefault set = _security.setPermissionDefault
set('Edit CVS File', ('Owner', 'Manager', 'Authenticated')) set('Edit CVS File', ('Owner', 'Manager', 'Authenticated'))
set('FTP Access', ('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()) 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): def inCMF(self):
"""Return true if this object is in a CMF portal. """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 create_standard_formpart, create_externalfile_formpart
from Products.CMFCore.DirectoryView import registerDirectory from Products.CMFCore.DirectoryView import registerDirectory
from Products.CMFCore import utils from Products.CMFCore import utils, CMFCorePermissions
from socket import gethostname from socket import gethostname
factory_type_information = ( factory_type_information = (
{'id': 'CMF CVS File', {'id': 'CMF CVS File',
'content_icon': 'www/fish.gif',
'meta_type': 'CMF CVS File', 'meta_type': 'CMF CVS File',
'description': 'A file in a CVS repository.',
'content_icon': 'file_icon.gif',
'icon': 'file_icon.gif',
'product': 'PloneCVSFile', 'product': 'PloneCVSFile',
'factory': 'addPloneCVSFile', 'factory': 'addPloneCVSFile',
'immediate_view': 'index_html', 'immediate_view': 'metadata_edit_form',
'actions': ({'id': 'view', 'actions': ({'id': 'view',
'name': 'View', 'name': 'View',
'action': 'wikipage_view', 'action': 'file_view',
'permissions': ('View CVS File',)}, 'permissions': (CMFCorePermissions.View,)},
{'id': 'comment', {'id': 'download',
'name': 'Comment', 'name': 'Download',
'action': 'wikipage_comment_form', 'action': '',
'permissions': ('Add CVS File Comment',)}, 'permissions': (CMFCorePermissions.View,)},
{'id': 'edit', {'id': 'edit',
'name': 'Edit', 'name': 'Edit',
'action': 'wikipage_edit_form', 'action': 'file_edit_form',
'permissions': ('Edit CVS File',)}, 'permissions': (CMFCorePermissions.ModifyPortalContent,)},
{'id': 'create', {'id': 'metadata',
'name': 'Create', 'name': 'Metadata',
'category': 'folder', 'action': 'metadata_edit_form',
'action':'wikipage_create_form', 'permissions': (CMFCorePermissions.ModifyPortalContent,)},
'permissions': ('Create CVS File',), )
'visible': 0 },
),
}, },
) )

View File

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