[Zope3-dev] IFile, widget, form etc

Roger Ineichen dev at projekt01.ch
Sat Jan 15 07:37:13 EST 2005


Hi Janko, Jim, ...

Perhaps we should think about the problem a little bit 
befor we implement something. Or at least sync our ideas.

The result should give us a proposal.

Here are some questions I have.

-------------------------------
Reimplement the IFile

The File has to handle different parts.

- The file data itself.
- The content type
- The filename (stored in the parent IContainer)
...

For the implementation zope3 offers us the following components:

- IFile (interface)
- IField (schema field)
- File (class)
- XYWidget (widgets)
- Add and edit/upload forms
- Events
- Perhaps adapters and views


Let's define the problems and find out what's the right 
component for the implementation


Problem 1 (content type)

What's happen if we add a file object called filename.txt.
What's the content type of this object?
What's happen if we upload a binary object like a ms-word document?
Does the content type change?

Who is responsible for the content type if we rename the object?
Should the content type change if we rename the fielname to
filename.xsl?

Or should the content type change if we upload a new file called
filename.js?


Problem 2 (i18n)

Can we implement the same pattern of "Problem 1" in a i18n implementation?
One restriction is, that the fielname of a i18n file is given for all
languages. How does the content type work on i18n implementation.
Perhaps we have to implement a validation for preventing upload
different content types on each language.

-------------------------------

My main target is an implementation which works for normal and 
i18n files. It should also work with the standard form framework.
Own implementation should work if we inherit from IFile or from
the IFile (field) out of the box.

BTW
I have added some i18n add and edit forms in our framework
for supporting IFile with i18n support. Perhaps we can move
this forms to Zope3.

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