[Zope] Workflow question - sort of solved

David Pratt fairwinds at eastlink.ca
Thu Aug 18 15:28:04 EDT 2005


I guess what I have learned so far is that the data of an object in an 
automatic workflow transition
from a PUT is not there until it completes - but the good thing is that 
the data is in the request body variable.

So I can check the request method and if a PUT, use the request's body 
variable and the transaction
completes on PUT and no more 426 Error. Yay!  I am not sure if there is 
any other way to go but interested
if there is a better solution.

Regards,
David

On Wednesday, August 17, 2005, at 06:08 PM, David Pratt wrote:

> Hi Dieter. Many thanks for your reply. The place in my workflow that 
> it failed was opening the image.
>
> IOError: cannot identify image file
>
> 		for image_data in image_data_list:
> 			
> 			# Get original image data into string object
> 			original_file = StringIO(str(image_obj.data))
> 			image_size_px = image_data['size']
> 			
> 			# Create an image instance
> error here -->	image = PIL.Image.open(original_file)
>
> This had me puzzled since my workflow works in all other cases in the 
> portal including cutting an image from one folder and pasting into the 
> folder the workflow acts on (just not FTP case). So I wrote a very 
> simple workflow script that will only cut and paste an image back in 
> same folder to see what would happen:
>
> # Get the object and its id
> image_obj = state_change.object
> id = image_obj.getId()
>
> # This is the folder we are starting from
> upload_dir = image_obj.aq_parent
>
> # Do cut and paste
> objs = upload_dir.manage_cutObjects([id])
> upload_dir.manage_pasteObjects(objs)
>
> return
>
> I discovered that it does not appear possible to have a workflow act 
> on content immediately after being FTP'd to a site without generating 
> the 'FTP 426 Error creating file' error.  If I FTP an image to the 
> folder as Manager with copy or move permission, it will trigger 426 
> Error creating file and the following traceback.  The workflow will 
> work for regular operations within the portal, just not FTP.
>
>     *  Module OFS.CopySupport, line 92, in manage_cutObjects
>
> Copy Error: <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>A084.JPG</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>
>
> The body of the image appears in my traceback as well
>
> My folders work fine with FTP without the workflow - no errors.  Only 
> generates errors when workflow is attached to type it acts on and then 
> 426 error appears.
>
> Regards,
> David
>
>
>
> On Wednesday, August 17, 2005, at 05:07 PM, Dieter Maurer wrote:
>
>> David Pratt wrote at 2005-8-17 00:13 -0300:
>>> ...
>>> but when I FTP
>>> my images to this directory it fails giving me a 426 Error creating
>>> file.
>>
>> Look at your "error_log" object to find out the real reason
>> (and get the traceback).
>>
>>
>> -- 
>> Dieter
>>
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )
>


More information about the Zope mailing list