Portlet settings from a GS profile?

Martin Aspeli optilude at gmx.net
Mon Oct 1 21:49:31 UTC 2007

Hi Maurits,

> Let me think out loud here.
>   <?xml version="1.0"?>
>   <portlet-assignments>
>     <portlet
>         type="contenttype"
>         name="portlets.rss"
>         condition="Folder"

I don't like the name "condition", but something like it may work.

You'd also need to specify which portlet manager (e.g. plone.leftcolumn) 
this was in.

However, you're missing something here: plone.portlet.RSS (the name of 
the RSS portlet) takes config parameters. These parameters are specified 
in the schema interface for its assignment type (e.g. IRSSPortlet). If 
you have the name, you can get the interface I think, from the 
IPortletType, so that helps.

We'd need a way to set and extract these, and also make sure that 
portlet assignment objects could be instantiated by the handler. This 
could be done with some introspection I guess.

It may be possible to cleverly use the add view code, which already 
knows how to instantiate a portlet from a dict of parameters, now that I 
think of it. The IPortletType (local) utility that is used by the 
portlet management UI holds the add view name.

>         />
>     <portlet
>         type="context"
>         name="portlets.Login"
>         condition="/front-page"
>         />
>     <portlet
>         type="group"
>         name="portlets.Events"
>         condition="Party People"
>         />
>   </portlet-assignments>
> This could go in portlets.xml or a new file. 

I vote for portlets.xml.

> Has anyone given thought
> to this?  Is it an option to add content type portlets to the xml file
> of that content type?  (I guess not.)

"structure" isn't exported by default either.

> The first portlet assignment adds an rss portlet to the content type
> Folder.  That could be a portal_type or maybe an interface: whatever
> is done by the current types configlet I would say.  The name of the
> portlet is as it is called in
> e.g. plone/app/portlets/portlets/configure.zcml
> The second portlet assignment adds a login portlet by context to the
> front-page.  The condition would be the path from the portal root.
> The third portlet assignment adds an events portlet to the group with
> the name "Party People".  BTW, I have not yet done anything with this
> type of portlet.
> Does this make sense?

Largely, yes, but see above.


Acquisition is a jealous mistress

More information about the Product-Developers mailing list