[CMF-checkins] CVS: CMF - DublinCore.py:1.10
Jeffrey Shell
jeffrey@digicool.com
Tue, 5 Jun 2001 18:56:25 -0400 (EDT)
Update of /cvs-repository/CMF/CMFDefault
In directory korak.digicool.com:/home/jeffrey/InstanceHomes/about-stuff/CMF/CMFDefault
Modified Files:
DublinCore.py
Log Message:
Modified DefaultDublinCoreImpl#setContributors() to use new tuplize
functionality (the ability to pass in a different splitter function).
If a string is passed in to setContributors(), it gets split on
semicolons. This allows setting of contributor strings to be like
"Doe, John E (john@doe.a.deer); The Mertz Family Foundation; PBS"
If one so deeply and dearly desired. (The above would turn into a
three element tuple).
---
Also modified #getMetadataHeaders() to do return the contributors
tuple, joined by semicolons (this function is used by manage_FTPGet
when rendering headers out to FTP/DAV Source Port).
--- Updated File DublinCore.py in package CMF --
--- DublinCore.py 2001/06/04 18:25:14 1.9
+++ DublinCore.py 2001/06/05 22:56:25 1.10
@@ -83,17 +83,18 @@
#
##############################################################################
-import string
+import string, re
from OFS.PropertyManager import PropertyManager
from DateTime.DateTime import DateTime
from Acquisition import aq_base
from Products.CMFCore.WorkflowCore import WorkflowAction
-from utils import tuplize, _dtmldir
+from utils import tuplize, _dtmldir, semi_split
from Globals import InitializeClass, DTMLFile
from AccessControl import ClassSecurityInfo
from Products.CMFCore import CMFCorePermissions
+
class DefaultDublinCoreImpl( PropertyManager ):
"""
Mix-in class which provides Dublin Core methods
@@ -313,7 +314,7 @@
hdrlist.append( ( 'Publisher', self.Publisher() ) )
hdrlist.append( ( 'Description', self.Description() ) )
hdrlist.append( ( 'Contributors', string.join(
- self.Contributors() ) ) )
+ self.Contributors(), '; ' ) ) )
hdrlist.append( ( 'Effective_date', self.EffectiveDate() ) )
hdrlist.append( ( 'Expiration_date', self.ExpirationDate() ) )
hdrlist.append( ( 'Type', self.Type() ) )
@@ -357,7 +358,7 @@
def setContributors( self, contributors ):
"Dublin Core element - additional contributors to resource"
# XXX: fixme
- self.contributors = tuplize( 'contributors', contributors )
+ self.contributors = tuplize('contributors', contributors, semi_split)
security.declareProtected( CMFCorePermissions.ModifyPortalContent
, 'setEffectiveDate' )