[Zope-CMF] [dev] Method Aliases API revisited

yuppie y.2004_ at wcm-solutions.de
Wed Sep 1 13:16:29 EDT 2004


Hi!


Don't know if anybody uses the possibility to define Method Aliases for 
paths instead of simple methods. I'm afraid this is YAGNI and makes the 
Method Aliases API more complex than necessary.


I propose to replace these two methods:

     def getMethodPath(key):
         """ Get reverse relative method path by alias.

         Permission -- Always available

         Returns -- Tuple of IDs
         """

     def getMethodURL(key):
         """ Get relative method URL by alias.

         Permission -- Always available

         Returns -- Slash-separated string
         """

by:

     def getMethodID(key):
         """ Get method ID by alias.

         Permission -- Always available

         Returns -- String
         """

While it is straight forward to use method paths on publishing 
traversal, it isn't easy to use method paths from scripts. So currently 
code like that for the 'mkdir' hook anyway makes the assumption that the 
method path contains only one ID.

This would also make it easier to replace the deprecated 'getActionById' 
in cases where we want to call the method.


Given that people agree this simplification makes sense, I'm not sure 
what would be the right way to make that change:

Do we have to support the current API in CMF 1.5 because the beta is 
already out or would it be ok to break backwards compatibility to the beta?


Any feedback is welcome.

Cheers,
	Yuppie




More information about the Zope-CMF mailing list