Hi.

Martin Aspeli wrote:
> 
>>   #4: Prevent over-complication
>> This goal unfortunately hasn't been met very well.  In my opinion the
>> new mechanics of integrating Zope 3 CA techniques used in this plip have
>> increased the complication of setting up portlets by several magnitudes.
>> Of course it wasn't hard to do this since the current method of defining
>> portlets and setting them up is extremely simple.  This goal has not
>> been adequately met.
> 
> I kind of contest this point. If you want to make portlets the old way
> (a template), there is no difference. The only difference is that
> instead of going to the ZMI and editing a property, you add a "classic
> portlet" from within the Plone UI and point it at your template.
> 
> But - there are things you can do with portlets now that is more
> powerful than what you could do before. Doing so requires the following:
> 
>  - An interface describing the schema of the configurable aspects of
> your portlet (could be just a marker)
> 
>  - A simple content class implementing this schema (normally just a
> class with a few attributes, and two properties)
> 
>  - An add view, with the appropriate view registration
> 
>  - An edit view, with the appropriate view registration
> 
> Note that both of these have simple base classes, so it's normally just
> a couple of lines of code + ZCML.
> 
>  - A content provider (a view) + a template (normally) for rendering the
> actual portlet
> 
> You can see a full portlet in
> 
> http://svn.plone.org/svn/plone/plone.app.portlets/trunk/plone/app/portlets/portlets/classic.py
> 
> 
> The ZCML is the top part of
> 
> http://svn.plone.org/svn/plone/plone.app.portlets/trunk/plone/app/portlets/portlets/configure.zcml
> 
> 
> There are several parts here, but that is only because we are separating
> concerns, Zope 3 style. I still fully expect integrator-type people to
> keep writing template-based portlets, in which case they will never have
> to touch any of this. But those who want to write more powerful,
> efficient and flexible portlets will be able to do so.
> 
> For example, I want to write a portlet that is essentially just a
> reference to a Smart Folder, which can list its content (so the portlet
> is just a view on the Smart Folder); or, one that points to a Document
> and can render its text in an appropriate font. All that is very easy
> because of the decoupling in the plone.portlets infrastructure.

In this case I would love to see a short tutorial on how to write a new
simple portlet in the Plone developer reference.

Having a simple example people can copy as a base for their own products
would help quite a lot, as most of the used technologies are not used in
the wild that much. If you have the boilerplate ready it's far easier to
build on top of that instead of having to reinvent it from scratch.

And I know Martin can write extremely easy to understand and helpful
tutorials ;)

Hanno


_______________________________________________
Framework-Team mailing list
Framework-Team@lists.plone.org
http://lists.plone.org/mailman/listinfo/framework-team

Reply via email to