Better access to APIs in paths (was Re: [Zope3-dev] needing views clues - template/title troubles)

Stuart Bishop zen@shangri-la.dropbear.id.au
Mon, 24 Feb 2003 10:40:38 +1100


On Monday, February 24, 2003, at 01:23  AM, Jim Fulton wrote:

>   context/++view++foo
>   context/@@foo
>   context/++api++title
>   context//title
>   context/++/title
>
> Thoughts?

For ZPT (which I think deserves a special case because of its target 
audience):
     <h1 tal:content="dc:context/title"/>
or for a shortcut to the most common case, just
     <h1 tal:content="dc:title"/>

Will be more familiar and explainable. API -> prefix mappings specified 
in the
config files, and can be overridden by properties on the page template 
object
(or possibly with a new <html tal:ns="dc IZopeDublinCore"> TAL tag.

This approach could also be used to make access from Python Scripts more
mnemonic using these prefixes, but I think IZopeDublinCore(ob).title is
quite acceptable. dc(ob).title would probably be the best alternative.

This all doesn't match the subject of this thread, but I think using
a 'generic-works-everywhere' path syntax (limited by what can go in a
URL) in places where there is more flexibilty will lead to much 
yuckyness
and desires to stick with Zope 2. A good goal would be to make 
understanding
the magic Perlish syntax a requirement of as few Actors as possible 
IMHO.
Preferably none at all, with any '++@@' gibberish being generated by 
Zope or
helper methods. I know I'd be turned off if I saw this sort of thing in 
a
'Hello World' equivalent.

-- 
Stuart Bishop <zen@shangri-la.dropbear.id.au>
http://shangri-la.dropbear.id.au/