Re: Re: What does Five and Z3 mean for Archetypes?
Alec Mitchell <apm13-WLbs8XpHrcb2fBVCVOL8/[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.archetypes.devel |
|---|---|
| Message-ID | <[email protected]> |
On Tuesday 22 November 2005 04:52 am, Martijn Faassen wrote: > Sidnei da Silva wrote: > > On Mon, Nov 21, 2005 at 06:59:28PM +0100, Martijn Faassen wrote: > > | >Thats great. I'm very interested in hearing what you have to say > > | > about it. > > | > > | Well, I gave a summary just now. :) Are your usecases for marshalling > > | broader than just export/import? Basically as soon as an 'export' to a > > | potentially untrusted system happens, that should not have all the > > | information in the system, you need to start worrying about which > > | version of which objects you export. > > > > How do you solve that problem in Silva? > > Hm, we haven't really made a unified solution, but the basic idea is to > parameterize the export logic so that it can be controlled -- exporting > certain information is suppressed. Similarly a checking needs to happen > upon import, if import from untrusted sources is allowed. > > [snip] > > > | >It's actually not that hard, but the z3 widgets would have to 'adapt' > > | >the AT fields to the the interface for a z3 field. > > | > > | If I understand you correctly, that would be the other way around; > > | using AT widgets within Zope 3. > > > > Nope, its exactly as I said. Unless you are thinking about using z3 > > *schemas* with AT there's no way to use Z3 widgets with AT fields > > unless we adapt the AT fields to Z3 field interface (IField?). > > Ah, okay, I think I understand now -- I misread. You're talking about > the same thing I am, I think. :) > > [snip] > > > This is more or less what happens: > > > > - Get a AT field > > - Get the field's Widget > > - Get the widget 'macro' attribute and find a page template by > > simple traversal > > - Find a macro matching the 'mode' parameter > > - Inject 'field', 'widget', 'accessor', 'instance', 'mode' and > > 'field_name' in the page template local namespace (equivalent to a > > tal:define) > > - Return the macro > > Thanks for this summary. > > > Then basically the forms do a metal:use-macro with what was > > returned. > > > > *I* think this last part should be changed to a simple call, eg: > > tal:replace="widget", then we can return a Z3 widget and have it be > > rendered just as easily. > > Right, good to hear. I imagine you'd use tal:replace="structure widget", > but I get the idea. :) > > > | >Should be trivial. Archetypes doesn't expect much from a widget other > > | >than providing a macro and a method to extract it's own value from > > | > the request. > > | > > | This is good. Of course Zope 3 doesn't have a macro per widget. :) > > > > That's why I made the suggestion just above. > > Understood. > > > | >| b) port over Archetypes widgets to Zope 3 style > > [snip] > > > | >I'm +10 on this. > > | > > | Good! I think the next step here would be for someone to try porting > > | an interesting AT widget to Zope 3. From the problems this person will > > | have we will learn what changes, if any, Zope 3 needs, and we can > > | recommend a path to take for the next widget. I think I can contribute > > | to this process, even though the AT side of things will have to come > > | from someone else, so I cannot do it alone. > > > > What would be a intersting AT widget? I think the 'RichWidget' is a > > good candidate. It embeds kupu and a upload input box in the same > > widget. > > I don't know much about AT widgets, but that seems like an interesting > candidate. Any other widgets that people can come up with? The widgets that I've written which I will be attempting to port to z3/AT are AutoCompleteWidget, which does vocabulary based auto completion (though it's js needs some real work), and MasterSelectWidget which is a selection widget which dynamically alters the vocabularies/values/visibility of other widgets on the page using AJAX based on the current selection. Alec ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit: http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click