[Zope-CMF] [dev] type infos and 'add' actions - a proposal

2008-07-21 Thread yuppie

Hi!


This is a proposal for implementing one part of what we discussed in 
this thread:

http://mail.zope.org/pipermail/zope-cmf/2008-July/027500.html

Using add views instead of folder_factories for creating content makes 
it necessary to provide some kind of menu items for them. In CMF menu 
items are usually represented by 'actions'.



Type infos already define most data required for actions:

- 'id': can be reused

- 'title': can be reused; if we want action titles like 'Add File ...' 
instead of 'File' we can change that in the template


- 'description': has already the same purpose as in actions

- 'icon': 'content_icon' is a path relative to the site root, but we can 
use the same icon and compute the required absolute path


- 'available': can be computed using allowType of the container

- 'allowed': can be computed using isConstructionAllowed

Missing are these properties:

- 'category': can be hardcoded, e.g. as 'folder/add'

- 'url': requires a new type info property, I propose to use 'url_expr' 
to keep it in sync with normal Action objects


- 'visible': can be hardcoded as True


So instead of adding separate 'add' actions we can extend the type info 
classes, making them implement IAction as well.


listActions of the types tool would include type infos if they provide 
IAction *and* have an url specified.



As always, feedback is welcome.

Cheers,

Yuppie


___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] [dev] type infos and 'add' actions - a proposal

2008-07-21 Thread Charlie Clark


Am 21.07.2008 um 12:51 schrieb yuppie:

So instead of adding separate 'add' actions we can extend the type  
info classes, making them implement IAction as well.


listActions of the types tool would include type infos if they  
provide IAction *and* have an url specified.



As always, feedback is welcome.



+1 an excellent suggestion!

Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226



___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests