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

Shane Hathaway shane@zope.com
Tue, 25 Feb 2003 12:32:56 -0500


John D. Heintz wrote:
> I'm also sorry to hear you might be finished with this thread Shane.
> 
> Your ideas parallel to XML namespaces is perfectly intuitive.

Thanks.  As I return to work on page templates that lack API 
declarations and use a lot of Python expressions, I long for 
namespace-bound APIs.  An example:

<html metal:define-macro="master"
       tal:define="utool nocall:here/portal_url;
                   mtool here/portal_membership;
                   atool here/portal_actions;
                   wtool here/portal_workflow;
                   portal_object utool/getPortalObject;
                   portal_title portal_object/Title;
                   object_title here/Title;
                   page_title page_title | template/title;
                   portal_url here/portal_url;
                   member mtool/getAuthenticatedMember;
                   isAnon mtool/isAnonymousUser;
                   actions python: atool.listFilteredActionsFor( here );
                   user_actions actions/user;
                   object_actions actions/object;
                   workflow_actions actions/workflow;
                   folder_actions actions/folder;
                   global_actions actions/global;
                   wf_state
                     python:wtool.getInfoFor(here,'review_state','');
                  ">

This is quite brittle, but I can't fix it without breaking someone 
else's derived templates.  Namespace-bound APIs would give me a way to 
fix this culture.

Shane