How to add development eggs
Discusses how to create a portlet egg and actively develop eggs in Plone 3.1
For those who are familiar with Plone 2.5 one may remember being able to add a product to Plone by placing it in the Products folder. If the product was being activly developed one would place their Plone server in "development mode" and any changes made to the product would become instantly live. Plone 3 introduces eggs - which encapsulates products. Eggs require a slightly different process if one wishes to actively develop an egg. Instead of placing the product in the Products folder - one needs to add the egg into the src directory and then add a few things in the buildout.cfg file.
Examples
Creating a new portlet egg using paster
example command:
cd /opt/Plone-3.1/zinstance/src/ /opt/Plone-3.1/Python-2.4/bin/paster create -t plone3_portlet uwosh.cusportlet
*Note: additional useful paster commands: plone3_theme, plone3_app, archtype
This example will create a blank portlet egg called cusportlet. Before creation it will ask you the following questions:
Selected and implied templates: ZopeSkel#nested_namespace A project with two nested namespaces. ZopeSkel#plone3_portlet A Plone 3 portlet Variables: egg: uwosh.cusportlet package: uwoshcusportlet project: uwosh.cusportlet Enter namespace_package (Namespace package (like plone)) ['collective']: uwosh Enter namespace_package2 (Nested namespace package (like app)) ['portlet']: Enter package (The package contained namespace package (like example)) ['example']: cusportlet Enter zope2product (Are you creating a Zope 2 Product?) [True]: Enter version (Version) ['0.1']: Enter description (One-line description of the package) ['']: This is an example portlet Enter long_description (Multi-line description (in reST)) ['']: This is a blank portlet ready for development Enter author (Author name) ['Plone Foundation']: Me Enter author_email (Author email) ['plone-developers@lists.sourceforge.net']: Enter keywords (Space-separated keywords/tags) ['']: blank template development portlet custom Enter url (URL of homepage) ['http://plone.org']: Enter license_name (License name) ['GPL']: Enter zip_safe (True/False: if the package can be distributed as a .zip file) [False]: Enter portlet_name (Portlet name (human readable)) ['Example portlet']: Custom Portlet Enter portlet_type_name (Portlet type name (should not contain spaces)) ['ExamplePortlet']: CusPortlet
After you have created the portlet egg you must register the portlet through the buildout file. To complete this add the following lines to your buildout.cfg file (/opt/Plone-3.1/zinstance/buildout.cfg).
#Under "eggs = "add the following line uwosh.cusportlet #Under "develop = " add the following line src/uwosh.cusportlet #Under "zcml = " add the following line uwosh.portlet.cusportlet
After modifying the buildout.cfg rebuild the buildout (cd /opt/Plone-3.1/zinstance/; sudo ./bin/buildout) and restart the Plone server. You should now be able to add the product through the Plone Add/Remove Products page.
Adding the uwosh theme as a development egg
First checkout the desired product from the repository
svn co https://svn.it.uwosh.edu/svn/plone/Projects/uwosh.core/trunk /opt/Plone-3.1/zinstance/src/uwosh.core
Add the following lines to your buildout.cfg file (/opt/Plone-3.1/zinstance/buildout.cfg).
#Under "eggs = "add the following line uwosh.core #Under "develop = " add the following line src/uwosh.core #Under "zcml = " add the following line uwosh.core
Rebuild the buildout (cd /opt/Plone-3.1/zinstance/; sudo ./bin/buildout) and restart the Plone server. You should now be able to add the product through the Plone Add/Remove Products page. Repeat as needed for the other oshkosh products.











