How to Setup an External Editor
This How-to applies to: Any version.
For example, you can edit a Microsoft Word document stored on your Plone site locally in Microsoft Word. When you save the document, it's automatically sent to Plone.
External Editor comes with the Plone installer packages and sets up automatically on the server. The application is unusual in that it has two components: one for the server and one for each client that wants to use the product.
Installing on the Server (tasks completed by your web-site consultant.)
Installing the server product isn't necessary if you used an
installer to install your Plone site. If this isn't the case, the
server-side product is available at http://plope.com/software/ExternalEditor
Install the product in the standard way discussed at the beginning of this chapter,
and then restart your Zope.
Then, in Plone, log in as the administrator, click plone setup,
and then select Portal Configuration. Select the Enable External Editor
option to make sure you can edit objects with this tool.
Installing the Client Product
For every computer accessing the Plone site, you'll need to install this product on the client computer. Just like you'd install Flash or QuickTime in your browser, you install the client-side External Editor code. This is manageable in intranets or on your computer but can be a little harder for a public site.
For Windows 2000 and XP, download the executable Windows installer named zopeedit-win32-0.7.1.exe. Double-click the installer, and the graphical install will proceed. You just need to select all the defaults. This will set up the options for Internet Explorer. To verify that this has worked, do the following:
- From the My Computer window, choose Tool > Folder Options
- In the File Types window, scroll to the bottom, where you should see the extention Zope, as showing in 10-13
File type configuration on Windows
After you've installed the client, you'll need to configure each browser you want to use. Instructions for Konqueror, Galeon, and other browsers are available online at Zope.org. The following are the step-by-step configuration instructions for Mozilla:
- Select Edit > Preferences
- Under Navigation, choose Helper Applications
- Click the New Type button
- Enter a description, such as Zope Editor
- for MIME type, enter application/z-zope-edit
- For Application, select the helper application Python file.
- Click OK, and then close Preferences.
External Editor opens an editor based on the contents of a configuration file. To have an editor of your choice invoked, alter that file. You can find it under different names in the following places, depending on your setup:
- On Windows, if you installed Plone using an installer, you can find this file at c:Program FilesPloneZopepwizopeedit.ini.
- On Windows, if you used the stand-alone External Editor installer, you can find this file in the directory you installed External Editor to; by default this is c:Program FilesZopeExternalEditorzopeedit.ini.
- On Unix, this file will be called .zope-external-edit and located in the home directory of the user running the program, for example, /home/andy/.zope-external-edit. It's in the home directory of the user because each user may have different settings.
This file contains a mapping of extensions and the editor invoked; to change the editor for page templates, for example, find the following lines that have meta-type:Page-Template:
For example, you can use Scite, a free text editor. To use this editor for page templates, you'd have to change the file to read as follows:
For External Editor to work, each invocation of the editor must open a separate process. This means that the External Editor client program can monitor that process to see when it's finished. This causes problems for some editors that try to open multiple files in the same process. For example, to load VIM in KDE, you must run a separate shell as follows:
editor=konsole -e vim
Editing a Microsoft Word document is actually really easy to set up; all you need is Microsoft Word installed on your local computer. Upload your Microsoft Word document to Plone as a standard file and then view the file in Plone. Click the little pencil icon in the top-right corner of your page. Microsoft Word will open on your computer, and the document from the server will display. You can now edit the content as much as you want, and clicking Save will automatically save the file into Plone.
To create a page template, use the ZMI. Sure enough, when viewing
the folder containing the page template, you'll see an extra pencil
icon to the right of the object. Clicking the pencil will activate
External Editor and open the page template in the editor you've
selected. All you need to do is find a good editor for editing the page
templates. Since page templates are just Extensible HTML (XHTML), I use
a simple editor that supports Extensible Markup Language (XML). The
following sections discuss two example editors: Dreamweaver and
Change the [meta-type:Page Template] part of the configuration file to point to Dreamweaver. For example, in my installation this is as follows:
editor=C:\Program Files\Macromedia\Dreamweaver MX\Dreamweaver.exe
Clicking the pencil icon to edit in External Editor now opens it directly in Dreamweaver, as shown in Figure 10-14. Unfortunately, Dreamweaver will not open in each file in a separate instance, which means you can edit only one file at a time.
Figure 10-14. Editing page templates in Dreamweaver