[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


[Zope-CMF] CMF Tests: 9 OK

2008-07-21 Thread CMF Tests Summarizer
Summary of messages to the cmf-tests list.
Period Sun Jul 20 11:00:00 2008 UTC to Mon Jul 21 11:00:00 2008 UTC.
There were 9 messages: 9 from CMF Tests.


Tests passed OK
---

Subject: OK : CMF-1.6 Zope-2.8 Python-2.3.6 : Linux
From: CMF Tests
Date: Sun Jul 20 21:40:08 EDT 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-July/009371.html

Subject: OK : CMF-1.6 Zope-2.9 Python-2.4.4 : Linux
From: CMF Tests
Date: Sun Jul 20 21:41:38 EDT 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-July/009372.html

Subject: OK : CMF-2.0 Zope-2.9 Python-2.4.4 : Linux
From: CMF Tests
Date: Sun Jul 20 21:43:08 EDT 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-July/009373.html

Subject: OK : CMF-2.0 Zope-2.10 Python-2.4.4 : Linux
From: CMF Tests
Date: Sun Jul 20 21:44:38 EDT 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-July/009374.html

Subject: OK : CMF-2.1 Zope-2.10 Python-2.4.4 : Linux
From: CMF Tests
Date: Sun Jul 20 21:46:08 EDT 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-July/009375.html

Subject: OK : CMF-2.1 Zope-2.11 Python-2.4.4 : Linux
From: CMF Tests
Date: Sun Jul 20 21:47:38 EDT 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-July/009376.html

Subject: OK : CMF-trunk Zope-2.10 Python-2.4.4 : Linux
From: CMF Tests
Date: Sun Jul 20 21:49:09 EDT 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-July/009377.html

Subject: OK : CMF-trunk Zope-2.11 Python-2.4.4 : Linux
From: CMF Tests
Date: Sun Jul 20 21:50:39 EDT 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-July/009378.html

Subject: OK : CMF-trunk Zope-trunk Python-2.4.4 : Linux
From: CMF Tests
Date: Sun Jul 20 21:52:09 EDT 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-July/009379.html

___
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


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

2008-07-21 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

yuppie wrote:
> 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.

+1.  Seems a simple, straighforward extension, with zero BBB problems.


Tres.
- --
===
Tres Seaver  +1 540-429-0999  [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIhJgu+gerLs4ltQ4RAmZpAKCzp8t3m5Xf/NAq+ShK8tQwULR5LACgjhU+
oBdD84fizqzDGOmUFR5d9wI=
=rcl2
-END PGP SIGNATURE-

___
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 Jens Vagelpohl


On Jul 21, 2008, at 12:51 , yuppie wrote:


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


+1 from me. Thanks for proactively taking this on.

jens



___
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


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

2008-07-21 Thread Martin Aspeli

Hi Yuppie,

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


I wonder whether addview_url or something similar would be more 
appropriate, since "the url of a type" is somewhat ambiguous.



- '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.


How about making them adaptable to IAction instead of directly 
implementing it? That sounds cleaner than trying to bend some of the old 
properties.


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


Apart from the two comments above, a great +1. :)

Martin

--
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book

___
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