[Zope3-dev] IFile refactoring

Roger Ineichen dev at projekt01.ch
Mon Jan 24 10:52:54 EST 2005


Hi jim, and all who are insteressted in IFile

can you please take a look at the branch jhauser-filefieldwidget
and tell me if the IFile and IMime interfaces looks 
like you whant.

The contents attribute on IFile is a Mime instance.

I didn't implement the IMime interface in the File
class directly. If we whould do so, we have to 
provide the schema part of IMime. (data, mimeType, encoding)
as properties.

I think the IFile should only provide:

contents = Mime
get/setMimeType()
get/setEncoding()
open()
getSize()

If you start Zope3, you can see that the mime part is a subwidget
of the File.

What do you think?
Tell me what I should change.

After cleanup I start to implement the session support
for the MimeWidget which handles the mimeType attribute
guessed from the uploaded fielname.

I'm not sure if the html input field of the type file
allows to set the value back after refresh. 
I think this is not possible because of a security 
restriction in the clients (browser).

BTW;
2 function tests are broken, I think this is a bug in the 
ftest permission setup. edit.html and upload.html work 
just fine in reality, but the test rasie a permission 
exception.

Regards
Roger Ineichen
_____________________________
Projekt01 GmbH
www.projekt01.ch
Langackerstrasse 8
6330 Cham
phone     +41 (0)41 781 01 78
mobile    +41 (0)79 340 52 32
fax       +41 (0)41 781 00 78
email r.ineichen at projekt01.ch
_____________________________
END OF MESSAGE 



More information about the Zope3-dev mailing list