[Zapp-cvs-commit] ZApp ZApp_CMFBase.py,1.23,1.24 ZApp_DublinCoreMixin.py,1.1,1.2
Brought to you by:
sspickle
|
From: <ssp...@us...> - 2004-01-12 14:25:24
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv17345
Modified Files:
ZApp_CMFBase.py ZApp_DublinCoreMixin.py
Log Message:
adding some CMF features..
Index: ZApp_CMFBase.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** ZApp_CMFBase.py 9 Jan 2004 11:28:31 -0000 1.23
--- ZApp_CMFBase.py 12 Jan 2004 14:25:16 -0000 1.24
***************
*** 14,18 ****
missing = []
! dbug_level = 0
lpcol = LeverPropertyCollection
--- 14,18 ----
missing = []
! dbug_level = 100
lpcol = LeverPropertyCollection
***************
*** 64,67 ****
--- 64,69 ----
class_default_for_copyable = 0 # make these guys default to 'not copyable'
+
+ _custom_skin_scripts = ('WHEN OBJECT CHANGED STORE portal_type using self.change(cmf_portal_type=self.portal_type)',)
_primaryKeyStringSize=255 # allow for a pretty rediculous size...
Index: ZApp_DublinCoreMixin.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_DublinCoreMixin.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ZApp_DublinCoreMixin.py 2 Jan 2004 22:07:01 -0000 1.1
--- ZApp_DublinCoreMixin.py 12 Jan 2004 14:25:16 -0000 1.2
***************
*** 42,45 ****
--- 42,75 ----
class_default_for_metadata_modified = 0
+ def ZApp_handleMetaData(self, metadata=None, returnHeaders=0):
+ """
+ a new metadata dictionary needs to be used to update current metadata.
+ """
+
+ if metadata:
+ for key in metadata.keys():
+ oldValue = None
+ newValue = metadata.get(key,None)
+ setMethodName = 'set' + key
+ if hasattr(self, setMethodName) and newValue:
+ setMethod = getattr(self, setMethodName, None)
+ getMethod = getattr(self, key, None)
+ if getMethod:
+ oldValue = getMethod()
+ if type(oldValue) == type(()):
+ oldValue = list(oldValue)
+ if type(oldValue) == type([]) and (newValue not in oldValue):
+ newValue = tuple(oldValue + [newValue])
+ else:
+ newValue = (newValue,)
+
+ if setMethod:
+ setMethod( newValue )
+
+ if returnHeaders:
+ return self.getMetadataHeaders()
+ else:
+ return "OK!"
+
def _v_meta(self):
"""metadata changed trigger... """
|