I like programming in Python. I like learning about it, I like using it, and so I wish to share it.

Friday, February 6, 2009

Plone GenericSetup

GenericSetup is a cool feature in Plone that can be used to create profiles for products that can be imported when the product is installed. The original reference which I used can be found here. Basically you can setup one site exactly how you want it to be with all the details on the folders structures, portlets and permissions even. And then you can export the profile of that portal so that it can be imported into any other sites you might be developing.

To export it go to the ZMI, under portal_setup->export. At the very bottom there is an "Export all" button. If that is pressed then you'll be able to download a tarball which contain all the specification needed to recreate the portal you have just made. You won't need all of them but you can use whichever one you need.

Those files would go under profiles/default directory in a common archgenxml product. I've had problems customizing portlets because the exported portlets.xml gave a 'ConstratintNotSatisfied' error. Found out from here that I needed to delete some entries in the tag, namely:


<property name=”name” />
<property name=”root” />

Also learnt from there how to remove portlets:

<assignment remove=”true” name=”login” category=”context” key=”/”
manager=”plone.leftcolumn” type=”portlets.Login” />
<assignment remove=”true” name=”calendar” category=”context” key=”/”
manager=”plone.rightcolumn” type=”portlets.Calendar” />
<assignment remove=”true” name=”events” category=”context” key=”/”
manager=”plone.rightcolumn” type=”portlets.Events” />
<assignment remove=”true” name=”news” category=”context” key=”/”
manager=”plone.rightcolumn” type=”portlets.News” />
<assignment remove=”true” name=”recent-items” category=”context” key=”/”
manager=”plone.rightcolumn” type=”portlets.recent” />
<assignment remove=”true” name=”review-list” category=”context” key=”/”
manager=”plone.rightcolumn” type=”portlets.review” />

0 comments: