[ZCM] [ZC] 1214/ 1 Request "Possible Bug in CopySupport "
Collector: Zope Bugs, Features,
and Patches ...
zope-coders-admin at zope.org
Sat Jan 31 20:53:33 EST 2004
Issue #1214 Update (Request) "Possible Bug in CopySupport "
Status Pending, Zope/bug critical
To followup, visit:
http://zope.org/Collectors/Zope/1214
==============================================================
= Request - Entry #1 by iaclem on Jan 31, 2004 8:53 pm
Uploaded: "ZReportEngine.py"
- http://zope.org/Collectors/Zope/1214/ZReportEngine.py/view
>I am currently undertaking my final year project at University and I have hit a major >problem
>I am fairly certain itâs a bug in Zope but my knowledge of Zope is not good enough >to be certain. I am fast running out of time for my project and would greatly >appreciate any help or advice people could offer.
>Background:
>I have developed a Report Engine product for Zope. Essentially you upload and >XML file using the ZMI which has certain tags like â database connection, report >expression, report table, report graph. These tags are matched to python classes >which create a report script which when triggered uploads graphs and a report data >file(xml) into a report engine folder. Report templates (xsl) are stored in a special >folder in the Report Engine ZMI and are then used to generate web pages using the >report data file. The report engine has an automatic archive feature which removes >old report files and then pastes them into an archive folder so the >current_report_folder is empty and ready to hold a newly generated report.
>If I generate a report one at a time from a zope python script e.g. call a report engine >method called generateReport(args, REQUEST) it works fine. Old reports are cut >and pasted into the relevant archive folder and the new graph images and xml files >are then uploaded in the current_report folder. However if I have a loop in a zope >python script and call my generateReport method more than once I hit problems.
>From what I understand the first report call will run fine however when I make a >subsequent call to the method (More than one call in the same request) I get an error >informing me that I cannot Cut an object in my current_report folder. This means >that my archive method is failing because Zope is saying an object it is unmoveable. >The method - cb_isMoveable in CopySuppport.py is returning false on normal Zope >objects like images and files. But if I were to return to my web form and run a >request for just one report it works fine. From what I can make out there is no >reason why these objects should be unmoveable. I have uploaded the code for my >report engine class the error message I am getting and the Python script I use to >trigger the Report Engine are listed below.
>This is my first attempt at developing a Zope Product so my code is probably pretty >poor. Any suggestions on the product itself are also welcome. No security has been >implemented yet the product is still in development.
>Once again any help, bugfix or workaround would be very greatly appreciated.
>Many thanks
>Ian.
>Python Script Recieves Form Post
>If only 1 site ID sent works fine 2 or more it fails
>request = container.REQUEST
>RESPONSE = request.RESPONSE
>dReport_Args = {}
>for site_id in request.form['site_ids'].values():
> dReport_Args['SiteName'] = 'Z'
> dReport_Args['StartDate'] = '01-%s-%s' %(request.form[site_id].report_month, >request.form[site_id].report_year[2:])
> container.dev.generateReport(dReport_Args)
>Error Message Generated
>Time 2004/02/01 01:32:07.274 GMT+0
>User Name (User Id) ian (ian)
>Request URL >http://localhost:8080/philosopher_reporting/plate_abort_error_code/generate_new_r>eports/generate_new_reports
>Exception Type Copy Error
>Exception Value <HTML> <HEAD> <TITLE>Not Supported</TITLE> </HEAD> ><BODY BGCOLOR="#FFFFFF"> <FORM ACTION="manage_main" >METHOD="GET" > <TABLE BORDER="0" WIDTH="100%" >CELLPADDING="10"> <TR> <TD VALIGN="TOP"> <BR> ><CENTER><B><FONT SIZE="+6" >COLOR="#77003B">!</FONT></B></CENTER> </TD> <TD VALIGN="TOP"> ><BR><BR> <CENTER> The action against the <em>report_data_file.xml</em> >object could not be carried out. One of the following constraints caused the problem: ><br><br>The object does not support this operation.<br><br>-- OR --<br><br>The >currently logged-in user does not have the <b>Copy or Move</b> permission >respective to the object. </CENTER> </TD> </TR> <TR> <TD VALIGN="TOP"> ></TD> <TD VALIGN="TOP"> <CENTER> <INPUT TYPE="SUBMIT" >VALUE=" Ok "> </CENTER> </TD> </TR> </TABLE> </FORM> ></BODY></HTML>
>Traceback (innermost last):
>Module ZPublisher.Publish, line 100, in publish
>Module ZPublisher.mapply, line 88, in mapply
>Module ZPublisher.Publish, line 40, in call_object
>Module Shared.DC.Scripts.Bindings, line 306, in __call__
>Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
>Module Products.PythonScripts.PythonScript, line 318, in _exec
>Module None, line 9, in generate_new_reports
><PythonScript at >/philosopher_reporting/plate_abort_error_code/generate_new_reports/generate_new>_reports>
>Line 9
>Module Products.ZReportEngine.ZReportEngine, line 317, in generateReport
>Module Products.ZReportEngine.ZReportEngine, line 382, in prepReportFolder
>Module Products.ZReportEngine.ZReportEngine, line 462, in archiveReport
>Module OFS.CopySupport, line 77, in manage_cutObjects
==============================================================
More information about the Zope-Collector-Monitor
mailing list