README.txt
Epoz - a cross-browser-wysiwyg-editor for Zope
Epoz allows you to edit Zope-objects with a wysiwyg-editor. No plugins are required. You only have to use a recent browser (IE >= 5.5, Mozilla >= 1.3.1, Netscape >= 7.1, Firebird >= 0.7) that supports Rich-Text-controls (called Midas for Mozilla).
Please read the CHANGES.txt before upgrading Epoz.
To use Epoz, simply install it into your Products-directory of your
Zope-Server and restart the server. If you want to get nice
formatted and xhtml-compatible html-code from Epoz, you should also
install mxTidy
on your server. Epoz talks over XMLRPC to the Zope-Server to clean
up the html-code. After the processing of mxTidy, Epoz tries to call
an additional hook (EpozPostTidy) which can do postprocessings on
the html-source. Create an external method or a python-script with
id=EpozPostTidy in the root of your site, which expects
two parameters self
(=current context) and html
(=only htmlbody).
It should return a new html-body.
If you want to use Epoz with Plone use the CMFQuickInstaller or
create an External Method with id=Install in your Plone-Site.
Then edit the newly created External Method, set
Module Name = Epoz.Install, Function Name = install and
click on Test
. Now you can select Epoz as default editor in "your
preferences" of the Plone-Site. You can customize the widget
(uncomment elements you don't want to see) through customization
of portal_skins/epoz/epoz_script_widget.js. Epoz is shipped with a
default toolbox for Plone (icon with ball on it). You can insert links
(please highlight text before inserting a link) and images by
searching / navigating through your site and simply click
"Insert Link/Image".
If you want to use Epoz with native Zope applications, you have to create a customized edit-script. Because there is no unique interface for editing Zope-Objects, I did not include a "manage_edit_all"-script for Epoz. You have to create it yourself!!! To start working with Epoz, simply create a DTML-Method with id=edit:
<dtml-var standard_html_header> <dtml-if html> <dtml-call "manage_edit('', content_type='text/html', filedata=_.str(html))"> </dtml-if> <p><a href="<dtml-var URL1>">View Document</a></p> <form action="<dtml-var URL>" method="post"> <dtml-var "Epoz('html:string', data=this().data, toolbox='/toolbox', lang='en', style='width: 620px; height: 250px; border: 1px solid #000000;')"> <input type="submit" name="submit" value=" Save Changes " > </form> <dtml-var standard_html_footer>
Then create an empty File with id=test and point your browser to http://yourServer/test/edit. That's all...:) Please note: Epoz is a pure HTML-editor and can't edit any ZPT-or-DTML-Tags!
To create an Epoz-Rich-Text-Editor from your own Products/Scripts/Methods/ZPT, you have to call it with one fixed and several optional paramters::
Epoz(self, name, data='', toolbox='', lang=en
,
path='', widget='',
style=width: 600px; height: 250px; border: 1px solid #000000;
,
button=background-color: #EFEFEF; border: 1px solid #A0A0A0; cursor: pointer; margin-right: 1px; margin-bottom: 1px;
,
css='', charset=utf-8
):
""" Create an Epoz-Wysiwyg-Editor.
name : the name of the form-element which submits the data data : the data to edit toolbox : a link to a HTML-Page which delivers additional tools lang: a code for the language-file (en,de,...) path : path to Epoz-Javascript. Needed mainly for Plone (portal_url). widget: You can specify a path to an alternative JavaScript for epoz_script_widget.js style : style-definition for the editor-area button : style-definiton for buttons css : url to a css which should be used for rendering content in editor-area charset : charset which is edited in the editor-area
If Epoz can't create a Rich-Text-Editor, a simple textarea is created. """
Epoz is shipped with a very nice additional feature. Besides the rich-text-controls you can set up a customized toolbox. This is simply an URL which provides a popup-window with special functions. To get the idea, create a DTML-Method with id=toolbox in your Zope-Root and enter something like:
<html> <head><title>Epoz-Toolbox</title></head> <body onload="this.focus();"> <h1>Images</h1> <dtml-in "PYTHONPATH.TO.IMAGES.objectValues(['Image'])"> <img src="<dtml-var absolute_url>" border="0" width="16" height="16" alt="<dtml-var title_or_id>" style="cursor: pointer;" onclick="window.opener.CreateImage('<dtml-var absolute_url>'); window.close();"> </dtml-in> <hr /> <h1>Links</h1> <dtml-tree "PYTHONPATH.TO.CONTENT" branches_expr="objectValues(['Folder','File'])" nowrap=1> <a href="#" style="cursor: pointer;" onclick="window.opener.CreateLink('<dtml-var absolute_url>'); window.close();" ><dtml-var title_or_id></a> </dtml-tree> </body> </html>
Now you can click onto the little icon with the folder on it and get a popup, which provides images (simply click) and links (select text in Epoz-window, then click onto link).
If you want to translate Epoz into your own language, have a look at skins/epoz_lang_en.js.dtml. It would be nice if you want to share your translation with me.
If you want to use Epoz on a shared Zope-Server (e.g. freezope.org), where are you don't allowed to install products, you can turn Epoz easily into a standalone webapplication for Zope:
- Copy all .gif and .dtml files from skins/epoz to a Zope-Folder on your shared Zope-Server (use FTP or WebDav (cadaver is very useful!)). Remove the postfix .dtml from files with rename.
- Copy & Paste the Epoz-Function from Epoz/__init__.py to a PythonScript with id=Epoz. Before saving cut&paste the parameter-list (starting with name, leave out the self) to the parameter-list of the PythonScript. Remove the function-declaration-line (def Epoz(...):) and unindent the rest of the code.
- Now you have to set the correct path-variable in your edit-script, pointing to your folder.
- Create a edit-method as described above. That's it.
I hope you'll enjoy Epoz. For me Epoz is the missing link to Zope.
There's an ongoing effort on http://sf.net/projects/epoz to develop a next generation of Epoz (1.x), based on new ideas and on a new design. Guido Wesdorp, Philipp von Weitershausen and Paul Everitt have done a great job working on Epoz 1.x. The developement of the original Epoz (0.x) will continue because I run several applications which I can't easily update to EpozNG in the near future.
If you consider using Epoz, please write me a short mail about your use-case.
Questions, comments, patches are welcome. Please send them to: [email protected]