Attention

This document was written for an old version of Plone, Plone 3, and was last updated 1204 days ago.

To learn how to upgrade to the current version of Plone, read the upgrade manual.

Creating a new development project and managing it with Subclipse

by Mikko Ohtamaa last modified Feb 04, 2009 03:08 AM
Currently Subclipse expects the project root to be a Subversion branch (trunk) and all project files should belong to this branch. If you want to manage your project files Subclipse and have all Plone Python files accessible in Eclipse, you need to create two separate projects.

Setting up Subversion repository explorer
-----------------------------------------

Open SVN Repository Exploring perspective: Window -> Open perspective - Other -> SVN Repository exploring. Add your Subversion repository root by clicking "Add new SVN repository" icon or through right click menu. After this you should be able to browse the whole Subversion repository in SVN Repository Exploring perspective.

Creating a new project from scratch
-----------------------------------

Choose File -> New PyDev project. Type in the project name and choose Python 2.4.

Use `paster to create the project skeleton <http://plone.org/documentation/how-to/use-paster>`_ on your Eclipse project folder.

In SVN Repository Exploring perspective, create Subversion project with the following structure through right click menu::

svnroot
myproject
branches
trunk
tags


You might need to refresh SVN Explorer after changes by right click -> Refresh.

Right click the project and choose Team -> Share project. Choose SVN repository type and svnroot/myproject/trunk for the target.

Creating a project from the existing Subversion branch
------------------------------------------------------

If you have files already in Subversion repository you can checkout them from Eclipse IDE. Go to SVN Repository Exploring perspective. Navigate to your branch (trunk). Right click and choose "Checkout". Choose "Use New Project wizard" and PyDev project. Type in the project name and configure the project for Python 2.4.

.. image:: /documentation/tutorial/developing-plone-with-eclipse/snapshot2.png
:width: 320
:height: 240
:target: /documentation/tutorial/developing-plone-with-eclipse/snapshot2.png

*SVN Exploring Perspective*

Setting up Buildout src target
------------------------------

The last thing to do is to configure buildout to find the products from your separate development project.

Open buildout.cfg in the Eclipse text editor.

For old-style products (lying inside Products namespace), add lines::

[instance]

...

products =
${buildout:directory}/products
${productdistros:location}
${plone:products}
../mydevprojectcontainingproductsfolderwithnestedmyproduct

[omelette]
recipe = collective.recipe.omelette
eggs = ${instance:eggs}
products =
${instance:products}
../mydevprojectcontainingproductsfolderwithnestedmyproduct

For new-style products, configure related ZCML slugs and develop directories. You need to touch the following buildout directives (freearch.theme product as an example)::

[buildout]
...
eggs =
...
freearch.theme

develop =
../freearch/freearch.theme

[instance]
...
zcml =
freearch.theme

Problems with setuptools and Subversion 1.5
-------------------------------------------
If you're using setuptools-0.6c8 with SVN 1.5, you might be hit by this error message::

File "/usr/lib/python2.4/site-packages/setuptools/command/sdist.py", line 98, in entries_finder
log.warn("unrecognized .svn/entries format in %s", dirname)
NameError: global name 'log' is not defined
While:
Installing.

This is a bug and it's fixed in setuptools-0.6c9, so please upgrade. See
`this thread <http://groups.google.com/group/linux.debian.bugs.dist/browse_thread/thread/b5d23c96e328b178796fd556351da9ca?lnk=rao>`_ and `this bug report <http://bugs.python.org/setuptools/issue4>`_ for additional information.


Contribute

Something wrong or out of date? Anybody can edit or create a new article in the knowledge base. Simply create an account on this site, log in, and click the Edit button to contribute.