You are here: Home Articles A cool project, if you have the time
Navigation
OpenID Log in

 

A cool project, if you have the time

by Martin Aspeli last modified Sep 23, 2007 09:12 PM

Archetypes a-la-carte?

I've been wanting to look into this for a while, but I just can't find the time, so I thought I'd put it out there. We already have ZopeSkel, which you can use to create a new egg-based Plone product, like this:

$ paster create -t plone my.package

Paster is very extensible, and it's pretty easy to create new templates. We already have a few, such as plone_app for nested name spaces ala plone.app.* and plone3_theme, a package set up like a theme.

I'd like to propose a new template: archetype. This would be a special version of the plone template that created a layout geared up for a modern Archetypes package. "Modern" here means Plone 3-like and Zope 3-like, with GenericSetup, Zope 3 views, adapters and field properties.

However, Paster lets us take this one step further. I propose that the archetypes template leaves the bare bones setup, without any actual content types. Instead, you'd do this to create a new content type:

$ paster contenttype

That would only work inside the package, and it would essentially invoke a new paster template (perhaps with some interactive options) to add a new content type, including a content type class, some GS setup, a browser view and so on. The key here is that you could invoke this command as many times as you wanted, to add more content types to the product. We could even make different commands, such as page to add a standalone page or form to add a simple formlib form.

Under the hood, this can be implemented using Paster's local command support. Pylons already does something like this to create new controllers, and it works very well.

I know pretty much exactly how it needs to work and what the final output needs to look like. I think it'd be a great time-saver for a lot of people, and would help us stabilise a "best practice" template that we could then evolve over time. It's not even that much work, just a bit of QA to make sure it works for the edge cases and is easy to use. I have a skeletal product already that could be adapted for this. If anyone wants to take it on, please give me a shout. :-)

Document Actions

+1

Posted by Anonymous User at Sep 23, 2007 10:44 PM
Sounds like a pretty fantastic idea that would really smooth out the learning curve for Plone 3 integrators!

+100!

Posted by Anonymous User at Sep 23, 2007 11:36 PM
Amazing... I was fooling around with Pylons the other day, and thinking 'why oh why don't we have these paster templates for Archetypes??'

signed,
a guy who never wants to use ArgoUML again

+1

Posted by Anonymous User at Sep 24, 2007 05:06 AM
I like the idea.

Go Martin go ;-)

Raphael

And don't forget the workflow

Posted by Anonymous User at Sep 24, 2007 02:01 PM
One thing I've also kept in the back of my mind: using archgenxml (or Vidar's great new tool) to generate just the workflow. Not the whole archgenxml-generated-product cruft, but just the workflow.xml, nice and handy.

Not gonna program that right now, though :-)

Reinout van Rees

Something to get started

Posted by Anonymous User at Sep 27, 2007 03:55 PM
Reinout: I want to do that too. Best would be that the tools simply call the various paster commands to do the dirty work.

Martin: I basically implemented the 'archetype' template last month but decided not to use it for the time being. Perhaps we can start there.

Viðar
Plone Book
Professional Plone 4 Development

I am the author of a book called Professional Plone Development. You can read more about it here.

About this site

This Plone site is kindly hosted by: 

Six Feet Up