zapp-cvs-commit Mailing List for ZApp Framework (Page 6)
Brought to you by:
sspickle
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(24) |
Jul
(14) |
Aug
(19) |
Sep
(3) |
Oct
(21) |
Nov
(9) |
Dec
(8) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(23) |
Feb
(13) |
Mar
(37) |
Apr
(5) |
May
(15) |
Jun
(2) |
Jul
(1) |
Aug
(1) |
Sep
(13) |
Oct
(1) |
Nov
(1) |
Dec
|
| 2005 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
|
From: <ssp...@us...> - 2003-12-31 18:04:26
|
Update of /cvsroot/zapp/ZApp/skins In directory sc8-pr-cvs1:/tmp/cvs-serv2278/skins Added Files: .cvsignore Log Message: fixed up for IADC --- NEW FILE: .cvsignore --- *.pyc refresh.txt .DS* foo* |
Update of /cvsroot/zapp/ZApp/skins/zapp_generic
In directory sc8-pr-cvs1:/tmp/cvs-serv2278/skins/zapp_generic
Modified Files:
zapp_cmf_object_edit_form.pt zapp_cmf_object_view.pt
Added Files:
zapp_cmf_sub_contents.pt
Removed Files:
zapp_cmf_sub_contents.zpt
Log Message:
fixed up for IADC
--- NEW FILE: zapp_cmf_sub_contents.pt ---
<span tal:replace="structure here/folder_contents"/>
Index: zapp_cmf_object_edit_form.pt
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_cmf_object_edit_form.pt,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** zapp_cmf_object_edit_form.pt 28 Oct 2003 20:27:04 -0000 1.4
--- zapp_cmf_object_edit_form.pt 31 Dec 2003 18:04:21 -0000 1.5
***************
*** 10,14 ****
<div metal:fill-slot="main">
! ZApp CMF Thingy..
<!-- A ZApp CMF property set is a list of objects/dictionaries (stored as 'zapp_properties') in the TypeProperty
--- 10,15 ----
<div metal:fill-slot="main">
! This is the default 'edit' view. This object apparently has no edit form skin yet.
!
<!-- A ZApp CMF property set is a list of objects/dictionaries (stored as 'zapp_properties') in the TypeProperty
***************
*** 111,113 ****
</body>
! </html>
--- 112,114 ----
</body>
! </html>
\ No newline at end of file
Index: zapp_cmf_object_view.pt
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_cmf_object_view.pt,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** zapp_cmf_object_view.pt 28 Oct 2003 20:27:04 -0000 1.5
--- zapp_cmf_object_view.pt 31 Dec 2003 18:04:21 -0000 1.6
***************
*** 18,22 ****
myProperties python:here.safeMiscData.getXMLDict()">
! ZApp CMF Thing.
<div tal:content="myTypePropertiesMiscData"> </div>
--- 18,22 ----
myProperties python:here.safeMiscData.getXMLDict()">
! Raw Data View (this screen apparently has no skin yet.. )
<div tal:content="myTypePropertiesMiscData"> </div>
***************
*** 28,30 ****
</body>
! </html>
--- 28,30 ----
</body>
! </html>
\ No newline at end of file
--- zapp_cmf_sub_contents.zpt DELETED ---
|
|
From: <ssp...@us...> - 2003-12-31 18:04:24
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv2278
Modified Files:
ZApp_MiscData.py
Log Message:
fixed up for IADC
Index: ZApp_MiscData.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_MiscData.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** ZApp_MiscData.py 4 Dec 2003 22:25:59 -0000 1.22
--- ZApp_MiscData.py 31 Dec 2003 18:04:21 -0000 1.23
***************
*** 92,95 ****
--- 92,99 ----
d[attr] = value
+
+ def _clearXMLAttrs(self):
+ self._v_xmlDict = {}
+ self.buildXML()
def setXMLAttr(self, attr, value):
***************
*** 98,103 ****
self.buildXML()
! def setXMLAttrs(self, dict=None, **kw):
! """ set some XML attributes based on a dictionary."""
saveDict = {}
--- 102,111 ----
self.buildXML()
! def setXMLAttrs(self, dict=None, zapp_misc_data_clear=0, **kw):
! """
! set some XML attributes based on a dictionary.
!
! if zapp_misc_data_clear is true, clear out any existing data in stored xml.
! """
saveDict = {}
***************
*** 108,111 ****
--- 116,122 ----
saveDict.update(dict)
+ if zapp_misc_data_clear:
+ self._clearXMLAttrs()
+
d = self._v_xmlDict # getting _v_xmlDict insures the cache is setup
***************
*** 180,184 ****
return mds
! def getMiscData(self, Manager=None, dataType=''):
"""
Get MiscData object associated with this object/Manager/dataType combination..
--- 191,195 ----
return mds
! def getMiscData(self, Manager=None, dataType='', createIfNone=0):
"""
Get MiscData object associated with this object/Manager/dataType combination..
***************
*** 188,191 ****
--- 199,203 ----
localmdmKey = Manager + ":" + dataType
mdm = self._v_MyMDMCache.get(localmdmKey, missing)
+ mdResult = None
if mdm is missing:
***************
*** 193,200 ****
for aBag in mds.ZApp_getItems( objectID = self.getMiscObjectID(), Manager = Manager):
if aBag.dataType == dataType:
! mdm = aBag
break
! return mdm or None
def setupMiscData(self, Manager=None, dataType='', checked=0):
--- 205,215 ----
for aBag in mds.ZApp_getItems( objectID = self.getMiscObjectID(), Manager = Manager):
if aBag.dataType == dataType:
! mdResult = aBag
break
! if createIfNone and (mdResult is None):
! mdResult = self.setupMiscData( Manager, dataType, checked=1)
!
! return mdResult or None
def setupMiscData(self, Manager=None, dataType='', checked=0):
|
|
From: <ssp...@us...> - 2003-12-16 17:19:47
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv6778
Modified Files:
ZApp_Application.py ZApp_CMFBase.py ZApp_RelatableItem.py
Log Message:
working with plone now..
Index: ZApp_Application.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_Application.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** ZApp_Application.py 10 Dec 2003 14:20:21 -0000 1.27
--- ZApp_Application.py 16 Dec 2003 17:19:44 -0000 1.28
***************
*** 27,30 ****
--- 27,35 ----
_marker = []
+ from ZApp_LOG import ZApp_LOG
+ from zLOG import INFO, PROBLEM, ERROR
+
+ dbug_level = PROBLEM
+
Folder = OFS.Folder.Folder
DTMLMethod = OFS.DTMLMethod
***************
*** 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)
--- 109,115 ----
***************
*** 118,122 ****
if leverSet != 'Generic Lever Methods':
ob.LeversSetGroup._constructPlugIn('Generic Lever Methods', 'genericLevers')
!
updateMethodsInFolder(ob, getUIMethods(ui_method_names))
--- 121,125 ----
if leverSet != 'Generic Lever Methods':
ob.LeversSetGroup._constructPlugIn('Generic Lever Methods', 'genericLevers')
!
updateMethodsInFolder(ob, getUIMethods(ui_method_names))
***************
*** 124,128 ****
return MessageDialog(title='OK', message = ' Added ZApp Application ', action='manage_main')
-
from ZApp_RelationshipManager import rManID
--- 127,130 ----
***************
*** 130,134 ****
applicationMetaType = meta_type = 'Z App Application'
! specialistMetaTypes = ['Specialist','Z App Specialist']
LOCALE_ID = 'TST'
MiscDataSpecialist = 'MiscData'
--- 132,136 ----
applicationMetaType = meta_type = 'Z App Application'
! specialistMetaTypes = ['Specialist','Z App Specialist','Z App Relationship Manager']
LOCALE_ID = 'TST'
MiscDataSpecialist = 'MiscData'
***************
*** 136,139 ****
--- 138,145 ----
def _v_SpecialistsCache(self):
+ for mType in ZApp_Application.specialistMetaTypes:
+ if mType not in self.specialistMetaTypes:
+ self.specialistMetaTypes.append(mType)
+
v = self._v_SpecialistsCache = self.getSpecialistsCache()
return v
***************
*** 142,148 ****
def zapp_app_id(self):
! return self.id
zapp_app_id = ComputedAttribute( zapp_app_id )
_v_debugApp = None
--- 148,170 ----
def zapp_app_id(self):
! return self.getId()
zapp_app_id = ComputedAttribute( zapp_app_id )
+
+ def zapp_portal_object( self ):
+ if hasattr(self, 'portal_url'):
+ return self.portal_url.getPortalObject()
+
+ for item in self.objectValues():
+ if hasattr(item, '_isPortalRoot'):
+ return item
+
+ zapp_portal_object = ComputedAttribute( zapp_portal_object )
+
+ def zapp_portal_id(self):
+ po = self.zapp_portal_object
+ return (po and po.getId()) or 'none'
+
+ zapp_portal_id = ComputedAttribute( zapp_portal_id )
_v_debugApp = None
***************
*** 172,176 ****
{'id':'CMFDataSpecialist','type':'string','mode':'w'},
{'id':'MiscDataSpecialist','type':'string','mode':'w'},
! {'id':'zapp_app_id','type':'string','mode':'w'},
)
--- 194,199 ----
{'id':'CMFDataSpecialist','type':'string','mode':'w'},
{'id':'MiscDataSpecialist','type':'string','mode':'w'},
! {'id':'zapp_app_id','type':'string','mode':''},
! {'id':'zapp_portal_id','type':'string','mode':''},
)
***************
*** 181,190 ****
)
-
manage_leverActionsForm = DTMLFile('manage_ui/leverActionsForm',globals(),management_view='Lever Actions')
manage_leverResults = DTMLFile('manage_ui/leverResults',globals(),management_view='Lever Actions')
!
!
def __bobo_traverse__(self, REQUEST, name):
--- 204,211 ----
)
manage_leverActionsForm = DTMLFile('manage_ui/leverActionsForm',globals(),management_view='Lever Actions')
manage_leverResults = DTMLFile('manage_ui/leverResults',globals(),management_view='Lever Actions')
!
def __bobo_traverse__(self, REQUEST, name):
***************
*** 256,261 ****
get the application's "RelationshipManager".
"""
! return self.getSpecialist(rManID)
def getSpecialistsCache(self):
--- 277,288 ----
get the application's "RelationshipManager".
"""
+ result = self.getSpecialist(rManID)
+ if not result:
+ import pdb
+ pdb.set_trace()
! ZApp_LOG("Failed to get rman!", dbug_level);
!
! return result
def getSpecialistsCache(self):
Index: ZApp_CMFBase.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** ZApp_CMFBase.py 10 Dec 2003 14:20:21 -0000 1.19
--- ZApp_CMFBase.py 16 Dec 2003 17:19:44 -0000 1.20
***************
*** 6,9 ****
--- 6,11 ----
import time
import string
+ import traceback
+
from ZApp_Base import ZApp_Base, extendProperties, LeverPropertyCollection, LeverProperty
***************
*** 11,14 ****
--- 13,17 ----
missing = []
+ dbug_level = 0
lpcol = LeverPropertyCollection
***************
*** 72,76 ****
def calcPathID(self):
-
try:
if self.id.find(',') != -1:
--- 75,78 ----
***************
*** 78,82 ****
else:
objPath = ','.join(self.getPhysicalPath())
! portalPath = ','.join(self.portal_url.getPortalObject().getPhysicalPath()) + ','
result = objPath[len(portalPath)-1:]
except:
--- 80,85 ----
else:
objPath = ','.join(self.getPhysicalPath())
! portal_object = self.zapp_portal_object
! portalPath = ','.join(portal_object.getPhysicalPath()) + ','
result = objPath[len(portalPath)-1:]
except:
***************
*** 103,127 ****
def _notifyOfCopyTo(self, container, op=0):
"""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:
safeStorage.setXMLAttrs( operationType = op )
! safeStorage.setXMLAttrs( oldID = self.calcPathID())
safeStorageID = safeStorage.getId()
! self.change(safeStorageID = safeStorageID )
! 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):
--- 106,154 ----
def _notifyOfCopyTo(self, container, op=0):
+ """
+ notify of copy...
+ """
+
+ if self.REQUEST.get('notifyClear',0):
+ import pdb
+ pdb.set_trace()
+
+ self._ZCMFnotifyOfCopyTo(container, op)
+
+ def _subobjectNotify(self, op, mdm, notify_depth, safeStorage):
+ """notify subobjects of their impending change... """
+
+ for item in self.objectValues():
+ if getattr(item, 'zapp_cmf_type', 0):
+ item._ZCMFnotifyOfCopyTo( self, op, mdm, notify_depth+1, safeStorage)
+
+ def _ZCMFnotifyOfCopyTo(self, container, op=0, mdm=None, notify_depth=0, safeStorage=None):
"""we use _notifyOfCopy to save our miscData to a property
! so that the copy can retrieve it once created..."""
!
! ZApp_LOG("_notifyOfCopyTo: " + container.getId() + ":" + `op` + ":" + `notify_depth`, dbug_level)
!
! if notify_depth > 20:
! ZApp_LOG("Err... recursion problem?", dbug_level)
! return
if mdm is None:
mdm = self.getMiscDataSpecialist()
! selfID = self.calcPathID()
! mdmManager = self.safeMiscData.Manager
!
! if safeStorage is None:
! safeStorage = mdm.ZApp_createNewItem(objectID=selfID, dataType='copyPasteStorage', Manager=mdmManager)
safeStorage.setXMLAttrs( operationType = op )
! safeStorage.setXMLAttrs( oldID = selfID)
safeStorageID = safeStorage.getId()
! self.change(safeStorageID = safeStorageID, cmf_portal_type=self.portal_type )
! ZApp_LOG("commit sub-transaction...")
! get_transaction().commit(1)
!
! ZApp_LOG("do subobject notify: safeStorageID:" + safeStorage.getId() + ":self.id:" + selfID + ":Manager:" + mdmManager, dbug_level)
! self._subobjectNotify( op, mdm, notify_depth, safeStorage)
def _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)
--- 160,163 ----
***************
*** 139,153 ****
if oldID:
self._v_safeStorageID = safeStorageID
- self._v_cmf_portal_type = cmf_portal_type
else:
self._v_safeStorageID = None
- 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
--- 165,176 ----
if oldID:
self._v_safeStorageID = safeStorageID
else:
self._v_safeStorageID = None
! ZApp_LOG("_setID: SafeStorageID, oldID, id, are now %s" % (`(self._v_safeStorageID,oldID,id)`), dbug_level)
return result
def _getCopy(self, container):
safeStorageID = self.safeStorageID
***************
*** 155,166 ****
ob = CopySource._getCopy.im_func(self,container)
ob.__of__(container) # force DM hookup
if safeStorageID:
ob.__dict__['safeStorageID'] = safeStorageID
- 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..
--- 178,232 ----
ob = CopySource._getCopy.im_func(self,container)
ob.__of__(container) # force DM hookup
+
+ ZApp_LOG("_getCopy, before" + self.getId() + ":" + `safeStorageID` + ":" + `self.portal_type` , dbug_level)
+
if safeStorageID:
ob.__dict__['safeStorageID'] = safeStorageID
! ZApp_LOG("_getCopy, after" + `ob.__dict__.keys()` , dbug_level)
return ob
+ def ZAppCMF_afterAdd(self, safeStorage, newID):
+ """
+ For (sub)objects that need to be hooked up after an 'add'
+ operation.
+ """
+
+ get = safeStorage.getXMLAttr
+ op = get('operationType','')
+ oldID = get('oldID','')
+ mySpec = self.getMySpecialist()
+ newRelID = self.calcPathID().split(newID)[1]
+ oldItemID = oldID + newRelID
+
+ ZApp_LOG("ZAppCMF_afterAdd: " + newRelID + ":" + oldItemID + ":" + mySpec.getId() + ":", dbug_level)
+
+ if mySpec and oldItemID:
+ oldSelf = mySpec.getItem( oldItemID )
+ if oldSelf:
+ newSelf = mySpec.ZApp_createNewItem(id=self.calcPathID())
+ mySpec.commit_subtransaction()
+
+ newSelf.setMiscData( dataDict = oldSelf.safeMiscData.getXMLDict())
+ newSelf.change(safeStorageID = '', cmf_portal_type=self.portal_type)
+ mySpec.commit_subtransaction()
+
+ newSelf.copyObjectRelations( oldSelf.objectRelations( returnObjects=1 ))
+
+ if op:
+ #
+ # it's a move operation...
+ #
+ oldSelf.manage_delete()
+
+ else:
+
+ oldSelf.change(safeStorageID = '')
+
+ for item in self.objectValues():
+ if getattr(item, 'zapp_cmf_type', 0):
+ item.ZAppCMF_afterAdd( safeStorage, newID )
+
def manage_afterAdd(self, item, container):
""" restore XML from volitile attribute..
***************
*** 168,217 ****
"""
- ZApp_LOG("_manage_afterAdd" + `self.__dict__`, 100)
-
safeStorageID = getattr(self, '_v_safeStorageID','')
! cmf_portal_type = getattr(self, '_v_cmf_portal_type','')
! SkinnedFolder.manage_afterAdd(self, item, container)
! ZApp_Base.manage_afterAdd(self, item, container)
!
if safeStorageID:
mdm = self.getMiscDataSpecialist()
safeStorage = mdm.getItem(safeStorageID)
if safeStorage:
! get = safeStorage.getXMLAttr
! op = get('operationType','')
! oldID = get('oldID','')
! mySpec = self.getMySpecialist()
!
! if mySpec and oldID:
! oldSelf = mySpec.getItem( oldID )
!
! if oldSelf:
! newSelf = mySpec.ZApp_createNewItem(id=self.calcPathID())
! mySpec.commit_subtransaction()
!
! newSelf.setMiscData( dataDict = oldSelf.safeMiscData.getXMLDict())
! newSelf.change(safeStorageID = '', cmf_portal_type=cmf_portal_type)
! mySpec.commit_subtransaction()
! newSelf.copyObjectRelations( oldSelf.objectRelations( returnObjects=1 ))
! if op:
! #
! # it's a move operation...
! #
! oldSelf.manage_delete()
! else:
! oldSelf.change(safeStorageID = '')
!
! safeStorage.manage_delete()
! if self.safeStorageID:
! self.change(safeStorageID = '')
! if hasattr(self, '_v_safeStorageID'):
! del self._v_safeStorageID # we've got it now.. thanks. ;-)
!
def copyObjectRelations(self, theObjectRelations):
--- 234,263 ----
"""
safeStorageID = getattr(self, '_v_safeStorageID','')
! newID = self.calcPathID()
! ZApp_LOG("_manage_afterAdd: " + self.getId() + ":" + safeStorageID + ":_v_in_manage_afterAdd:" + `getattr(self,'_v_in_manage_afterAdd',0)`, dbug_level)
!
! if getattr(self,'_v_in_manage_afterAdd',0):
! return
! else:
! self._v_in_manage_afterAdd = 1
!
if safeStorageID:
mdm = self.getMiscDataSpecialist()
safeStorage = mdm.getItem(safeStorageID)
if safeStorage:
! self.ZAppCMF_afterAdd( safeStorage, newID )
! safeStorage.manage_delete()
! del self._v_safeStorageID # we've got it now.. thanks. ;-)
! self.change( cmf_portal_type = self.portal_type)
! get_transaction().commit(1)
! SkinnedFolder.manage_afterAdd(self, item, container)
! ZApp_Base.manage_afterAdd(self, item, container)
! del self._v_in_manage_afterAdd
def copyObjectRelations(self, theObjectRelations):
Index: ZApp_RelatableItem.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_RelatableItem.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** ZApp_RelatableItem.py 28 Oct 2003 20:27:03 -0000 1.21
--- ZApp_RelatableItem.py 16 Dec 2003 17:19:44 -0000 1.22
***************
*** 11,14 ****
--- 11,19 ----
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from ZApp_LOG import ZApp_LOG
+ from zLOG import PROBLEM, INFO, ERROR
+
+ dbug_level=INFO
+
+ import traceback
class ZApp_RelatableParentMixin:
***************
*** 279,283 ****
def getRelationshipManager(self):
! return self.findApplication().getRelationshipManager()
def getObjectManagerID(self):
--- 284,293 ----
def getRelationshipManager(self):
! rm = self.findApplication().getRelationshipManager()
! if not rm:
! ZApp_LOG("Ack... can't find relationship manager!", ERROR)
! traceback.print_stack()
!
! return rm
def getObjectManagerID(self):
***************
*** 317,330 ****
A UI method to create and add an object..
"""
-
cond = {}
if objectProperties is not None:
! for k in objectProperties.keys():
! cond[k] = objectProperties[k]
!
if kw:
cond.update(kw)
self.createAndAddObject(objectProperties=cond, objectManager=objectManager, objectRole=objectRole, selfRole=selfRole, createIfNone=createIfNone, contextID=contextID)
--- 327,343 ----
A UI method to create and add an object..
"""
cond = {}
if objectProperties is not None:
! cond.update(objectProperties)
!
if kw:
cond.update(kw)
+ if REQUEST:
+ cond.update(REQUEST.form)
+
+ ZApp_LOG("createAndAddObject_ui:" + `cond` + ":" + `kw`, dbug_level)
+
self.createAndAddObject(objectProperties=cond, objectManager=objectManager, objectRole=objectRole, selfRole=selfRole, createIfNone=createIfNone, contextID=contextID)
***************
*** 374,378 ****
rm = self.getRelationshipManager()
! selfRItem = rm.relateObjects( object1=self, object1Role=selfRole, object2=otherObject, object2Role=objectRole, createIfNone=createIfNone, contextID=contextID)
return selfRItem
--- 387,395 ----
rm = self.getRelationshipManager()
! if rm:
! selfRItem = rm.relateObjects( object1=self, object1Role=selfRole, object2=otherObject, object2Role=objectRole, createIfNone=createIfNone, contextID=contextID)
! else:
! raise RuntimeError, "Can't find relationship manager!"
!
return selfRItem
|
|
From: <ssp...@us...> - 2003-12-16 17:19:47
|
Update of /cvsroot/zapp/ZApp/zpt
In directory sc8-pr-cvs1:/tmp/cvs-serv6778/zpt
Modified Files:
findNewRelationship_ui.zpt
Log Message:
working with plone now..
Index: findNewRelationship_ui.zpt
===================================================================
RCS file: /cvsroot/zapp/ZApp/zpt/findNewRelationship_ui.zpt,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** findNewRelationship_ui.zpt 8 Oct 2003 20:33:53 -0000 1.2
--- findNewRelationship_ui.zpt 16 Dec 2003 17:19:44 -0000 1.3
***************
*** 5,11 ****
dummy python:request.set('filterProperties',{'objectManager':objectManager, });
dummy python:request.set('actionProperties',{'objectManager':objectManager, });
! dummy python:request.set('itemIdName','objectProperties.objectID:record');
dummy python:request.set('itemControlType','radio');
! dummy python:request.set('formParams',{'action':'createAndAddObject_ui', 'submit':'Create Relationship',
'hiddenFormItems':[{'name':'objectManager', 'value':objectManager},
{'name':'createIfNone:int', 'value':'1'}],
--- 5,11 ----
dummy python:request.set('filterProperties',{'objectManager':objectManager, });
dummy python:request.set('actionProperties',{'objectManager':objectManager, });
! dummy python:request.set('itemIdName','objectID');
dummy python:request.set('itemControlType','radio');
! dummy python:request.set('formParams',{'action':'createAndAddObject_ui', 'submit':'Create Relationship', 'method':'post',
'hiddenFormItems':[{'name':'objectManager', 'value':objectManager},
{'name':'createIfNone:int', 'value':'1'}],
|
|
From: <ssp...@us...> - 2003-12-16 17:19:47
|
Update of /cvsroot/zapp/ZApp/www_ui
In directory sc8-pr-cvs1:/tmp/cvs-serv6778/www_ui
Modified Files:
filterDisplay_html.plain
Log Message:
working with plone now..
Index: filterDisplay_html.plain
===================================================================
RCS file: /cvsroot/zapp/ZApp/www_ui/filterDisplay_html.plain,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** filterDisplay_html.plain 8 Oct 2003 20:33:52 -0000 1.1
--- filterDisplay_html.plain 16 Dec 2003 17:19:44 -0000 1.2
***************
*** 63,71 ****
names="stats.names()"
formAction="formParams.get('action','deleteSelectedItems_html')"
formSubmitValue="formParams.get('submit','Delete Selected Item(s)')"
hiddenFormItems="formParams.get('hiddenFormItems',[])"
formItems="formParams.get('formItems',[])">
! <form action="&dtml-formAction;">
<div align="left">
<dtml-in stats>
--- 63,72 ----
names="stats.names()"
formAction="formParams.get('action','deleteSelectedItems_html')"
+ formMethod="formParams.get('method','post')"
formSubmitValue="formParams.get('submit','Delete Selected Item(s)')"
hiddenFormItems="formParams.get('hiddenFormItems',[])"
formItems="formParams.get('formItems',[])">
! <form action="&dtml-formAction;" method="&dtml-formMethod;">
<div align="left">
<dtml-in stats>
|
|
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','')
|
|
From: <ssp...@us...> - 2003-12-04 22:26:03
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv28727
Modified Files:
ZApp_MiscData.py __init__.py
Log Message:
add swd files to FSFile extensions
Index: ZApp_MiscData.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_MiscData.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** ZApp_MiscData.py 28 Oct 2003 20:27:03 -0000 1.21
--- ZApp_MiscData.py 4 Dec 2003 22:25:59 -0000 1.22
***************
*** 72,76 ****
return self.xml
! def getXMLAttr(self, attr, default=None, escNL=0):
""" get an XML based attribute."""
value = self._v_xmlDict.get(attr, default)
--- 72,76 ----
return self.xml
! def getXMLAttr(self, attr, default=None):
""" get an XML based attribute."""
value = self._v_xmlDict.get(attr, default)
***************
*** 159,168 ****
_v_MyMDMCache = ComputedAttribute( _v_MyMDMCache )
-
- def applicationURL(self):
- """
- get app url..
- """
- return self.findApplication().absolute_url()
def getMiscDataManager(self):
--- 159,162 ----
Index: __init__.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/__init__.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** __init__.py 24 Nov 2003 16:39:22 -0000 1.18
--- __init__.py 4 Dec 2003 22:25:59 -0000 1.19
***************
*** 20,23 ****
--- 20,24 ----
mimetypes.types_map['.swf'] = 'application/x-shockwave-flash'
+ mimetypes.types_map['.swd'] = 'application/octet-stream'
try:
***************
*** 72,75 ****
--- 73,82 ----
context.registerHelpTitle('ZApp Help')
+
+ from Products.CMFCore.DirectoryView import registerDirectory, registerFileExtension
+ from Products.CMFCore.FSFile import FSFile
+
+ registerDirectory('skins', globals())
+ registerFileExtension('swd', FSFile)
zapp_globals = globals()
|
|
From: <ssp...@us...> - 2003-11-24 22:15:22
|
Update of /cvsroot/zapp/ZApp/tests/ZAppTestClasses
In directory sc8-pr-cvs1:/tmp/cvs-serv31433/tests/ZAppTestClasses
Modified Files:
ZTC_RObject.py
Log Message:
automatic create form wasn't quite right with timestamp dbType
Index: ZTC_RObject.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/tests/ZAppTestClasses/ZTC_RObject.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ZTC_RObject.py 24 Nov 2003 21:57:48 -0000 1.3
--- ZTC_RObject.py 24 Nov 2003 22:15:17 -0000 1.4
***************
*** 12,19 ****
lprop(id='name'),
lprop(id='objsize',type='int'),
! lprop(id='aTimeStamp',type='date', dbType='timestamp'),
]
)
!
class ZTC_RObject( ZApp_Base.ZApp_Base, ZApp_RelatableItem.ZApp_RelatedObject):
--- 12,21 ----
lprop(id='name'),
lprop(id='objsize',type='int'),
! lprop(id='aTimeStamp', prop_type='date',
! prop_default='1/1/1001', dbType='timestamp', create_template='%(id)s=now()', update_template='%(id)s=now()',
! mode='', update_internal=1),
]
)
!
class ZTC_RObject( ZApp_Base.ZApp_Base, ZApp_RelatableItem.ZApp_RelatedObject):
|
|
From: <ssp...@us...> - 2003-11-24 21:57:51
|
Update of /cvsroot/zapp/ZApp/tests/ZAppTestClasses
In directory sc8-pr-cvs1:/tmp/cvs-serv26996/tests/ZAppTestClasses
Modified Files:
ZTC_RObject.py
Log Message:
automatic create form wasn't quite right with timestamp dbType
Index: ZTC_RObject.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/tests/ZAppTestClasses/ZTC_RObject.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ZTC_RObject.py 17 Apr 2003 14:30:45 -0000 1.2
--- ZTC_RObject.py 24 Nov 2003 21:57:48 -0000 1.3
***************
*** 12,15 ****
--- 12,16 ----
lprop(id='name'),
lprop(id='objsize',type='int'),
+ lprop(id='aTimeStamp',type='date', dbType='timestamp'),
]
)
|
|
From: <ssp...@us...> - 2003-11-24 21:57:51
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv26996
Modified Files:
ZApp_Specialist.py
Log Message:
automatic create form wasn't quite right with timestamp dbType
Index: ZApp_Specialist.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_Specialist.py,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** ZApp_Specialist.py 6 Nov 2003 18:20:14 -0000 1.31
--- ZApp_Specialist.py 24 Nov 2003 21:57:47 -0000 1.32
***************
*** 437,440 ****
--- 437,441 ----
'text':'text',
'boolean':'int',
+ 'timestamp':'date',
}
|
|
From: <ssp...@us...> - 2003-11-24 16:45:38
|
Update of /cvsroot/zapp/ZApp/skins/zapp_generic
In directory sc8-pr-cvs1:/tmp/cvs-serv27366/skins/zapp_generic
Modified Files:
zapp_cmf_object_edit.py
Log Message:
fixe up rediection and status message
Index: zapp_cmf_object_edit.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_cmf_object_edit.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** zapp_cmf_object_edit.py 28 Oct 2003 20:27:04 -0000 1.4
--- zapp_cmf_object_edit.py 24 Nov 2003 16:45:35 -0000 1.5
***************
*** 5,15 ****
##bind script=script
##bind subpath=traverse_subpath
! ##parameters=inputDict=None
##title=
##
title=context.REQUEST.get('title',None)
if title is not None:
! context.manage_changeProperties(title=title)
myApp = context.getApplication()
--- 5,20 ----
##bind script=script
##bind subpath=traverse_subpath
! ##parameters=inputDict=None, redirect_url=None
##title=
##
+ propDict = {'cmf_portal_type':getattr(context,'portal_type','unknown')}
+
title=context.REQUEST.get('title',None)
+
if title is not None:
! propDict['title'] = title
!
! context.manage_changeProperties(propDict)
myApp = context.getApplication()
***************
*** 59,62 ****
context.safeMiscData.setXMLAttrs(dict = dict)
! context.REQUEST.RESPONSE.redirect('zapp_cmf_object_edit_form?portal_status_message=ZApp+CMF+Object+Changed.')
--- 64,71 ----
context.safeMiscData.setXMLAttrs(dict = dict)
+ context.reindexObject()
! if not redirect_url:
! redirect_url=context.absolute_url() + '/zapp_cmf_object_edit_form?portal_status_message=ZApp+CMF+Object+Changed.'
!
! context.REQUEST.RESPONSE.redirect(redirect_url)
|
|
From: <ssp...@us...> - 2003-11-24 16:39:25
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv25933
Modified Files:
__init__.py
Log Message:
moved directory view stuff to CMF only section
Index: __init__.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/__init__.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** __init__.py 28 Aug 2003 17:12:46 -0000 1.17
--- __init__.py 24 Nov 2003 16:39:22 -0000 1.18
***************
*** 60,63 ****
--- 60,66 ----
).initialize(context)
+ from Products.CMFCore.DirectoryView import registerDirectory
+ registerDirectory('skins', globals())
+
ZApp_Specialist.initialize(context)
ZApp_Application.initialize(context)
***************
*** 69,75 ****
context.registerHelpTitle('ZApp Help')
-
- from Products.CMFCore.DirectoryView import registerDirectory
- registerDirectory('skins', globals())
zapp_globals = globals()
--- 72,75 ----
|
|
From: <ssp...@us...> - 2003-11-06 18:20:18
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv7353
Modified Files:
ZApp_Base.py ZApp_LOG.py ZApp_Specialist.py
Log Message:
fixed app meta type attr error
Index: ZApp_Base.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_Base.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** ZApp_Base.py 28 Oct 2003 20:27:03 -0000 1.21
--- ZApp_Base.py 6 Nov 2003 18:20:13 -0000 1.22
***************
*** 154,157 ****
--- 154,160 ----
meta_type = 'ZApp Base Type'
+
+ class_default_for_applicationMetaType=ZApp_Application.ZApp_Application.meta_type
+
testing = 0
_properties=()
Index: ZApp_LOG.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_LOG.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ZApp_LOG.py 28 Oct 2003 20:27:03 -0000 1.4
--- ZApp_LOG.py 6 Nov 2003 18:20:14 -0000 1.5
***************
*** 13,18 ****
LOG('ZApp',INFO,"Break Set for %s" % ZAPP_DEBUG_BREAK)
! def ZApp_LOG(message):
! if ZAPP_DEBUG:
! LOG('ZApp',INFO, message)
--- 13,18 ----
LOG('ZApp',INFO,"Break Set for %s" % ZAPP_DEBUG_BREAK)
! def ZApp_LOG(message, priority = INFO):
! if ZAPP_DEBUG or (priority > INFO):
! LOG('ZApp', priority, message)
Index: ZApp_Specialist.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_Specialist.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** ZApp_Specialist.py 28 Oct 2003 20:27:03 -0000 1.30
--- ZApp_Specialist.py 6 Nov 2003 18:20:14 -0000 1.31
***************
*** 6,10 ****
import os
! from ZApp_LOG import ZApp_LOG
from DateTime import DateTime
--- 6,10 ----
import os
! from ZApp_LOG import ZApp_LOG, INFO
from DateTime import DateTime
***************
*** 420,425 ****
! def ZApp_printDebugMessage(self, message):
! ZApp_LOG(message)
ZApp_print = ZApp_printDebugMessage
--- 420,425 ----
! def ZApp_printDebugMessage(self, message, priority=INFO):
! ZApp_LOG(message, priority)
ZApp_print = ZApp_printDebugMessage
|
|
From: <ssp...@us...> - 2003-11-06 18:05:08
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv3413
Modified Files:
Tag: CMF_relations
ZApp_Base.py
Log Message:
fixed app meta type attr error
Index: ZApp_Base.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_Base.py,v
retrieving revision 1.20.2.2
retrieving revision 1.20.2.3
diff -C2 -d -r1.20.2.2 -r1.20.2.3
*** ZApp_Base.py 6 Nov 2003 18:03:23 -0000 1.20.2.2
--- ZApp_Base.py 6 Nov 2003 18:05:04 -0000 1.20.2.3
***************
*** 155,159 ****
meta_type = 'ZApp Base Type'
! class_default_for_applicationMetaType=ZApp_Application.meta_type
testing = 0
--- 155,159 ----
meta_type = 'ZApp Base Type'
! class_default_for_applicationMetaType=ZApp_Application.ZApp_Application.meta_type
testing = 0
|
|
From: <ssp...@us...> - 2003-11-06 18:03:26
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv3011
Modified Files:
Tag: CMF_relations
ZApp_Base.py ZApp_LOG.py ZApp_Specialist.py
Log Message:
fixed app meta type attr error
Index: ZApp_Base.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_Base.py,v
retrieving revision 1.20.2.1
retrieving revision 1.20.2.2
diff -C2 -d -r1.20.2.1 -r1.20.2.2
*** ZApp_Base.py 8 Oct 2003 20:37:47 -0000 1.20.2.1
--- ZApp_Base.py 6 Nov 2003 18:03:23 -0000 1.20.2.2
***************
*** 154,157 ****
--- 154,160 ----
meta_type = 'ZApp Base Type'
+
+ class_default_for_applicationMetaType=ZApp_Application.meta_type
+
testing = 0
_properties=()
Index: ZApp_LOG.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_LOG.py,v
retrieving revision 1.3.4.1
retrieving revision 1.3.4.2
diff -C2 -d -r1.3.4.1 -r1.3.4.2
*** ZApp_LOG.py 8 Oct 2003 20:37:47 -0000 1.3.4.1
--- ZApp_LOG.py 6 Nov 2003 18:03:23 -0000 1.3.4.2
***************
*** 13,18 ****
LOG('ZApp',INFO,"Break Set for %s" % ZAPP_DEBUG_BREAK)
! def ZApp_LOG(message):
! if ZAPP_DEBUG:
! LOG('ZApp',INFO, message)
--- 13,18 ----
LOG('ZApp',INFO,"Break Set for %s" % ZAPP_DEBUG_BREAK)
! def ZApp_LOG(message, priority = INFO):
! if ZAPP_DEBUG or (priority > INFO):
! LOG('ZApp', priority, message)
Index: ZApp_Specialist.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_Specialist.py,v
retrieving revision 1.29.2.1
retrieving revision 1.29.2.2
diff -C2 -d -r1.29.2.1 -r1.29.2.2
*** ZApp_Specialist.py 8 Oct 2003 20:37:48 -0000 1.29.2.1
--- ZApp_Specialist.py 6 Nov 2003 18:03:23 -0000 1.29.2.2
***************
*** 6,10 ****
import os
! from ZApp_LOG import ZApp_LOG
from DateTime import DateTime
--- 6,10 ----
import os
! from ZApp_LOG import ZApp_LOG, INFO
from DateTime import DateTime
***************
*** 420,425 ****
! def ZApp_printDebugMessage(self, message):
! ZApp_LOG(message)
ZApp_print = ZApp_printDebugMessage
--- 420,425 ----
! def ZApp_printDebugMessage(self, message, priority=INFO):
! ZApp_LOG(message, priority)
ZApp_print = ZApp_printDebugMessage
|
|
From: <ssp...@us...> - 2003-11-06 17:24:00
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv23601
Modified Files:
ZApp_CMFBase.py
Log Message:
fixed CMFBAse so that it still works with levers..
Index: ZApp_CMFBase.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** ZApp_CMFBase.py 28 Oct 2003 20:27:03 -0000 1.17
--- ZApp_CMFBase.py 6 Nov 2003 17:23:55 -0000 1.18
***************
*** 17,20 ****
--- 17,21 ----
props = lpcol(
[
+ lprop(id='title'),
lprop(id='cmf_portal_type'),
lprop(id='safeStorageID'),
|
|
From: <ssp...@us...> - 2003-10-28 20:29:46
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv28855
Modified Files:
ZApp_Application.py ZApp_Base.py ZApp_CMFBase.py ZApp_LOG.py
ZApp_MiscData.py ZApp_RelatableItem.py
ZApp_RelationshipItem.py ZApp_RelationshipManager.py
ZApp_Specialist.py
Log Message:
attempt to merge new CMF relations back to main branch
Index: ZApp_Application.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_Application.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** ZApp_Application.py 12 Sep 2003 15:27:50 -0000 1.25
--- ZApp_Application.py 28 Oct 2003 20:27:03 -0000 1.26
***************
*** 87,90 ****
--- 87,91 ----
index_html.plain
quickDisplay_html.plain
+ filterDisplay_html.plain
updateItem.plain
updateItem_html.plain """
***************
*** 128,131 ****
--- 129,133 ----
applicationMetaType = meta_type = 'Z App Application'
specialistMetaTypes = ['Specialist','Z App Specialist']
+
LOCALE_ID = 'TST'
***************
*** 273,277 ****
SDT = 'SESSION_DATA_TYPE'
!
def getUserSessions(self, browserID=None, create=0):
"""
--- 275,279 ----
SDT = 'SESSION_DATA_TYPE'
!
def getUserSessions(self, browserID=None, create=0):
"""
Index: ZApp_Base.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_Base.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** ZApp_Base.py 25 Jun 2003 15:47:30 -0000 1.20
--- ZApp_Base.py 28 Oct 2003 20:27:03 -0000 1.21
***************
*** 8,12 ****
import os
! ZAPP_DEBUG=os.environ.get('ZAPP_DEBUG',0)
from OFS import SimpleItem
--- 8,13 ----
import os
! undefined_zdb = []
! ZAPP_DEBUG=os.environ.get('ZAPP_DEBUG',undefined_zdb)
from OFS import SimpleItem
***************
*** 46,49 ****
--- 47,52 ----
DataSkin.__get_attr__ = __new__get_attr__
+ if ZAPP_DEBUG is not undefined_zdb:
+
__orig__notify = Trigger._notify
***************
*** 62,65 ****
--- 65,70 ----
Trigger._notify = __new__notify
+ if ZAPP_DEBUG:
+
__orig__AttributeFor = Compute._AttributeFor
***************
*** 168,172 ****
return primary key of self..
"""
! return self.aq_parent.defaultRack.loadAttrib or 'pk'
def applicationURL(self):
--- 173,180 ----
return primary key of self..
"""
! return self._v_dm_.defaultRack.loadAttrib or 'pk'
!
! def getPrimaryKeyValue(self):
! return self.id
def applicationURL(self):
***************
*** 197,204 ****
def beforeChange(self):
pass
def afterChange(self):
try:
! crr = self.aq_parent.ZApp_clearResultCache
except AttributeError:
crr = None
--- 205,216 ----
def beforeChange(self):
pass
+
+ def getMySpecialist(self):
+ """ get my specialist """
+ return self._v_dm_.aq_inner.aq_parent
def afterChange(self):
try:
! crr = self.getMySpecialist().ZApp_clearResultCache
except AttributeError:
crr = None
***************
*** 214,219 ****
argDict = self.get_argument_dictionary( props, REQUEST, kw)
! ZApp_LOG("changing " + self.aq_parent.id + ":" + self.id + ":" + `argDict`)
!
self.beforeChange()
self.manage_changeProperties(argDict)
--- 226,231 ----
argDict = self.get_argument_dictionary( props, REQUEST, kw)
! ZApp_LOG("changing " + self.getMySpecialist().getId() + ":" + self.id + ":" + `argDict`)
!
self.beforeChange()
self.manage_changeProperties(argDict)
Index: ZApp_CMFBase.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** ZApp_CMFBase.py 11 Sep 2003 09:47:03 -0000 1.16
--- ZApp_CMFBase.py 28 Oct 2003 20:27:03 -0000 1.17
***************
*** 8,17 ****
from ZApp_Base import ZApp_Base, extendProperties, LeverPropertyCollection, LeverProperty
lpcol = LeverPropertyCollection
lprop = LeverProperty
props = lpcol(
! [lprop(id='cmf_portal_type'),
! ]
)
--- 8,23 ----
from ZApp_Base import ZApp_Base, extendProperties, LeverPropertyCollection, LeverProperty
+ from ZApp_LOG import ZApp_LOG
+
+ missing = []
+
lpcol = LeverPropertyCollection
lprop = LeverProperty
props = lpcol(
! [
! lprop(id='cmf_portal_type'),
! lprop(id='safeStorageID'),
! ]
)
***************
*** 20,25 ****
#
- from Products.CMFCore.PortalContent import PortalContent
from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl
from AccessControl import ClassSecurityInfo, getSecurityManager
from Products.CMFCore import CMFCorePermissions
--- 26,31 ----
#
from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl
+ from Products.CMFDefault.SkinnedFolder import SkinnedFolder
from AccessControl import ClassSecurityInfo, getSecurityManager
from Products.CMFCore import CMFCorePermissions
***************
*** 27,30 ****
--- 33,38 ----
from ZApp_RelatableItem import ZApp_RelatedObject
from Products.FreeRangeDS import FreeRangeDS, _v_dm_
+ from OFS.CopySupport import CopySource
+ from Acquisition import ImplicitAcquisitionWrapper,aq_base
from DateTime import DateTime
***************
*** 32,68 ****
import tempfile
! class ZApp_CMFBase(FreeRangeDS, ZApp_Base, PortalContent, DefaultDublinCoreImpl, ZApp_MiscDataUser, ZApp_RelatedObject):
! meta_type = 'ZApp CMF Content Type'
zapp_cmf_type = 1
! _primaryKeyStringSize=255 # allow for a pretty rediculous size...
!
! __implements__ = ( PortalContent.__implements__
! , DefaultDublinCoreImpl.__implements__
! )
!
! manage_options = PortalContent.manage_options
!
! def getMiscDataManager(self):
! """find the id of the specialist for this class.. """
! dm = self.getDataManagerFor( self, None )
! Manager = dm.aq_parent.id
! return Manager
! # Declarative security (replaces __ac_permissions__)
_primaryKeyGenerator='self.calcPathID()'
_insertQueryPrefix = 'self.checkDups() and '
def checkDups(self):
! return not self.__dict__[_v_dm_].getItem(self.calcPathID())
def calcPathID(self):
! if self.id.find(',') != -1:
! result = self.id
! else:
! objPath = ','.join(self.getPhysicalPath())
! portalPath = ','.join(self.portal_url.getPortalObject().getPhysicalPath()) + ','
! result = objPath[len(portalPath)-1:]
return result
--- 40,85 ----
import tempfile
! class ZApp_CMFBase(FreeRangeDS, SkinnedFolder, ZApp_Base, DefaultDublinCoreImpl, ZApp_MiscDataUser, ZApp_RelatedObject):
! meta_type = 'ZApp CMF Content'
zapp_cmf_type = 1
! isPrincipiaFolderish = 1
! class_default_for_copyable = 0 # make these guys default to 'not copyable'
+ _primaryKeyStringSize=255 # allow for a pretty rediculous size...
_primaryKeyGenerator='self.calcPathID()'
_insertQueryPrefix = 'self.checkDups() and '
+ manage_options = SkinnedFolder.manage_options
+
+ def getPrimaryKeyValue(self):
+ return self.calcPathID()
+
def checkDups(self):
! """
! Check for a pre-existing record.... don't rely on data cached in 'self'
! since we could be in a copy/cut/paste operation.
! """
!
! dupID = self.calcPathID()
! spec = self.getMySpecialist()
! pk = spec.getPrimaryKey()
! dup = spec.ZApp_doSelectItem( REQUEST={ pk: dupID })
! result = not dup
! return result
def calcPathID(self):
!
! try:
! if self.id.find(',') != -1:
! result = self.id
! else:
! objPath = ','.join(self.getPhysicalPath())
! portalPath = ','.join(self.portal_url.getPortalObject().getPhysicalPath()) + ','
! result = objPath[len(portalPath)-1:]
! except:
! raise
!
return result
***************
*** 77,132 ****
return "OK!"
def _setId(self, id):
! # check for rename operation..
! currID = self.__dict__.get('id',None)
! print "in _setID of CMFBase..."
! if currID is not None:
! self.__dict__['_v_ZApp_OrigID'] = currID
! print "currID was not none... but " + currID
else:
! print "currID was None."
! return ZApp_Base._setId(self, id)
!
! def _notifyOfCopyTo(self, container, op=0):
! """we use _notifyOfCopy to save our miscData to a volitile container property
! so that the copy can retrieve it once created..."""
! #ti = self.getTypeInfo to handle media item copy/paste... notify
! #actions = ti.listActions()
! #for action in actions:
! #if action.getId() ==
! print "in notify copy.. "
! copyID = '_v_' + self.id + 'copyXML'
! setattr(container, copyID, self.safeMiscData.getXMLDict())
def manage_afterAdd(self, item, container):
! """ restore XML from volitile attribute.. """
!
! #print "in manage_afterAdd", self.id
! PortalContent.manage_afterAdd(self, item, container)
ZApp_Base.manage_afterAdd(self, item, container)
-
- checkID = self.id
! if checkID[:4] == 'copy':
! pos = checkID.find('_of_')
! if pos>3:
! if pos>4:
! try:
! x = int(checkID[4:pos])
! checkID = checkID[pos + 4:]
! except ValueError:
! pass
! else:
! checkID = checkID[pos + 4:]
!
! copyID = '_v_' + checkID + 'copyXML'
! savedXML = getattr(container, copyID, {})
! if savedXML:
! self.safeMiscData.setXMLAttrs( dict = savedXML )
extendProperties(ZApp_CMFBase, props)
--- 94,226 ----
return "OK!"
+
+ def _canCopy(self, op=0):
+ """
+ Can this object be copied?
+ """
+ return getattr(self, 'copyable',0)
+
+ def _notifyOfCopyTo(self, container, op=0):
+ """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:
+ safeStorage.setXMLAttrs( operationType = op )
+ safeStorage.setXMLAttrs( oldID = self.calcPathID())
+ safeStorageID = safeStorage.getId()
+ self.change(safeStorageID = safeStorageID )
+ get_transaction().commit(1)
+
+ ZApp_LOG("_notifyOfCopyTo: Setting safeStorageID to " + safeStorageID)
def _setId(self, id):
! #
! # save the 'safeStorageID' so we can use it when we're added again..
! #
! oldID = self.getId()
!
! if oldID:
! safeStorageID = getattr(self, 'safeStorageID','')
! cmf_portal_type = getattr(self, 'cmf_portal_type','')
! result = ZApp_Base._setId(self, id)
!
! if oldID:
! self._v_safeStorageID = safeStorageID
! self._v_cmf_portal_type = cmf_portal_type
else:
! self._v_safeStorageID = None
! 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
! self = aq_base(self).__of__(container)
! ob = CopySource._getCopy.im_func(self,container)
! ob.__of__(container) # force DM hookup
! if safeStorageID:
! ob.__dict__['safeStorageID'] = safeStorageID
! 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','')
! cmf_portal_type = getattr(self, '_v_cmf_portal_type','')
!
! SkinnedFolder.manage_afterAdd(self, item, container)
ZApp_Base.manage_afterAdd(self, item, container)
! if safeStorageID:
! mdm = self.getMiscDataSpecialist()
! safeStorage = mdm.getItem(safeStorageID)
! if safeStorage:
! get = safeStorage.getXMLAttr
! op = get('operationType','')
! oldID = get('oldID','')
! mySpec = self.getMySpecialist()
!
! if mySpec and oldID:
! oldSelf = mySpec.getItem( oldID )
!
! if oldSelf:
! newSelf = mySpec.ZApp_createNewItem(id=self.calcPathID())
! mySpec.commit_subtransaction()
! newSelf.setMiscData( dataDict = oldSelf.safeMiscData.getXMLDict())
! newSelf.change(safeStorageID = '', cmf_portal_type=cmf_portal_type)
! mySpec.commit_subtransaction()
!
! newSelf.copyObjectRelations( oldSelf.objectRelations( returnObjects=1 ))
!
! if op:
! #
! # it's a move operation...
! #
! oldSelf.manage_delete()
! else:
! oldSelf.change(safeStorageID = '')
!
! safeStorage.manage_delete()
!
! if self.safeStorageID:
! self.change(safeStorageID = '')
!
! if hasattr(self, '_v_safeStorageID'):
! del self._v_safeStorageID # we've got it now.. thanks. ;-)
!
!
! def copyObjectRelations(self, theObjectRelations):
! """
! copy object relations that belong to the object I was cloned from...
! """
! for relationDict in theObjectRelations:
! get = relationDict.get
! otherObject = get('otherObject','')
! otherRole = get('otherRole','')
! contextID = get('otherContextID','')
! selfContextID = get('selfContextID','')
!
! selfRole = get('selfRole','')
! if otherObject:
! selfRItem = self.addObject( otherObject, otherRole, selfRole, contextID)
! selfRItem.change(contextID=selfContextID)
extendProperties(ZApp_CMFBase, props)
***************
*** 139,153 ****
existingObject = None
!
if id.find(',') != -1:
raise RuntimeError, "Sorry.. no ',' allowed in id!"
!
if useExisting:
dm = self.getDataManagerFor( klass, None )
if dm != None:
objPath = ','.join(self.getPhysicalPath()) + ',' + id
portalPath = ','.join(self.portal_url.getPortalObject().getPhysicalPath()) + ','
checkID = objPath[len(portalPath):]
! existingObject = dm.getItem( checkID )
if existingObject:
--- 233,248 ----
existingObject = None
!
if id.find(',') != -1:
raise RuntimeError, "Sorry.. no ',' allowed in id!"
!
if useExisting:
dm = self.getDataManagerFor( klass, None )
+
if dm != None:
objPath = ','.join(self.getPhysicalPath()) + ',' + id
portalPath = ','.join(self.portal_url.getPortalObject().getPhysicalPath()) + ','
checkID = objPath[len(portalPath):]
! existingObject = dm.getItem(checkID)
if existingObject:
***************
*** 251,254 ****
--- 346,357 ----
, 'action': 'string:${object_url}/metadata_edit_form'
, 'permissions' : (CMFCorePermissions.ModifyPortalContent,)},
+ { 'id' : 'subobjects'
+ , 'name' : 'SubObjects'
+ , 'action': 'string:${object_url}/zapp_cmf_sub_contents'
+ , 'permissions' : (CMFCorePermissions.View,)},
+ { 'id' : 'test'
+ , 'name' : 'Test'
+ , 'action': 'string:${object_url}/zapp_cmf_object_test'
+ , 'permissions' : (CMFCorePermissions.ManagePortal,)},
),
},
Index: ZApp_LOG.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_LOG.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ZApp_LOG.py 30 Mar 2003 16:25:02 -0000 1.3
--- ZApp_LOG.py 28 Oct 2003 20:27:03 -0000 1.4
***************
*** 3,7 ****
from zLOG import register_subsystem, LOG, INFO
! ZAPP_DEBUG=os.environ.get('ZAPP_DEBUG',0)
ZAPP_DEBUG_BREAK=os.environ.get('ZAPP_DEBUG_BREAK',0)
--- 3,7 ----
from zLOG import register_subsystem, LOG, INFO
! ZAPP_DEBUG=os.environ.get('ZAPP_DEBUG',None) is not None
ZAPP_DEBUG_BREAK=os.environ.get('ZAPP_DEBUG_BREAK',0)
Index: ZApp_MiscData.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_MiscData.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** ZApp_MiscData.py 23 Sep 2003 18:51:44 -0000 1.20
--- ZApp_MiscData.py 28 Oct 2003 20:27:03 -0000 1.21
***************
*** 24,28 ****
props = lpcol(
[lprop(id='Manager'),
! lprop(id='objectID', dbSize=1023),
lprop(id='dataType', dbSize=100),
lprop(id='xml', prop_type='text', dbType='text'),
--- 24,28 ----
props = lpcol(
[lprop(id='Manager'),
! lprop(id='objectID', dbSize=255),
lprop(id='dataType', dbSize=100),
lprop(id='xml', prop_type='text', dbType='text'),
***************
*** 171,175 ****
Manager = self.miscDataManagerKey
else:
! Manager = self.aq_inner.aq_parent.id
return Manager
--- 171,175 ----
Manager = self.miscDataManagerKey
else:
! Manager = self.getMySpecialist().getId()
return Manager
***************
*** 191,195 ****
"""
! Manager = Manager or self.miscDataManager
localmdmKey = Manager + ":" + dataType
mdm = self._v_MyMDMCache.get(localmdmKey, missing)
--- 191,195 ----
"""
! Manager = (Manager or '') or self.miscDataManager
localmdmKey = Manager + ":" + dataType
mdm = self._v_MyMDMCache.get(localmdmKey, missing)
***************
*** 239,243 ****
result = []
! myDM = self.__dict__[_v_dm_]
for provider in getattr(myDM,myDM.DataPlugins.attr):
if provider.meta_type == 'DataSkin Class Extender':
--- 239,243 ----
result = []
! myDM = self._v_dm_
for provider in getattr(myDM,myDM.DataPlugins.attr):
if provider.meta_type == 'DataSkin Class Extender':
***************
*** 496,500 ****
"""
result = ZApp_MiscDataAttributeProvider.inheritedAttribute('manage_editProperties')(self, REQUEST)
! myDM = self.aq_parent
propManAttr = 'PropSheetFor_' + self.propsheetname
for provider in getattr(myDM,myDM.DataPlugins.attr):
--- 496,500 ----
"""
result = ZApp_MiscDataAttributeProvider.inheritedAttribute('manage_editProperties')(self, REQUEST)
! myDM = self._v_dm_
propManAttr = 'PropSheetFor_' + self.propsheetname
for provider in getattr(myDM,myDM.DataPlugins.attr):
Index: ZApp_RelatableItem.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_RelatableItem.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** ZApp_RelatableItem.py 12 Sep 2003 15:27:50 -0000 1.20
--- ZApp_RelatableItem.py 28 Oct 2003 20:27:03 -0000 1.21
***************
*** 5,12 ****
--- 5,14 ----
import ZApp_Base
import string
+
lpcol = ZApp_Base.LeverPropertyCollection
lprop = ZApp_Base.LeverProperty
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
+ from ZApp_LOG import ZApp_LOG
class ZApp_RelatableParentMixin:
***************
*** 23,27 ****
if not parentManager:
! parentManager = self.aq_parent.id
conditions={ referenceAttribute:self.id, 'parentManager':parentManager }
--- 25,29 ----
if not parentManager:
! parentManager = self.getMySpecialist().getId()
conditions={ referenceAttribute:self.id, 'parentManager':parentManager }
***************
*** 78,82 ****
if not parentManager:
! parentManager = self.aq_parent.id
conditions={ 'parentID':self.id, 'parentManager':parentManager, 'countMinMax':'contextID::text::int' } # this is PG specific!
--- 80,84 ----
if not parentManager:
! parentManager = self.getMySpecialist().getId()
conditions={ 'parentID':self.id, 'parentManager':parentManager, 'countMinMax':'contextID::text::int' } # this is PG specific!
***************
*** 117,128 ****
contextID = self.nextContextID()
! return {'parentID':self.id, 'parentManager':self.aq_parent.id, 'contextID':contextID}
def getObjectManager(self, objectManagerID=None):
if objectManagerID:
! om = getattr(self.aq_parent, objectManagerID)
else:
! om = (self.childManagers and getattr(self.aq_parent, self.childManagers[0])) or self.aq_parent
return om
--- 119,131 ----
contextID = self.nextContextID()
! return {'parentID':self.id, 'parentManager':self.getMySpecialist().getId(), 'contextID':contextID}
def getObjectManager(self, objectManagerID=None):
if objectManagerID:
! om = getattr(self.getMySpecialist(), objectManagerID)
else:
! mySpec = self.getMySpecialist()
! om = (self.childManagers and getattr(mySpec, self.childManagers[0])) or mySpec
return om
***************
*** 205,210 ****
"""
! refAttr = referenceAttribute or self.parentManager or self.aq_parent.aq_parent.id
! return getattr(self.aq_parent, refAttr, None)
def getParent(self, referenceAttribute='parentID'):
--- 208,214 ----
"""
! mySpec = self.getMySpecialist()
! refAttr = referenceAttribute or self.parentManager or mySpec.aq_parent.getId()
! return getattr(mySpec, refAttr, None)
def getParent(self, referenceAttribute='parentID'):
***************
*** 257,261 ****
--- 261,268 ----
displayCustomUpdate_pt = PageTemplateFile('zpt/Generic_displayRelatedObjects', globals())
+ addRelationship_pt = PageTemplateFile('zpt/addRelationship_ChooseObjectManager_ui', globals())
findNewRelationship_pt = PageTemplateFile('zpt/findNewRelationship_ui', globals())
+
+ class_default_for_related_object_types = () # by default you can't related to anything
_custom_skin_scripts=(
***************
*** 265,268 ****
--- 272,281 ----
)
+ def findSpecialistsForRelationship(self):
+ """
+ in base class we just return our relatable_object_types property.
+ """
+ return self.related_object_types
+
def getRelationshipManager(self):
return self.findApplication().getRelationshipManager()
***************
*** 272,276 ****
get my object manager ID
"""
! return self.aq_parent.getId()
def relationDeleted(self, relationshipItem):
--- 285,289 ----
get my object manager ID
"""
! return self.getMySpecialist().getId()
def relationDeleted(self, relationshipItem):
***************
*** 318,326 ****
if REQUEST is not None:
responseURL = REQUEST.get('responseURL',None)
-
if responseURL:
REQUEST.RESPONSE.redirect(responseURL)
else:
! self.displayUpdateForm_html(self, REQUEST)
def createAndAddObject(self, objectProperties=None, objectManager=None, objectRole=None, selfRole=None, createIfNone=0, contextID='', **kw):
--- 331,342 ----
if REQUEST is not None:
responseURL = REQUEST.get('responseURL',None)
if responseURL:
REQUEST.RESPONSE.redirect(responseURL)
else:
! REQUEST.RESPONSE.redirect(self.REQUEST.URL1 + '/displayUpdateForm_html')
!
! # don't change this return value! We need it for testing....
!
! return "OK!"
def createAndAddObject(self, objectProperties=None, objectManager=None, objectRole=None, selfRole=None, createIfNone=0, contextID='', **kw):
***************
*** 354,361 ****
If objectRole is not None, assign objectRole to the otherObject in this relationship.
If selfRole is not None, assign selfRole to self in this relationship.
"""
rm = self.getRelationshipManager()
! rm.relateObjects( object1=self, object1Role=selfRole, object2=otherObject, object2Role=objectRole, createIfNone=createIfNone, contextID=contextID)
def removeObjectRelations(self, ids=None):
--- 370,379 ----
If objectRole is not None, assign objectRole to the otherObject in this relationship.
If selfRole is not None, assign selfRole to self in this relationship.
+ returns the relatioshipItem for self...
"""
rm = self.getRelationshipManager()
! selfRItem = rm.relateObjects( object1=self, object1Role=selfRole, object2=otherObject, object2Role=objectRole, createIfNone=createIfNone, contextID=contextID)
! return selfRItem
def removeObjectRelations(self, ids=None):
***************
*** 371,374 ****
--- 389,393 ----
if ids:
+ ZApp_LOG("Removing object relations from object:" + `self.getId()` + ":" + `ids`)
self.getRelationshipManager().removeObjectRelations( ids )
***************
*** 406,415 ****
returns a list of dictionaries like so:
[
! {'relationshipID':rid,
! 'otherObjectID':objId,
! 'otherManagerID':manID,
! 'otherRole':otherRole,
! 'selfRole':selfRole,
! },
{....
},
--- 425,439 ----
returns a list of dictionaries like so:
[
! {
! 'relationshipID': the relationshipID,
! 'otherRIID': other object's relationshipItemID,
! 'otherObjectID': other object's ID,
! 'otherManagerID': other object's Manager,
! 'otherRole': other object's role..
! 'otherContextID': other object's contextID,
! 'selfRole': my roleName,
! 'selfRIID': my relationshipItemID,
! 'selfContextID': my contextID,
! },
{....
},
***************
*** 419,423 ****
if returnObjects is true, each dictionary also has 'otherObject':otherObject as a member.
"""
!
if objectTypes:
if type(objectTypes) == type(''):
--- 443,447 ----
if returnObjects is true, each dictionary also has 'otherObject':otherObject as a member.
"""
!
if objectTypes:
if type(objectTypes) == type(''):
Index: ZApp_RelationshipItem.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_RelationshipItem.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ZApp_RelationshipItem.py 2 Jun 2003 14:46:08 -0000 1.5
--- ZApp_RelationshipItem.py 28 Oct 2003 20:27:03 -0000 1.6
***************
*** 13,18 ****
props = lpcol([
lprop(id='relationshipID'),
! lprop(id='objectID'),
! lprop(id='objectManager'),
lprop(id='roleID'),
lprop(id='contextID'),
--- 13,18 ----
props = lpcol([
lprop(id='relationshipID'),
! lprop(id='objectID',dbSize=255),
! lprop(id='objectManager',dbSize=50),
lprop(id='roleID'),
lprop(id='contextID'),
***************
*** 23,26 ****
--- 23,28 ----
meta_type = 'ZApp RelationshipItem'
+
+ _indexed_attrs = ('objectID',)
def getObject(self):
Index: ZApp_RelationshipManager.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_RelationshipManager.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ZApp_RelationshipManager.py 3 Jul 2003 18:23:10 -0000 1.4
--- ZApp_RelationshipManager.py 28 Oct 2003 20:27:03 -0000 1.5
***************
*** 30,44 ****
return getattr(self, rItemsID)
- def getRelationshipItems(self, excludeIDs = None):
- """
- get all the relItems in this relationship.
- """
-
- rItemMan = self.getRelationshipItemManager()
- results = rItemMan.ZApp_getItems(relationshipID = self.id)
- if excludeIDs:
- results = filter(lambda x,eids=excludeIDs: x.id not in eids, results)
- return results
-
def relateObjects(self, object1, object2, object1Role=None, object2Role=None, createIfNone=0, contextID=''):
"""
--- 30,33 ----
***************
*** 65,70 ****
! rItem1 = relItems.ZApp_createNewItem(relationshipID=newR.id, objectID=object1.id, objectManager=object1.Manager, roleID=role1ID)
! rItem2 = relItems.ZApp_createNewItem(relationshipID=newR.id, objectID=object2.id, objectManager=object2.Manager, roleID=role2ID, contextID=contextID)
def removeObjects(self, object1, object2=None, object1Role=None, object2Role=None, object2Type=None, object2Manager=None):
--- 54,60 ----
! rItem1 = relItems.ZApp_createNewItem(relationshipID=newR.id, objectID=object1.getPrimaryKeyValue(), objectManager=object1.Manager, roleID=role1ID)
! rItem2 = relItems.ZApp_createNewItem(relationshipID=newR.id, objectID=object2.getPrimaryKeyValue(), objectManager=object2.Manager, roleID=role2ID, contextID=contextID)
! return rItem1
def removeObjects(self, object1, object2=None, object1Role=None, object2Role=None, object2Type=None, object2Manager=None):
***************
*** 98,102 ****
role2ID = role2IDs and role2IDs[0]
! rItems = rItemsMan.ZApp_getItems(objectID=object1.id, objectManager=object1.Manager, roleID=role1ID)
self.removeObjectRelations( rItems = rItems, role1ID = role1ID, role2ID = role2ID, o2Type = o2Type, o2Manager = o2Manager)
--- 88,92 ----
role2ID = role2IDs and role2IDs[0]
! rItems = rItemsMan.ZApp_getItems(objectID=object1.getPrimaryKeyValue(), objectManager=object1.Manager, roleID=role1ID)
self.removeObjectRelations( rItems = rItems, role1ID = role1ID, role2ID = role2ID, o2Type = o2Type, o2Manager = o2Manager)
***************
*** 166,170 ****
rItemsMan = self.getRelationshipItemManager()
! myRelationshipItems = rItemsMan.ZApp_getItems( objectID=anObject.id, objectManager=anObject.Manager)
riMan = self.getRoleManager()
--- 156,160 ----
rItemsMan = self.getRelationshipItemManager()
! myRelationshipItems = rItemsMan.ZApp_getItems( objectID=anObject.getPrimaryKeyValue(), objectManager=anObject.Manager)
riMan = self.getRoleManager()
***************
*** 234,238 ****
"""
! myRelationshipItems = self.getRelationshipItemManager().ZApp_getItems( objectID=anObject.id, objectManager=anObject.Manager)
riMan = self.getRoleManager()
--- 224,228 ----
"""
! myRelationshipItems = self.getRelationshipItemManager().ZApp_getItems( objectID=anObject.getPrimaryKeyValue(), objectManager=anObject.Manager)
riMan = self.getRoleManager()
***************
*** 254,258 ****
continue
! if (not ((rItem.objectManager == anObject.Manager) and (rItem.objectID == anObject.id))):
if objectTypes and (theObject.objectType not in objectTypes):
continue
--- 244,248 ----
continue
! if (not ((rItem.objectManager == anObject.Manager) and (rItem.objectID == anObject.getPrimaryKeyValue()))):
if objectTypes and (theObject.objectType not in objectTypes):
continue
Index: ZApp_Specialist.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_Specialist.py,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** ZApp_Specialist.py 3 Jul 2003 18:05:07 -0000 1.29
--- ZApp_Specialist.py 28 Oct 2003 20:27:03 -0000 1.30
***************
*** 5,10 ****
import types
import os
- ZAPP_DEBUG=os.environ.get('ZAPP_DEBUG',0)
- ZAPP_DEBUG_BREAK=os.environ.get('ZAPP_DEBUG_BREAK',0)
from ZApp_LOG import ZApp_LOG
--- 5,8 ----
***************
*** 73,80 ****
class UniqueIDGenerator( Synchronized ):
! def __init__(self, debug=0):
self.lastTime = time.time()
- self.debug = debug
-
minDelta = 0.1
--- 71,76 ----
class UniqueIDGenerator( Synchronized ):
! def __init__(self):
self.lastTime = time.time()
minDelta = 0.1
***************
*** 104,108 ****
meta_type = 'Z App Specialist'
- debug = ZAPP_DEBUG
LeversSetsGroup = PlugInGroup('LeversSetsGroup', ['ZApp Lever Method Sets'], attr='leverList', title='Lever Sets')
--- 100,103 ----
***************
*** 176,189 ****
return 1
- def ZApp_setupDebug(self):
- """
- Just a method we can tickle...
- """
- if ZAPP_DEBUG_BREAK:
- ZApp_LOG("checking for ZAPP_DEBUG_BREAK %s -?- %s" % (ZAPP_DEBUG_BREAK, __name__))
- if ZAPP_DEBUG_BREAK == __name__:
- import pdb
- pdb.set_trace()
-
def ZApp_cleanDate(self, theDate):
""" Clean up a date """
--- 171,174 ----
***************
*** 545,549 ****
def ZApp_clearResultCache( self, itemID ):
! ZApp_LOG( "clearing result cache for itemID %s" % itemID )
self._rmCache( itemID )
--- 530,534 ----
def ZApp_clearResultCache( self, itemID ):
! ZApp_LOG( "clearing result cache for itemID %s in %s" % (itemID, self.getId()))
self._rmCache( itemID )
***************
*** 623,627 ****
return theIDs
! def ZApp_getItems(self, conditions=None, createIfNone=0, debug=0, displayQuery=0, **kw):
""" get my items that match conditions """
--- 608,612 ----
return theIDs
! def ZApp_getItems(self, conditions=None, createIfNone=0, displayQuery=0, **kw):
""" get my items that match conditions """
|
|
From: <ssp...@us...> - 2003-10-28 20:29:25
|
Update of /cvsroot/zapp/ZApp/skins/zapp_generic
In directory sc8-pr-cvs1:/tmp/cvs-serv28855/skins/zapp_generic
Modified Files:
zapp_cmf_object_edit.py zapp_cmf_object_edit_form.pt
zapp_cmf_object_type_edit.py zapp_cmf_object_type_edit_form.pt
zapp_cmf_object_view.pt
Added Files:
.cvsignore zapp_cmf_object_test.py zapp_cmf_sub_contents.zpt
Log Message:
attempt to merge new CMF relations back to main branch
Index: zapp_cmf_object_edit.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_cmf_object_edit.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** zapp_cmf_object_edit.py 28 Aug 2003 17:38:48 -0000 1.3
--- zapp_cmf_object_edit.py 28 Oct 2003 20:27:04 -0000 1.4
***************
*** 8,15 ****
##title=
##
myApp = context.getApplication()
myType = context.portal_type
miscData = myApp.MiscData
! tpropObjects = miscData.ZApp_getItems(Manager='CMFThings', objectID='metaObject', dataType='ZCMFPropsFor' + myType)
myTPropsObj = tpropObjects and tpropObjects[0]
myTPropDict = (myTPropsObj and myTPropsObj.getXMLDict()) or {}
--- 8,22 ----
##title=
##
+
+ title=context.REQUEST.get('title',None)
+ if title is not None:
+ context.manage_changeProperties(title=title)
+
myApp = context.getApplication()
myType = context.portal_type
miscData = myApp.MiscData
!
! cmfSpec = context.getMySpecialist()
! tpropObjects = miscData.ZApp_getItems(Manager=cmfSpec.getId(), objectID='metaObject', dataType='ZCMFPropsFor' + myType)
myTPropsObj = tpropObjects and tpropObjects[0]
myTPropDict = (myTPropsObj and myTPropsObj.getXMLDict()) or {}
***************
*** 53,55 ****
context.safeMiscData.setXMLAttrs(dict = dict)
! context.REQUEST.RESPONSE.redirect('zapp_cmf_object_edit_form')
--- 60,62 ----
context.safeMiscData.setXMLAttrs(dict = dict)
! context.REQUEST.RESPONSE.redirect('zapp_cmf_object_edit_form?portal_status_message=ZApp+CMF+Object+Changed.')
Index: zapp_cmf_object_edit_form.pt
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_cmf_object_edit_form.pt,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** zapp_cmf_object_edit_form.pt 18 Aug 2003 13:38:09 -0000 1.3
--- zapp_cmf_object_edit_form.pt 28 Oct 2003 20:27:04 -0000 1.4
***************
*** 29,34 ****
<div tal:define="myApp python:here.getApplication();
myType here/portal_type;
miscDataSpecialist myApp/MiscData;
! typePropertiesObjects python:miscDataSpecialist.ZApp_getItems(Manager='CMFThings', objectID='metaObject', dataType='ZCMFPropsFor' + myType);
myTPropsMiscData python:typePropertiesObjects and typePropertiesObjects[0].getXMLDict();
myPropSet myTPropsMiscData/zapp_properties | nothing;
--- 29,35 ----
<div tal:define="myApp python:here.getApplication();
myType here/portal_type;
+ cmfSpec python:here.getMySpecialist();
miscDataSpecialist myApp/MiscData;
! typePropertiesObjects python:miscDataSpecialist.ZApp_getItems(Manager=cmfSpec.getId(), objectID='metaObject', dataType='ZCMFPropsFor' + myType);
myTPropsMiscData python:typePropertiesObjects and typePropertiesObjects[0].getXMLDict();
myPropSet myTPropsMiscData/zapp_properties | nothing;
***************
*** 36,43 ****
<table tal:condition="myPropSet">
! <form action="zapp_cmf_object_edit" method="post">
<tr tal:repeat="propDef myPropSet">
! <td tal:define="propName propDef/name;
! propType propDef/type;
subObject propDef/subObject | python:[];
subDefs subObject/zapp_properties | python:[];
--- 37,45 ----
<table tal:condition="myPropSet">
! <form action="." tal:attributes="action string:${here/getId}/zapp_cmf_object_edit" method="post">
! <tr><td>Title: <input name="title" size="20" value="" tal:attributes="value here/title"/></td></tr>
<tr tal:repeat="propDef myPropSet">
! <td tal:define="propName propDef/name;
! propType propDef/type;
subObject propDef/subObject | python:[];
subDefs subObject/zapp_properties | python:[];
Index: zapp_cmf_object_type_edit.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_cmf_object_type_edit.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** zapp_cmf_object_type_edit.py 28 Aug 2003 17:38:48 -0000 1.3
--- zapp_cmf_object_type_edit.py 28 Oct 2003 20:27:04 -0000 1.4
***************
*** 11,15 ****
myType = context.portal_type
miscData = myApp.MiscData
! tpropObjects = miscData.ZApp_getItems(Manager='CMFThings', objectID='metaObject', dataType='ZCMFPropsFor' + myType)
myTPropsObj = tpropObjects and tpropObjects[0]
myTPropDict = (myTPropsObj and myTPropsObj.getXMLDict()) or {}
--- 11,16 ----
myType = context.portal_type
miscData = myApp.MiscData
! cmfSpec = context.getMySpecialist()
! tpropObjects = miscData.ZApp_getItems(Manager=cmfSpec.getId(), objectID='metaObject', dataType='ZCMFPropsFor' + myType)
myTPropsObj = tpropObjects and tpropObjects[0]
myTPropDict = (myTPropsObj and myTPropsObj.getXMLDict()) or {}
***************
*** 126,130 ****
if not myTPropsObj:
! tpropObjects = miscData.ZApp_getItems(Manager='CMFThings', objectID='metaObject', dataType='ZCMFPropsFor' + myType, createIfNone=1)
myTPropsObj = tpropObjects and tpropObjects[0]
if not myTPropsObj:
--- 127,131 ----
if not myTPropsObj:
! tpropObjects = miscData.ZApp_getItems(Manager=cmfSpec.getId(), objectID='metaObject', dataType='ZCMFPropsFor' + myType, createIfNone=1)
myTPropsObj = tpropObjects and tpropObjects[0]
if not myTPropsObj:
***************
*** 133,135 ****
myTPropsObj.setXMLAttrs({'zapp_properties': myTPropDefs})
! context.REQUEST.RESPONSE.redirect('zapp_cmf_object_type_edit_form')
--- 134,136 ----
myTPropsObj.setXMLAttrs({'zapp_properties': myTPropDefs})
! context.REQUEST.RESPONSE.redirect(context.absolute_url() + '/zapp_cmf_object_type_edit_form')
Index: zapp_cmf_object_type_edit_form.pt
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_cmf_object_type_edit_form.pt,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** zapp_cmf_object_type_edit_form.pt 18 Aug 2003 13:38:09 -0000 1.4
--- zapp_cmf_object_type_edit_form.pt 28 Oct 2003 20:27:04 -0000 1.5
***************
*** 54,63 ****
<div tal:define="myApp python:here.getApplication();
myType here/portal_type;
miscDataSpecialist myApp/MiscData;
! typePropertiesObjects python:miscDataSpecialist.ZApp_getItems(Manager='CMFThings', objectID='metaObject', dataType='ZCMFPropsFor' + myType);
! myTPropsMiscData python:typePropertiesObjects and typePropertiesObjects[0].getXMLDict();
myPropSet myTPropsMiscData/zapp_properties | nothing">
! <form action="zapp_cmf_object_type_edit" method="post">
<table tal:condition="myPropSet">
<tr tal:repeat="propDef myPropSet">
--- 54,64 ----
<div tal:define="myApp python:here.getApplication();
myType here/portal_type;
+ cmfSpec python:here.getMySpecialist();
miscDataSpecialist myApp/MiscData;
! typePropertiesObjects python:miscDataSpecialist.ZApp_getItems(Manager=cmfSpec.getId(), objectID='metaObject', dataType='ZCMFPropsFor' + myType);
! myTPropsMiscData python:typePropertiesObjects and typePropertiesObjects[0].getXMLDict();
myPropSet myTPropsMiscData/zapp_properties | nothing">
! <form action="." tal:attributes="action string:${here/getId}/zapp_cmf_object_type_edit" method="post">
<table tal:condition="myPropSet">
<tr tal:repeat="propDef myPropSet">
Index: zapp_cmf_object_view.pt
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_cmf_object_view.pt,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** zapp_cmf_object_view.pt 7 Aug 2003 13:50:32 -0000 1.4
--- zapp_cmf_object_view.pt 28 Oct 2003 20:27:04 -0000 1.5
***************
*** 11,17 ****
<div tal:define="myApp python:here.getApplication();
myType here/portal_type;
miscDataSpecialist myApp/MiscData;
! typePropertiesObjects python:miscDataSpecialist.ZApp_getItems(Manager='CMFThings', objectID='metaObject', dataType='ZCMFPropsFor' + myType);
! myTypePropertiesMiscData python:typePropertiesObjects and typePropertiesObjects[0].getXMLDict();
myProperties python:here.safeMiscData.getXMLDict()">
--- 11,19 ----
<div tal:define="myApp python:here.getApplication();
myType here/portal_type;
+ cmfSpec python:here.getMySpecialist();
miscDataSpecialist myApp/MiscData;
! typePropertiesObjects python:miscDataSpecialist.ZApp_getItems(Manager=cmfSpec.getId(), objectID='metaObject', dataType='ZCMFPropsFor' + myType);
! myTypePropertiesMiscData python:typePropertiesObjects and typePropertiesObjects[0].getXMLDict();
! myPropSet myTypePropertiesMiscData/zapp_properties | nothing;
myProperties python:here.safeMiscData.getXMLDict()">
|
|
From: <ssp...@us...> - 2003-10-28 20:29:24
|
Update of /cvsroot/zapp/ZApp/zpt
In directory sc8-pr-cvs1:/tmp/cvs-serv28855/zpt
Modified Files:
Generic_displayRelatedObjects.zpt
Log Message:
attempt to merge new CMF relations back to main branch
Index: Generic_displayRelatedObjects.zpt
===================================================================
RCS file: /cvsroot/zapp/ZApp/zpt/Generic_displayRelatedObjects.zpt,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Generic_displayRelatedObjects.zpt 7 Aug 2003 17:51:55 -0000 1.4
--- Generic_displayRelatedObjects.zpt 28 Oct 2003 20:27:04 -0000 1.5
***************
*** 1,4 ****
<div tal:define="app python:here.findApplication(); appURL app/absolute_url;
! objRelations python:here.objectRelations( returnObjects=1 )">
<form action="" tal:attributes="action request/URL1" method="post">
<table >
--- 1,5 ----
<div tal:define="app python:here.findApplication(); appURL app/absolute_url;
! objRelations python:here.objectRelations( returnObjects=1 );
! managerIDs here/findSpecialistsForRelationship">
<form action="" tal:attributes="action request/URL1" method="post">
<table >
***************
*** 18,22 ****
<input tal:condition="objRelations" type="submit" value="Edit Selected Relations" name="editRelations_ui:method">
</td></tr>
! <tr><td colspan="3"><input type="submit" value="Relate Other Object" name="findNewRelationship_pt:method">
</td></tr>
</table>
--- 19,23 ----
<input tal:condition="objRelations" type="submit" value="Edit Selected Relations" name="editRelations_ui:method">
</td></tr>
! <tr tal:condition="managerIDs"><td colspan="3"><input type="submit" value="Relate Other Object" name="addRelationship_pt:method">
</td></tr>
</table>
|
|
From: <ssp...@us...> - 2003-10-28 20:29:23
|
Update of /cvsroot/zapp/ZApp/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv28855/tests
Modified Files:
test_PGRelations.py
Log Message:
attempt to merge new CMF relations back to main branch
Index: test_PGRelations.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/tests/test_PGRelations.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** test_PGRelations.py 2 Jun 2003 16:41:38 -0000 1.4
--- test_PGRelations.py 28 Oct 2003 20:27:04 -0000 1.5
***************
*** 17,21 ****
if __name__=='__main__':
-
main(defaultTest='test_suite')
--- 17,20 ----
|
|
From: <ssp...@us...> - 2003-10-28 20:21:39
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv26852
Modified Files:
Tag: CMF_relations
ZApp_CMFBase.py
Log Message:
check for copyable when copy is happening..
Index: ZApp_CMFBase.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v
retrieving revision 1.16.2.7
retrieving revision 1.16.2.8
diff -C2 -d -r1.16.2.7 -r1.16.2.8
*** ZApp_CMFBase.py 28 Oct 2003 19:01:43 -0000 1.16.2.7
--- ZApp_CMFBase.py 28 Oct 2003 20:19:27 -0000 1.16.2.8
***************
*** 46,53 ****
isPrincipiaFolderish = 1
_primaryKeyStringSize=255 # allow for a pretty rediculous size...
_primaryKeyGenerator='self.calcPathID()'
_insertQueryPrefix = 'self.checkDups() and '
-
manage_options = SkinnedFolder.manage_options
--- 46,54 ----
isPrincipiaFolderish = 1
+ class_default_for_copyable = 0 # make these guys default to 'not copyable'
+
_primaryKeyStringSize=255 # allow for a pretty rediculous size...
_primaryKeyGenerator='self.calcPathID()'
_insertQueryPrefix = 'self.checkDups() and '
manage_options = SkinnedFolder.manage_options
***************
*** 98,102 ****
Can this object be copied?
"""
! return hasattr(self.aq_parent.aq_base, 'zapp_cmf_type')
def _notifyOfCopyTo(self, container, op=0):
--- 99,103 ----
Can this object be copied?
"""
! return getattr(self, 'copyable',0)
def _notifyOfCopyTo(self, container, op=0):
|
|
From: <ssp...@us...> - 2003-10-28 19:02:01
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv6887
Modified Files:
Tag: CMF_relations
ZApp_CMFBase.py
Log Message:
cleaned out print statements <oops!>
Index: ZApp_CMFBase.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v
retrieving revision 1.16.2.6
retrieving revision 1.16.2.7
diff -C2 -d -r1.16.2.6 -r1.16.2.7
*** ZApp_CMFBase.py 28 Oct 2003 18:33:19 -0000 1.16.2.6
--- ZApp_CMFBase.py 28 Oct 2003 19:01:43 -0000 1.16.2.7
***************
*** 115,146 ****
ZApp_LOG("_notifyOfCopyTo: Setting safeStorageID to " + safeStorageID)
- def ___getstate__(self):
- """
- getstate is called when an object is being 'saved'
- """
- print "in getstate for %s" % self.id
- result = SkinnedFolder.__getstate__(self)
- print "XXXXX*****XXXXXX got result '%s'" % `result`
- return result
-
- def ___setstate__(self, state):
- """
- calling setstate.. set state gets called when an object is pulled into memory
- """
- try:
- rep = `state`
- except:
- rep = "can't render"
-
- print "in setstate for %s with state '%s'" % (self.id, rep)
- result = SkinnedFolder.__setstate__(self, state)
- print "XXXXX*****XXXXXX got result '%s'" % `result`
- return result
-
def _setId(self, id):
#
# save the 'safeStorageID' so we can use it when we're added again..
#
- print "In _setID for ", id
oldID = self.getId()
--- 115,122 ----
***************
*** 260,265 ****
raise RuntimeError, "Sorry.. no ',' allowed in id!"
- print "Adding CMF object ", id, " to ", self.getId()
-
if useExisting:
dm = self.getDataManagerFor( klass, None )
--- 236,239 ----
***************
*** 284,289 ****
initCMFObjectMetadata(o)
o.change()
-
- print "Added CMF Object:" , id
if klass != ZApp_CMFBase:
--- 258,261 ----
|
|
From: <ssp...@us...> - 2003-10-28 19:01:55
|
Update of /cvsroot/zapp/ZApp/zpt
In directory sc8-pr-cvs1:/tmp/cvs-serv6887/zpt
Modified Files:
Tag: CMF_relations
Generic_displayRelatedObjects.zpt
Log Message:
cleaned out print statements <oops!>
Index: Generic_displayRelatedObjects.zpt
===================================================================
RCS file: /cvsroot/zapp/ZApp/zpt/Generic_displayRelatedObjects.zpt,v
retrieving revision 1.4.2.1
retrieving revision 1.4.2.2
diff -C2 -d -r1.4.2.1 -r1.4.2.2
*** Generic_displayRelatedObjects.zpt 8 Oct 2003 20:37:48 -0000 1.4.2.1
--- Generic_displayRelatedObjects.zpt 28 Oct 2003 19:01:44 -0000 1.4.2.2
***************
*** 3,7 ****
managerIDs here/findSpecialistsForRelationship">
<form action="" tal:attributes="action request/URL1" method="post">
- <span tal:content="managerIDs"/><br>
<table >
<tr tal:condition="objRelations"><td> </td><td>Manager</td><td>ObjectID</td><td>Info</td><td>Context ID</td></tr>
--- 3,6 ----
|
|
From: <ssp...@us...> - 2003-10-28 18:33:29
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv2885
Modified Files:
Tag: CMF_relations
ZApp_CMFBase.py
Log Message:
fixed subclassing problem!
Index: ZApp_CMFBase.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v
retrieving revision 1.16.2.5
retrieving revision 1.16.2.6
diff -C2 -d -r1.16.2.5 -r1.16.2.6
*** ZApp_CMFBase.py 28 Oct 2003 15:43:33 -0000 1.16.2.5
--- ZApp_CMFBase.py 28 Oct 2003 18:33:19 -0000 1.16.2.6
***************
*** 40,44 ****
import tempfile
! class ZApp_CMFBase(FreeRangeDS, ZApp_Base, SkinnedFolder, DefaultDublinCoreImpl, ZApp_MiscDataUser, ZApp_RelatedObject):
meta_type = 'ZApp CMF Content'
--- 40,44 ----
import tempfile
! class ZApp_CMFBase(FreeRangeDS, SkinnedFolder, ZApp_Base, DefaultDublinCoreImpl, ZApp_MiscDataUser, ZApp_RelatedObject):
meta_type = 'ZApp CMF Content'
***************
*** 70,80 ****
def calcPathID(self):
! if self.id.find(',') != -1:
! result = self.id
! else:
! objPath = ','.join(self.getPhysicalPath())
! portalPath = ','.join(self.portal_url.getPortalObject().getPhysicalPath()) + ','
! result = objPath[len(portalPath)-1:]
!
return result
--- 70,84 ----
def calcPathID(self):
!
! try:
! if self.id.find(',') != -1:
! result = self.id
! else:
! objPath = ','.join(self.getPhysicalPath())
! portalPath = ','.join(self.portal_url.getPortalObject().getPhysicalPath()) + ','
! result = objPath[len(portalPath)-1:]
! except:
! raise
!
return result
***************
*** 111,115 ****
ZApp_LOG("_notifyOfCopyTo: Setting safeStorageID to " + safeStorageID)
! def __getstate__(self):
"""
getstate is called when an object is being 'saved'
--- 115,119 ----
ZApp_LOG("_notifyOfCopyTo: Setting safeStorageID to " + safeStorageID)
! def ___getstate__(self):
"""
getstate is called when an object is being 'saved'
***************
*** 120,124 ****
return result
! def __setstate__(self, state):
"""
calling setstate.. set state gets called when an object is pulled into memory
--- 124,128 ----
return result
! def ___setstate__(self, state):
"""
calling setstate.. set state gets called when an object is pulled into memory
***************
*** 255,258 ****
--- 259,264 ----
if id.find(',') != -1:
raise RuntimeError, "Sorry.. no ',' allowed in id!"
+
+ print "Adding CMF object ", id, " to ", self.getId()
if useExisting:
***************
*** 367,370 ****
--- 373,384 ----
, 'action': 'string:${object_url}/metadata_edit_form'
, 'permissions' : (CMFCorePermissions.ModifyPortalContent,)},
+ { 'id' : 'subobjects'
+ , 'name' : 'SubObjects'
+ , 'action': 'string:${object_url}/zapp_cmf_sub_contents'
+ , 'permissions' : (CMFCorePermissions.View,)},
+ { 'id' : 'test'
+ , 'name' : 'Test'
+ , 'action': 'string:${object_url}/zapp_cmf_object_test'
+ , 'permissions' : (CMFCorePermissions.ManagePortal,)},
),
},
|