Setting up a project
A 'project' in PIDA is a simple bookmark to a filesystem directory, and whatever execution commands you want to associate with it.
To create a new project:
- Select Project > Add Project from the menu. A file dialog will appear.
- Navigate to the directory that you want to use for the project root, then click Open (or OK, or whatever confirmation button your file dialog presents to you).
- If the directory you select has never been used for a PIDA project, you'll be prompted to create a new project file - click Yes.
Since PIDA's concept of a project is simple, you've got some flexibility in what you decide to use as a project root. If you're working on a single Plone product, you can use that product's directory. If you're working on multiple products in a single Zope instance, then you could use the instance Products directory as the project root. If you're using a buildout instead of an traditional instance, and you'd like to use PIDA to explore your entire buildout, then you can use the top-level directory of your buildout environment as the project root. It's up to you - do what works best for you.
Execution Controllers
Execution controllers are used to run your projects - or in our case, to run the Zope instance that we're using to test our product. We'll use zopectl (or 'instance' for buildouts) for our execution controllers. Let's start with a default controller to run Zope as a foreground process:
- Select your project in the project list
- From the menu, select Project > Project Properties. The properties panel will appear on the right side of the window.
- Enter 'Zope FG' or something similar in the Controller Name field
- Click 'Add'. Your new controller will appear in the controller list.
- Select your new controller in the controller list.
- In the field list below the controller list, click the 'value' field in the row labeled 'Execution Command'
- If you're using a traditional Zope instance, enter the full path to your instance's zopectl script, followed by 'fg':
/path/to/zope/instance/bin/zopectl fg
- If you're using a buildout, enter the full path to the buildout instance script, followed by 'fg'
/path/to/buildout/bin/instance fg
Once you've got your default execution controller set, test it by selecting Project > Execute Default from the menu. An embedded terminal window will appear in the bottom of the PIDA window, and you'll see the typical Zope startup messages, hopefully followed by the familiar "Zope Ready to handle requests". Use the ZMI in your web browser to shut down your instance when you need to. The terminal will display 'Child exited, press any key to close' once Zope has stopped.
Some other useful execution controllers and their commands, for example:
- Zope Debug - /path/to/zope/instance/bin/zopectl debug
- Test MyProduct - /path/to/zope/instance/bin/zopectl test -m Products.MyProduct
You could also set up controllers for zopectl start/stop/restart daemon commands, running your buildout script, or generating code with ArchGenXML. PIDA's execution controllers are just commands - each project has a specific set of controllers, but you can use them for non-project specific things. You could use them to tail your event log, check your mail, launch your web browser, or just about anything else you need.
Get to work!
At this point, you're ready to start using PIDA to develop your next great product - so you do just that. You're using PIDA's IDE features and your hard-earned vim muscle memory to write tests and content types with the greatest of ease. Everything's going great until... hmm. Something's not working.
Time to break out the debugger...
