Hi guys,
First of all, if you haven't checked out ZopeSkel local commands, you
should. Get the latest version:
$ easy_install -U ZopeSkel
and then do:
$ paster create -t archetype my.contenttype
(answer questions)
$ cd my.contenttype
$ paster addcontent contenttype
(answer questions)
$ paster addcontent view
(answer questions)
$ paster addcontent portlet
(answer questions)
This stuff is really great. :) It saves a ton of typing, it allows us to
automate some best-practice stuff, and it's pretty slick.
To make it *very* slick here are a few things we should do. Some people
(Tarek, Mustapha, David, others) are doing some great work on ZopeSkel.
If we can polish a tiny bit more, then this will go a long way towards
helping people get started as developers.
1. Document this on plone.org better.
2. Make sure each time you generate a package, there's a README.txt
that says "now here are some things you could do" and explain the basic
layout of the generated code.
3. Clean up some ZopeSkel/paster warts:
- Things sometimes have bad defaults, e.g. an "archetype" package has
to be a Zope 2 product, but it defaults to False.
- zip_safe should not be an option - it should always be False, since
Zope 3 can't read ZCML inside a zipped egg. This is nasty, since you
don't notice during development when you're in develop mode!
- If you create an egg, you have to make sure that the foldername and
the namespace + package names match up. e.g. "paster create -t plone
my.package" means you *have* to say namespace = "my" and package =
"package".
- Typing "True" and "False" sucks. We need to ensure we can accept t,
f, T, F, y, n, Y N etc.
- The description text is something badly formatted and hard to read.
If we could fix the layout a bit so that the prompt is always on a new
line and the text is wrapped properly, that'd be nice
- You always get a tests.py, and sometimes you get a tests/ package as
well. One will beat the other. tests.py is also a bit limited for most
purposes.
There are probably a few more like these.
4. Make sure there are sufficient inline comments (but too many!) for
the things we generate so people understand what they do.
5. Think about new things we could add as local commands:
- I'd like to see something for generating basic workflows, maybe where
you optionally pick the states and transtions and permissions you want
to manage.
- An option to create a viewlet would be nice
- The 'view' local command should allow you to set the context type, maybe
- We could maybe have some local commands in the plone3_theme template
for adding a customisation of a particular view, viewlet or skin
resource. If we could get something where you paste a name from the
browser into paster, that'd be very helpful.
- Commands to add tests!
6. Think about new skeletons we'd like to support.
- Maybe a basic "policy" package that has a GS profile but not a
content type.
ZopeSkel is not a panacea. It only really works if you have a pretty
good idea what's going on - but it lowers the bar, it makes it easier to
get started, and it saves a lot of typing. It also makes it easier to
write documentation, since you can skip a lot of boilerplate detail that
people are likely to screw up anyway. :)
Cheers,
Martin
--
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See
http://martinaspeli.net/plone-book-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________
Plone-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers