[Zope] Zope needs this (and Dynamo has it)

Shalabh Chaturvedi shalabh@pspl.co.in
Thu, 9 Mar 2000 12:10:28 +0530


Martijn Faassen wrote:

> Still, a simple variety of DTML would be nice. Currently you can
> successfully use a subset of DTML, which almost has no arcaneness but
> is still very powerful. PythonMethods will help even more there. Still,
> DTML allows too much, so it's too easy to move into the arcane domain. Also
> some of its powerful features have the side effect that some of the simple
> features look too complex.
>
> So perhaps we should create a seperate language, based on the subset,
> with simplified syntax, which _doesn't_ allow fancy stuff. The fancy
> stuff would be in DTML-methods or PythonMethods of some kind. Perhaps
> even the HTML would be in seperate methods. Perhaps some XML-ish Zope
> glue language, like this:
>
> <zopeglue>
> <var object="header"/>
>
> <assign name="age" object="get_age"/>
> <var object="show_age_intro" arguments="age"/>
>
> <var object="layout.table_header"/>
> <in object="get_above_age" arguments="age">
> <var object="myrecord" arguments="in_item"/>
> </in>
> <var object="layout.table_footer"/>
>
> <assign name="age" object="getage">
> <var object="footer"/>
> </zopeglue>
>

I don't think a new syntax should be brought about. There are too many things
to learn already, it will only add to the confusion.

I do agree that dtml is complex and something needs to be done about it.
Probably a subset of the current dtml itself - with minimal additions which
make somethings easy - would be good.

Also (if this is seriously being considered) I would favour for a somewhat
different paradigm:

Instead of:
> <var object="layout.table_header"/>
> <in object="get_above_age" arguments="age">
> <var object="myrecord" arguments="in_item"/>
> </in>
> <var object="layout.table_footer"/>

We could have:
<dtml-var object="layout.table">
<param name="datasource" value="get_above_age">
<param name="columns" value="Name,Age">
</dtml-var>

The advantage here is that:
   o   One logical presentation element (a table) is one element in dtml code.

   o   One-to-one relation is possible between the code and any GUI entity
        being used to design (think ZStudio). This means the layout.table can
        be one icon that is dropped into a design view and it's parameters
        specifed through some fancy widget. 
        Also when the code is stored and reloaded, it would still be
        possible to display the same GUI entity in the design view and it's
        parameters would be editable.

Discussions on the above have taken place on the ptk and zope-moz lists.

Regards,
Shalabh
______________________________
Shalabh Chaturvedi
icq://43284067
http://advogato.org/person/shalabh/