[Zope] setting properties - some basic questions

Jason Cunliffe jasonic@nomadicsltd.com
Fri, 2 Mar 2001 10:31:19 -0500


Phil Harris <phil.harris@zope.co.uk> wrote:

> To my mind your thinking about it the wrong way.
>
> The pages don't suddenly become admin pages, the anonymous users become
> admin users so the pages should change their rendered view based on a
> property of the user.
>
> something like:
>
> <dtml-if
"AUTHENTICATED_USER.has_role(['Manager','some_other_admin_role'])>
>    admin = <dtml-var admin><br>
>    <dtml-var showjavascripts>
>  <dtml-else>
>    admin is OFF
> </dtml-if>

Phil

Thanks for the alternative[lateral_think] heads up.

hmm... Yes. You are of course right about user-role oriented logic. But
there are some good reasons why, right now, I want to explore this direction
in Zope of variable property nuances. I practice I can well imagine using a
hybrid of approaches to be more efficient, depending on where the specific
need is system or user[context]- oriented logic. Ironically it is precisely
because I am trying to develop a very user-oreiented approach that I want to
master proprties in Zope!

I am trying to develop a super user-friendly design which couples Zope with
Flash5+ to do smart-client and smasrt-server scripting. Part of my plan is
to use local Zopes [running transparently I hope] on users client machines
linked to a public 24/7 remote web Zopesite. I believe that Flash5 offers
some very interesting parallels to Zope __if__ designed and programmed
right.  Some major advantages I see of Flash over HTML are:

- advanced screen layout and interactivity control
- advanced user feedback capabilities
- better use of client machine processing resources
- reduced network traffic and server demand
- powerful object-oriented 'container' metaphor [matches Zope quite well]
- Flash's timeline + keyframe paradigm allows natural sequencing of user
interface elements

This last point is crucial imho. Web[HTML] has no implicit notion of
sequencing, yet this is exactly what people experience and what
site/applications designers often need to implement.


I have been using frame and container properties in Flash Actionscript, and
it makes for nice clean portable code. My design goal calls for maximum
symmetry between client and server [Flash to Zope adn vice versa]. I am
using Flash5 as rapid prototyping tool to directly model user interface and
I hope very soon to directly model Zopesite also. My hope is to develop
Zope-side code simultanously, and allow both systems to pass data and object
structures to the other. Simple tests have alrady shown this to be quite
workable.

Flash does not have an equivalent of
"AUTHENTICATED_USER.has_role(['Manager','some_other_admin_role'])> but your
post provokes me to implement something like it. Setting properties in Flash
is easy and does allow for logical design including making it easy to nest
components independently to build up logic.

For example depending user action or program flow I can set various flags in
Actionscript:
if (admin)
if (login)
if (colorchanged)
if (returning) etc..

Permutations of these are quite easy to plot and functions can be built and
tested rapidly without disturbing previous work.   Likewise setting values
in dictionaries for such attributes offers even more subtle ways to maintain
state, keep history etc. After I get the basics of Zope properties down, I
want to explore more fully this use of dictionaries as type='Tokens'.

I tested soem of this with Gerard Mulot's help last summer. He used folder
properties to hold data templates structured as dictionaries. The Database
we used was Berkeley Storage, which Gerrard wrote a small Zope product
wrapper for. As proof of concept, this worked very nicely, allowing us to
minimize Zope calls, and it was fast and efficient cross platform database
solution. We were working with Flash4 at the time, which was painful and
very restrictive because its limited scripting. Flash5 is major advance for
programmers, including XML tools.

Among the main criticisms of Flash are lack of any well considered usability
and code bloat. It is my contention that highly object-oriented
Zope-inspired Flash can remedy both of these problems. To take a trivial but
crucial example, many dotcomera-developed flash sites do not have the
euqivalent of the Browser's 'BACK' button, or offer status message feedback
on mouse rollover of what effect a mouseclick will have or goto. In fact
Flash5 is brilliantly equipped to do much more than HTML and  Web browsers
in this regard, and without a lot of server calls or thick javascript. But
it does call for an elegant an inspired paradigm new[re]think.

To me Zope is part of this newthink. So I want now to learn to do same in
Zope. Hopefully my experiences over coming months will improve my coding on
both systems and evolve in highly re-usable modular code. Zope alrady makes
me approach Flash in novel ways and I hope Flash allows me to be likewise
craetive with Zope. At the very least it is interesting and fun!

Your comments most welcome.

- Jason
___________________________________________________________
Jason CUNLIFFE = NOMADICS['Interactive Art and Technology']