I am trying to use the CMFExternalFile.
A futur good product but i have problems with
portal_catalog in plone.
1/ When i create a new CMF External File, a new object
named like "External_File.2003-08-14.0954" is created.
An entry for this object is created in the catalog.
After editing the object, and renaming it to
PloneBook.pdf for example, a new entry in catalog is
created, but the old reference "External_File.2003-08-
14.0954" is still here.
For the other object types (Document, File...), it is the
same thing, except that the first entry is deleted.
2/ When a CMFExternalFile is deleted, it is not removed
from catalog.
So, it seems that CMFExternalFiles are never deleted
from catalog and must be removed by hand :-(
Logged In: YES
user_id=726932
I found the problem :
manage_beforeDelete and manage_afterAdd functions from
CMFCatalog are not called after adding or deleting a
CMFExternalFile.
I resolved the problem by added these lines in
CMFExternalFile.py :
security.declarePrivate('manage_afterAdd')
def manage_afterAdd(self, item, container):
""" """
PortalContent.manage_afterAdd(self, item, container)
security.declarePrivate('manage_beforeDelete')
def manage_beforeDelete(self, item, container):
""" """
PortalContent.manage_beforeDelete(self, item, container)
Now, all works well ! But i don't know why i must add these
lines for CMFExternalFile product and not for another ones.
Logged In: YES
user_id=726932
Finally, i found a more simple way to solve this bug.
It's an heritage problem in CMFExternalFile Class.
PortalContent must be the first of herited classes :
Replacing
class CMFExternalFile(ExternalFile, PortalContent,
DefaultDublinCoreImpl):
By
class CMFExternalFile(PortalContent,
DefaultDublinCoreImpl, ExternalFile):
solves the bug. :-)
ZeGoR