[Zapp-cvs-commit] ZApp ZApp_Application.py,1.26,1.27 ZApp_CMFBase.py,1.18,1.19
Brought to you by:
sspickle
|
From: <ssp...@us...> - 2003-12-10 14:20:24
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv17608
Modified Files:
ZApp_Application.py ZApp_CMFBase.py
Log Message:
make app object more self-contained.
Index: ZApp_Application.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_Application.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** ZApp_Application.py 28 Oct 2003 20:27:03 -0000 1.26
--- ZApp_Application.py 10 Dec 2003 14:20:21 -0000 1.27
***************
*** 104,110 ****
--- 104,112 ----
ob = ZApp_Application(id)
ob.id = id
+ ob.zapp_app_id = id
ob.title = "ZApp Application Object"
else:
ob = appObject
+ ob.zapp_app_id = id
self._setObject(ob.id, ob)
***************
*** 129,134 ****
applicationMetaType = meta_type = 'Z App Application'
specialistMetaTypes = ['Specialist','Z App Specialist']
-
LOCALE_ID = 'TST'
def _v_SpecialistsCache(self):
--- 131,137 ----
applicationMetaType = meta_type = 'Z App Application'
specialistMetaTypes = ['Specialist','Z App Specialist']
LOCALE_ID = 'TST'
+ MiscDataSpecialist = 'MiscData'
+ CMFDataSpecialist = 'CMFData'
def _v_SpecialistsCache(self):
***************
*** 137,140 ****
--- 140,148 ----
_v_SpecialistsCache = ComputedAttribute( _v_SpecialistsCache )
+
+ def zapp_app_id(self):
+ return self.id
+
+ zapp_app_id = ComputedAttribute( zapp_app_id )
_v_debugApp = None
***************
*** 162,165 ****
--- 170,176 ----
{'id':'applicationMetaType','type':'string','mode':'w'},
{'id':'LOCALE_ID','type':'string','mode':'w'},
+ {'id':'CMFDataSpecialist','type':'string','mode':'w'},
+ {'id':'MiscDataSpecialist','type':'string','mode':'w'},
+ {'id':'zapp_app_id','type':'string','mode':'w'},
)
Index: ZApp_CMFBase.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** ZApp_CMFBase.py 6 Nov 2003 17:23:55 -0000 1.18
--- ZApp_CMFBase.py 10 Dec 2003 14:20:21 -0000 1.19
***************
*** 105,110 ****
"""we use _notifyOfCopy to save our miscData to a property
so that the copy can retrieve it once created..."""
- mdm = self.getMiscDataSpecialist()
safeStorage = mdm.ZApp_createNewItem(objectID=self.calcPathID(), dataType='copyPasteStorage', Manager=self.safeMiscData.Manager)
if safeStorage:
--- 105,114 ----
"""we use _notifyOfCopy to save our miscData to a property
so that the copy can retrieve it once created..."""
+ return self._prepareRecursiveCopy(container, op)
+
+ def _prepareRecursiveCopy(self, container, op=0, mdm=None):
+ if mdm is None:
+ mdm = self.getMiscDataSpecialist()
safeStorage = mdm.ZApp_createNewItem(objectID=self.calcPathID(), dataType='copyPasteStorage', Manager=self.safeMiscData.Manager)
if safeStorage:
***************
*** 115,119 ****
get_transaction().commit(1)
! ZApp_LOG("_notifyOfCopyTo: Setting safeStorageID to " + safeStorageID)
def _setId(self, id):
--- 119,127 ----
get_transaction().commit(1)
! ZApp_LOG("_notifyOfCopyTo: Setting safeStorageID to " + safeStorageID, 100)
!
! for subObject in self.objectValues():
! if getattr(subObject, 'zapp_cmf_type', 0):
! subObject._prepareRecursiveCopy( self, op, mdm)
def _setId(self, id):
***************
*** 125,129 ****
if oldID:
safeStorageID = getattr(self, 'safeStorageID','')
! cmf_portal_type = getattr(self, 'cmf_portal_type','')
result = ZApp_Base._setId(self, id)
--- 133,137 ----
if oldID:
safeStorageID = getattr(self, 'safeStorageID','')
! cmf_portal_type = getattr(self, 'portal_type', getattr(self, 'cmf_portal_type',''))
result = ZApp_Base._setId(self, id)
***************
*** 136,145 ****
self._v_cmf_portal_type = None
! ZApp_LOG("_setID: SafeStorageID, cmf_portal_type are now %s" % (`(self._v_safeStorageID,oldID,id,self._v_cmf_portal_type)`))
return result
def _getCopy(self, container):
! ZApp_LOG("_getCopy, before" + `self.__dict__`)
safeStorageID = self.safeStorageID
--- 144,153 ----
self._v_cmf_portal_type = None
! ZApp_LOG("_setID: SafeStorageID, cmf_portal_type are now %s" % (`(self._v_safeStorageID,oldID,id,self._v_cmf_portal_type)`), 100)
return result
def _getCopy(self, container):
! ZApp_LOG("_getCopy, before" + `self.__dict__` + ":" + self.portal_type, 100)
safeStorageID = self.safeStorageID
***************
*** 151,166 ****
ob.__dict__['cmf_portal_type'] = self.portal_type
! ZApp_LOG("_getCopy, after" + `ob.__dict__`)
- return ob
-
def manage_afterAdd(self, item, container):
""" restore XML from volitile attribute..
-
at this point 'self' is somewhat bogus. It still has cached DataSkin attributes from its prior self.
-
"""
!
! ZApp_LOG("_manage_afterAdd" + `self.__dict__`)
safeStorageID = getattr(self, '_v_safeStorageID','')
--- 159,172 ----
ob.__dict__['cmf_portal_type'] = self.portal_type
! ZApp_LOG("_getCopy, after" + `ob.__dict__`, 100)
!
! return ob
def manage_afterAdd(self, item, container):
""" restore XML from volitile attribute..
at this point 'self' is somewhat bogus. It still has cached DataSkin attributes from its prior self.
"""
!
! ZApp_LOG("_manage_afterAdd" + `self.__dict__`, 100)
safeStorageID = getattr(self, '_v_safeStorageID','')
|