zapp-cvs-commit Mailing List for ZApp Framework (Page 3)
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: Steve S. <ssp...@us...> - 2004-04-02 14:39:08
|
Update of /cvsroot/zapp/ZApp/skins/zapp_generic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30311/skins/zapp_generic Modified Files: zapp_cmf_object_edit_form.pt zapp_image_view.pt Added Files: zapp_show_mov.pt Log Message: fixed up some media skins.. 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.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** zapp_cmf_object_edit_form.pt 22 Mar 2004 18:33:08 -0000 1.8 --- zapp_cmf_object_edit_form.pt 2 Apr 2004 14:26:59 -0000 1.9 *************** *** 34,38 **** 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; myProperties python:here.safeMiscData.getXMLDict()"> --- 34,38 ---- typePropertiesObjects python:miscDataSpecialist.ZApp_getItems(Manager=cmfSpec.getId(), objectID='metaObject', dataType='ZCMFPropsFor' + myType); myTPropsMiscData python:typePropertiesObjects and typePropertiesObjects[0].getXMLDict(); ! myPropSet python:myTPropsMiscData.get('zapp_properties',[]); myProperties python:here.safeMiscData.getXMLDict()"> *************** *** 40,44 **** 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"> <tr><td>Title: <input name="title" size="20" value="" tal:attributes="value here/title"/></td></tr> --- 40,44 ---- My Portal Type: <span tal:content="here/portal_type"/> </div> ! <table> <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> *************** *** 117,121 **** </table> - <div tal:condition="not:myPropSet"> Sorry.. there is no propSet for this type! </div> </div> </div> --- 117,120 ---- --- NEW FILE: zapp_show_mov.pt --- <div metal:define-macro="main"> <tal:block tal:omit-tag="" define="main_name python:'.'.join(path('here/getId').split('.')[:-1]); mov_url here/graphic_url"> <OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="480" HEIGHT="300" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"> <PARAM NAME="type" VALUE="video/quicktime"> <PARAM NAME="controller" VALUE="true"> <PARAM NAME="autoplay" VALUE="true"> <PARAM NAME="target" VALUE="myself"> <PARAM NAME="src" VALUE="" tal:attributes="value mov_url"> <PARAM NAME="HREF" VALUE="" tal:attributes="value mov_url"> <PARAM NAME="pluginspage" VALUE="http://www.apple.com/quicktime/download/indext.html"> <EMBED WIDTH="480" HEIGHT="300" CONTROLLER="TRUE" SRC="" HREF="" tal:attributes="src mov_url; href mov_url" type="video/quicktime" TARGET="myself" BGCOLOR="#000000" BORDER="0" PLUGINSPAGE="http://www.apple.com/quicktim e/download/indext.html"></EMBED></OBJECT></tal:block> </div> Index: zapp_image_view.pt =================================================================== RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_image_view.pt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** zapp_image_view.pt 21 Jan 2004 16:35:00 -0000 1.4 --- zapp_image_view.pt 2 Apr 2004 14:26:59 -0000 1.5 *************** *** 18,22 **** <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! --- 18,25 ---- <div metal:fill-slot="main"> ! <tal:block tal:omit-tag="" tal:define="mov_mime string:video/quicktime; ! swf_mime string:application/x-shockwave-flash"> ! ! <div tal:condition="python:here.Format() == swf_mime"> <div metal:use-macro="here/zapp_show_swf/macros/main"> Sorry! *************** *** 24,31 **** </div> ! <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> --- 27,42 ---- </div> ! <div tal:condition="python:here.Format() == mov_mime"> ! <div metal:use-macro="here/zapp_show_mov/macros/main"> ! Sorry! ! </div> ! </div> ! ! <div tal:condition="python:here.Format() not in [mov_mime, swf_mime]"> <img tal:attributes="src python:here.zapp_get_fileObj().absolute_url(); width zapp_image_width | string:400"/> </div> + + </tal:block> </div> |
|
From: Stephen S. <ce...@us...> - 2004-04-01 14:25:53
|
Update of /cvsroot/zapp/ZApp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23813 Modified Files: ZApp_Base.py Log Message: make findApplication more robust.. Index: ZApp_Base.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_Base.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ZApp_Base.py 30 Mar 2004 17:06:26 -0000 1.23 --- ZApp_Base.py 1 Apr 2004 14:13:54 -0000 1.24 *************** *** 260,271 **** while 1: if (not currObject) or (not hasattr(currObject, 'meta_type')): raise RuntimeError, "Hmm. thaf's odd.. I can't find any ZApp Application here!" ! if currObject.meta_type == self.applicationMetaType: break ! if hasattr(currObject, 'objectIds') and currObject.objectIds( ZApp_Application.ZApp_Application.meta_type ): ! apps = currObject.objectValues( ZApp_Application.ZApp_Application.meta_type ) result = apps and apps[0] if result: --- 260,272 ---- while 1: + mtype = getattr(currObject,'applicationMetaType','') if (not currObject) or (not hasattr(currObject, 'meta_type')): raise RuntimeError, "Hmm. thaf's odd.. I can't find any ZApp Application here!" ! if currObject.meta_type == mtype: break ! if hasattr(currObject, 'objectIds') and currObject.objectIds( mtype ): ! apps = currObject.objectValues( mtype ) result = apps and apps[0] if result: |
|
From: Steve S. <ssp...@us...> - 2004-03-31 17:45:23
|
Update of /cvsroot/zapp/ZApp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24765 Modified Files: ZApp_CMFBase.py Log Message: don't need custom hook in manage_afterAdd any more.. Index: ZApp_CMFBase.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** ZApp_CMFBase.py 31 Mar 2004 13:36:23 -0000 1.47 --- ZApp_CMFBase.py 31 Mar 2004 17:33:26 -0000 1.48 *************** *** 21,25 **** missing = [] ! dbug_level = 0 # 100 # make 100 to blather about various CMF related events.. lpcol = LeverPropertyCollection --- 21,25 ---- missing = [] ! dbug_level = 100 # 100 # make 100 to blather about various CMF related events.. lpcol = LeverPropertyCollection *************** *** 422,425 **** --- 422,426 ---- "WITH SELF COMPUTE fs_container=self.getCurrFolder()", "WITH SELF COMPUTE fs_object=self.getFSObject()", + "WHEN OBJECT DELETED CALL self.removeFSObject()", ) *************** *** 436,440 **** ZApp_LOG("ZApp FS Object Manage after add", dbug_level) ZApp_CMFBase.manage_afterAdd(self, item, container) ! self.manage_callPUTFilter() def objectValues(self, spec=None): --- 437,441 ---- ZApp_LOG("ZApp FS Object Manage after add", dbug_level) ZApp_CMFBase.manage_afterAdd(self, item, container) ! #self.manage_callPUTFilter() def objectValues(self, spec=None): *************** *** 488,491 **** --- 489,499 ---- return theFSObject + def removeFSObject(self): + """ + Remove my FS object... + """ + if self.getId() in self.fs_container.objectIds(): + self.fs_container.manage_delObjects(self.getId()) + def edit_fs_object(self, id='', title='', file=None, REQUEST=None): """ *************** *** 549,552 **** --- 557,563 ---- ZApp_LOG("In FS File PUT", dbug_level) + import pdb + pdb.set_trace() + newID = self.getId() if self.fs_object is None: *************** *** 688,692 **** self.size = fileObj.get_size() self.setFormat(self.content_type) - self.manage_callPUTFilter() return oldID, newID, newTitle --- 699,702 ---- *************** *** 716,720 **** self.setFormat(self.content_type) ZApp_LOG(("PUT real file In FS Image PUT:%i bytes" % self.size), dbug_level) ! self.manage_callPUTFilter() return result --- 726,731 ---- self.setFormat(self.content_type) ZApp_LOG(("PUT real file In FS Image PUT:%i bytes" % self.size), dbug_level) ! if self.size: ! self.manage_callPUTFilter() return result *************** *** 753,757 **** Image.manage_afterAdd(self, item, container) ZApp_Base.manage_afterAdd(self, item, container) - self.manage_callPUTFilter() self.ZAppRecursionLock_clear() --- 764,767 ---- |
|
From: Steve S. <ssp...@us...> - 2004-03-31 13:48:12
|
Update of /cvsroot/zapp/ZApp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6375 Modified Files: ZApp_CMFBase.py Log Message: ack.. check in with dbug_level back to 0 Index: ZApp_CMFBase.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** ZApp_CMFBase.py 31 Mar 2004 13:31:09 -0000 1.46 --- ZApp_CMFBase.py 31 Mar 2004 13:36:23 -0000 1.47 *************** *** 21,25 **** missing = [] ! dbug_level = 100 # 100 # make 100 to blather about various CMF related events.. lpcol = LeverPropertyCollection --- 21,25 ---- missing = [] ! dbug_level = 0 # 100 # make 100 to blather about various CMF related events.. lpcol = LeverPropertyCollection |
|
From: Steve S. <ssp...@us...> - 2004-03-31 13:42:59
|
Update of /cvsroot/zapp/ZApp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5133 Modified Files: ZApp_CMFBase.py Log Message: more DAV work with images.. Index: ZApp_CMFBase.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** ZApp_CMFBase.py 30 Mar 2004 17:23:03 -0000 1.45 --- ZApp_CMFBase.py 31 Mar 2004 13:31:09 -0000 1.46 *************** *** 17,23 **** from ZApp_LOG import ZApp_LOG missing = [] ! dbug_level = 0 # make 100 to blather about various CMF related events.. lpcol = LeverPropertyCollection --- 17,25 ---- from ZApp_LOG import ZApp_LOG + from Globals import InitializeClass + missing = [] ! dbug_level = 100 # 100 # make 100 to blather about various CMF related events.. lpcol = LeverPropertyCollection *************** *** 187,191 **** self.change(safeStorageID = safeStorageID, cmf_portal_type=self.portal_type ) - ZApp_LOG("commit sub-transaction...") get_transaction().commit(1) --- 189,192 ---- *************** *** 303,307 **** checkRecursion = self.ZAppRecusionLock_checkSet() ! ZApp_LOG("_manage_afterAdd: " + self.getId() + ":" + safeStorageID + ":_v_in_manage_afterAdd:" + `checkRecursion`, dbug_level) if not checkRecursion: --- 304,308 ---- checkRecursion = self.ZAppRecusionLock_checkSet() ! ZApp_LOG("ZAppBase_manage_afterAdd: " + self.getId() + ":" + safeStorageID + ":_v_in_manage_afterAdd:" + `checkRecursion`, dbug_level) if not checkRecursion: *************** *** 334,337 **** --- 335,355 ---- self.ZAppRecursionLock_clear() + def manage_callPUTFilter(self): + """ + Check for data.. and call PUT filter hook if found.. should only be used for + types with .data (e.g., Image, File etc.. ) + """ + objID = self.getId() + if objID and objID[0] != '.': + if hasattr(self, 'getData') and self.getData(): + hook_method = getattr(self, 'ZApp_PUT_filter', None) + if hook_method: + ZApp_LOG("manage_callPUTFilter filter hook...", dbug_level) + hook_method( self ) + else: + ZApp_LOG("manage_callPUTFilter no filter hook...", dbug_level) + else: + ZApp_LOG("manage_callPUTFIlter no data (yet?) ...", dbug_level) + def copyObjectRelations(self, theObjectRelations): """ *************** *** 369,372 **** --- 387,392 ---- """ + ZApp_LOG("in.. FSFolder PUT Factory... ", dbug_level) + pf = getattr(self, 'ZApp_putFactory', None) if not pf: *************** *** 374,378 **** self.invokeFactory( self.preferredMediaType, name ) obj = aq_base( self._getOb( name ) ) ! #self._delObject( name ) return obj else: --- 394,398 ---- self.invokeFactory( self.preferredMediaType, name ) obj = aq_base( self._getOb( name ) ) ! self._delObject( name ) return obj else: *************** *** 410,413 **** --- 430,441 ---- + def manage_afterAdd(self, item, container): + """ + Do manage_afterAdd + """ + ZApp_LOG("ZApp FS Object Manage after add", dbug_level) + ZApp_CMFBase.manage_afterAdd(self, item, container) + self.manage_callPUTFilter() + def objectValues(self, spec=None): """ *************** *** 498,504 **** --- 526,552 ---- return fsObj and fsObj.index_html(REQUEST, RESPONSE) + def getData(self): + """ + get file data. + """ + fsObj = self.fs_object + size = self.fs_object.get_size() + ZApp_LOG(("in ZApp_FSObject: found size = %i" % size), dbug_level) + if fsObj: + fsObj = fsObj.data + if fsObj: + ZApp_LOG("in ZApp_FSObject: found fsObj and data", dbug_level) + else: + ZApp_LOG("in ZApp_FSObject: found fsObj but no data", dbug_level) + else: + ZApp_LOG("in ZApp_FSObject: no fsObj", dbug_level) + + return fsObj + def PUT(self, REQUEST, RESPONSE): """Handle HTTP PUT requests""" + ZApp_LOG("In FS File PUT", dbug_level) + newID = self.getId() if self.fs_object is None: *************** *** 511,523 **** fileObj = self.fs_object if fileObj: ! hook_method = getattr(self, 'ZApp_PUT_Filter', None) ! if hook_method: ! hook_method(REQUEST, RESPONSE) ! ! fileObj.PUT( REQUEST, RESPONSE) self.content_type = fileObj.content_type self.setFormat(self.content_type) self.size = fileObj.get_size() manage_FTPget = index_html --- 559,572 ---- fileObj = self.fs_object + result = None if fileObj: ! result = fileObj.PUT( REQUEST, RESPONSE) self.content_type = fileObj.content_type self.setFormat(self.content_type) self.size = fileObj.get_size() + ZApp_LOG(("PUT real file In FS File PUT:%i bytes" % self.size), dbug_level) + self.manage_callPUTFilter() + + return result manage_FTPget = index_html *************** *** 613,616 **** --- 662,666 ---- """ + ZApp_LOG("In edit fs object... ", dbug_level) if not file: file = REQUEST and REQUEST.form.get('file',None) *************** *** 638,641 **** --- 688,692 ---- self.size = fileObj.get_size() self.setFormat(self.content_type) + self.manage_callPUTFilter() return oldID, newID, newTitle *************** *** 644,647 **** --- 695,700 ---- """Handle HTTP PUT requests""" + ZApp_LOG("In FS Image PUT", dbug_level) + newID = self.getId() if self.fs_object is None: *************** *** 654,663 **** fileObj = self.fs_object if fileObj: ! hook_method = getattr(self, 'ZApp_PUT_Filter', None) ! if hook_method: ! hook_method(REQUEST, RESPONSE) ! ! fileObj.PUT( REQUEST, RESPONSE) self.content_type = fileObj.content_type self.width = fileObj.width --- 707,713 ---- fileObj = self.fs_object + result = None if fileObj: ! result = fileObj.PUT( REQUEST, RESPONSE) self.content_type = fileObj.content_type self.width = fileObj.width *************** *** 665,669 **** --- 715,722 ---- self.size = fileObj.get_size() self.setFormat(self.content_type) + ZApp_LOG(("PUT real file In FS Image PUT:%i bytes" % self.size), dbug_level) + self.manage_callPUTFilter() + return result extendProperties(ZApp_CMF_FSImage, []) *************** *** 694,697 **** --- 747,751 ---- Do manage_afterAdd """ + ZApp_LOG("In ZODB Image manage_afterAdd... ", dbug_level) checkRecursion = self.ZAppBase_manage_afterAdd(item, container) *************** *** 699,727 **** Image.manage_afterAdd(self, item, container) ZApp_Base.manage_afterAdd(self, item, container) ! self.ZAppRecursionLock_clear() ! def edit(self, precondition='', file=''): ! """ Update and reindex. """ ! return Image.edit(self, precondition=precondition, file=file) ! ! def index_html(self, REQUEST=None, RESPONSE=None): """ ! use Image version... """ ! return Image.index_html(self, REQUEST, RESPONSE) def PUT(self, REQUEST, RESPONSE): ! """Handle HTTP PUT requests""" ! ! import pdb ! pdb.set_trace() ! ! hook_method = getattr(self, 'ZApp_PUT_Filter', None) ! if hook_method: ! hook_method(REQUEST, RESPONSE) ! return Image.PUT(self, REQUEST, RESPONSE) __str__ = Image.__str__ __len__ = Image.__len__ --- 753,780 ---- Image.manage_afterAdd(self, item, container) ZApp_Base.manage_afterAdd(self, item, container) ! self.manage_callPUTFilter() self.ZAppRecursionLock_clear() ! def getData(self): """ ! return data object. """ ! return self.data def PUT(self, REQUEST, RESPONSE): ! """ ! Handle a webdave PUT... ! """ ! ZApp_LOG("In ZODB PUT", dbug_level) ! Image.PUT(self, REQUEST, RESPONSE) ! self.manage_callPUTFilter() ! def edit(self, precondition='', file=''): ! """ ! delegate to Image class.. but add hook... ! """ ! Image.edit(self, precondition, file) + index_html = Image.index_html __str__ = Image.__str__ __len__ = Image.__len__ |
|
From: Steve S. <ssp...@us...> - 2004-03-30 17:34:43
|
Update of /cvsroot/zapp/ZApp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13824 Modified Files: ZApp_CMFBase.py Log Message: fixin' more bugs. Index: ZApp_CMFBase.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** ZApp_CMFBase.py 30 Mar 2004 17:06:26 -0000 1.44 --- ZApp_CMFBase.py 30 Mar 2004 17:23:03 -0000 1.45 *************** *** 677,681 **** __dav_collection__ = 0 - __implements__ = ( Image.__implements__, --- 677,680 ---- *************** *** 683,693 **** - manage_options = ( - { 'label' : 'Dublin Core' - , 'action' : 'manage_metadata' - } - ,) \ - + SkinnedFolder.manage_options - class_default_for_copyable = 0 # make these guys default to 'not copyable' --- 682,685 ---- *************** *** 734,740 **** __str__ = Image.__str__ __len__ = Image.__len__ - manage_FTPget = Image.index_html get_size = Image.get_size getContentType = Image.getContentType extendProperties(ZApp_CMF_ZODBImage, []) --- 726,734 ---- __str__ = Image.__str__ __len__ = Image.__len__ get_size = Image.get_size getContentType = Image.getContentType + manage_FTPget = Image.index_html + manage_FTPstat = Image.manage_FTPstat + manage_FTPlist = Image.manage_FTPlist extendProperties(ZApp_CMF_ZODBImage, []) |
|
From: Steve S. <ssp...@us...> - 2004-03-30 17:18:07
|
Update of /cvsroot/zapp/ZApp/skins/zapp_generic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10277/skins/zapp_generic Modified Files: zapp_cmf_view_relations.pt Log Message: fixin' bugs. Index: zapp_cmf_view_relations.pt =================================================================== RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_cmf_view_relations.pt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** zapp_cmf_view_relations.pt 19 Mar 2004 15:53:32 -0000 1.1 --- zapp_cmf_view_relations.pt 30 Mar 2004 17:06:26 -0000 1.2 *************** *** 13,18 **** objRelations python:here.objectRelations( returnObjects=1 ); managerIDs here/findSpecialistsForRelationship; myCMFId python:here.calcPathID()"> ! <form action="" tal:attributes="action string:${appURL}/CMFData/${myCMFId}"> <input type="hidden" name="responseURL" tal:attributes="value request/URL0"> <table > --- 13,19 ---- objRelations python:here.objectRelations( returnObjects=1 ); managerIDs here/findSpecialistsForRelationship; + cmfManager here/CMFDataSpecialist; myCMFId python:here.calcPathID()"> ! <form action="" tal:attributes="action string:${appURL}/${cmfManager}/${myCMFId}"> <input type="hidden" name="responseURL" tal:attributes="value request/URL0"> <table > |
|
From: Steve S. <ssp...@us...> - 2004-03-30 17:18:07
|
Update of /cvsroot/zapp/ZApp/leverMethods/Generic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10277/leverMethods/Generic Modified Files: doCreateSchema.plain doDropSchema.plain reCatalog.plain Log Message: fixin' bugs. Index: reCatalog.plain =================================================================== RCS file: /cvsroot/zapp/ZApp/leverMethods/Generic/reCatalog.plain,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** reCatalog.plain 28 Mar 2003 06:32:22 -0000 1.1 --- reCatalog.plain 30 Mar 2004 17:06:26 -0000 1.2 *************** *** 6,10 **** Id: reCatalog Meta-Type: Script (Python) ! Parameters: sqlName='', dbName='', catalogName='' Permissions: Proxy-Roles: --- 6,10 ---- Id: reCatalog Meta-Type: Script (Python) ! Parameters: sqlName='', dbName='', catalogName='', rackName='defaultRack' Permissions: Proxy-Roles: Index: doCreateSchema.plain =================================================================== RCS file: /cvsroot/zapp/ZApp/leverMethods/Generic/doCreateSchema.plain,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** doCreateSchema.plain 28 Mar 2003 20:38:28 -0000 1.2 --- doCreateSchema.plain 30 Mar 2004 17:06:26 -0000 1.3 *************** *** 6,10 **** Id: doCreateSchema Meta-Type: Script (Python) ! Parameters: dbName='', sqlName='createSchema', catalogName='' Permissions: Proxy-Roles: --- 6,10 ---- Id: doCreateSchema Meta-Type: Script (Python) ! Parameters: dbName='', sqlName='createSchema', catalogName='', rackName='defaultRack' Permissions: Proxy-Roles: Index: doDropSchema.plain =================================================================== RCS file: /cvsroot/zapp/ZApp/leverMethods/Generic/doDropSchema.plain,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** doDropSchema.plain 28 Mar 2003 20:38:29 -0000 1.2 --- doDropSchema.plain 30 Mar 2004 17:06:26 -0000 1.3 *************** *** 6,10 **** Id: doDropSchema Meta-Type: Script (Python) ! Parameters: dbName='', sqlName='createSchema', catalogName='' Permissions: Proxy-Roles: --- 6,10 ---- Id: doDropSchema Meta-Type: Script (Python) ! Parameters: dbName='', sqlName='createSchema', catalogName='', rackName='defaultRack' Permissions: Proxy-Roles: |
|
From: Steve S. <ssp...@us...> - 2004-03-30 17:18:07
|
Update of /cvsroot/zapp/ZApp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10277 Modified Files: ZApp_Application.py ZApp_Base.py ZApp_CMFBase.py ZApp_MiscData.py ZApp_Specialist.py __init__.py Log Message: fixin' bugs. Index: ZApp_Base.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_Base.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ZApp_Base.py 6 Nov 2003 18:20:13 -0000 1.22 --- ZApp_Base.py 30 Mar 2004 17:06:26 -0000 1.23 *************** *** 9,14 **** --- 9,17 ---- undefined_zdb = [] + ZAPP_DEBUG=os.environ.get('ZAPP_DEBUG',undefined_zdb) + FULL_REPR=os.environ.get('ZAPP_REPR_FULL',undefined_zdb) + from OFS import SimpleItem from OFS.PropertyManager import PropertyManager *************** *** 23,26 **** --- 26,30 ---- _marker = [] + unbreak=0 if ZAPP_DEBUG: *************** *** 31,42 **** def __new__get_attr__(self, name, _v_dm_=_v_dm_): c = self._v_attrCache has = c.has_key d = self.__dict__ ! id = d.get('id','No id') t = self.__class__.__name__ if not has(name): ! ZApp_LOG("In getattr -> cache failed %s(%s) looking for %s" % (id, t, name)) else: v = c.get(name,'No Value') --- 35,50 ---- def __new__get_attr__(self, name, _v_dm_=_v_dm_): + + global unbreak # let's only break once.. + c = self._v_attrCache has = c.has_key d = self.__dict__ ! id = d.get('id',_marker) ! t = self.__class__.__name__ if not has(name): ! ZApp_LOG("In getattr -> cache failed %s(%s) looking for %s" % (`id`, t, name)) else: v = c.get(name,'No Value') *************** *** 188,193 **** def __repr__(self): ! return ('<ZApp_BaseObject meta_type=%s %s>' % (self.meta_type, self.propDisplay())) ! def get_argument_dictionary(self, props=None, REQUEST=None, kw=None): --- 196,203 ---- def __repr__(self): ! if FULL_REPR is not undefined_zdb: ! return ('<ZApp_BaseObject meta_type=%s %s>' % (self.meta_type, self.propDisplay())) ! else: ! return ('<ZApp_BaseObject meta_type=%s at 0x%x>' % (self.meta_type, id(self))) def get_argument_dictionary(self, props=None, REQUEST=None, kw=None): Index: ZApp_Application.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_Application.py,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** ZApp_Application.py 28 Mar 2004 22:14:47 -0000 1.34 --- ZApp_Application.py 30 Mar 2004 17:06:25 -0000 1.35 *************** *** 517,525 **** --- 517,529 ---- resultList.append("Not allowed to run this lever.. safe levers only.. ") continue + spec = spec.__of__(leverMethod) + if leverName=='skinScriptLever': rackList = spec.rackList else: rackList = [spec.defaultRack] + + resultList.append("Found racks: " + `rackList`) for rack in rackList: *************** *** 535,538 **** --- 539,544 ---- f.seek(0) resultList.append("Ahh!!!" + f.read()) + else: + resultList.append("*** Can't find leverMethod: '%s' ***** " % leverName) else: resultList.append(" can't find any specialists there.. ") Index: ZApp_Specialist.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_Specialist.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** ZApp_Specialist.py 21 Mar 2004 13:08:18 -0000 1.39 --- ZApp_Specialist.py 30 Mar 2004 17:06:26 -0000 1.40 *************** *** 612,618 **** if not itemID: ! import pdb ! pdb.set_trace() ! raise RuntimeError, ("Can't be! got null id in %s.chachedSelectItemResult()" % self.id) queryResult = self._fromCache(itemID) --- 612,616 ---- if not itemID: ! return None queryResult = self._fromCache(itemID) Index: ZApp_MiscData.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_MiscData.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ZApp_MiscData.py 19 Mar 2004 15:53:32 -0000 1.27 --- ZApp_MiscData.py 30 Mar 2004 17:06:26 -0000 1.28 *************** *** 182,196 **** def getMiscDataSpecialist(self): ! mds = self.findApplication().getSpecialist('MiscData') if not mds: try: # acquisition failed... try CMF skin, if we're in context.. # ! mds = self.getApplication().getSpecialist('MiscData') except AttributeError: pass return mds - def getMiscData(self, Manager=None, dataType='', createIfNone=0): """ --- 182,197 ---- def getMiscDataSpecialist(self): ! app = self.findApplication() ! mdID = app.MiscDataSpecialist ! mds = getattr(app, mdID) if not mds: try: # acquisition failed... try CMF skin, if we're in context.. # ! mds = self.getApplication().getSpecialist(mdID) except AttributeError: pass return mds def getMiscData(self, Manager=None, dataType='', createIfNone=0): """ Index: ZApp_CMFBase.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** ZApp_CMFBase.py 29 Mar 2004 13:58:34 -0000 1.43 --- ZApp_CMFBase.py 30 Mar 2004 17:06:26 -0000 1.44 *************** *** 48,51 **** --- 48,53 ---- from DateTime import DateTime + cmfbase_unbreak=0 + import tempfile *************** *** 99,107 **** --- 101,120 ---- def calcPathID(self): + + global cmfbase_unbreak try: if self.id.find(',') != -1: result = self.id else: + if 0: # not cmfbase_unbreak: + cmfbase_unbreak=1 + + import pdb + pdb.set_trace() + app = self.findApplication() + cmfSpec = getattr(app,app.CMFDataSpecialist,'') + if cmfSpec and cmfSpec.getId() == self.aq_parent.getId(): + return 'IMPOSSIBLE_PATH_ID' objPath = ','.join(self.getPhysicalPath()) portal_object = app.zapp_portal_object *************** *** 355,369 **** if it's an image, create our preferred media type to handle it. """ - if typ.startswith('image') or typ.startswith('application'): - self.invokeFactory( self.preferredMediaType, name ) - obj = aq_base( self._getOb( name ) ) - self._delObject( name ) - return obj ! class ZApp_CMF_FSObject( ZApp_CMFBase ): meta_type = 'ZApp CMF FSObject' isPrincipiaFolderish = 0 isAnObjectManager = 0 __dav_collection__ = 0 --- 368,395 ---- if it's an image, create our preferred media type to handle it. """ ! pf = getattr(self, 'ZApp_putFactory', None) ! if not pf: ! if typ.startswith('image') or typ.startswith('application'): ! self.invokeFactory( self.preferredMediaType, name ) ! obj = aq_base( self._getOb( name ) ) ! #self._delObject( name ) ! return obj ! else: ! return pf(name, typ, body) ! ! extendProperties(ZApp_CMF_FSFolder, props) + class ZApp_CMF_FSObject( ZApp_CMFBase ): + """ + There is an attribute check for ZApp_PUT_filter during a 'PUT' so that a custom filter can + be invoked before data is stored. + """ + meta_type = 'ZApp CMF FSObject' isPrincipiaFolderish = 0 isAnObjectManager = 0 + isPortalContent = 1 + __dav_collection__ = 0 *************** *** 385,388 **** --- 411,417 ---- def objectValues(self, spec=None): + """ + Don't behave like a container. + """ return () *************** *** 456,459 **** --- 485,491 ---- if file: fileObj.manage_upload(file) + self.content_type = fileObj.content_type + self.setFormat(self.content_type) + self.size = fileObj.get_size() return oldID, newID, newTitle *************** *** 478,485 **** else: fileObj = self.fs_object ! if fileObj: fileObj.PUT( REQUEST, RESPONSE) self.content_type = fileObj.content_type self.size = fileObj.get_size() --- 510,522 ---- else: fileObj = self.fs_object ! if fileObj: + hook_method = getattr(self, 'ZApp_PUT_Filter', None) + if hook_method: + hook_method(REQUEST, RESPONSE) + fileObj.PUT( REQUEST, RESPONSE) self.content_type = fileObj.content_type + self.setFormat(self.content_type) self.size = fileObj.get_size() *************** *** 600,603 **** --- 637,641 ---- self.height = fileObj.height self.size = fileObj.get_size() + self.setFormat(self.content_type) return oldID, newID, newTitle *************** *** 615,620 **** else: fileObj = self.fs_object ! if fileObj: fileObj.PUT( REQUEST, RESPONSE) self.content_type = fileObj.content_type --- 653,662 ---- else: fileObj = self.fs_object ! if fileObj: + hook_method = getattr(self, 'ZApp_PUT_Filter', None) + if hook_method: + hook_method(REQUEST, RESPONSE) + fileObj.PUT( REQUEST, RESPONSE) self.content_type = fileObj.content_type *************** *** 622,625 **** --- 664,668 ---- self.height = fileObj.height self.size = fileObj.get_size() + self.setFormat(self.content_type) *************** *** 628,632 **** class ZApp_CMF_ZODBImage( ZApp_CMFBase, Image): ! meta_type = 'ZApp CMF Image' zapp_cmf_type = 1 isPrincipiaFolderish = 0 --- 671,675 ---- class ZApp_CMF_ZODBImage( ZApp_CMFBase, Image): ! meta_type = 'ZApp CMF ZODB Image' zapp_cmf_type = 1 isPrincipiaFolderish = 0 *************** *** 667,670 **** --- 710,743 ---- self.ZAppRecursionLock_clear() + def edit(self, precondition='', file=''): + """ Update and reindex. """ + return Image.edit(self, precondition=precondition, file=file) + + def index_html(self, REQUEST=None, RESPONSE=None): + """ + use Image version... + """ + return Image.index_html(self, REQUEST, RESPONSE) + + def PUT(self, REQUEST, RESPONSE): + """Handle HTTP PUT requests""" + + import pdb + pdb.set_trace() + + hook_method = getattr(self, 'ZApp_PUT_Filter', None) + if hook_method: + hook_method(REQUEST, RESPONSE) + + return Image.PUT(self, REQUEST, RESPONSE) + + __str__ = Image.__str__ + __len__ = Image.__len__ + manage_FTPget = Image.index_html + get_size = Image.get_size + getContentType = Image.getContentType + + extendProperties(ZApp_CMF_ZODBImage, []) + from DateTime import DateTime *************** *** 719,722 **** --- 792,832 ---- ), }, + {'id': 'ZApp CMF ZODB Image', + 'title':'', + 'meta_type' : ZApp_CMF_ZODBImage.meta_type, + 'product': 'ZApp', + 'description':'Image Content type based on ZApp objects using ZODB for storage', + 'icon':'image_icon.gif', + 'factory': 'addZAppCMFZODBImage', + 'immediate_view': 'image_edit_form', + 'actions': ({'id': 'view', + 'name': 'View', + 'action': 'image_view', + 'permissions': (CMFCorePermissions.View,), + }, + {'id': 'edit', + 'name': 'Edit', + 'action': 'image_edit_form', + 'permissions': (CMFCorePermissions.ModifyPortalContent,), + }, + { 'id' : 'metadata' + , 'name' : 'Metadata' + , 'action': 'string:${object_url}/metadata_edit_form' + , 'permissions' : (CMFCorePermissions.ModifyPortalContent,), + }, + { 'id' : 'xml' + , 'name' : 'XML' + , 'action': 'string:${object_url}/zapp_cmf_xml_form' + , 'permissions' : (CMFCorePermissions.ManagePortal,) + , 'visible' : 1, + }, + { 'id' : 'relations' + , 'name' : 'Relationships' + , 'action': 'string:${object_url}/zapp_cmf_view_relations' + , 'permissions' : (CMFCorePermissions.ManagePortal,) + , 'visible' : 1, + }, + ), + }, {'id': 'ZApp CMF ImageFolder', 'title':'', *************** *** 823,833 **** 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: --- 933,946 ---- 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 not existingObject: + proxyObj = dm.newItem( checkID ) if existingObject: *************** *** 843,847 **** self._setObject(id, o) initCMFObjectMetadata(o) - o.change() if klass not in [ZApp_CMFBase, ZApp_CMF_FSObject, ZApp_CMF_FSImage, ZApp_CMF_FSFolder, ZApp_CMF_ZODBImage]: --- 956,959 ---- *************** *** 854,858 **** return addZAppCMFObject(self, id, title, klass, useExisting) ! def addZAppCMFImage(self, id, title='', klass=ZApp_CMF_ZODBImage, useExisting=1): """ add a CMF_ZODBImage object.. pass in the right class... --- 966,970 ---- return addZAppCMFObject(self, id, title, klass, useExisting) ! def addZAppCMFZODBImage(self, id, title='', klass=ZApp_CMF_ZODBImage, useExisting=1): """ add a CMF_ZODBImage object.. pass in the right class... Index: __init__.py =================================================================== RCS file: /cvsroot/zapp/ZApp/__init__.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** __init__.py 28 Mar 2004 22:14:47 -0000 1.25 --- __init__.py 30 Mar 2004 17:06:26 -0000 1.26 *************** *** 55,58 **** --- 55,59 ---- context.registerBaseClass(ZApp_CMFBase.ZApp_CMFBase) context.registerBaseClass(ZApp_CMFBase.ZApp_CMF_FSImage) + context.registerBaseClass(ZApp_CMFBase.ZApp_CMF_ZODBImage) context.registerBaseClass(ZApp_CMFBase.ZApp_CMF_FSFolder) *************** *** 61,65 **** content_types = (ZApp_CMFBase.ZApp_CMFBase, ZApp_CMFBase.ZApp_CMF_FSImage, ZApp_CMFBase.ZApp_CMF_ZODBImage, ZApp_CMFBase.ZApp_CMF_FSFolder), permission = AddPortalContent, ! extra_constructors = (ZApp_CMFBase.addZAppCMFObject, ZApp_CMFBase.addZAppCMFFSImage, ZApp_CMFBase.addZAppCMFImage, ZApp_CMFBase.addZAppCMFFSFolder), fti=ZApp_CMFBase.factory_type_information, ).initialize(context) --- 62,66 ---- content_types = (ZApp_CMFBase.ZApp_CMFBase, ZApp_CMFBase.ZApp_CMF_FSImage, ZApp_CMFBase.ZApp_CMF_ZODBImage, ZApp_CMFBase.ZApp_CMF_FSFolder), permission = AddPortalContent, ! extra_constructors = (ZApp_CMFBase.addZAppCMFObject, ZApp_CMFBase.addZAppCMFFSImage, ZApp_CMFBase.addZAppCMFZODBImage, ZApp_CMFBase.addZAppCMFFSFolder), fti=ZApp_CMFBase.factory_type_information, ).initialize(context) |
|
From: Steve S. <ssp...@us...> - 2004-03-29 16:29:36
|
Update of /cvsroot/zapp/ZApp/Extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23507 Added Files: getDataManagerFor_dist.py Log Message: example getDataManagerFor.py --- NEW FILE: getDataManagerFor_dist.py --- # # An example getDataManagerFor if you are using different racks to store different # CMFish classes.. # def getDataManagerFor(self, obj, objdm): m_type = getattr(obj, 'meta_type','') if m_type in ['ZApp CMF FSImage']: return self.CMFData.mediaRack elif m_type in ['ZApp CMF Media Folder']: return self.CMFData.folderRack else: return self.CMFData.defaultRack |
|
From: Steve S. <ssp...@us...> - 2004-03-29 14:10:02
|
Update of /cvsroot/zapp/ZApp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28344 Modified Files: ZApp_CMFBase.py Log Message: FS Objects need to __implement__ File interface Index: ZApp_CMFBase.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** ZApp_CMFBase.py 29 Mar 2004 04:20:00 -0000 1.42 --- ZApp_CMFBase.py 29 Mar 2004 13:58:34 -0000 1.43 *************** *** 10,13 **** --- 10,14 ---- from Products.PageTemplates.PageTemplateFile import PageTemplateFile + from Products.CMFDefault.Image import Image from ZApp_Base import ZApp_Base, extendProperties, LeverPropertyCollection, LeverProperty *************** *** 378,381 **** --- 379,387 ---- + __implements__ = ( + Image.__implements__, + ) + + def objectValues(self, spec=None): return () *************** *** 620,625 **** extendProperties(ZApp_CMF_FSImage, []) - from Products.CMFDefault.Image import Image - class ZApp_CMF_ZODBImage( ZApp_CMFBase, Image): --- 626,629 ---- |
|
From: Steve S. <ssp...@us...> - 2004-03-29 04:34:22
|
Update of /cvsroot/zapp/ZApp/zpt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22370/zpt Modified Files: CMF_displayRelatedObjects.zpt Log Message: need to add /view in a few places. Index: CMF_displayRelatedObjects.zpt =================================================================== RCS file: /cvsroot/zapp/ZApp/zpt/CMF_displayRelatedObjects.zpt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CMF_displayRelatedObjects.zpt 19 Mar 2004 15:53:32 -0000 1.1 --- CMF_displayRelatedObjects.zpt 29 Mar 2004 04:22:58 -0000 1.2 *************** *** 5,9 **** <span tal:condition="portal"> <tal:block tal:omit-tag="" tal:define="relURL python:here.calcPathID().replace(',','/')[1:]"> ! <a tal:attributes="href string:${portal/absolute_url}/${relURL}">Portal View</a> </tal:block></span> --- 5,9 ---- <span tal:condition="portal"> <tal:block tal:omit-tag="" tal:define="relURL python:here.calcPathID().replace(',','/')[1:]"> ! <a tal:attributes="href string:${portal/absolute_url}/${relURL}/view">Portal View</a> </tal:block></span> |
|
From: Steve S. <ssp...@us...> - 2004-03-29 04:31:23
|
Update of /cvsroot/zapp/ZApp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21858 Modified Files: ZApp_CMFBase.py Log Message: added better 'size' caching.. Index: ZApp_CMFBase.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** ZApp_CMFBase.py 29 Mar 2004 03:29:49 -0000 1.41 --- ZApp_CMFBase.py 29 Mar 2004 04:20:00 -0000 1.42 *************** *** 473,477 **** fileObj = self.fs_object ! fileObj.PUT( REQUEST, RESPONSE) manage_FTPget = index_html --- 473,480 ---- fileObj = self.fs_object ! if fileObj: ! fileObj.PUT( REQUEST, RESPONSE) ! self.content_type = fileObj.content_type ! self.size = fileObj.get_size() manage_FTPget = index_html *************** *** 527,534 **** Returns the size of the file or image. """ ! size = 0 ! if self.fs_object: ! size = self.fs_object.get_size() ! return size --- 530,540 ---- Returns the size of the file or image. """ ! size = getattr(self, 'size', None) ! if size is None: ! if self.fs_object: ! size = self.fs_object.get_size() ! else: ! size = 0 ! self.size = size return size *************** *** 541,545 **** Returns the content type (MIME type) of a file or image. """ ! return self.content_type def __str__(self): --- 547,551 ---- Returns the content type (MIME type) of a file or image. """ ! return getattr(self, 'content_type', 'none') def __str__(self): *************** *** 587,591 **** self.width = fileObj.width self.height = fileObj.height ! return oldID, newID, newTitle --- 593,597 ---- self.width = fileObj.width self.height = fileObj.height ! self.size = fileObj.get_size() return oldID, newID, newTitle *************** *** 604,608 **** fileObj = self.fs_object ! fileObj.PUT( REQUEST, RESPONSE) extendProperties(ZApp_CMF_FSImage, []) --- 610,620 ---- fileObj = self.fs_object ! if fileObj: ! fileObj.PUT( REQUEST, RESPONSE) ! self.content_type = fileObj.content_type ! self.width = fileObj.width ! self.height = fileObj.height ! self.size = fileObj.get_size() ! extendProperties(ZApp_CMF_FSImage, []) |
|
From: Steve S. <ssp...@us...> - 2004-03-29 03:41:12
|
Update of /cvsroot/zapp/ZApp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13255 Modified Files: ZApp_CMFBase.py Log Message: fixed problem in DAV/FTP support for ZApp_CMF_Images... Index: ZApp_CMFBase.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** ZApp_CMFBase.py 28 Mar 2004 22:14:47 -0000 1.40 --- ZApp_CMFBase.py 29 Mar 2004 03:29:49 -0000 1.41 *************** *** 58,62 **** zapp_cmf_type = 1 isPrincipiaFolderish = 1 ! __implements__ = ( ZApp_DublinCoreMixin.__implements__, --- 58,63 ---- zapp_cmf_type = 1 isPrincipiaFolderish = 1 ! isAnObjectManager = 1 ! __implements__ = ( ZApp_DublinCoreMixin.__implements__, *************** *** 363,366 **** --- 364,369 ---- meta_type = 'ZApp CMF FSObject' isPrincipiaFolderish = 0 + isAnObjectManager = 0 + __dav_collection__ = 0 _custom_skin_scripts = ("WITH SELF COMPUTE portal_object_id=_.getattr(self, 'zapp_portal_id')", *************** *** 375,378 **** --- 378,386 ---- + def objectValues(self, spec=None): + return () + + objectIds=objectItems=objectValues + def getFSRoot(self, app=None): """ *************** *** 429,433 **** if self.fs_object is None: ! self.fs_container.manage_addImage(id=newID, title=title, file=file) fileObj = getattr(self.fs_container, newID, None) else: --- 437,441 ---- if self.fs_object is None: ! self.fs_container.manage_addFile(id=newID, title=title, file=file) fileObj = getattr(self.fs_container, newID, None) else: *************** *** 450,454 **** """ fsObj = self.fs_object ! return fsObj and fsObj.index_html(REQUEST=REQUEST, RESPONSE=RESPONSE) def PUT(self, REQUEST, RESPONSE): --- 458,462 ---- """ fsObj = self.fs_object ! return fsObj and fsObj.index_html(REQUEST, RESPONSE) def PUT(self, REQUEST, RESPONSE): *************** *** 457,461 **** newID = self.getId() if self.fs_object is None: ! self.fs_container.manage_addImage(id=newID, title=self.Title(), file=None) if newID in self.fs_container.objectIds(): fileObj = getattr(self.fs_container, newID, None) --- 465,469 ---- newID = self.getId() if self.fs_object is None: ! self.fs_container.manage_addFile(id=newID, title=self.Title(), file=None) if newID in self.fs_container.objectIds(): fileObj = getattr(self.fs_container, newID, None) *************** *** 467,477 **** fileObj.PUT( REQUEST, RESPONSE) ! def manage_FTPget(self, REQUEST=None, RESPONSE=None): ! """ ! Implement ftp get.... ! """ ! fileObj = self.fs_object ! if fileObj: ! return fileObj.manage_FTPget(REQUEST=REQUEST, RESPONSE=RESPONSE) def zcmf_copyToCurrPath( self, oldSelf ): --- 475,479 ---- fileObj.PUT( REQUEST, RESPONSE) ! manage_FTPget = index_html def zcmf_copyToCurrPath( self, oldSelf ): *************** *** 520,523 **** --- 522,554 ---- os.system("mv %s %s" % (oldMetaPath, newMetaPath)) + def get_size(self): + """Get the size of a file or image. + + Returns the size of the file or image. + """ + size = 0 + if self.fs_object: + size = self.fs_object.get_size() + + return size + + # deprecated; use get_size! + getSize=get_size + + def getContentType(self): + """Get the content type of a file or image. + + Returns the content type (MIME type) of a file or image. + """ + return self.content_type + + def __str__(self): + if self.fs_object: + return str(self.fs_object.data) + else: + return '' + + def __len__(self): return 1 + extendProperties(ZApp_CMF_FSObject, []) *************** *** 528,531 **** --- 559,609 ---- _custom_skin_scripts = ( "WITH SELF COMPUTE graphic_url=self.fs_object_url",) + def edit_fs_object(self, id='', title='', file=None, REQUEST=None): + """ + edit the FS object + """ + + if not file: + file = REQUEST and REQUEST.form.get('file',None) + + oldID = self.getId() + newID, newTitle = self.zapp_cook_id( id, title, file ) + + if self.fs_object is None: + self.fs_container.manage_addImage(id=newID, title=title, file=file) + else: + if newID != oldID: + self.fs_container.manage_renameObjects((oldID,), (newID,)) + + fileObj = getattr(self.fs_container, newID, None) + + # + # this allows folks to edit the id/title of an image without requiring a fresh upload.. + # + + if file: + fileObj.manage_upload(file) + self.content_type = fileObj.content_type + self.width = fileObj.width + self.height = fileObj.height + + + return oldID, newID, newTitle + + def PUT(self, REQUEST, RESPONSE): + """Handle HTTP PUT requests""" + + newID = self.getId() + if self.fs_object is None: + self.fs_container.manage_addImage(id=newID, title=self.Title(), file=None) + if newID in self.fs_container.objectIds(): + fileObj = getattr(self.fs_container, newID, None) + else: + fileObj = None + else: + fileObj = self.fs_object + + fileObj.PUT( REQUEST, RESPONSE) + extendProperties(ZApp_CMF_FSImage, []) *************** *** 537,540 **** --- 615,621 ---- zapp_cmf_type = 1 isPrincipiaFolderish = 0 + isAnObjectManager = 0 + __dav_collection__ = 0 + __implements__ = ( |
|
From: Steve S. <ssp...@us...> - 2004-03-28 22:26:08
|
Update of /cvsroot/zapp/ZApp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21319 Modified Files: ZApp_Application.py ZApp_CMFBase.py ZApp_RelationshipManager.py __init__.py Log Message: added FSFolder class Index: ZApp_Application.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_Application.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** ZApp_Application.py 21 Mar 2004 13:08:17 -0000 1.33 --- ZApp_Application.py 28 Mar 2004 22:14:47 -0000 1.34 *************** *** 194,197 **** --- 194,198 ---- {'id':'zapp_app_id','type':'string','mode':''}, {'id':'zapp_portal_id','type':'string','mode':''}, + {'id':'zapp_fSystem_id','type':'string','mode':'w'}, ) *************** *** 203,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): ! ob = getattr(self, name, _marker) if ob is _marker: --- 204,215 ---- manage_leverActionsForm = DTMLFile('manage_ui/leverActionsForm',globals(),management_view='Lever Actions') manage_leverResults = DTMLFile('manage_ui/leverResults',globals(),management_view='Lever Actions') + zapp_fSystem_id = 'fSystem' # id of localFS object for filesystem based objects... + def __bobo_traverse__(self, REQUEST, name): ! """ ! This is a bit of hackery that allows us to embed namespace values in an url (e.g., portal_skin). ! """ ob = getattr(self, name, _marker) if ob is _marker: *************** *** 397,400 **** --- 401,410 ---- return self + def getFSystemObject(self): + """ + return filesystem object, or None + """ + return getattr(self, self.zapp_fSystem_id, None) + def getException(self): """ *************** *** 508,512 **** continue spec = spec.__of__(leverMethod) ! for rack in spec.rackList: rack = rack.__of__(spec) resultList.append("checking rack: " + `rack`) --- 518,527 ---- continue spec = spec.__of__(leverMethod) ! if leverName=='skinScriptLever': ! rackList = spec.rackList ! else: ! rackList = [spec.defaultRack] ! ! for rack in rackList: rack = rack.__of__(spec) resultList.append("checking rack: " + `rack`) Index: ZApp_CMFBase.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** ZApp_CMFBase.py 22 Mar 2004 17:24:21 -0000 1.39 --- ZApp_CMFBase.py 28 Mar 2004 22:14:47 -0000 1.40 *************** *** 78,83 **** _insertQueryPrefix = 'self.checkDups() and ' - manage_options = SkinnedFolder.manage_options - displayCustomUpdate_pt = PageTemplateFile('zpt/CMF_displayRelatedObjects', globals()) --- 78,81 ---- *************** *** 264,268 **** item.ZAppCMF_afterAdd( safeStorage, newID ) ! 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. --- 262,282 ---- item.ZAppCMF_afterAdd( safeStorage, newID ) ! def ZAppRecusionLock_checkSet(self): ! """ ! check for already being in manage_afterAdd() ! """ ! if getattr(self,'_v_in_manage_afterAdd',0): ! return 0 ! else: ! self._v_in_manage_afterAdd = 1 ! return 1 ! ! def ZAppRecursionLock_clear(self): ! """ ! clear the recursion lock. ! """ ! del self._v_in_manage_afterAdd ! ! def ZAppBase_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. *************** *** 271,282 **** 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() --- 285,296 ---- safeStorageID = getattr(self, '_v_safeStorageID','') newID = self.calcPathID() ! checkRecursion = self.ZAppRecusionLock_checkSet() ! ! ZApp_LOG("_manage_afterAdd: " + self.getId() + ":" + safeStorageID + ":_v_in_manage_afterAdd:" + `checkRecursion`, dbug_level) ! ! if not checkRecursion: ! return checkRecursion ! if safeStorageID: mdm = self.getMiscDataSpecialist() *************** *** 291,298 **** 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): --- 305,321 ---- get_transaction().commit(1) ! return checkRecursion ! def manage_afterAdd(self, item, container): ! """ ! Do manage_afterAdd ! """ ! checkRecursion = self.ZAppBase_manage_afterAdd(item, container) ! ! if not checkRecursion: ! SkinnedFolder.manage_afterAdd(self, item, container) ! ZApp_Base.manage_afterAdd(self, item, container) ! ! self.ZAppRecursionLock_clear() def copyObjectRelations(self, theObjectRelations): *************** *** 314,320 **** --- 337,366 ---- extendProperties(ZApp_CMFBase, props) + class ZApp_CMF_FSFolder( ZApp_CMFBase): + """ + Folder with special skinnable PUT hook to handle ZApp media. + """ + meta_type = 'ZApp CMF Media Folder' + + _properties=({'id':'title', 'type': 'string', 'mode':'w'}, + {'id':'preferredMediaType','type':'string','mode':'w'}, + ) + + class_default_for_preferredMediaType = 'ZApp CMF Image' + + def PUT_factory( self, name, typ, body ): + """ + if it's an image, create our preferred media type to handle it. + """ + if typ.startswith('image') or typ.startswith('application'): + self.invokeFactory( self.preferredMediaType, name ) + obj = aq_base( self._getOb( name ) ) + self._delObject( name ) + return obj + class ZApp_CMF_FSObject( ZApp_CMFBase ): meta_type = 'ZApp CMF FSObject' + isPrincipiaFolderish = 0 _custom_skin_scripts = ("WITH SELF COMPUTE portal_object_id=_.getattr(self, 'zapp_portal_id')", *************** *** 322,329 **** "WITH SELF COMPUTE fs_object_relpath='%s/%s/%s' % (self.getPhysicalPath()[1], self.portal_object_id, self.cmfdataid[1:].replace(',','/'))", "WITH SELF COMPUTE fs_object_url=self.findApplication().absolute_url() + '/fSystem/' + self.fs_object_relpath", ! "WITH SELF COMPUTE fs_root_object=self.findApplication().fSystem", "WITH SELF COMPUTE fs_object_path='%s/%s' % (self.fs_root_object.basepath, self.fs_object_relpath)", ) ! def zcmf_copyToCurrPath( self, oldSelf ): """ --- 368,478 ---- "WITH SELF COMPUTE fs_object_relpath='%s/%s/%s' % (self.getPhysicalPath()[1], self.portal_object_id, self.cmfdataid[1:].replace(',','/'))", "WITH SELF COMPUTE fs_object_url=self.findApplication().absolute_url() + '/fSystem/' + self.fs_object_relpath", ! "WITH SELF COMPUTE fs_root_object=self.getFSRoot()", "WITH SELF COMPUTE fs_object_path='%s/%s' % (self.fs_root_object.basepath, self.fs_object_relpath)", + "WITH SELF COMPUTE fs_container=self.getCurrFolder()", + "WITH SELF COMPUTE fs_object=self.getFSObject()", ) ! ! ! def getFSRoot(self, app=None): ! """ ! get root filesystem object. ! """ ! if app is None: ! app = self.findApplication() ! return app.getFSystemObject() ! ! def getCurrFolder(self): ! """ ! get the 'folder object' that contains me ! """ ! currFolder = self.fs_root_object ! path = self.getPhysicalPath() ! portal = self.portal_object ! ! for folder in path[1:-1]: ! if folder in currFolder.objectIds('Folder'): ! fsFolder = getattr(currFolder, folder, None) ! else: ! currFolder.manage_addFolder(folder) ! fsFolder = getattr( currFolder, folder, None) ! ! if not fsFolder: ! raise RuntimeError, "Can't create folder!" ! ! currFolder = fsFolder ! ! return currFolder ! ! def getFSObject(self): ! """ ! return the Filesystem based object that holds my 'data'. ! """ ! ! if self.getId() in self.fs_container.objectIds(): ! theFSObject = getattr(self.fs_container, self.getId(), None) ! else: ! theFSObject = None ! ! return theFSObject ! ! def edit_fs_object(self, id='', title='', file=None, REQUEST=None): ! """ ! edit the FS object ! """ ! ! if not file: ! file = REQUEST and REQUEST.form.get('file',None) ! ! oldID = self.getId() ! newID, newTitle = self.zapp_cook_id( id, title, file ) ! ! if self.fs_object is None: ! self.fs_container.manage_addImage(id=newID, title=title, file=file) ! fileObj = getattr(self.fs_container, newID, None) ! else: ! if newID != oldID: ! self.fs_container.manage_renameObjects((oldID,), (newID,)) ! ! fileObj = getattr(self.fs_container, newID, None) ! ! # ! # this allows folks to edit the id/title of an image without requiring a fresh upload.. ! # ! if file: ! fileObj.manage_upload(file) ! ! return oldID, newID, newTitle ! ! def index_html(self, REQUEST=None, RESPONSE=None): ! """ ! render image. ! """ ! fsObj = self.fs_object ! return fsObj and fsObj.index_html(REQUEST=REQUEST, RESPONSE=RESPONSE) ! ! def PUT(self, REQUEST, RESPONSE): ! """Handle HTTP PUT requests""" ! ! newID = self.getId() ! if self.fs_object is None: ! self.fs_container.manage_addImage(id=newID, title=self.Title(), file=None) ! if newID in self.fs_container.objectIds(): ! fileObj = getattr(self.fs_container, newID, None) ! else: ! fileObj = None ! else: ! fileObj = self.fs_object ! ! fileObj.PUT( REQUEST, RESPONSE) ! ! def manage_FTPget(self, REQUEST=None, RESPONSE=None): ! """ ! Implement ftp get.... ! """ ! fileObj = self.fs_object ! if fileObj: ! return fileObj.manage_FTPget(REQUEST=REQUEST, RESPONSE=RESPONSE) ! def zcmf_copyToCurrPath( self, oldSelf ): """ *************** *** 381,384 **** --- 530,573 ---- extendProperties(ZApp_CMF_FSImage, []) + from Products.CMFDefault.Image import Image + + class ZApp_CMF_ZODBImage( ZApp_CMFBase, Image): + + meta_type = 'ZApp CMF Image' + zapp_cmf_type = 1 + isPrincipiaFolderish = 0 + + __implements__ = ( + Image.__implements__, + ) + + + manage_options = ( + { 'label' : 'Dublin Core' + , 'action' : 'manage_metadata' + } + ,) \ + + SkinnedFolder.manage_options + + 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 ' + + displayCustomUpdate_pt = PageTemplateFile('zpt/CMF_displayRelatedObjects', globals()) + + def manage_afterAdd(self, item, container): + """ + Do manage_afterAdd + """ + checkRecursion = self.ZAppBase_manage_afterAdd(item, container) + + if not checkRecursion: + Image.manage_afterAdd(self, item, container) + ZApp_Base.manage_afterAdd(self, item, container) + + self.ZAppRecursionLock_clear() + from DateTime import DateTime *************** *** 400,406 **** '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', --- 589,595 ---- 'meta_type' : ZApp_CMF_FSImage.meta_type, 'product': 'ZApp', ! 'description':'Image Content type based on ZApp objects using LocalFS for filesystem storage', 'icon':'image_icon.gif', ! 'factory': 'addZAppCMFFSImage', 'immediate_view': 'zapp_image_edit_form', 'actions': ({'id': 'view', *************** *** 433,436 **** --- 622,668 ---- ), }, + {'id': 'ZApp CMF ImageFolder', + 'title':'', + 'meta_type' : ZApp_CMF_FSFolder.meta_type, + 'product': 'ZApp', + 'description':'Portal Folder for Images with ZApp PUT hook (defaults to create ZApp CMF Image objects)', + 'icon':'folder_icon.gif', + 'factory': 'addZAppCMFFSFolder', + 'immediate_view': 'zapp_cmf_object_edit_form', + 'filter_content_types' : 1, + 'allowed_content_types':('ZApp CMF Image',), + 'actions': ({'id': 'view', + 'name': 'View', + 'action': 'zapp_cmf_object_view', + 'permissions': (CMFCorePermissions.View,), + }, + {'id': 'edit', + 'name': 'Edit', + 'action': 'zapp_cmf_object_edit_form', + 'permissions': (CMFCorePermissions.ModifyPortalContent,), + }, + { 'id' : 'subobjects' + , 'name' : 'SubObjects' + , 'action': 'string:${object_url}/folder_contents' + , 'permissions' : (CMFCorePermissions.View,)}, + { 'id' : 'metadata' + , 'name' : 'Metadata' + , 'action': 'string:${object_url}/metadata_edit_form' + , 'permissions' : (CMFCorePermissions.ModifyPortalContent,), + }, + { 'id' : 'xml' + , 'name' : 'XML' + , 'action': 'string:${object_url}/zapp_cmf_xml_form' + , 'permissions' : (CMFCorePermissions.ManagePortal,) + , 'visible' : 1, + }, + { 'id' : 'relations' + , 'name' : 'Relationships' + , 'action': 'string:${object_url}/zapp_cmf_view_relations' + , 'permissions' : (CMFCorePermissions.ManagePortal,) + , 'visible' : 1, + }, + ), + }, {'id': 'ZApp CMF Content', 'title':'', *************** *** 441,444 **** --- 673,677 ---- 'factory': 'addZAppCMFObject', 'immediate_view': 'zapp_cmf_object_view', + 'filter_content_types' : 1, 'actions': ({'id': 'view', 'name': 'View', *************** *** 515,526 **** 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) --- 748,770 ---- o.change() ! if klass not in [ZApp_CMFBase, ZApp_CMF_FSObject, ZApp_CMF_FSImage, ZApp_CMF_FSFolder, ZApp_CMF_ZODBImage]: return o + def addZAppCMFFSImage(self, id, title='', klass=ZApp_CMF_FSImage, useExisting=1): + """ + add a CMF_FSImage object.. pass in the right class... + """ + return addZAppCMFObject(self, id, title, klass, useExisting) ! def addZAppCMFImage(self, id, title='', klass=ZApp_CMF_ZODBImage, useExisting=1): ! """ ! add a CMF_ZODBImage object.. pass in the right class... ! """ ! return addZAppCMFObject(self, id, title, klass, useExisting) ! ! def addZAppCMFFSFolder(self, id, title='', klass=ZApp_CMF_FSFolder, 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.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** __init__.py 15 Feb 2004 15:58:53 -0000 1.24 --- __init__.py 28 Mar 2004 22:14:47 -0000 1.25 *************** *** 55,64 **** 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) --- 55,65 ---- context.registerBaseClass(ZApp_CMFBase.ZApp_CMFBase) context.registerBaseClass(ZApp_CMFBase.ZApp_CMF_FSImage) + context.registerBaseClass(ZApp_CMFBase.ZApp_CMF_FSFolder) utils.ContentInit( 'ZApp CMF Content', ! content_types = (ZApp_CMFBase.ZApp_CMFBase, ZApp_CMFBase.ZApp_CMF_FSImage, ZApp_CMFBase.ZApp_CMF_ZODBImage, ZApp_CMFBase.ZApp_CMF_FSFolder), permission = AddPortalContent, ! extra_constructors = (ZApp_CMFBase.addZAppCMFObject, ZApp_CMFBase.addZAppCMFFSImage, ZApp_CMFBase.addZAppCMFImage, ZApp_CMFBase.addZAppCMFFSFolder), fti=ZApp_CMFBase.factory_type_information, ).initialize(context) *************** *** 76,80 **** context.registerHelpTitle('ZApp Help') - from Products.CMFCore.DirectoryView import registerDirectory, registerFileExtension from Products.CMFCore.FSFile import FSFile --- 77,80 ---- Index: ZApp_RelationshipManager.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_RelationshipManager.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ZApp_RelationshipManager.py 28 Oct 2003 20:27:03 -0000 1.5 --- ZApp_RelationshipManager.py 28 Mar 2004 22:14:47 -0000 1.6 *************** *** 298,301 **** --- 298,303 ---- rRoles = getattr(ob, rRolesID) + rItems.manage_changeProperties(zapp_spec_order='aRelationshipItems') # make sure it comes after 'Relationships' and 'RelationshipRoles' + if (leverSet == 'ZODB_Lever_Methods'): rItems.defaultRack.manage_setStorage(zclass='Products.ZApp.ZApp_RelationshipItem/ZApp_RelationshipItem', use_attrib='NO', load_attrib='') *************** *** 317,320 **** --- 319,324 ---- theApp.manage_changeProperties( specialistMetaTypes = oldList + [ZApp_RelationshipManager.meta_type]) + + if REQUEST: return self.manage_main(self,REQUEST,update_menu=1) |
|
From: Steve S. <ssp...@us...> - 2004-03-28 22:26:08
|
Update of /cvsroot/zapp/ZApp/skins/zapp_generic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21319/skins/zapp_generic Modified Files: zapp_image_edit.py Log Message: added FSFolder class Index: zapp_image_edit.py =================================================================== RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_image_edit.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** zapp_image_edit.py 16 Jan 2004 09:55:34 -0000 1.2 --- zapp_image_edit.py 28 Mar 2004 22:14:47 -0000 1.3 *************** *** 11,50 **** 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 ! for folder in path[1:-1]: ! if folder in currFolder.objectIds('Folder'): ! fsFolder = getattr(currFolder, folder, None) ! else: ! currFolder.manage_addFolder(folder) ! fsFolder = getattr( currFolder, folder, None) ! ! if not fsFolder: ! raise RuntimeError, "Can't create folder!" ! ! 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)) --- 11,17 ---- REQUEST = context.REQUEST ! oldID, newID, newTitle = context.edit_fs_object( id=REQUEST.get('id',''), title=REQUEST.get('title',''), file=REQUEST.form.get('file',None)) REQUEST.RESPONSE.redirect( "%s/folder_rename?ids:list=%s&new_ids:list=%s&new_titles:list=%s" % (REQUEST.get('URL2'), oldID, newID, newTitle)) |
|
From: Steve S. <ssp...@us...> - 2004-03-22 18:43:29
|
Update of /cvsroot/zapp/ZApp/skins/zapp_generic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22762/skins/zapp_generic Modified Files: zapp_cmf_object_edit_form.pt Log Message: make text areas a bit bigger by default 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.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** zapp_cmf_object_edit_form.pt 21 Jan 2004 12:26:48 -0000 1.7 --- zapp_cmf_object_edit_form.pt 22 Mar 2004 18:33:08 -0000 1.8 *************** *** 59,63 **** <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> </table> --- 59,63 ---- <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="10" cols="60"/></td></tr> </table> *************** *** 84,88 **** <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> --- 84,88 ---- <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="10" cols="60"/> <input tal:condition="python:propType in ['boolean']" type="checkbox" value="1" tal:attributes="name string:${propName}.${subPropName}:int:record; checked propValue"> </td> *************** *** 104,108 **** <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"/> </span> --- 104,108 ---- <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="10" cols="60"/> </span> |
|
From: Steve S. <ssp...@us...> - 2004-03-22 17:34:41
|
Update of /cvsroot/zapp/ZApp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7200 Modified Files: ZApp_CMFBase.py Log Message: fixed bug in zapp_cmf_image copy/paste Index: ZApp_CMFBase.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** ZApp_CMFBase.py 21 Mar 2004 13:33:56 -0000 1.38 --- ZApp_CMFBase.py 22 Mar 2004 17:24:21 -0000 1.39 *************** *** 332,336 **** oldPath = oldSelf.fs_object_path newPath = self.fs_object_path ! os.system("cp %s %s" % (oldPath, newPath)) def zcmf_moveToCurrPath( self, oldSelf ): --- 332,350 ---- oldPath = oldSelf.fs_object_path newPath = self.fs_object_path ! ! oldDir, oldFile = os.path.split(oldPath) ! newDir, newFile = os.path.split(newPath) ! ! oldMetaPath = os.path.join(oldDir, ".%s,z" % oldFile) ! newMetaPath = os.path.join(newDir, ".%s,z" % newFile) ! ! if os.path.isfile(oldPath): ! if not os.path.isdir(newDir): ! os.makedirs( newDir ) ! ! os.system("cp %s %s" % (oldPath, newPath)) ! ! if os.path.isfile(oldMetaPath): ! os.system("cp %s %s" % (oldMetaPath, newMetaPath)) def zcmf_moveToCurrPath( self, oldSelf ): *************** *** 338,351 **** for move operation.... copy old fs object to new location. """ oldPath = oldSelf.fs_object_path newPath = self.fs_object_path oldDir, oldFile = os.path.split(oldPath) newDir, newFile = os.path.split(newPath) ! ! if not os.path.isDir(newDir): ! os.makedirs( newDIr ) ! ! os.system("mv %s %s" % (oldPath, newPath)) ! extendProperties(ZApp_CMF_FSObject, []) --- 352,374 ---- for move operation.... copy old fs object to new location. """ + oldPath = oldSelf.fs_object_path newPath = self.fs_object_path + oldDir, oldFile = os.path.split(oldPath) newDir, newFile = os.path.split(newPath) ! ! oldMetaPath = os.path.join(oldDir, ".%s,z" % oldFile) ! newMetaPath = os.path.join(newDir, ".%s,z" % newFile) ! ! if os.path.isfile(oldPath): ! if not os.path.isdir(newDir): ! os.makedirs( newDir ) ! ! os.system("mv %s %s" % (oldPath, newPath)) ! ! if os.path.isfile(oldMetaPath): ! os.system("mv %s %s" % (oldMetaPath, newMetaPath)) ! extendProperties(ZApp_CMF_FSObject, []) *************** *** 384,396 **** 'name': 'View', 'action': 'zapp_image_view', ! 'permissions': (CMFCorePermissions.View,)}, {'id': 'edit', 'name': 'Edit', 'action': 'zapp_image_edit_form', ! 'permissions': (CMFCorePermissions.ModifyPortalContent,)}, { 'id' : 'metadata' , 'name' : 'Metadata' , 'action': 'string:${object_url}/metadata_edit_form' ! , 'permissions' : (CMFCorePermissions.ModifyPortalContent,)}, ), }, --- 407,434 ---- 'name': 'View', 'action': 'zapp_image_view', ! 'permissions': (CMFCorePermissions.View,), ! }, {'id': 'edit', 'name': 'Edit', 'action': 'zapp_image_edit_form', ! 'permissions': (CMFCorePermissions.ModifyPortalContent,), ! }, { 'id' : 'metadata' , 'name' : 'Metadata' , 'action': 'string:${object_url}/metadata_edit_form' ! , 'permissions' : (CMFCorePermissions.ModifyPortalContent,), ! }, ! { 'id' : 'xml' ! , 'name' : 'XML' ! , 'action': 'string:${object_url}/zapp_cmf_xml_form' ! , 'permissions' : (CMFCorePermissions.ManagePortal,) ! , 'visible' : 1, ! }, ! { 'id' : 'relations' ! , 'name' : 'Relationships' ! , 'action': 'string:${object_url}/zapp_cmf_view_relations' ! , 'permissions' : (CMFCorePermissions.ManagePortal,) ! , 'visible' : 1, ! }, ), }, |
|
From: Steve S. <ssp...@us...> - 2004-03-22 14:36:23
|
Update of /cvsroot/zapp/ZApp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30086 Modified Files: version.txt Log Message: prepare a release Index: version.txt =================================================================== RCS file: /cvsroot/zapp/ZApp/version.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** version.txt 28 Mar 2003 06:32:22 -0000 1.1 --- version.txt 22 Mar 2004 14:26:04 -0000 1.2 *************** *** 1 **** ! Unreleased ($Revision$) \ No newline at end of file --- 1 ---- ! ZApp ($Revision$) \ No newline at end of file |
|
From: Steve S. <ssp...@us...> - 2004-03-22 03:48:02
|
Update of /cvsroot/zapp/ZApp/skins/zapp_generic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4125/skins/zapp_generic Modified Files: zapp_cmf_xml_form.pt Log Message: allow xml form to clear old xml for some data type Index: zapp_cmf_xml_form.pt =================================================================== RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_cmf_xml_form.pt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** zapp_cmf_xml_form.pt 19 Mar 2004 15:53:32 -0000 1.2 --- zapp_cmf_xml_form.pt 22 Mar 2004 03:37:48 -0000 1.3 *************** *** 39,42 **** --- 39,43 ---- <form action="" tal:attributes="action string:${here/absolute_url}/zapp_cmf_xml_edit" method="post"> Data Type (edit to create new data type): <input name="dataType" tal:attributes="value dataType"><br> + Clean old xml before saving: <input type="checkbox" name="clearFlag:int" value="1"><br> <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"/> |
|
From: Steve S. <ssp...@us...> - 2004-03-21 13:44:09
|
Update of /cvsroot/zapp/ZApp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30070 Modified Files: ZApp_CMFBase.py Log Message: add graphic_url alias for fs_object_url Index: ZApp_CMFBase.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** ZApp_CMFBase.py 21 Mar 2004 13:08:18 -0000 1.37 --- ZApp_CMFBase.py 21 Mar 2004 13:33:56 -0000 1.38 *************** *** 348,357 **** os.system("mv %s %s" % (oldPath, newPath)) ! extendProperties(ZApp_CMF_FSObject, []) class ZApp_CMF_FSImage( ZApp_CMF_FSObject): meta_type = 'ZApp CMF FSImage' ! from DateTime import DateTime --- 348,361 ---- os.system("mv %s %s" % (oldPath, newPath)) ! extendProperties(ZApp_CMF_FSObject, []) class ZApp_CMF_FSImage( ZApp_CMF_FSObject): meta_type = 'ZApp CMF FSImage' ! ! _custom_skin_scripts = ( "WITH SELF COMPUTE graphic_url=self.fs_object_url",) ! ! extendProperties(ZApp_CMF_FSImage, []) ! from DateTime import DateTime |
|
From: Steve S. <ssp...@us...> - 2004-03-21 13:18:30
|
Update of /cvsroot/zapp/ZApp/leverMethods/PG In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26043/leverMethods/PG Modified Files: createSchemaLever.plain deleteItemLever.plain dropSchemaLever.plain insertItemLever.plain newKeyLever.plain selectItemLever.plain skinScriptLever.plain updateItemLever.plain Log Message: allow rack specific customizations Index: skinScriptLever.plain =================================================================== RCS file: /cvsroot/zapp/ZApp/leverMethods/PG/skinScriptLever.plain,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** skinScriptLever.plain 3 Jul 2003 18:05:07 -0000 1.7 --- skinScriptLever.plain 21 Mar 2004 13:08:19 -0000 1.8 *************** *** 15,21 **** skinName='dataScript' specialist = context.aq_parent ! primaryKey = specialist.getPrimaryKey() ! primaryKeyGenerator = specialist.ZApp_getPrimaryKeyGenerator() initString = 'INITIALIZE OBJECT WITH ' --- 15,22 ---- skinName='dataScript' specialist = context.aq_parent + rackID=context.getId() ! primaryKey = specialist.getPrimaryKey(rackID=rackID) ! primaryKeyGenerator = specialist.ZApp_getPrimaryKeyGenerator(rackID=rackID) initString = 'INITIALIZE OBJECT WITH ' *************** *** 32,36 **** changeList = [] ! pm = specialist.ZApp_getPropertyMap() for item in pm: --- 33,37 ---- changeList = [] ! pm = specialist.ZApp_getPropertyMap(rackID=rackID) for item in pm: *************** *** 64,68 **** computeString = computeString + string.join(computeList, ', ') addedString = addedString + string.join(saveList,', ') + ')' ! customScripts = specialist.ZApp_getCustomSkinScripts() if initList: --- 65,69 ---- computeString = computeString + string.join(computeList, ', ') addedString = addedString + string.join(saveList,', ') + ')' ! customScripts = specialist.ZApp_getCustomSkinScripts(rackID=rackID) if initList: Index: createSchemaLever.plain =================================================================== RCS file: /cvsroot/zapp/ZApp/leverMethods/PG/createSchemaLever.plain,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** createSchemaLever.plain 8 Jan 2004 15:26:51 -0000 1.10 --- createSchemaLever.plain 21 Mar 2004 13:08:19 -0000 1.11 *************** *** 6,10 **** Id: createSchemaLever Meta-Type: Script (Python) ! Parameters: dbName='', sqlName='createSchema', catalogName='' Permissions: Proxy-Roles: --- 6,10 ---- Id: createSchemaLever Meta-Type: Script (Python) ! Parameters: dbName='', sqlName='createSchema', catalogName='', rackName='defaultRack' Permissions: Proxy-Roles: Index: updateItemLever.plain =================================================================== RCS file: /cvsroot/zapp/ZApp/leverMethods/PG/updateItemLever.plain,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** updateItemLever.plain 18 Mar 2004 19:02:42 -0000 1.10 --- updateItemLever.plain 21 Mar 2004 13:08:19 -0000 1.11 *************** *** 6,10 **** Id: updateItemLever Meta-Type: Script (Python) ! Parameters: sqlName='doUpdateItem', dbName='', catalogName='' Permissions: Proxy-Roles: --- 6,10 ---- Id: updateItemLever Meta-Type: Script (Python) ! Parameters: sqlName='doUpdateItem', dbName='', catalogName='', rackName='defaultRack' Permissions: Proxy-Roles: Index: insertItemLever.plain =================================================================== RCS file: /cvsroot/zapp/ZApp/leverMethods/PG/insertItemLever.plain,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** insertItemLever.plain 18 Mar 2004 19:02:42 -0000 1.14 --- insertItemLever.plain 21 Mar 2004 13:08:19 -0000 1.15 *************** *** 6,10 **** Id: insertItemLever Meta-Type: Script (Python) ! Parameters: sqlName='insertItem', dbName='', catalogName='' Permissions: Proxy-Roles: --- 6,10 ---- Id: insertItemLever Meta-Type: Script (Python) ! Parameters: sqlName='insertItem', dbName='', catalogName='', rackName='defaultRack' Permissions: Proxy-Roles: Index: selectItemLever.plain =================================================================== RCS file: /cvsroot/zapp/ZApp/leverMethods/PG/selectItemLever.plain,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** selectItemLever.plain 12 Jun 2003 14:00:56 -0000 1.5 --- selectItemLever.plain 21 Mar 2004 13:08:19 -0000 1.6 *************** *** 6,10 **** Id: selectItemLever Meta-Type: Script (Python) ! Parameters: sqlName='selectItem', dbName='', catalogName='' Permissions: Proxy-Roles: --- 6,10 ---- Id: selectItemLever Meta-Type: Script (Python) ! Parameters: sqlName='selectItem', dbName='', catalogName='', rackName='defaultRack' Permissions: Proxy-Roles: Index: dropSchemaLever.plain =================================================================== RCS file: /cvsroot/zapp/ZApp/leverMethods/PG/dropSchemaLever.plain,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dropSchemaLever.plain 19 Feb 2003 07:19:22 -0000 1.2 --- dropSchemaLever.plain 21 Mar 2004 13:08:19 -0000 1.3 *************** *** 6,10 **** Id: dropSchemaLever Meta-Type: Script (Python) ! Parameters: primaryKey='', sqlName='dropSchema', dbName='', catalogName='' Permissions: Proxy-Roles: --- 6,10 ---- Id: dropSchemaLever Meta-Type: Script (Python) ! Parameters: primaryKey='', sqlName='dropSchema', dbName='', catalogName='', rackName='defaultRack' Permissions: Proxy-Roles: Index: newKeyLever.plain =================================================================== RCS file: /cvsroot/zapp/ZApp/leverMethods/PG/newKeyLever.plain,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** newKeyLever.plain 14 Mar 2003 15:54:58 -0000 1.3 --- newKeyLever.plain 21 Mar 2004 13:08:19 -0000 1.4 *************** *** 6,10 **** Id: newKeyLever Meta-Type: Script (Python) ! Parameters: sqlName='newKeyQuery', dbName='MySQL_database_connection', catalogName='' Permissions: Proxy-Roles: --- 6,10 ---- Id: newKeyLever Meta-Type: Script (Python) ! Parameters: sqlName='newKeyQuery', dbName='MySQL_database_connection', catalogName='', rackName='defaultRack' Permissions: Proxy-Roles: Index: deleteItemLever.plain =================================================================== RCS file: /cvsroot/zapp/ZApp/leverMethods/PG/deleteItemLever.plain,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** deleteItemLever.plain 14 Mar 2003 15:54:58 -0000 1.3 --- deleteItemLever.plain 21 Mar 2004 13:08:19 -0000 1.4 *************** *** 6,10 **** Id: deleteItemLever Meta-Type: Script (Python) ! Parameters: primaryKey='', sqlName='deleteItem', dbName='', catalogName='' Permissions: Proxy-Roles: --- 6,10 ---- Id: deleteItemLever Meta-Type: Script (Python) ! Parameters: primaryKey='', sqlName='deleteItem', dbName='', catalogName='', rackName='defaultRack' Permissions: Proxy-Roles: |
|
From: Steve S. <ssp...@us...> - 2004-03-21 13:18:30
|
Update of /cvsroot/zapp/ZApp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26043 Modified Files: ZApp_Application.py ZApp_CMFBase.py ZApp_Specialist.py Log Message: allow rack specific customizations Index: ZApp_Application.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_Application.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** ZApp_Application.py 16 Mar 2004 20:56:30 -0000 1.32 --- ZApp_Application.py 21 Mar 2004 13:08:17 -0000 1.33 *************** *** 514,518 **** try: lever = getattr(rack, leverName) ! resultList.append(`lever(dbName=dbName, catalogName=catalogName)`) except: f = StringIO() --- 514,518 ---- try: lever = getattr(rack, leverName) ! resultList.append(`lever(dbName=dbName, catalogName=catalogName, rackName=rack.getId())`) except: f = StringIO() Index: ZApp_CMFBase.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** ZApp_CMFBase.py 21 Mar 2004 12:26:09 -0000 1.36 --- ZApp_CMFBase.py 21 Mar 2004 13:08:18 -0000 1.37 *************** *** 347,350 **** --- 347,352 ---- os.system("mv %s %s" % (oldPath, newPath)) + + extendProperties(ZApp_CMF_FSObject, []) class ZApp_CMF_FSImage( ZApp_CMF_FSObject): Index: ZApp_Specialist.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_Specialist.py,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** ZApp_Specialist.py 10 Mar 2004 20:43:56 -0000 1.38 --- ZApp_Specialist.py 21 Mar 2004 13:08:18 -0000 1.39 *************** *** 120,124 **** ) ! def getPrimaryKey(self): """ Get the primary key for the objects managed by this specialist... --- 120,124 ---- ) ! def getPrimaryKey(self, rackID='defaultRack'): """ Get the primary key for the objects managed by this specialist... *************** *** 342,346 **** return "OK!" ! def ZApp_getDefaultDictionary(self, typeString=0): """ return a dictionary with default values for each property... --- 342,346 ---- return "OK!" ! def ZApp_getDefaultDictionary(self, typeString=0, rackID='defaultRack'): """ return a dictionary with default values for each property... *************** *** 350,354 **** dict = {} ! pm = self.ZApp_getPropertyMap() if typeString: --- 350,354 ---- dict = {} ! pm = self.ZApp_getPropertyMap(rackID=rackID) if typeString: *************** *** 377,381 **** return dict ! def ZApp_getPropertyMap(self): """ return a tuple of property dictionaries for the properties of the --- 377,381 ---- return dict ! def ZApp_getPropertyMap(self, rackID='defaultRack'): """ return a tuple of property dictionaries for the properties of the *************** *** 387,437 **** return tuple(filter( lambda x:x.get('id','') != 'title', map( lambda dict: dict.copy(), ! self.ZApp_getItemClassAttr('_properties')) ) ) ! def ZApp_getIndexedAttributes(self): """ return a list of indexed attributes for this class.. """ ! return self.ZApp_getItemClassAttr('_indexed_attrs') ! def ZApp_getInsertQueryPrefix(self): """ return an insert query prefix. """ ! return self.ZApp_getItemClassAttr('_insertQueryPrefix') ! def ZApp_getCustomSkinScripts(self): """ return a list of custom skin scripts for this Specialists storage class.. """ ! return self.ZApp_getItemClassAttr('_custom_skin_scripts') ! def ZApp_getPrimaryKeyGenerator(self): """ return a primary key generator string. """ ! return self.ZApp_getItemClassAttr('_primaryKeyGenerator') ! def ZApp_getDefaultStringSize(self): """ return a default string size for dbSize... """ ! return self.ZApp_getItemClassAttr('_defaultStringSize',30) ! def ZApp_getPrimaryKeySize(self): """ return a default string size for dbSize... """ ! return self.ZApp_getItemClassAttr('_primaryKeyStringSize',40) ! def ZApp_getItemClassAttr(self, attr, default=None): """ Return the class for objects managed by this ZApp_Specialist. """ ! return self.defaultRack.getKlassAttr( attr, default ) ! def ZApp_getReferenceLookup(self): """ return a lookup table for references by objects managed --- 387,444 ---- return tuple(filter( lambda x:x.get('id','') != 'title', map( lambda dict: dict.copy(), ! self.ZApp_getItemClassAttr('_properties', rackID=rackID)) ) ) ! def ZApp_getIndexedAttributes(self, rackID='defaultRack'): """ return a list of indexed attributes for this class.. """ ! return self.ZApp_getItemClassAttr('_indexed_attrs', rackID=rackID) ! def ZApp_getInsertQueryPrefix(self, rackID='defaultRack'): """ return an insert query prefix. """ ! return self.ZApp_getItemClassAttr('_insertQueryPrefix', rackID=rackID) ! def ZApp_getCustomSkinScripts(self, rackID='defaultRack'): """ return a list of custom skin scripts for this Specialists storage class.. """ ! return self.ZApp_getItemClassAttr('_custom_skin_scripts', rackID=rackID) ! def ZApp_getPrimaryKeyGenerator(self, rackID='defaultRack'): """ return a primary key generator string. """ ! return self.ZApp_getItemClassAttr('_primaryKeyGenerator', rackID=rackID) ! def ZApp_getDefaultStringSize(self, rackID='defaultRack'): """ return a default string size for dbSize... """ ! return self.ZApp_getItemClassAttr('_defaultStringSize',30, rackID=rackID) ! def ZApp_getPrimaryKeySize(self, rackID='defaultRack'): """ return a default string size for dbSize... """ ! return self.ZApp_getItemClassAttr('_primaryKeyStringSize',40, rackID=rackID) ! def ZApp_getItemClassAttr(self, attr, default=None, rackID='defaultRack'): """ Return the class for objects managed by this ZApp_Specialist. """ ! ! missing = [] ! ! rack = getattr(self, rackID, missing) ! if rack is missing: ! return default ! ! return rack.getKlassAttr( attr, default ) ! def ZApp_getReferenceLookup(self, rackID='defaultRack'): """ return a lookup table for references by objects managed *************** *** 461,465 **** if refLookup is missing: ! refLookup = self.ZApp_getItemClassAttr('ZApp_referenceLookup', {}) if hasattr( refLookup, 'func_code' ) or hasattr( refLookup, '__call__'): --- 468,472 ---- if refLookup is missing: ! refLookup = self.ZApp_getItemClassAttr('ZApp_referenceLookup', {}, rackID=rackID) if hasattr( refLookup, 'func_code' ) or hasattr( refLookup, '__call__'): |
|
From: Steve S. <ssp...@us...> - 2004-03-21 12:36:46
|
Update of /cvsroot/zapp/ZApp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19037 Modified Files: ZApp_CMFBase.py Log Message: fixed fSystem based image/files copy/paste Index: ZApp_CMFBase.py =================================================================== RCS file: /cvsroot/zapp/ZApp/ZApp_CMFBase.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** ZApp_CMFBase.py 19 Mar 2004 15:53:30 -0000 1.35 --- ZApp_CMFBase.py 21 Mar 2004 12:26:09 -0000 1.36 *************** *** 7,10 **** --- 7,11 ---- import string import traceback + import os from Products.PageTemplates.PageTemplateFile import PageTemplateFile *************** *** 225,233 **** operation. """ - get = safeStorage.getXMLAttr op = get('operationType','') oldID = get('oldID','') mySpec = self.getMySpecialist() newRelID = self.calcPathID().split(newID)[1] oldItemID = oldID + newRelID --- 226,234 ---- operation. """ get = safeStorage.getXMLAttr op = get('operationType','') oldID = get('oldID','') mySpec = self.getMySpecialist() + myDM = self.getDataManagerFor(self, None) newRelID = self.calcPathID().split(newID)[1] oldItemID = oldID + newRelID *************** *** 235,240 **** 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()) --- 236,241 ---- ZApp_LOG("ZAppCMF_afterAdd: " + newRelID + ":" + oldItemID + ":" + mySpec.getId() + ":", dbug_level) ! if mySpec and myDM and oldItemID: ! oldSelf = myDM.getItem( oldItemID ) if oldSelf: newSelf = mySpec.ZApp_createNewItem(id=self.calcPathID()) *************** *** 252,257 **** --- 253,262 ---- # oldSelf.manage_delete() + if hasattr(self, 'zcmf_moveToCurrPath'): + self.zcmf_moveToCurrPath( oldSelf ) else: oldSelf.change(safeStorageID = '') + if hasattr(self, 'zcmf_copyToCurrPath'): + self.zcmf_copyToCurrPath( oldSelf ) for item in self.objectValues(): *************** *** 315,320 **** _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): --- 320,350 ---- _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_relpath='%s/%s/%s' % (self.getPhysicalPath()[1], self.portal_object_id, self.cmfdataid[1:].replace(',','/'))", ! "WITH SELF COMPUTE fs_object_url=self.findApplication().absolute_url() + '/fSystem/' + self.fs_object_relpath", ! "WITH SELF COMPUTE fs_root_object=self.findApplication().fSystem", ! "WITH SELF COMPUTE fs_object_path='%s/%s' % (self.fs_root_object.basepath, self.fs_object_relpath)", ) + + def zcmf_copyToCurrPath( self, oldSelf ): + """ + for copy operation.... copy old fs object to new location. + """ + oldPath = oldSelf.fs_object_path + newPath = self.fs_object_path + os.system("cp %s %s" % (oldPath, newPath)) + + def zcmf_moveToCurrPath( self, oldSelf ): + """ + for move operation.... copy old fs object to new location. + """ + oldPath = oldSelf.fs_object_path + newPath = self.fs_object_path + oldDir, oldFile = os.path.split(oldPath) + newDir, newFile = os.path.split(newPath) + + if not os.path.isDir(newDir): + os.makedirs( newDIr ) + + os.system("mv %s %s" % (oldPath, newPath)) class ZApp_CMF_FSImage( ZApp_CMF_FSObject): |
|
From: Steve S. <ssp...@us...> - 2004-03-19 16:03:23
|
Update of /cvsroot/zapp/ZApp/zpt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30660/zpt Modified Files: addRelationship_ChooseObjectManager_ui.zpt findNewRelationship_ui.zpt Added Files: CMF_displayRelatedObjects.zpt Log Message: add relationship management views to CMF display Index: addRelationship_ChooseObjectManager_ui.zpt =================================================================== RCS file: /cvsroot/zapp/ZApp/zpt/addRelationship_ChooseObjectManager_ui.zpt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** addRelationship_ChooseObjectManager_ui.zpt 8 Oct 2003 20:36:28 -0000 1.1 --- addRelationship_ChooseObjectManager_ui.zpt 19 Mar 2004 15:53:32 -0000 1.2 *************** *** 4,7 **** --- 4,8 ---- tal:define="managerIDs here/findSpecialistsForRelationship"> + <input type="hidden" name="responseURL" value="" tal:attributes="value request/responseURL | default"> <table tal:condition="managerIDs"> <tr><td>Manager</td><td><select name="objectManager"><option value=""></option> Index: findNewRelationship_ui.zpt =================================================================== RCS file: /cvsroot/zapp/ZApp/zpt/findNewRelationship_ui.zpt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** findNewRelationship_ui.zpt 16 Dec 2003 17:19:44 -0000 1.3 --- findNewRelationship_ui.zpt 19 Mar 2004 15:53:33 -0000 1.4 *************** *** 9,13 **** dummy python:request.set('formParams',{'action':'createAndAddObject_ui', 'submit':'Create Relationship', 'method':'post', 'hiddenFormItems':[{'name':'objectManager', 'value':objectManager}, ! {'name':'createIfNone:int', 'value':'1'}], 'formItems':[{'name':'objectRole', 'value':'', 'label':'Object Role'},]});"> --- 9,15 ---- dummy python:request.set('formParams',{'action':'createAndAddObject_ui', 'submit':'Create Relationship', 'method':'post', 'hiddenFormItems':[{'name':'objectManager', 'value':objectManager}, ! {'name':'createIfNone:int', 'value':'1'}, ! {'name':'responseURL', 'value':request.get('responseURL','')}, ! ], 'formItems':[{'name':'objectRole', 'value':'', 'label':'Object Role'},]});"> --- NEW FILE: CMF_displayRelatedObjects.zpt --- <div tal:define="app python:here.findApplication(); appURL app/absolute_url; portal python:getattr(app, app.zapp_portal_id, ''); objRelations python:here.objectRelations( returnObjects=1 ); managerIDs here/findSpecialistsForRelationship"> <span tal:condition="portal"> <tal:block tal:omit-tag="" tal:define="relURL python:here.calcPathID().replace(',','/')[1:]"> <a tal:attributes="href string:${portal/absolute_url}/${relURL}">Portal View</a> </tal:block></span> <form action="" tal:attributes="action request/URL1" method="post"> <table > <tr tal:condition="objRelations"><td> </td><td>Manager</td><td>ObjectID</td><td>Info</td><td>Context ID</td></tr> <tr tal:condition="objRelations" tal:repeat="objRelation objRelations"> <span tal:omit-tag="" tal:define="otherObject python:objRelation.get('otherObject',None)"> <input type="hidden" name="relationInfo.otherRIID:records" tal:attributes="value objRelation/otherRIID"> <td><input name="ids:list" type=checkbox value="" tal:attributes="value objRelation/otherRIID"/></td> <td tal:content="objRelation/otherManagerID"/> <td><a tal:content="objRelation/otherObjectID" tal:attributes="href string:${objRelation/otherObject/absolute_url}/displayUpdateForm_html"/></td> <td tal:content="otherObject/Info | otherObject/name | otherObject/description | otherObject/objectType | nothing"/> <td><input name="relationInfo.contextID:records" tal:attributes="value objRelation/otherContextID"/></td> </span> </tr> <tr tal:condition="objRelations"><td colspan="3"> <input type="submit" value="Delete Relation" name="removeObjectRelations_ui:method"> <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> </form> </div> |