zapp-cvs-commit Mailing List for ZApp Framework (Page 5)
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...> - 2004-02-04 12:08:32
|
Update of /cvsroot/zapp/ZApp/www_ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv393/www_ui Modified Files: filterDisplay_html.plain quickDisplay_html.plain Log Message: fixed quickdisplay query Index: filterDisplay_html.plain =================================================================== RCS file: /cvsroot/zapp/ZApp/www_ui/filterDisplay_html.plain,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** filterDisplay_html.plain 25 Jan 2004 20:58:46 -0000 1.3 --- filterDisplay_html.plain 4 Feb 2004 12:06:08 -0000 1.4 *************** *** 54,58 **** </form> ! <dtml-call "REQUEST.set('queryDisplayText',ZApp_getItemIds(displayQuery=1))"> <dtml-let searchResults="ZApp_getItemIds(REQUEST=REQUEST)" --- 54,58 ---- </form> ! <dtml-call "REQUEST.set('queryDisplayText',ZApp_getItemIds(REQUEST=REQUEST, displayQuery=1))"> <dtml-let searchResults="ZApp_getItemIds(REQUEST=REQUEST)" Index: quickDisplay_html.plain =================================================================== RCS file: /cvsroot/zapp/ZApp/www_ui/quickDisplay_html.plain,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** quickDisplay_html.plain 25 Jan 2004 20:58:46 -0000 1.11 --- quickDisplay_html.plain 4 Feb 2004 12:06:08 -0000 1.12 *************** *** 47,51 **** </form> ! <dtml-call "REQUEST.set('queryDisplayText',ZApp_getItemIds(displayQuery=1))"> <dtml-let searchResults="ZApp_getItemIds(REQUEST=REQUEST)" --- 47,51 ---- </form> ! <dtml-call "REQUEST.set('queryDisplayText',ZApp_getItemIds(REQUEST=REQUEST, displayQuery=1))"> <dtml-let searchResults="ZApp_getItemIds(REQUEST=REQUEST)" |
|
From: <kfr...@us...> - 2004-02-04 09:30:27
|
Update of /cvsroot/zapp/ZApp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24114 Modified Files: __init__.py Log Message: I found problem importing ZApp_CMFBase with no FreeRangeDS product installed.. needed better error message. Index: __init__.py =================================================================== RCS file: /cvsroot/zapp/ZApp/__init__.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** __init__.py 25 Jan 2004 20:58:45 -0000 1.21 --- __init__.py 4 Feb 2004 01:58:39 -0000 1.22 *************** *** 15,19 **** import ZApp_RelationshipManager ! from ZApp_LOG import ZApp_LOG import mimetypes --- 15,19 ---- import ZApp_RelationshipManager ! from ZApp_LOG import ZApp_LOG, INFO import mimetypes *************** *** 22,25 **** --- 22,26 ---- mimetypes.types_map['.swd'] = 'application/octet-stream' + try: import ZApp_CMFBase *************** *** 29,32 **** --- 30,34 ---- except ImportError: do_cmf = 0 + ZApp_LOG("Ack! CMF not installed? FreeRangeDS? Something goofy... ", 100) from AccessControl import ClassSecurityInfo, ModuleSecurityInfo, Permission |
|
From: <ssp...@pr...> - 2004-01-26 00:47:26
|
Update of /cvsroot/zapp/ZApp/help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23833/help Added Files: ZApp_RelatableItem.py Log Message: add some relatable item doc --- NEW FILE: ZApp_RelatableItem.py --- # # ZApp RelatableItem. This is an object that can take part in a relationship # class ZApp_RelatableParentMixin: """ These are just the things we need/like when we're a parent object. """ def getSortedContextIDs(self, objectManagerID=None, referenceAttribute='parentID', parentManager=None, additionalConditions=None): """ get the current contextIDs in some sort of 'sorted' order. """ def nextContextID(self, objectManagerID=None, referenceAttribute='parentID', parentManager=None, additionalConditions=None): """ get the 'next' contextID that makes sense.. """ def nextContextID_QSD(self, objectManagerID=None, referenceAttribute='parentID', parentManager=None, additionalConditions=None): """ get the 'next' contextID that makes sense. Use 'querySearchDirect' method.. """ def getSubItemInits(self, contextID=''): """ get the relationship related properties of s sub item """ def addSubItem_ui(self, beginContextID, numItems, objectManagerID=None, addMethodID=None): """ add some subitems to this item """ def addSubItem(self, subItem=None, contextID=None, objectManagerID = None, **kw): """ Add a new child to this parent. """ class ZApp_RelatableChildMixin: """ Methods and characteristics of a child object.. """ class ZApp_RelatableParent: """ These are simple items that can have many children, but no parents.. """ class ZApp_RelatableChild: """ These are simple items that can have a single parent object, and no children. """ class ZApp_RelatableItem: """ These are simple items that can have a single parent object, and many child objects (and object types!) """ class ZApp_RelatedObject: """ Currently more than half-baked Mixin class that can be managed by an 'object-hub' like thingy called a RelationshipManager """ def findSpecialistsForRelationship(self): """ in base class we just return our relatable_object_types property. """ def getObjectManagerID(self): """ get my object manager ID """ def relationDeleted(self, relationshipItem): """ a relationshipItem has been terminated. """ def getObjectType(self): """ Track down this object's object type """ def createAndAddObject_ui(self, objectProperties=None, objectManager=None, objectRole=None, selfRole=None, createIfNone=0, contextID='', REQUEST=None, **kw): """ A UI method to create and add an object.. """ def createAndAddObject(self, objectProperties=None, objectManager=None, objectRole=None, selfRole=None, createIfNone=0, contextID='', **kw): """ Use object properties to create and object.. and then add it to me. """ def addObject(self, otherObject, objectRole=None, selfRole=None, createIfNone=0, contextID=''): """ Add an object to this object. 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... """ def removeObjectRelations(self, ids=None): """ remove the relationships with the given relationship IDs.. """ def removeObjectRelations_ui(self, ids, REQUEST=None): """ remove the relationships with the given relationship IDs.. + UI fluff.. this method requires ids to be passed... """ def removeObject(self, otherObject=None, selfRole=None, objectRole=None): """ remove a related object. If selfRole is not None, only remove if 'self's role is selfRole. if objectRole is not None, only remove if 'object's role is otherRole. if otherObject is None, remove all objects that match roles.. """ def objectRelations(self, objectTypes=None, objectRoles=None, selfRoles=None, returnObjects=0): """ Get info about the relationships in which I'm involved... 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, }, {.... }, ... ] if returnObjects is true, each dictionary also has 'otherObject':otherObject as a member. """ def relatedObjects(self, objectTypes=None, objectRoles=None, selfRoles=None): """ Get related objects themselves. """ def relatedObjectContextIDs(self, objectTypes=None, objectRoles=None, selfRoles=None): """ get related object context ids.. """ def editRelations_ui(self, ids, relationInfo, REQUEST=None): """ edit my relationships... """ def nextContextID(self, objectTypes=None, objectRoles=None, selfRoles=None): """ get the 'next' contextID that makes sense.. """ |
|
From: <ssp...@pr...> - 2004-01-25 20:59:34
|
Update of /cvsroot/zapp/ZApp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17693 Modified Files: ZApp_Application.py ZApp_CMFBase.py ZApp_MiscData.py ZApp_Specialist.py __init__.py Log Message: fix some MiscData/ZApp_getItems problems.... you may need to 'Update FS Methods' in ZApp App to use developer view.. Index: ZApp_Application.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_Application.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** ZApp_Application.py 8 Jan 2004 15:26:50 -0000 1.29 --- ZApp_Application.py 25 Jan 2004 20:58:44 -0000 1.30 *************** *** 179,184 **** Folder.manage_options[1:-4]+( {'label':'Lever Actions','action':'manage_leverActionsForm',}, - {'label':'Security','action':'manage_access', - 'help':('OFSP','Security.stx'),}, {'label':'Update FS Methods', 'action':'manage_updateFSMethodsForm', --- 179,182 ---- Index: ZApp_CMFBase.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** ZApp_CMFBase.py 21 Jan 2004 14:31:30 -0000 1.26 --- ZApp_CMFBase.py 25 Jan 2004 20:58:44 -0000 1.27 *************** *** 68,74 **** # src="http://hecxs.spvi.net:9180/HECPlone/fSystem/HECPlone/HEC/Media/Foods/clay.jpg" ! _custom_skin_scripts = ('WHEN OBJECT CHANGED STORE portal_type using self.change(cmf_portal_type=self.portal_type)', ! "WITH SELF COMPUTE portal_object_id=_.getattr(self, 'zapp_portal_id')", ! "WITH SELF COMPUTE portal_object=_.getattr(self.findApplication(), self.portal_object_id)" "WITH SELF COMPUTE graphic_url=self.findApplication().absolute_url() + ( '/fSystem/%s/%s/%s' % (self.getPhysicalPath()[1], self.portal_object_id, self.cmfdataid[1:].replace(',','/')))", ) --- 68,73 ---- # src="http://hecxs.spvi.net:9180/HECPlone/fSystem/HECPlone/HEC/Media/Foods/clay.jpg" ! _custom_skin_scripts = ("WITH SELF COMPUTE portal_object_id=_.getattr(self, 'zapp_portal_id')", ! "WITH SELF COMPUTE portal_object=_.getattr(self.findApplication(), self.portal_object_id)", "WITH SELF COMPUTE graphic_url=self.findApplication().absolute_url() + ( '/fSystem/%s/%s/%s' % (self.getPhysicalPath()[1], self.portal_object_id, self.cmfdataid[1:].replace(',','/')))", ) *************** *** 277,281 **** safeStorage = mdm.getItem(safeStorageID) if safeStorage: ! self.ZAppCMF_afterAdd( safeStorage, newID ) safeStorage.manage_delete() --- 276,280 ---- safeStorage = mdm.getItem(safeStorageID) if safeStorage: ! self.ZAppCMF_afterAdd( safeStorage, newID) safeStorage.manage_delete() Index: ZApp_MiscData.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_MiscData.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** ZApp_MiscData.py 3 Jan 2004 03:13:48 -0000 1.25 --- ZApp_MiscData.py 25 Jan 2004 20:58:45 -0000 1.26 *************** *** 196,200 **** Get MiscData object associated with this object/Manager/dataType combination.. """ - Manager = (Manager or '') or self.miscDataManager localmdmKey = Manager + ":" + dataType --- 196,199 ---- *************** *** 212,216 **** mdResult = self.setupMiscData( Manager, dataType, checked=1) ! return mdResult or None def setupMiscData(self, Manager=None, dataType='', checked=0): --- 211,217 ---- mdResult = self.setupMiscData( Manager, dataType, checked=1) ! return mdResult or None ! ! return mdm def setupMiscData(self, Manager=None, dataType='', checked=0): Index: ZApp_Specialist.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_Specialist.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** ZApp_Specialist.py 9 Jan 2004 11:28:31 -0000 1.35 --- ZApp_Specialist.py 25 Jan 2004 20:58:45 -0000 1.36 *************** *** 622,626 **** return queryResult ! def ZApp_getItemIds(self, conditions=None, displayQuery=0, createIfNone=0, **kw): """ Get all my itemIds that match conditions.. """ --- 622,626 ---- return queryResult ! def ZApp_getItemIds(self, conditions=None, displayQuery=0, createIfNone=0, REQUEST=None, **kw): """ Get all my itemIds that match conditions.. """ *************** *** 638,645 **** conditions.update(kw) ! if not conditions: try: ! conditions.update(self.REQUEST.form) ! conditions.update(self.REQUEST.other) except: conditions = {} --- 638,645 ---- conditions.update(kw) ! if REQUEST is not None: try: ! conditions.update(self.REQUEST.form.copy()) ! conditions.update(self.REQUEST.other.copy()) except: conditions = {} *************** *** 669,679 **** return theIDs ! def ZApp_getItems(self, conditions=None, createIfNone=0, displayQuery=0, **kw): """ get my items that match conditions """ results = [] ! if conditions == None: ! conditions = self.REQUEST.form.copy() if kw: --- 669,682 ---- return theIDs ! def ZApp_getItems(self, conditions=None, createIfNone=0, displayQuery=0, REQUEST=None, **kw): """ get my items that match conditions """ results = [] ! if conditions is None: ! conditions = {} ! ! if REQUEST is not None: # only use the REQUEST if it is specifically passed in as an argument. ! conditions.update(REQUEST.form.copy()) if kw: Index: __init__.py =================================================================== RCS file: /cvsroot/zapp/ZApp/__init__.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** __init__.py 16 Jan 2004 09:55:34 -0000 1.20 --- __init__.py 25 Jan 2004 20:58:45 -0000 1.21 *************** *** 35,39 **** ModuleSecurityInfo('pdb').declarePublic('set_trace') ModuleSecurityInfo('urllib').declarePublic('urlencode', 'quote') ! ModuleSecurityInfo('xmlrpclib').declarePublic('Server') allow_module('Products.ZApp.ZApp_Utils') --- 35,39 ---- ModuleSecurityInfo('pdb').declarePublic('set_trace') ModuleSecurityInfo('urllib').declarePublic('urlencode', 'quote') ! ModuleSecurityInfo('xmlrpclib').declarePublic('Server', 'loads', 'dumps') allow_module('Products.ZApp.ZApp_Utils') |
|
From: <ssp...@pr...> - 2004-01-25 20:59:34
|
Update of /cvsroot/zapp/ZApp/skins/zapp_generic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17693/skins/zapp_generic Modified Files: zapp_cmf_object_edit.py zapp_cmf_xml_edit.py Log Message: fix some MiscData/ZApp_getItems problems.... you may need to 'Update FS Methods' in ZApp App to use developer view.. Index: zapp_cmf_object_edit.py =================================================================== RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_cmf_object_edit.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** zapp_cmf_object_edit.py 21 Jan 2004 12:26:48 -0000 1.8 --- zapp_cmf_object_edit.py 25 Jan 2004 20:58:46 -0000 1.9 *************** *** 39,43 **** submitValue = dict.get('submit','') ! for key in ['submit', 'zapp_dataType', 'zapp_misc_data_clear', 'redirect_url']: if dict.has_key(key): del dict[key] --- 39,43 ---- submitValue = dict.get('submit','') ! for key in ['submit', 'zapp_dataType', 'zapp_misc_data_clear', 'redirect_url', 'propToChange']: if dict.has_key(key): del dict[key] Index: zapp_cmf_xml_edit.py =================================================================== RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_cmf_xml_edit.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** zapp_cmf_xml_edit.py 20 Jan 2004 03:42:53 -0000 1.1 --- zapp_cmf_xml_edit.py 25 Jan 2004 20:58:46 -0000 1.2 *************** *** 5,9 **** ##bind script=script ##bind subpath=traverse_subpath ! ##parameters=xml, dataType="", no_redir=0, redirect_url='' ##title= ## --- 5,9 ---- ##bind script=script ##bind subpath=traverse_subpath ! ##parameters=xml, dataType="", no_redir=0, redirect_url='', clearFlag=0 ##title= ## *************** *** 12,21 **** """ miscData = context.getMiscData( dataType=dataType, createIfNone=1 ) if not miscData: raise RuntimeError, "Dang... can't find misc data object...." ! ! miscData.change( xml = xml ) if no_redir: --- 12,30 ---- """ + import xmlrpclib + miscData = context.getMiscData( dataType=dataType, createIfNone=1 ) if not miscData: raise RuntimeError, "Dang... can't find misc data object...." ! ! try: ! loadResult = xmlrpclib.loads(xml) ! args = loadResult[0] ! obj = args[0] ! except: ! raise RuntimeError, "Hmm.. can't seem to parse this XML" ! ! miscData.setXMLAttrs(dict = obj, zapp_misc_data_clear=clearFlag) if no_redir: |
|
From: <ssp...@pr...> - 2004-01-25 20:59:33
|
Update of /cvsroot/zapp/ZApp/www_ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17693/www_ui Modified Files: filterDisplay_html.plain quickDisplay_html.plain Log Message: fix some MiscData/ZApp_getItems problems.... you may need to 'Update FS Methods' in ZApp App to use developer view.. Index: filterDisplay_html.plain =================================================================== RCS file: /cvsroot/zapp/ZApp/www_ui/filterDisplay_html.plain,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** filterDisplay_html.plain 16 Dec 2003 17:19:44 -0000 1.2 --- filterDisplay_html.plain 25 Jan 2004 20:58:46 -0000 1.3 *************** *** 56,60 **** <dtml-call "REQUEST.set('queryDisplayText',ZApp_getItemIds(displayQuery=1))"> ! <dtml-let searchResults="ZApp_getItemIds()" foo="REQUEST.set('countMinMax',getPrimaryKey())" foo="REQUEST.set('start',0)" --- 56,60 ---- <dtml-call "REQUEST.set('queryDisplayText',ZApp_getItemIds(displayQuery=1))"> ! <dtml-let searchResults="ZApp_getItemIds(REQUEST=REQUEST)" foo="REQUEST.set('countMinMax',getPrimaryKey())" foo="REQUEST.set('start',0)" Index: quickDisplay_html.plain =================================================================== RCS file: /cvsroot/zapp/ZApp/www_ui/quickDisplay_html.plain,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** quickDisplay_html.plain 13 Jun 2003 13:59:53 -0000 1.10 --- quickDisplay_html.plain 25 Jan 2004 20:58:46 -0000 1.11 *************** *** 49,53 **** <dtml-call "REQUEST.set('queryDisplayText',ZApp_getItemIds(displayQuery=1))"> ! <dtml-let searchResults="ZApp_getItemIds()" foo="REQUEST.set('countMinMax',getPrimaryKey())" foo="REQUEST.set('start',0)" --- 49,53 ---- <dtml-call "REQUEST.set('queryDisplayText',ZApp_getItemIds(displayQuery=1))"> ! <dtml-let searchResults="ZApp_getItemIds(REQUEST=REQUEST)" foo="REQUEST.set('countMinMax',getPrimaryKey())" foo="REQUEST.set('start',0)" |
|
From: <ssp...@us...> - 2004-01-21 16:35:03
|
Update of /cvsroot/zapp/ZApp/skins/zapp_generic In directory sc8-pr-cvs1:/tmp/cvs-serv16883 Modified Files: zapp_image_view.pt Log Message: oops! Index: zapp_image_view.pt =================================================================== RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_image_view.pt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** zapp_image_view.pt 21 Jan 2004 12:26:48 -0000 1.3 --- zapp_image_view.pt 21 Jan 2004 16:35:00 -0000 1.4 *************** *** 26,30 **** <div tal:condition="python:here.Format() != 'application/x-shockwave-flash'"> <img tal:attributes="src python:here.zapp_get_fileObj().absolute_url(); ! width zapp_image_width | 400"/> </div> </div> --- 26,30 ---- <div tal:condition="python:here.Format() != 'application/x-shockwave-flash'"> <img tal:attributes="src python:here.zapp_get_fileObj().absolute_url(); ! width zapp_image_width | string:400"/> </div> </div> |
|
From: <ssp...@us...> - 2004-01-21 14:31:33
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv21603
Modified Files:
ZApp_CMFBase.py
Log Message:
put xml tab on CMF Content view for manager..
Index: ZApp_CMFBase.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** ZApp_CMFBase.py 16 Jan 2004 09:55:34 -0000 1.25
--- ZApp_CMFBase.py 21 Jan 2004 14:31:30 -0000 1.26
***************
*** 390,394 ****
, 'action': 'string:${object_url}/zapp_cmf_object_test'
, 'permissions' : (CMFCorePermissions.ManagePortal,)},
! ),
},
)
--- 390,400 ----
, 'action': 'string:${object_url}/zapp_cmf_object_test'
, 'permissions' : (CMFCorePermissions.ManagePortal,)},
! { 'id' : 'xml'
! , 'name' : 'XML'
! , 'action': 'string:${object_url}/zapp_cmf_xml_form'
! , 'permissions' : (CMFCorePermissions.ManagePortal,)
! , 'visible' : 1
! },
! ),
},
)
|
|
From: <ssp...@us...> - 2004-01-21 12:26:51
|
Update of /cvsroot/zapp/ZApp/skins/zapp_generic
In directory sc8-pr-cvs1:/tmp/cvs-serv29258/skins/zapp_generic
Modified Files:
zapp_cmf_object_edit.py zapp_cmf_object_edit_form.pt
zapp_image_view.pt
Log Message:
more edit/image fixes..
Index: zapp_cmf_object_edit.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_cmf_object_edit.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** zapp_cmf_object_edit.py 12 Jan 2004 14:25:16 -0000 1.7
--- zapp_cmf_object_edit.py 21 Jan 2004 12:26:48 -0000 1.8
***************
*** 39,43 ****
submitValue = dict.get('submit','')
! for key in ['submit', 'zapp_dataType', 'zapp_misc_data_clear']:
if dict.has_key(key):
del dict[key]
--- 39,43 ----
submitValue = dict.get('submit','')
! for key in ['submit', 'zapp_dataType', 'zapp_misc_data_clear', 'redirect_url']:
if dict.has_key(key):
del dict[key]
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.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** zapp_cmf_object_edit_form.pt 8 Jan 2004 11:20:26 -0000 1.6
--- zapp_cmf_object_edit_form.pt 21 Jan 2004 12:26:48 -0000 1.7
***************
*** 50,57 ****
propValue python:myProperties.get(propName,'')">
! <table tal:condition="python:propType in ['float','int','long','string','date']">
<tr><td tal:content="string:${propName}(${propType})"/><td><input tal:attributes="name string:${propName}:${propType}; value propValue"></td></tr>
</table>
<table tal:condition="python:propType in ['text']">
<tr><td tal:content="string:${propName}(${propType})"/><td><textarea tal:content="propValue" tal:attributes="name string:${propName}" rows="5" cols="40"/></td></tr>
--- 50,61 ----
propValue python:myProperties.get(propName,'')">
! <table tal:condition="python:propType in ['float','int','long','string']">
<tr><td tal:content="string:${propName}(${propType})"/><td><input tal:attributes="name string:${propName}:${propType}; value propValue"></td></tr>
</table>
+ <table tal:condition="python:propType in ['date']">
+ <tr><td tal:content="string:${propName}(${propType})"/><td><input tal:attributes="name string:${propName}:${propType}; value python:propValue or DateTime().strftime('%m/%d/%Y')"></td></tr>
+ </table>
+
<table tal:condition="python:propType in ['text']">
<tr><td tal:content="string:${propName}(${propType})"/><td><textarea tal:content="propValue" tal:attributes="name string:${propName}" rows="5" cols="40"/></td></tr>
***************
*** 77,83 ****
propValue python:propValue and propValue.get(subPropName,'')">
<td tal:content="string:${subPropName}(${propType})"/>
! <td><input tal:condition="python:propType not in ['boolean','text']" tal:attributes="name string:${propName}.${subPropName}:${propType}:record; value propValue">
! <textarea tal:condition="python:propType in ['text']" tal:content="propValue" tal:attributes="name string:${propName}.${subPropName}:record;" rows="5" cols="40"/>
! <input tal:condition="python:propType in ['boolean']" type="checkbox" value="1" tal:attributes="name string:${propName}.${subPropName}:int:record; checked propValue">
</td>
</tal:block>
--- 81,89 ----
propValue python:propValue and propValue.get(subPropName,'')">
<td tal:content="string:${subPropName}(${propType})"/>
! <td>
! <input tal:condition="python:propType in ['float','int','long','string']" tal:attributes="name string:${propName}.${subPropName}:${propType}:record; value propValue">
! <input tal:condition="python:propType in ['date']" tal:attributes="name string:${propName}.${subPropName}:${propType}:record; value python:propValue or DateTime().strftime('%m/%d/%Y')">
! <textarea tal:condition="python:propType in ['text']" tal:content="propValue" tal:attributes="name string:${propName}.${subPropName}:record;" rows="5" cols="40"/>
! <input tal:condition="python:propType in ['boolean']" type="checkbox" value="1" tal:attributes="name string:${propName}.${subPropName}:int:record; checked propValue">
</td>
</tal:block>
***************
*** 95,99 ****
subpropType propDef/type;
currVal python:currItem.get(subPropName,'')">
! <input tal:condition="python:subpropType in ['float','int','long','string','date']" tal:attributes="name string:${propName}.${subPropName}:records; value currVal">
<input tal:condition="python:subpropType in ['boolean']" type="checkbox" value="1" tal:attributes="name string:${propName}.${subPropName}:int:records; checked currVal">
<textarea tal:condition="python:subpropType in ['text']" tal:content="currVal" tal:attributes="name string:${propName}.${subPropName}:records;" rows="5" cols="40"/>
--- 101,106 ----
subpropType propDef/type;
currVal python:currItem.get(subPropName,'')">
! <input tal:condition="python:subpropType in ['float','int','long','string']" tal:attributes="name string:${propName}.${subPropName}:records; value currVal">
! <input tal:condition="python:subpropType in ['date']" tal:attributes="name string:${propName}.${subPropName}:records; value python:currVal or DateTime().strftime('%m/%d/%Y')">
<input tal:condition="python:subpropType in ['boolean']" type="checkbox" value="1" tal:attributes="name string:${propName}.${subPropName}:int:records; checked currVal">
<textarea tal:condition="python:subpropType in ['text']" tal:content="currVal" tal:attributes="name string:${propName}.${subPropName}:records;" rows="5" cols="40"/>
***************
*** 115,117 ****
</body>
! </html>
\ No newline at end of file
--- 122,124 ----
</body>
! </html>
Index: zapp_image_view.pt
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_image_view.pt,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** zapp_image_view.pt 16 Jan 2004 09:55:34 -0000 1.2
--- zapp_image_view.pt 21 Jan 2004 12:26:48 -0000 1.3
***************
*** 25,32 ****
<div tal:condition="python:here.Format() != 'application/x-shockwave-flash'">
! <img tal:attributes="src python:here.zapp_get_fileObj().absolute_url()"/>
</div>
</div>
</body>
! </html>
\ No newline at end of file
--- 25,33 ----
<div tal:condition="python:here.Format() != 'application/x-shockwave-flash'">
! <img tal:attributes="src python:here.zapp_get_fileObj().absolute_url();
! width zapp_image_width | 400"/>
</div>
</div>
</body>
! </html>
|
|
From: <ssp...@us...> - 2004-01-20 03:42:56
|
Update of /cvsroot/zapp/ZApp/skins/zapp_generic
In directory sc8-pr-cvs1:/tmp/cvs-serv19164/skins/zapp_generic
Added Files:
zapp_cmf_object_export.py zapp_cmf_xml_edit.py
zapp_cmf_xml_form.pt
Log Message:
adde new skin methods/templates
--- NEW FILE: zapp_cmf_object_export.py ---
## Script (Python) "setCurrentStack"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=currStack
##title=
##
import xmlrpclib
return xmlrpclib.dumps(context.safeMiscData.getXMLDict()
--- NEW FILE: zapp_cmf_xml_edit.py ---
## Script (Python) "zapp_cmf_xml_edit"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=xml, dataType="", no_redir=0, redirect_url=''
##title=
##
"""
Save xml directly....
"""
miscData = context.getMiscData( dataType=dataType, createIfNone=1 )
if not miscData:
raise RuntimeError, "Dang... can't find misc data object...."
miscData.change( xml = xml )
if no_redir:
return "OK!"
else:
if not redirect_url:
redirect_url = context.absolute_url() + '/zapp_cmf_xml_form?portal_status_message=ZApp+CMF+Object+Changed.'
context.REQUEST.RESPONSE.redirect(redirect_url)
return "redirecting.. "
--- NEW FILE: zapp_cmf_xml_form.pt ---
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
metal:use-macro="here/main_template/macros/master">
<metal:block fill-slot="base">
<base href=""
tal:attributes="href python: here.absolute_url() + '/'">
</metal:block>
<body>
<div metal:fill-slot="main">
<form action="" tal:attributes="action string:${here/absolute_url}/zapp_cmf_xml_edit"
tal:define="dataType here/dataType | request/dataType | nothing;
miscData python:here.getMiscData( dataType=dataType or '', createIfNone=1);"
method="post">
<textarea tal:condition="miscData" rows="30" cols="70" name="xml" tal:content="miscData/xml"/>
<span tal:condition="not:miscData" tal:content="string:Sorry... no misc data"/>
<input type="submit" name="save"/>
</form>
</div>
</body>
</html>
|
|
From: <ssp...@us...> - 2004-01-16 09:55:44
|
Update of /cvsroot/zapp/ZApp/skins/zapp_generic
In directory sc8-pr-cvs1:/tmp/cvs-serv22109/skins/zapp_generic
Modified Files:
zapp_file_edit.py zapp_file_edit_form.pt zapp_file_view.pt
zapp_get_fileObj.py zapp_image_edit.py zapp_image_edit_form.pt
zapp_image_view.pt
Added Files:
zapp_cook_id.py zapp_get_filesFolderObject.py zapp_show_swf.pt
Log Message:
file system based image handling for Plone
--- NEW FILE: zapp_cook_id.py ---
## Script (Python) "hec_image_edit"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=id, title, file
##title=
##
if not id and hasattr(file,'filename'):
filename=file.filename
title=title or filename
id=filename[max(filename.rfind('/'),
filename.rfind('\\'),
filename.rfind(':'),
)+1:]
return id, title
--- NEW FILE: zapp_get_filesFolderObject.py ---
## Script (Python) "zapp_get_fileObj"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=debug=0
##title=
##
try:
path = context.getPhysicalPath()
fileID = path[-1]
currFolder = context.fSystem
for folder in path[1:-1]:
if folder in currFolder.objectIds('Folder'):
fsFolder = getattr(currFolder, folder, None)
if not fsFolder:
raise RuntimeError, "Can't find folder!" + folder
currFolder = fsFolder
except:
return 'ack!'
if not debug:
return currFolder
return currFolder.getId()
--- NEW FILE: zapp_show_swf.pt ---
<div metal:define-macro="main">
<tal:block tal:omit-tag="" define="main_name python:'.'.join(path('here/getId').split('.')[:-1]);
swf_url here/graphic_url">
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
tal:attributes="id main_name" ALIGN="">
<PARAM NAME=movie tal:attributes="VALUE swf_url">
<PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED tal:attributes="src swf_url;NAME main_name" quality=high bgcolor=#FFFFFF
ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>
</tal:block>
</div>
Index: zapp_file_edit.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_file_edit.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** zapp_file_edit.py 25 Jun 2003 11:45:53 -0000 1.1
--- zapp_file_edit.py 16 Jan 2004 09:55:34 -0000 1.2
***************
*** 10,26 ****
# Example code:
! file = context.REQUEST.form.get('file','')
!
! portal = context.portal_url.getPortalObject()
!
if not file:
! return "I need a file!"
! path = context.getPhysicalPath()
! print "I got a ", `file`
fileID = path[-1]
currFolder = portal.fSystem
--- 10,28 ----
# Example code:
! REQUEST = context.REQUEST
! file = REQUEST.form.get('file','')
if not file:
! raise RuntimeError, "I need a file!"
! print file.filename
! return printed
! oldID = context.getId()
! portal = context.portal_url.getPortalObject()
! path = context.getPhysicalPath()
fileID = path[-1]
+ newID = REQUEST.form.get('id',oldID)
currFolder = portal.fSystem
***************
*** 36,56 ****
currFolder = fsFolder
-
fileObj = getattr(currFolder, fileID, None)
- #print "adding ", `fileObj`," with id ", fileObj.id, " image to ", `currFolder`, currFolder.id
-
if fileObj is None:
currFolder.manage_addFile(id=fileID, file=file)
fileObj = getattr(currFolder, fileID, None)
- print "I'm creating a file object.. "
! try:
! print "I'm trying to upload a file"
! fileObj.manage_upload(file)
! except:
! print "I failed.. by getting a ", `fileObj`
! return printed
context.REQUEST.RESPONSE.redirect('view')
--- 38,50 ----
currFolder = fsFolder
fileObj = getattr(currFolder, fileID, None)
if fileObj is None:
currFolder.manage_addFile(id=fileID, file=file)
fileObj = getattr(currFolder, fileID, None)
! print "I'm trying to upload a file"
! fileObj.manage_upload(file)
context.REQUEST.RESPONSE.redirect('view')
Index: zapp_file_edit_form.pt
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_file_edit_form.pt,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** zapp_file_edit_form.pt 25 Jun 2003 11:45:53 -0000 1.1
--- zapp_file_edit_form.pt 16 Jan 2004 09:55:34 -0000 1.2
***************
*** 12,33 ****
tal:replace="here/getId" i18n:name="objectid">My ID</span></h2>
! <form action="hec_file_edit" method="post" enctype="multipart/form-data"
! tal:attributes="action string:${here/absolute_url}/hec_file_edit"
>
<table class="FormLayout">
<tr>
! <th i18n:translate="">Title</th>
! <td> <span tal:replace="here/Title">My Title</span></td>
! </tr>
!
! <tr>
! <th i18n:translate="">Description</th>
! <td> <span tal:replace="here/Description">My Description</span></td>
</tr>
<tr>
! <th i18n:translate="">Content type</th>
! <td> <span tal:replace="here/Format">html/text</span></td>
</tr>
--- 12,28 ----
tal:replace="here/getId" i18n:name="objectid">My ID</span></h2>
! <form action="zapp_file_edit" method="post" enctype="multipart/form-data"
! tal:attributes="action string:${here/absolute_url}/zapp_file_edit"
>
<table class="FormLayout">
<tr>
! <th i18n:translate="">Short Name (id: no spaces!)</th>
! <td> <input name="id" tal:attributes="value here/id" value=""/></td>
</tr>
<tr>
! <th i18n:translate="">Title</th>
! <td> <input name="title" tal:attributes="value here/Title" value=""/></td>
</tr>
Index: zapp_file_view.pt
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_file_view.pt,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** zapp_file_view.pt 25 Jun 2003 11:45:53 -0000 1.1
--- zapp_file_view.pt 16 Jan 2004 09:55:34 -0000 1.2
***************
*** 18,23 ****
</div>
- <div metal:use-macro="here/content_byline/macros/byline">By Me</div>
-
</div>
--- 18,21 ----
***************
*** 26,30 ****
<h2 i18n:translate=""> File Properties </h2>
! <table tal:define="theFile here/hec_image_get_fileObj">
<tr>
--- 24,28 ----
<h2 i18n:translate=""> File Properties </h2>
! <table tal:define="theFile here/zapp_get_fileObj">
<tr>
Index: zapp_get_fileObj.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_get_fileObj.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** zapp_get_fileObj.py 25 Jun 2003 11:45:53 -0000 1.1
--- zapp_get_fileObj.py 16 Jan 2004 09:55:34 -0000 1.2
***************
*** 1,16 ****
! portal = context.portal_url.getPortalObject()
! path = context.getPhysicalPath()
! fileID = path[-1]
! currFolder = portal.fSystem
!
! for folder in path[1:-1]:
! if folder in currFolder.objectIds('Folder'):
! fsFolder = getattr(currFolder, folder, None)
!
! if not fsFolder:
! raise RuntimeError, "Can't find folder!" + folder
!
! currFolder = fsFolder
!
! return getattr(currFolder, fileID, None)
--- 1,12 ----
! ## Script (Python) "zapp_get_fileObj"
! ##bind container=container
! ##bind context=context
! ##bind namespace=
! ##bind script=script
! ##bind subpath=traverse_subpath
! ##parameters=
! ##title=
! ##
! currFolder = context.zapp_get_filesFolderObject()
! return getattr(currFolder, context.getId(), 'Ack!')
Index: zapp_image_edit.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_image_edit.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** zapp_image_edit.py 25 Jun 2003 11:45:53 -0000 1.1
--- zapp_image_edit.py 16 Jan 2004 09:55:34 -0000 1.2
***************
*** 10,26 ****
# Example code:
! file = context.REQUEST.form.get('file','')
!
! portal = context.portal_url.getPortalObject()
!
if not file:
! return "I need a file!"
path = context.getPhysicalPath()
! print "I got a ", `file`
!
! fileID = path[-1]
!
currFolder = portal.fSystem
--- 10,23 ----
# Example code:
! REQUEST = context.REQUEST
! file = REQUEST.form.get('file','')
if not file:
! raise RuntimeError, "I need a file!"
+ portal = context.portal_url.getPortalObject()
path = context.getPhysicalPath()
! oldID = path[-1]
! newID, newTitle = context.zapp_cook_id( REQUEST.get('id',''), REQUEST.get('title',''), file)
currFolder = portal.fSystem
***************
*** 37,56 ****
currFolder = fsFolder
! fileObj = getattr(currFolder, fileID, None)
! #print "adding ", `fileObj`," with id ", fileObj.id, " image to ", `currFolder`, currFolder.id
- if fileObj is None:
- currFolder.manage_addImage(id=fileID, file=file)
- fileObj = getattr(currFolder, fileID, None)
- print "I'm creating a file object.. "
- try:
- print "I'm trying to upload a file"
- fileObj.manage_upload(file)
- except:
- print "I failed.. by getting a ", `fileObj`
- return printed
-
- context.REQUEST.RESPONSE.redirect('view')
--- 34,51 ----
currFolder = fsFolder
+ fileObj = getattr(currFolder, oldID, None)
! if fileObj is None:
! currFolder.manage_addImage(id=newID, file=file)
! fileObj = getattr(currFolder, newID, None)
! else:
! if newID != oldID:
! currFolder.manage_renameObjects((oldID,), (newID,))
!
! fileObj = getattr(currFolder, newID, None)
! fileObj.manage_upload(file)
!
! REQUEST.RESPONSE.redirect( "%s/folder_rename?ids:list=%s&new_ids:list=%s&new_titles:list=%s" % (REQUEST.get('URL2'), oldID, newID, newTitle))
Index: zapp_image_edit_form.pt
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_image_edit_form.pt,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** zapp_image_edit_form.pt 25 Jun 2003 11:45:53 -0000 1.1
--- zapp_image_edit_form.pt 16 Jan 2004 09:55:34 -0000 1.2
***************
*** 14,35 ****
tal:replace="here/getId" i18n:name="objectid">My ID</span></h2>
! <form action="hec_image_edit" method="post" enctype="multipart/form-data"
! tal:attributes="action string:${here/absolute_url}/hec_image_edit"
>
<table class="FormLayout">
<tr>
! <th i18n:translate="">Title</th>
! <td> <span tal:replace="here/Title">My Title</span> </td>
! </tr>
!
! <tr>
! <th i18n:translate="">Description</th>
! <td> <span tal:replace="here/Description">My Description</span> </td>
</tr>
<tr>
! <th i18n:translate="">Content type</th>
! <td> <span tal:replace="here/Format">text/html</span> </td>
</tr>
--- 14,30 ----
tal:replace="here/getId" i18n:name="objectid">My ID</span></h2>
! <form action="zapp_image_edit" method="post" enctype="multipart/form-data"
! tal:attributes="action string:${here/absolute_url}/zapp_image_edit"
>
<table class="FormLayout">
<tr>
! <th i18n:translate="">Short Name (id: no spaces!)</th>
! <td> <input name="id" tal:attributes="value here/id" value=""/></td>
</tr>
<tr>
! <th i18n:translate="">Title</th>
! <td> <input name="title" tal:attributes="value here/Title" value=""/></td>
</tr>
Index: zapp_image_view.pt
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_image_view.pt,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** zapp_image_view.pt 25 Jun 2003 11:45:53 -0000 1.1
--- zapp_image_view.pt 16 Jan 2004 09:55:34 -0000 1.2
***************
*** 9,35 ****
<div metal:fill-slot="header">
-
<h1 id="DesktopTitle"
tal:content="here/Title">Document Title</h1>
-
<div id="DesktopDescription" tal:content="here/Description">
Document Description goes here.
</div>
-
- <div metal:use-macro="here/content_byline/macros/byline">By Me</div>
-
</div>
<div metal:fill-slot="main">
! <img tal:attributes="src python:here.hec_image_get_fileObj().absolute_url()"/>
!
! <div class="Discussion">
! <span tal:replace="structure here/viewThreadsAtBottom"
! tal:condition="here/viewThreadsAtBottom|nothing"></span>
</div>
</div>
</body>
! </html>
--- 9,32 ----
<div metal:fill-slot="header">
<h1 id="DesktopTitle"
tal:content="here/Title">Document Title</h1>
<div id="DesktopDescription" tal:content="here/Description">
Document Description goes here.
</div>
</div>
<div metal:fill-slot="main">
! <div tal:condition="python:here.Format() == 'application/x-shockwave-flash'">
! <div metal:use-macro="here/zapp_show_swf/macros/main">
! Sorry!
! </div>
</div>
+ <div tal:condition="python:here.Format() != 'application/x-shockwave-flash'">
+ <img tal:attributes="src python:here.zapp_get_fileObj().absolute_url()"/>
+ </div>
</div>
</body>
! </html>
\ No newline at end of file
|
|
From: <ssp...@us...> - 2004-01-16 09:55:41
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv22109
Modified Files:
ZApp_CMFBase.py __init__.py
Log Message:
file system based image handling for Plone
Index: ZApp_CMFBase.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** ZApp_CMFBase.py 12 Jan 2004 14:25:16 -0000 1.24
--- ZApp_CMFBase.py 16 Jan 2004 09:55:34 -0000 1.25
***************
*** 14,18 ****
missing = []
! dbug_level = 100
lpcol = LeverPropertyCollection
--- 14,18 ----
missing = []
! dbug_level = 0
lpcol = LeverPropertyCollection
***************
*** 65,69 ****
class_default_for_copyable = 0 # make these guys default to 'not copyable'
! _custom_skin_scripts = ('WHEN OBJECT CHANGED STORE portal_type using self.change(cmf_portal_type=self.portal_type)',)
_primaryKeyStringSize=255 # allow for a pretty rediculous size...
--- 65,77 ----
class_default_for_copyable = 0 # make these guys default to 'not copyable'
! # we're converting our primaru key to an URL that points to filesystem
! # src="http://hecxs.spvi.net:9180/HECPlone/fSystem/HECPlone/HEC/Media/Foods/clay.jpg"
!
! _custom_skin_scripts = ('WHEN OBJECT CHANGED STORE portal_type using self.change(cmf_portal_type=self.portal_type)',
! "WITH SELF COMPUTE portal_object_id=_.getattr(self, 'zapp_portal_id')",
! "WITH SELF COMPUTE portal_object=_.getattr(self.findApplication(), self.portal_object_id)"
! "WITH SELF COMPUTE graphic_url=self.findApplication().absolute_url() + ( '/fSystem/%s/%s/%s' % (self.getPhysicalPath()[1], self.portal_object_id, self.cmfdataid[1:].replace(',','/')))",
! )
!
_primaryKeyStringSize=255 # allow for a pretty rediculous size...
***************
*** 300,339 ****
extendProperties(ZApp_CMFBase, props)
! def addZAppCMFObject(self, id, title='', klass=ZApp_CMFBase, useExisting=1):
!
! #
! # since we're a FreeRangeDataSkin.. we can get our data manager here..
! #
!
! 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:
! o = existingObject
! o.id = id
! o.title = title
! else:
! o = klass()
! o = o.__of__(self)
! o.id = id
! o.title = title
! self._setObject(id, o)
! initCMFObjectMetadata(o)
! o.change()
! if klass != ZApp_CMFBase:
! return o
from DateTime import DateTime
--- 308,323 ----
extendProperties(ZApp_CMFBase, props)
! class ZApp_CMF_FSObject( ZApp_CMFBase ):
! meta_type = 'ZApp CMF FSObject'
! _custom_skin_scripts = ("WITH SELF COMPUTE portal_object_id=_.getattr(self, 'zapp_portal_id')",
! "WITH SELF COMPUTE portal_object=_.getattr(self.findApplication(), self.portal_object_id)"
! "WITH SELF COMPUTE fs_object_url=self.findApplication().absolute_url() + ( '/fSystem/%s/%s/%s' % (self.getPhysicalPath()[1], self.portal_object_id, self.cmfdataid[1:].replace(',','/')))",
! )
! class ZApp_CMF_FSImage( ZApp_CMF_FSObject):
! meta_type = 'ZApp CMF FSImage'
from DateTime import DateTime
***************
*** 354,362 ****
{'id': 'ZApp CMF Image',
'title':'',
! 'meta_type' : 'ZApp CMF Image',
'product': 'ZApp',
'description':'Image Content type based on ZApp objects',
'icon':'image_icon.gif',
! 'factory': 'addZAppCMFObject',
'immediate_view': 'zapp_image_edit_form',
'actions': ({'id': 'view',
--- 338,346 ----
{'id': 'ZApp CMF Image',
'title':'',
! 'meta_type' : ZApp_CMF_FSImage.meta_type,
'product': 'ZApp',
'description':'Image Content type based on ZApp objects',
'icon':'image_icon.gif',
! 'factory': 'addZAppCMFImage',
'immediate_view': 'zapp_image_edit_form',
'actions': ({'id': 'view',
***************
*** 374,402 ****
),
},
- {'id': 'ZApp CMF File',
- 'title':'',
- 'meta_type' : 'ZApp CMF File',
- 'product': 'ZApp',
- 'description':'File Content type based on ZApp objects',
- 'icon':'file_icon.gif',
- 'factory': 'addZAppCMFObject',
- 'immediate_view': 'zapp_file_edit_form',
- 'actions': ({'id': 'view',
- 'name': 'View',
- 'action': 'zapp_file_view',
- 'permissions': (CMFCorePermissions.View,)},
- {'id': 'edit',
- 'name': 'Edit',
- 'action': 'zapp_file_edit_form',
- 'permissions': (CMFCorePermissions.ModifyPortalContent,)},
- { 'id' : 'metadata'
- , 'name' : 'Metadata'
- , 'action': 'string:${object_url}/metadata_edit_form'
- , 'permissions' : (CMFCorePermissions.ModifyPortalContent,)},
- ),
- },
{'id': 'ZApp CMF Content',
'title':'',
! 'meta_type' : 'ZApp CMF Content',
'product': 'ZApp',
'description':'Content type based on ZApp objects',
--- 358,364 ----
),
},
{'id': 'ZApp CMF Content',
'title':'',
! 'meta_type' : ZApp_CMFBase.meta_type,
'product': 'ZApp',
'description':'Content type based on ZApp objects',
***************
*** 433,434 ****
--- 395,440 ----
+ def addZAppCMFObject(self, id, title='', klass=ZApp_CMFBase, useExisting=1):
+
+ #
+ # since we're a FreeRangeDataSkin.. we can get our data manager here..
+ #
+
+ 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:
+ o = existingObject
+ o.id = id
+ o.title = title
+ else:
+ o = klass()
+ o = o.__of__(self)
+ o.id = id
+ o.title = title
+
+ self._setObject(id, o)
+ initCMFObjectMetadata(o)
+ o.change()
+
+ if klass not in [ZApp_CMFBase, ZApp_CMF_FSObject, ZApp_CMF_FSImage]:
+ return o
+
+
+ def addZAppCMFImage(self, id, title='', klass=ZApp_CMF_FSImage, useExisting=1):
+ """
+ add a CMFImage object.. pass in the right class...
+ """
+
+ return addZAppCMFObject(self, id, title, klass, useExisting)
Index: __init__.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/__init__.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** __init__.py 4 Dec 2003 22:25:59 -0000 1.19
--- __init__.py 16 Jan 2004 09:55:34 -0000 1.20
***************
*** 52,61 ****
if do_cmf:
context.registerBaseClass(ZApp_CMFBase.ZApp_CMFBase)
utils.ContentInit(
! 'ZAppCMFContent',
! content_types = (ZApp_CMFBase.ZApp_CMFBase,),
permission = AddPortalContent,
! extra_constructors = (ZApp_CMFBase.addZAppCMFObject,),
fti=ZApp_CMFBase.factory_type_information,
).initialize(context)
--- 52,62 ----
if do_cmf:
context.registerBaseClass(ZApp_CMFBase.ZApp_CMFBase)
+ context.registerBaseClass(ZApp_CMFBase.ZApp_CMF_FSImage)
utils.ContentInit(
! 'ZApp CMF Content',
! content_types = (ZApp_CMFBase.ZApp_CMFBase, ZApp_CMFBase.ZApp_CMF_FSImage),
permission = AddPortalContent,
! extra_constructors = (ZApp_CMFBase.addZAppCMFObject, ZApp_CMFBase.addZAppCMFImage),
fti=ZApp_CMFBase.factory_type_information,
).initialize(context)
|
|
From: <ssp...@us...> - 2004-01-12 14:25:24
|
Update of /cvsroot/zapp/ZApp/skins/zapp_generic
In directory sc8-pr-cvs1:/tmp/cvs-serv17345/skins/zapp_generic
Modified Files:
zapp_cmf_object_edit.py
Log Message:
adding some CMF features..
Index: zapp_cmf_object_edit.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_cmf_object_edit.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** zapp_cmf_object_edit.py 8 Jan 2004 11:20:26 -0000 1.6
--- zapp_cmf_object_edit.py 12 Jan 2004 14:25:16 -0000 1.7
***************
*** 5,11 ****
##bind script=script
##bind subpath=traverse_subpath
! ##parameters=inputDict=None, redirect_url=None
##title=
##
propDict = {'cmf_portal_type':getattr(context,'portal_type','unknown')}
--- 5,18 ----
##bind script=script
##bind subpath=traverse_subpath
! ##parameters=inputDict=None, redirect_url=None, no_redir=0
##title=
##
+ """
+ inputdict has all the state information about this object, or it could be in the REQUEST object.
+
+ redirect_url is where to go after executing
+
+ no_redir is true if no redirection is wanted.
+ """
propDict = {'cmf_portal_type':getattr(context,'portal_type','unknown')}
***************
*** 18,31 ****
context.manage_changeProperties(propDict)
- 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 {}
- myTPropDefs = myTPropDict.get('zapp_properties',[])
-
import xmlrpclib
--- 25,29 ----
***************
*** 39,43 ****
dataType = dict.get('zapp_dataType','')
clearFlag = dict.get('zapp_misc_data_clear',0)
-
submitValue = dict.get('submit','')
--- 37,40 ----
***************
*** 61,73 ****
currVal = currVal[:-1]
! for item in myTPropDefs:
! propName = item.get('name')
! propType = item.get('type')
! if (propName in dict.keys()) and (propType == 'xml'):
! inputValue = dict.get(propName,'')
! if inputValue:
! inputValue = xmlrpclib.loads(inputValue)
! dict[propName] = inputValue[0][0]
mdObject = context.getMiscData(dataType=dataType, createIfNone=1)
mdObject.setXMLAttrs(dict = dict, zapp_misc_data_clear=clearFlag)
--- 58,78 ----
currVal = currVal[:-1]
! if 0:
! # I don't think anybody is using this anymore.....
! for item in myTPropDefs:
! propName = item.get('name')
! propType = item.get('type')
! if (propName in dict.keys()) and (propType == 'xml'):
! inputValue = dict.get(propName,'')
! if inputValue:
! inputValue = xmlrpclib.loads(inputValue)
! dict[propName] = inputValue[0][0]
!
! metadata = dict.get('metadata',None)
+ if metadata is not None:
+ del dict['metadata']
+ context.ZApp_handleMetaData( metadata=metadata )
+
mdObject = context.getMiscData(dataType=dataType, createIfNone=1)
mdObject.setXMLAttrs(dict = dict, zapp_misc_data_clear=clearFlag)
***************
*** 77,80 ****
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)
--- 82,89 ----
if not redirect_url:
redirect_url=context.absolute_url() + '/zapp_cmf_object_edit_form?portal_status_message=ZApp+CMF+Object+Changed.'
!
! if no_redir:
! return "OK!"
! else:
! context.REQUEST.RESPONSE.redirect(redirect_url)
! return "redirecting.. "
|
|
From: <ssp...@us...> - 2004-01-12 14:25:24
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv17345
Modified Files:
ZApp_CMFBase.py ZApp_DublinCoreMixin.py
Log Message:
adding some CMF features..
Index: ZApp_CMFBase.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** ZApp_CMFBase.py 9 Jan 2004 11:28:31 -0000 1.23
--- ZApp_CMFBase.py 12 Jan 2004 14:25:16 -0000 1.24
***************
*** 14,18 ****
missing = []
! dbug_level = 0
lpcol = LeverPropertyCollection
--- 14,18 ----
missing = []
! dbug_level = 100
lpcol = LeverPropertyCollection
***************
*** 64,67 ****
--- 64,69 ----
class_default_for_copyable = 0 # make these guys default to 'not copyable'
+
+ _custom_skin_scripts = ('WHEN OBJECT CHANGED STORE portal_type using self.change(cmf_portal_type=self.portal_type)',)
_primaryKeyStringSize=255 # allow for a pretty rediculous size...
Index: ZApp_DublinCoreMixin.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_DublinCoreMixin.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ZApp_DublinCoreMixin.py 2 Jan 2004 22:07:01 -0000 1.1
--- ZApp_DublinCoreMixin.py 12 Jan 2004 14:25:16 -0000 1.2
***************
*** 42,45 ****
--- 42,75 ----
class_default_for_metadata_modified = 0
+ def ZApp_handleMetaData(self, metadata=None, returnHeaders=0):
+ """
+ a new metadata dictionary needs to be used to update current metadata.
+ """
+
+ if metadata:
+ for key in metadata.keys():
+ oldValue = None
+ newValue = metadata.get(key,None)
+ setMethodName = 'set' + key
+ if hasattr(self, setMethodName) and newValue:
+ setMethod = getattr(self, setMethodName, None)
+ getMethod = getattr(self, key, None)
+ if getMethod:
+ oldValue = getMethod()
+ if type(oldValue) == type(()):
+ oldValue = list(oldValue)
+ if type(oldValue) == type([]) and (newValue not in oldValue):
+ newValue = tuple(oldValue + [newValue])
+ else:
+ newValue = (newValue,)
+
+ if setMethod:
+ setMethod( newValue )
+
+ if returnHeaders:
+ return self.getMetadataHeaders()
+ else:
+ return "OK!"
+
def _v_meta(self):
"""metadata changed trigger... """
|
|
From: <ssp...@us...> - 2004-01-09 11:28:34
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv8647
Modified Files:
ZApp_CMFBase.py ZApp_Specialist.py
Log Message:
don't ever use 'title' in _properties
Index: ZApp_CMFBase.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** ZApp_CMFBase.py 5 Jan 2004 22:27:10 -0000 1.22
--- ZApp_CMFBase.py 9 Jan 2004 11:28:31 -0000 1.23
***************
*** 21,25 ****
props = lpcol(
[
- lprop(id='title'),
lprop(id='cmf_portal_type'),
lprop(id='safeStorageID'),
--- 21,24 ----
***************
*** 138,141 ****
--- 137,142 ----
item._ZCMFnotifyOfCopyTo( self, op, mdm, notify_depth+1, safeStorage)
+ class_default_for__ZCMF_CheckNotify = None # no method, just none for default
+
def _ZCMFnotifyOfCopyTo(self, container, op=0, mdm=None, notify_depth=0, safeStorage=None):
"""we use _notifyOfCopy to save our miscData to a property
***************
*** 167,170 ****
--- 168,176 ----
self._subobjectNotify( op, mdm, notify_depth, safeStorage)
+ if self._ZCMF_CheckNotify:
+ self._ZCMF_CheckNotify( container, op )
+
+ return "OK!"
+
def _setId(self, id):
#
***************
*** 235,241 ****
#
oldSelf.manage_delete()
-
else:
-
oldSelf.change(safeStorageID = '')
--- 241,245 ----
Index: ZApp_Specialist.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_Specialist.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** ZApp_Specialist.py 8 Jan 2004 15:26:50 -0000 1.34
--- ZApp_Specialist.py 9 Jan 2004 11:28:31 -0000 1.35
***************
*** 382,387 ****
objects managed by this Specialist. Call in context of Specialist!
"""
! return tuple(map(lambda dict: dict.copy(), self.ZApp_getItemClassAttr('_properties')))
def ZApp_getIndexedAttributes(self):
--- 382,393 ----
objects managed by this Specialist. Call in context of Specialist!
+ Take care never to return 'title' as a property.
+
"""
! return tuple(filter( lambda x:x.get('id','') != 'title',
! map( lambda dict: dict.copy(),
! self.ZApp_getItemClassAttr('_properties'))
! )
! )
def ZApp_getIndexedAttributes(self):
|
|
From: <ssp...@us...> - 2004-01-08 22:24:46
|
Update of /cvsroot/zapp/ZApp/leverMethods/PG
In directory sc8-pr-cvs1:/tmp/cvs-serv24686/leverMethods/PG
Modified Files:
insertItemLever.plain updateItemLever.plain
Log Message:
some ref integrity refinements for PG levers
Index: insertItemLever.plain
===================================================================
RCS file: /cvsroot/zapp/ZApp/leverMethods/PG/insertItemLever.plain,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** insertItemLever.plain 18 Jun 2003 02:39:12 -0000 1.11
--- insertItemLever.plain 8 Jan 2004 22:24:43 -0000 1.12
***************
*** 15,18 ****
--- 15,19 ----
specialist = context.aq_parent
primaryKey = specialist.getPrimaryKey()
+ refLookup = specialist.ZApp_getReferenceLookup()
typeLookups = {
***************
*** 40,44 ****
itemID = item['id']
theType = typeLookups.get(dbType, dbType)
-
if mode:
columnList.append(itemID)
--- 41,44 ----
***************
*** 48,52 ****
itemList.append(fmtString)
else:
! itemList.append('<dtml-sqlvar %s type="%s">' % (item['id'], theType))
templateString = templateString % (specialist.id, string.join(columnList, ',\n'), string.join(itemList,',\n'))
--- 48,56 ----
itemList.append(fmtString)
else:
! refList = refLookup.get(itemID,[])
! if len(refList) >= 2:
! itemList.append('<dtml-if %s><dtml-sqlvar %s type="%s"><dtml-else>NULL</dtml-if>' % (itemID, itemID, theType))
! else:
! itemList.append('<dtml-sqlvar %s type="%s">' % (itemID, theType))
templateString = templateString % (specialist.id, string.join(columnList, ',\n'), string.join(itemList,',\n'))
Index: updateItemLever.plain
===================================================================
RCS file: /cvsroot/zapp/ZApp/leverMethods/PG/updateItemLever.plain,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** updateItemLever.plain 18 Jun 2003 02:39:12 -0000 1.7
--- updateItemLever.plain 8 Jan 2004 22:24:43 -0000 1.8
***************
*** 15,18 ****
--- 15,19 ----
specialist = context.aq_parent
primaryKey = specialist.getPrimaryKey()
+ refLookup = specialist.ZApp_getReferenceLookup()
typeLookups = {
***************
*** 52,56 ****
else:
theType = typeLookups.get(dbType, dbType)
! itemString = '%s = <dtml-sqlvar %s type="%s">' % (itemID, itemID, theType)
itemList.append( itemString )
--- 53,61 ----
else:
theType = typeLookups.get(dbType, dbType)
! refList = refLookup.get(itemID,[])
! if len(refList) >= 2:
! itemString = '%s = <dtml-if %s><dtml-sqlvar %s type="%s"><dtml-else>NULL</dtml-if>' % (itemID, itemID, itemID, theType)
! else:
! itemString = '%s = <dtml-sqlvar %s type="%s">' % (itemID, itemID, theType)
itemList.append( itemString )
|
|
From: <ssp...@us...> - 2004-01-08 22:24:46
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv24686
Modified Files:
ZApp_RelationshipItem.py
Log Message:
some ref integrity refinements for PG levers
Index: ZApp_RelationshipItem.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_RelationshipItem.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ZApp_RelationshipItem.py 8 Jan 2004 15:26:50 -0000 1.7
--- ZApp_RelationshipItem.py 8 Jan 2004 22:24:43 -0000 1.8
***************
*** 26,30 ****
_indexed_attrs = ('objectID',)
! ZApp_referenceLookup = "relationshipID:Relationships:relationshipID"
def getObject(self):
--- 26,33 ----
_indexed_attrs = ('objectID',)
! ZApp_referenceLookup = """
! relationshipID:Relationships:relationshipID
! roleID:RelationshipRoles:relationshipRoleID
! """
def getObject(self):
|
|
From: <ssp...@us...> - 2004-01-08 15:26:53
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv21367
Modified Files:
ZApp_Application.py ZApp_RelationshipItem.py
ZApp_Specialist.py
Removed Files:
ZApp_RelationshipManagerMixin.py
Log Message:
adding better relational integrity
Index: ZApp_Application.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_Application.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** ZApp_Application.py 16 Dec 2003 17:19:44 -0000 1.28
--- ZApp_Application.py 8 Jan 2004 15:26:50 -0000 1.29
***************
*** 298,312 ****
return v
! def findSpecialistIDs(self):
"""
! brute force search..
"""
! results = []
! specialists = self.ZopeFind(self, obj_metatypes=self.specialistMetaTypes, search_sub=1)
! put = results.append
! for p, spec in specialists:
! put(spec.id)
return results
--- 298,325 ----
return v
! def findSpecialistIDs(self, specialistIDs=None, returnObjects=0):
"""
! brute force search.. return objects rather than IDs if specified.
"""
! if specialistIDs is None:
! specialists = self.ZopeFind(self, obj_metatypes=self.specialistMetaTypes, search_sub=1)
! else:
! specialists = self.ZopeFind(self, obj_metatypes=self.specialistMetaTypes, obj_ids=specialistIDs, search_sub=1)
! sortSpecList = [(spec.zapp_spec_order, p, spec) for p, spec in specialists]
! sortSpecList.sort()
! specialists = [(p, spec) for tag, p, spec in sortSpecList]
!
!
! results = []
!
! if returnObjects:
! results = specialists
!
! else:
! put = results.append
! for p, spec in specialists:
! put(spec.getId())
return results
***************
*** 482,486 ****
safeLevers=safeLevers)
! def runLever(self, leverName='createSQLLever', dbName='test_db', specialistIDs='', specialistMetaTypes=None, catalogName='', safeLevers=1):
"""
Run a Lever
--- 495,499 ----
safeLevers=safeLevers)
! def runLever(self, leverName='createSQLLever', dbName='test_db', specialistIDs=None, specialistMetaTypes=None, catalogName='', safeLevers=1):
"""
Run a Lever
***************
*** 491,499 ****
resultList.append("looking in " + self.getId() + " for " + `specialistMetaTypes`)
! if specialistIDs:
! specialists = self.ZopeFind(self, obj_metatypes=specialistMetaTypes, obj_ids=specialistIDs, search_sub=1)
! else:
! specialists = self.ZopeFind(self, obj_metatypes=specialistMetaTypes, search_sub=1)
!
if specialists:
for p, spec in specialists:
--- 504,508 ----
resultList.append("looking in " + self.getId() + " for " + `specialistMetaTypes`)
! specialists = self.findSpecialistIDs(specialistIDs, returnObjects=1)
if specialists:
for p, spec in specialists:
Index: ZApp_RelationshipItem.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_RelationshipItem.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ZApp_RelationshipItem.py 28 Oct 2003 20:27:03 -0000 1.6
--- ZApp_RelationshipItem.py 8 Jan 2004 15:26:50 -0000 1.7
***************
*** 26,29 ****
--- 26,31 ----
_indexed_attrs = ('objectID',)
+ ZApp_referenceLookup = "relationshipID:Relationships:relationshipID"
+
def getObject(self):
"""
Index: ZApp_Specialist.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_Specialist.py,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** ZApp_Specialist.py 8 Jan 2004 11:20:25 -0000 1.33
--- ZApp_Specialist.py 8 Jan 2004 15:26:50 -0000 1.34
***************
*** 101,104 ****
--- 101,112 ----
meta_type = 'Z App Specialist'
+ def zapp_spec_order(self):
+ return self.getId()
+
+ zapp_spec_order = ComputedAttribute( zapp_spec_order )
+
+ _properties=({'id':'title', 'type': 'string', 'mode':'w'},
+ {'id':'zapp_spec_order','type':'string','mode':'w'},)
+
LeversSetsGroup = PlugInGroup('LeversSetsGroup', ['ZApp Lever Method Sets'], attr='leverList', title='Lever Sets')
***************
*** 443,447 ****
"""
missing = []
!
refLookup = getattr(self, 'ZApp_referenceLookup', missing)
--- 451,455 ----
"""
missing = []
!
refLookup = getattr(self, 'ZApp_referenceLookup', missing)
***************
*** 458,463 ****
result = {}
for item in refLookup:
! if type(refLookup) == type(''):
! rList = refLookup.split(':')
if len(rList) >= 3:
result[ rList[0] ] = [ rList[1], rList[2] ]
--- 466,471 ----
result = {}
for item in refLookup:
! if type(item) == type(''):
! rList = item.strip().split(':')
if len(rList) >= 3:
result[ rList[0] ] = [ rList[1], rList[2] ]
--- ZApp_RelationshipManagerMixin.py DELETED ---
|
|
From: <ssp...@us...> - 2004-01-08 15:26:53
|
Update of /cvsroot/zapp/ZApp/leverMethods/PG
In directory sc8-pr-cvs1:/tmp/cvs-serv21367/leverMethods/PG
Modified Files:
createSchemaLever.plain
Log Message:
adding better relational integrity
Index: createSchemaLever.plain
===================================================================
RCS file: /cvsroot/zapp/ZApp/leverMethods/PG/createSchemaLever.plain,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** createSchemaLever.plain 8 Jan 2004 11:20:26 -0000 1.9
--- createSchemaLever.plain 8 Jan 2004 15:26:51 -0000 1.10
***************
*** 70,74 ****
refList = refLookup.get(itemID,[])
if len(refList) >= 2:
! createString += ' REFERENCES %s ( %s ) INITIALLY DEFERRED ' % (refList[0], refList[1] )
itemList.append(createString)
--- 70,74 ----
refList = refLookup.get(itemID,[])
if len(refList) >= 2:
! createString += ' REFERENCES %s ( %s ) INITIALLY DEFERRED' % (refList[0], refList[1] )
itemList.append(createString)
|
Update of /cvsroot/zapp/ZApp/skins/zapp_generic
In directory sc8-pr-cvs1:/tmp/cvs-serv5312/skins/zapp_generic
Modified Files:
zapp_cmf_object_edit.py zapp_cmf_object_edit_form.pt
zapp_cmf_object_type_edit_form.pt zapp_cmf_object_view.pt
Log Message:
make CMF object a bit more flexible WRT attribute management
Index: zapp_cmf_object_edit.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_cmf_object_edit.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** zapp_cmf_object_edit.py 24 Nov 2003 16:45:35 -0000 1.5
--- zapp_cmf_object_edit.py 8 Jan 2004 11:20:26 -0000 1.6
***************
*** 37,41 ****
dict.update(inputDict)
! submitValue = context.REQUEST.get('submit','')
if submitValue == 'add row':
--- 37,48 ----
dict.update(inputDict)
! dataType = dict.get('zapp_dataType','')
! clearFlag = dict.get('zapp_misc_data_clear',0)
!
! submitValue = dict.get('submit','')
!
! for key in ['submit', 'zapp_dataType', 'zapp_misc_data_clear']:
! if dict.has_key(key):
! del dict[key]
if submitValue == 'add row':
***************
*** 63,67 ****
dict[propName] = inputValue[0][0]
! context.safeMiscData.setXMLAttrs(dict = dict)
context.reindexObject()
--- 70,76 ----
dict[propName] = inputValue[0][0]
! mdObject = context.getMiscData(dataType=dataType, createIfNone=1)
! mdObject.setXMLAttrs(dict = dict, zapp_misc_data_clear=clearFlag)
!
context.reindexObject()
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.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** zapp_cmf_object_edit_form.pt 31 Dec 2003 18:04:21 -0000 1.5
--- zapp_cmf_object_edit_form.pt 8 Jan 2004 11:20:26 -0000 1.6
***************
*** 37,40 ****
--- 37,43 ----
myProperties python:here.safeMiscData.getXMLDict()">
+ <div>
+ My Portal Type: <span tal:content="here/portal_type"/>
+ </div>
<table tal:condition="myPropSet">
<form action="." tal:attributes="action string:${here/getId}/zapp_cmf_object_edit" method="post">
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.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** zapp_cmf_object_type_edit_form.pt 28 Oct 2003 20:27:04 -0000 1.5
--- zapp_cmf_object_type_edit_form.pt 8 Jan 2004 11:20:26 -0000 1.6
***************
*** 41,45 ****
'name': is the name of the property
! 'type': is it's type simple types like: 'float','int','long','string','date','boolean',
complex types like: 'int:list', (a list of values, the type specified before the ':' is the type of each value),
'record' (a structure or dictionary),
--- 41,45 ----
'name': is the name of the property
! 'type': is it's type simple types like: 'float','int','long','string','date',
complex types like: 'int:list', (a list of values, the type specified before the ':' is the type of each value),
'record' (a structure or dictionary),
***************
*** 59,62 ****
--- 59,65 ----
myTPropsMiscData python:typePropertiesObjects and typePropertiesObjects[0].getXMLDict();
myPropSet myTPropsMiscData/zapp_properties | nothing">
+ <div>
+ My Portal Type: <span tal:content="here/portal_type"/>
+ </div>
<form action="." tal:attributes="action string:${here/getId}/zapp_cmf_object_type_edit" method="post">
***************
*** 68,72 ****
subDefs subObject/zapp_properties | python:[]">
! <table tal:condition="python:propType in ['float','int','long','string','date','boolean','text']">
<tr><td><input type="checkbox" name="names:list" tal:attributes="value propName"/></td> <td tal:content="string:${propName}(${propType})"/></tr>
</table>
--- 71,75 ----
subDefs subObject/zapp_properties | python:[]">
! <table tal:condition="python:propType in ['float','int','long','string','date','text']">
<tr><td><input type="checkbox" name="names:list" tal:attributes="value propName"/></td> <td tal:content="string:${propName}(${propType})"/></tr>
</table>
***************
*** 93,97 ****
<td>
<select name="newItem.propType:record">
! <span tal:repeat="item python:['string','text','float','int','long','date','boolean','array','record','records']">
<option tal:attributes="value item" tal:content="item"/>
</span></select> </td>
--- 96,100 ----
<td>
<select name="newItem.propType:record">
! <span tal:repeat="item python:['string','text','float','int','long','date','record','records']">
<option tal:attributes="value item" tal:content="item"/>
</span></select> </td>
Index: zapp_cmf_object_view.pt
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_cmf_object_view.pt,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** zapp_cmf_object_view.pt 31 Dec 2003 18:04:21 -0000 1.6
--- zapp_cmf_object_view.pt 8 Jan 2004 11:20:26 -0000 1.7
***************
*** 18,22 ****
myProperties python:here.safeMiscData.getXMLDict()">
! Raw Data View (this screen apparently has no skin yet.. )
<div tal:content="myTypePropertiesMiscData"> </div>
--- 18,25 ----
myProperties python:here.safeMiscData.getXMLDict()">
! <div>
! Raw Data View (this screen apparently has no skin yet.. ) <br>
! My Portal Type: <span tal:content="here/portal_type"/>
! </div>
<div tal:content="myTypePropertiesMiscData"> </div>
|
|
From: <ssp...@us...> - 2004-01-08 11:20:28
|
Update of /cvsroot/zapp/ZApp/leverMethods/PG
In directory sc8-pr-cvs1:/tmp/cvs-serv5312/leverMethods/PG
Modified Files:
createSchemaLever.plain
Log Message:
make CMF object a bit more flexible WRT attribute management
Index: createSchemaLever.plain
===================================================================
RCS file: /cvsroot/zapp/ZApp/leverMethods/PG/createSchemaLever.plain,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** createSchemaLever.plain 25 Jun 2003 11:45:53 -0000 1.8
--- createSchemaLever.plain 8 Jan 2004 11:20:26 -0000 1.9
***************
*** 18,21 ****
--- 18,22 ----
defaultSize = specialist.ZApp_getDefaultStringSize()
pKeySize = specialist.ZApp_getPrimaryKeySize()
+ refLookup = specialist.ZApp_getReferenceLookup()
typeLookups = {
***************
*** 51,54 ****
--- 52,56 ----
for item in pm:
+ itemID = item['id']
sqlType = item.get('dbType',item.get('sqlType',None))
if sqlType is None:
***************
*** 61,68 ****
theType = theType % theSize
! createString = (" %s %s " % (item['id'], theType))
defaultValue = item.get('dbDefault',item.get('defaultValue',None))
if defaultValue:
createString += ' DEFAULT <dtml-sqlvar "%s" type="%s"> ' % (`defaultValue`, defaultValLookups.get(sqlType, item['type']))
itemList.append(createString)
--- 63,74 ----
theType = theType % theSize
! createString = (" %s %s " % (itemID, theType))
defaultValue = item.get('dbDefault',item.get('defaultValue',None))
if defaultValue:
createString += ' DEFAULT <dtml-sqlvar "%s" type="%s"> ' % (`defaultValue`, defaultValLookups.get(sqlType, item['type']))
+
+ refList = refLookup.get(itemID,[])
+ if len(refList) >= 2:
+ createString += ' REFERENCES %s ( %s ) INITIALLY DEFERRED ' % (refList[0], refList[1] )
itemList.append(createString)
|
|
From: <ssp...@us...> - 2004-01-08 11:20:28
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv5312
Modified Files:
ZApp_Specialist.py
Log Message:
make CMF object a bit more flexible WRT attribute management
Index: ZApp_Specialist.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_Specialist.py,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** ZApp_Specialist.py 24 Nov 2003 21:57:47 -0000 1.32
--- ZApp_Specialist.py 8 Jan 2004 11:20:25 -0000 1.33
***************
*** 419,422 ****
--- 419,468 ----
return self.defaultRack.getKlassAttr( attr, default )
+ def ZApp_getReferenceLookup(self):
+ """
+ return a lookup table for references by objects managed
+ by this specialist.
+
+ referenceLookup is an attribute of the specialist or the
+ class to a string, or a dictionary. If it's a string, it should be of the
+ form:
+
+ thisClassPropertyName:otherSpecialistName:otherClassPropertyName
+
+ e.g., if this specialist's class has a property personID, and
+ the "People" specialist uses 'personID' as a primary key you
+ would establish the relationship with a line in referenceLookup
+ as:
+
+ personID:People:personID
+
+ This permits the backend lever to qualify the schema with 'references xxxx'
+ clauses so that the backend can enforce referential integrity automatically.
+ (in addition to whatever enforcement is already done by ZPatterns/triggers).
+
+ """
+ missing = []
+
+ refLookup = getattr(self, 'ZApp_referenceLookup', missing)
+
+ if refLookup is missing:
+ refLookup = self.ZApp_getItemClassAttr('ZApp_referenceLookup', {})
+
+ if hasattr( refLookup, 'func_code' ) or hasattr( refLookup, '__call__'):
+ refLookup = refLookup()
+
+ if type(refLookup) == type(''):
+ refLookup = refLookup.split('\n')
+
+ if type(refLookup) == type([]):
+ result = {}
+ for item in refLookup:
+ if type(refLookup) == type(''):
+ rList = refLookup.split(':')
+ if len(rList) >= 3:
+ result[ rList[0] ] = [ rList[1], rList[2] ]
+ refLookup = result
+
+ return refLookup
def ZApp_printDebugMessage(self, message, priority=INFO):
|
|
From: <ssp...@us...> - 2004-01-05 22:27:13
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv29488
Modified Files:
ZApp_CMFBase.py
Added Files:
ZApp_Replicator.py
Log Message:
add replication capability to ZApp objects
--- NEW FILE: ZApp_Replicator.py ---
#
# ZApp Replicator, a mixin class to enable sharing of data with another object type...
#
from ComputedAttribute import ComputedAttribute
class ZApp_Replicator:
"""
ZApp_Replicator is meant to be mixed in with a ZApp_Base subclass.
"""
class_default_for_replication_specialists = ()
def getReplicationManager(self):
"""
return the name of my replication manager
"""
return self.getMySpecialist().getId()
_v_rep_manager = ComputedAttribute( getReplicationManager )
def replicateSelf(self):
"""
a change or create event has occurred. Update other specialists with my info..
RuntimeError is raised if there is a serious problem..
"""
app = self.findApplication()
if not app:
app = self.getApplication() # try CMF skin method if we are not in app scope..
if not app:
return # punt... we can't replicate from here...
for spec_id in self.replication_specialists:
spec = app.getSpecialist( spec_id )
if spec:
myReps = spec.ZApp_getItems( objectID=self.id, manager=self._v_repManager, createIfNone=1)
if len(myReps) == 1:
myRep = myReps[0]
myRep.doUpdateRep( self )
else:
raise RuntimeError, "Too many reps?"
else:
raise RuntimeError, "Can't find specialist:" + spec_id
class ZApp_Replicatee:
def class_default_for_doUpdateRep( self, other ):
"""
dummy method. Replace with subclass, or skinscript.
"""
pass
Index: ZApp_CMFBase.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** ZApp_CMFBase.py 2 Jan 2004 22:07:01 -0000 1.21
--- ZApp_CMFBase.py 5 Jan 2004 22:27:10 -0000 1.22
***************
*** 12,15 ****
--- 12,16 ----
from ZApp_LOG import ZApp_LOG
+
missing = []
dbug_level = 0
***************
*** 39,42 ****
--- 40,44 ----
from Acquisition import ImplicitAcquisitionWrapper,aq_base
from ZApp_DublinCoreMixin import ZApp_DublinCoreMixin
+ from ZApp_Replicator import ZApp_Replicator
from DateTime import DateTime
***************
*** 44,48 ****
import tempfile
! class ZApp_CMFBase(FreeRangeDS, SkinnedFolder, ZApp_Base, ZApp_DublinCoreMixin, ZApp_MiscDataUser, ZApp_RelatedObject):
meta_type = 'ZApp CMF Content'
--- 46,50 ----
import tempfile
! class ZApp_CMFBase(FreeRangeDS, SkinnedFolder, ZApp_Base, ZApp_DublinCoreMixin, ZApp_MiscDataUser, ZApp_RelatedObject, ZApp_Replicator):
meta_type = 'ZApp CMF Content'
***************
*** 96,100 ****
result = objPath[len(portalPath)-1:]
except:
! raise
return result
--- 98,102 ----
result = objPath[len(portalPath)-1:]
except:
! result = getattr(self, self.getPrimaryKey(), "IMPOSSIBLE_PATH_ID")
return result
|
|
From: <ssp...@us...> - 2004-01-03 03:13:51
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv23472
Modified Files:
ZApp_MiscData.py
Log Message:
make subtransaction more immediate on XML change..
Index: ZApp_MiscData.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_MiscData.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** ZApp_MiscData.py 2 Jan 2004 22:07:01 -0000 1.24
--- ZApp_MiscData.py 3 Jan 2004 03:13:48 -0000 1.25
***************
*** 22,25 ****
--- 22,27 ----
lprop = ZApp_Base.LeverProperty
+ DEFAULT_MISCNAMEATTR='miscAttributeNames'
+
props = lpcol(
[lprop(id='Manager'),
***************
*** 62,72 ****
_v_xmlDict = ComputedAttribute( _v_xmlDict )
! def buildXML(self):
""" create the XML to represent this object."""
! try:
! self.xml = dumps( (self._v_xmlDict,))
! except:
! import pdb
! pdb.set_trace()
return self.xml
--- 64,73 ----
_v_xmlDict = ComputedAttribute( _v_xmlDict )
! def buildXML(self, commit_now=1):
""" create the XML to represent this object."""
! self.xml = dumps( (self._v_xmlDict,))
!
! if commit_now:
! get_transaction().commit(1)
return self.xml
***************
*** 284,288 ****
}
- DEFAULT_MISCNAMEATTR='miscAttributeNames'
def setMiscDataFor(self, dataDict, miscNameAttr=DEFAULT_MISCNAMEATTR , dataType=''):
--- 285,288 ----
|
|
From: <ssp...@us...> - 2004-01-02 22:07:04
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv380
Modified Files:
ZApp_CMFBase.py ZApp_MiscData.py
Added Files:
ZApp_DublinCoreMixin.py
Log Message:
adding metadata code to ZApp_CMF stuff
--- NEW FILE: ZApp_DublinCoreMixin.py ---
#
# ZApp_DublinCore is just a 'shim' that allows ZApp to shadow dublin core metadata... without
# adding significant overhead...
#
from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl
from ComputedAttribute import ComputedAttribute
class ZApp_MetaMethodInvoker:
"""
This is an object that is ised to override a block of methods with
a behavior that consists of referencing a computed attribute
(_v_meta) of an instance before calling the original
method of the superclass.
This instance smells like a class method (and it is stored in
the class as if it really were a class method). It is assigned
as a computed attribute that only gets used if the orginally targeted
method of the instance is called.
"""
def __init__(self, method):
self.method = method
def setInstance(self, inst):
self.inst = inst
return self
def __call__(self, *args, **kw):
""" perform the method of the superclass """
self.inst._v_meta
return apply(self.method, (self.inst,) + args, kw)
class ZApp_DublinCoreMixin( DefaultDublinCoreImpl ):
__per_transaction_cache_attrs__ = ('_v_meta',)
_custom_skin_scripts = ('WHEN OBJECT CHANGED STORE metadata_modified USING self.zapp_cmf_metadataChanged and self.zapp_cmf_metadataChanged()',)
class_default_for_zapp_cmf_metadataChanged = None
class_default_for_metadata_modified = 0
def _v_meta(self):
"""metadata changed trigger... """
self._v_Keeper # make sure we reset at transaction boundaries..
self.metadata_modified = 1
return 1
_v_meta = ComputedAttribute( _v_meta )
#
# This is a bit tricky. We want to insert ourselves into the dublin core..
# Here's a way to do it without re-writing all the methods.... or even
# knowing what they are.
#
methodType = type(ZApp_DublinCoreMixin._v_meta)
for methodName in dir(DefaultDublinCoreImpl):
theMethod = getattr(DefaultDublinCoreImpl,methodName)
if methodName[:3] == 'set' and type(theMethod) == methodType:
setattr(ZApp_DublinCoreMixin, methodName, ComputedAttribute(ZApp_MetaMethodInvoker( theMethod ).setInstance))
Index: ZApp_CMFBase.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** ZApp_CMFBase.py 16 Dec 2003 17:19:44 -0000 1.20
--- ZApp_CMFBase.py 2 Jan 2004 22:07:01 -0000 1.21
***************
*** 30,34 ****
#
- from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl
from Products.CMFDefault.SkinnedFolder import SkinnedFolder
from AccessControl import ClassSecurityInfo, getSecurityManager
--- 30,33 ----
***************
*** 39,42 ****
--- 38,42 ----
from OFS.CopySupport import CopySource
from Acquisition import ImplicitAcquisitionWrapper,aq_base
+ from ZApp_DublinCoreMixin import ZApp_DublinCoreMixin
from DateTime import DateTime
***************
*** 44,48 ****
import tempfile
! class ZApp_CMFBase(FreeRangeDS, SkinnedFolder, ZApp_Base, DefaultDublinCoreImpl, ZApp_MiscDataUser, ZApp_RelatedObject):
meta_type = 'ZApp CMF Content'
--- 44,48 ----
import tempfile
! class ZApp_CMFBase(FreeRangeDS, SkinnedFolder, ZApp_Base, ZApp_DublinCoreMixin, ZApp_MiscDataUser, ZApp_RelatedObject):
meta_type = 'ZApp CMF Content'
***************
*** 50,53 ****
--- 50,65 ----
isPrincipiaFolderish = 1
+ __implements__ = (
+ ZApp_DublinCoreMixin.__implements__,
+ SkinnedFolder.__implements__,
+ )
+
+ manage_options = (
+ { 'label' : 'Dublin Core'
+ , 'action' : 'manage_metadata'
+ }
+ ,) \
+ + SkinnedFolder.manage_options
+
class_default_for_copyable = 0 # make these guys default to 'not copyable'
***************
*** 88,92 ****
return result
! def setMiscData(self, dataDict=None, **kw):
"""
Set miscellaneous data for this object..
--- 100,104 ----
return result
! def setMiscData(self, dataDict=None, dataType='', **kw):
"""
Set miscellaneous data for this object..
***************
*** 95,99 ****
currDict.update(kw)
currDict.update(dataDict)
! self.safeMiscData.setXMLAttrs( currDict )
return "OK!"
--- 107,112 ----
currDict.update(kw)
currDict.update(dataDict)
! miscData = self.getMiscData( dataType=dataType, createIfNone=1)
! miscData.setXMLAttrs( currDict )
return "OK!"
Index: ZApp_MiscData.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_MiscData.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** ZApp_MiscData.py 31 Dec 2003 18:04:21 -0000 1.23
--- ZApp_MiscData.py 2 Jan 2004 22:07:01 -0000 1.24
***************
*** 218,223 ****
then calling with 'checked=1' will avoid a search.
"""
-
-
mdm = None
Manager = Manager or self.miscDataManager
--- 218,221 ----
***************
*** 286,293 ****
}
! def setMiscDataFor(self, dataDict, miscNameAttr='miscAttributeNames', dataType=''):
"""
check for the existence of an attribute of this object with the name given by miscNameAttr
! (e.g., check for the 'miscAttributeNames' attribute of self by default). If this attribute exists,
use it to access a MiscData object that corresponds to this set of attributes.
--- 284,293 ----
}
! DEFAULT_MISCNAMEATTR='miscAttributeNames'
!
! def setMiscDataFor(self, dataDict, miscNameAttr=DEFAULT_MISCNAMEATTR , dataType=''):
"""
check for the existence of an attribute of this object with the name given by miscNameAttr
! (e.g., check for the DEFAULT_MISCNAMEATTR attribute of self by default). If this attribute exists,
use it to access a MiscData object that corresponds to this set of attributes.
***************
*** 335,342 ****
}
! def getMiscDataFor(self, miscNameAttr='miscAttributeNames', dataType=''):
"""
check for the existence of an attribute of this object with the name given by miscNameAttr
! (e.g., check for the 'miscAttributeNames' attribute of self by default). If this attribute exists,
use it to access a MiscData object that corresponds to this set of attributes.
--- 335,342 ----
}
! def getMiscDataFor(self, miscNameAttr=DEFAULT_MISCNAMEATTR, dataType=''):
"""
check for the existence of an attribute of this object with the name given by miscNameAttr
! (e.g., check for the DEFAULT_MISCNAMEATTR attribute of self by default). If this attribute exists,
use it to access a MiscData object that corresponds to this set of attributes.
***************
*** 378,400 ****
return result
! def getObjectInfo(self):
"""
return known attributes/values for object..
"""
result = {'objectID':self.getId()}
- for p in self._properties:
- if p['id']:
- val = getattr(self, p['id'])
- if p['type'] == 'date':
- val = (hasattr(val,'ISO') and val.ISO()) or `val`
- elif p['type'] != 'string':
- if val:
- val = `val`
- elif val is None:
- val = ''
-
- result[p['id']] = val
! result.update( self.getMiscDataFor( 'miscAttributeNames' ))
return result
--- 378,403 ----
return result
! def getObjectInfo(self, miscNameAttr=DEFAULT_MISCNAMEATTR):
"""
return known attributes/values for object..
"""
+
result = {'objectID':self.getId()}
! if miscNameAttr==DEFAULT_MISCNAMEATTR:
! for p in self._properties:
! if p['id']:
! val = getattr(self, p['id'])
! if p['type'] == 'date':
! val = (hasattr(val,'ISO') and val.ISO()) or `val`
! elif p['type'] != 'string':
! if val:
! val = `val`
! elif val is None:
! val = ''
!
! result[p['id']] = val
!
! result.update( self.getMiscDataFor( miscNameAttr ))
return result
|