import initial.
[Epoz.git] / README.txt
1 Epoz - a cross-browser-wysiwyg-editor for Zope
2
3 Epoz allows you to edit Zope-objects with a wysiwyg-editor. No
4 plugins are required. You only have to use a recent browser (IE >=
5 5.5, Mozilla >= 1.3.1, Netscape >= 7.1, Firebird >= 0.7) that
6 supports Rich-Text-controls (called Midas for Mozilla).
7
8 Please read the CHANGES.txt before upgrading Epoz.
9
10 To use Epoz, simply install it into your Products-directory of your
11 Zope-Server and restart the server. If you want to get nice
12 formatted and xhtml-compatible html-code from Epoz, you should also
13 install "mxTidy":http://www.lemburg.com/files/python/mxTidy.html or
14 "uTidylib":http://utidylib.sourceforge.net on your server.
15
16 Documentation about Epoz for end-users is provided by Tom Purl (see
17 "EpozBook":http://zopewiki.org/EpozBook). Thanks Tom!
18
19 Epoz talks over XMLRPC to the Zope-Server to clean up the html-code.
20 After the processing of mxTidy, Epoz tries to call an additional hook
21 (EpozPostTidy) which can do postprocessings on the html-source.
22
23 If you want to use the EpozPostTidy-Hook for getting relative urls from
24 Epoz out of the box, create an External Method in the root of the ZMI or
25 your Plone-Site with id=EpozPostTidy, Module Name=Epoz.EpozPostTidy,
26 Function Name=EpozPostTidy.
27
28 If you want to use the EpozPostTidy-Hook for customized tasks, please
29 have a look at Epoz/Extensions/EpozPostTidy.py on how to build an
30 EpozPostTidy-hook. To use the EpozPostTidy-Hook for your
31 own applications, create an external method or a python-script with
32 id=EpozPostTidy in the root of your site, which expects three parameters
33 'self' (=server context), 'html' (=only htmlbody) and 'pageurl' (=the "real" base
34 url of current page, use it to traverse the object, rewrite urls, etc.).
35 It should return a new html-body.
36
37 If you want to use Epoz with Plone use the CMFQuickInstaller or
38 create an External Method with id=Install in your Plone-Site.
39 Then edit the newly created External Method, set
40 Module Name = Epoz.Install, Function Name = install and
41 click on 'Test'. Now you can select Epoz as default editor in "your
42 preferences" of the Plone-Site. You can customize the widget
43 (uncomment elements you don't want to see) through customization
44 of portal_skins/epoz/epoz_script_widget.js. Epoz is shipped with a
45 default toolbox for Plone (icon with folder on it). You can insert links
46 (please highlight text before inserting a link) and images by
47 searching / navigating through your site and simply click
48 "Insert Link/Image".
49
50 If you want to use Epoz with native Zope applications, you have to
51 create a customized edit-script. Because there is no unique
52 interface for editing Zope-Objects, I did not include a
53 "manage_edit_all"-script for Epoz. You have to create it yourself!!!
54 To start working with Epoz, simply create a DTML-Method with
55 id=edit::
56
57 <dtml-var standard_html_header>
58 <dtml-if html>
59 <dtml-call "manage_edit('', content_type='text/html', filedata=_.str(html))">
60 </dtml-if>
61
62 <p><a href="<dtml-var URL1>">View Document</a></p>
63
64 <form action="<dtml-var URL>" method="post">
65 <dtml-var "Epoz('html:string', data=this().data,
66 toolbox='/toolbox',
67 lang='en',
68 style='width: 620px; height: 250px; border: 1px solid #000000;')">
69 <input type="submit" name="submit" value=" Save Changes " >
70 </form>
71 <dtml-var standard_html_footer>
72
73
74 Then create an empty File with id=test and point your
75 browser to http://yourServer/test/edit. That's all...:) Please note:
76 Epoz is a pure HTML-editor and can't edit any ZPT-or-DTML-Tags!
77
78 To create an Epoz-Rich-Text-Editor from your own
79 Products/Scripts/Methods/ZPT, you have to call it with one fixed and several
80 optional paramters::
81
82 Epoz(self, name, data='', toolbox='', lang='en',
83 path='', widget='',
84 style='width: 600px; height: 250px; border: 1px solid #000000;',
85 button='background-color: #EFEFEF; border: 1px solid #A0A0A0; cursor: pointer; margin-right: 1px; margin-bottom: 1px;',
86 css='', customcss='', charset='utf-8', pageurl=''):
87 """ Create an Epoz-Wysiwyg-Editor.
88
89 name : the name of the form-element which submits the data
90 data : the data to edit
91 toolbox : a link to a HTML-Page which delivers additional tools
92 lang: a code for the language-file (en,de,...)
93 path : path to Epoz-Javascript. Needed mainly for Plone (portal_url).
94 widget: You can specify a path to an alternative JavaScript for
95 epoz_script_widget.js
96 style : style-definition for the editor-area
97 button : style-definiton for buttons
98 css : url to a global css which should be used for rendering
99 content in editor-area
100 customcss : url to a customized css which should be used for rendering
101 content in editor-area
102 charset : charset which is edited in the editor-area
103 pageurl: the base-url for the edited page
104
105 If Epoz can't create a Rich-Text-Editor, a simple textarea is created.
106 """
107
108 Epoz is shipped with a very nice additional feature. Besides the
109 rich-text-controls you can set up a customized toolbox. This is
110 simply an URL which provides a popup-window with special functions.
111 To get the idea, create a DTML-Method with id=toolbox in your Zope-Root
112 and enter something like::
113
114 <html>
115 <head><title>Epoz-Toolbox</title></head>
116 <body onload="this.focus();">
117
118 <h1>Images</h1>
119
120 <dtml-in "PYTHONPATH.TO.IMAGES.objectValues(['Image'])">
121 <img src="<dtml-var absolute_url>"
122 border="0"
123 width="16"
124 height="16"
125 alt="<dtml-var title_or_id>"
126 style="cursor: pointer;"
127 onclick="window.opener.CreateImage('<dtml-var absolute_url>'); window.close();">
128 </dtml-in>
129
130 <hr />
131
132 <h1>Links</h1>
133
134 <dtml-tree "PYTHONPATH.TO.CONTENT" branches_expr="objectValues(['Folder','File'])" nowrap=1>
135 <a href="#"
136 style="cursor: pointer;"
137 onclick="window.opener.CreateLink('<dtml-var absolute_url>'); window.close();" ><dtml-var title_or_id></a>
138 </dtml-tree>
139
140 </body>
141 </html>
142
143 Now you can click onto the little icon with the folder on it and get a
144 popup, which provides images (simply click) and links (select text in
145 Epoz-window, then click onto link).
146
147 If you want to translate Epoz into your own language, have a look at
148 skins/epoz_lang_en.js.dtml. It would be nice if you want to share
149 your translation with me.
150
151 I hope you'll enjoy Epoz. For me Epoz is the missing link to Zope.
152 If you consider using Epoz, please write me a short mail about your
153 use-case.
154
155 Bug-reports & patches are welcome. Please send them to:
156 maik.jablonski@uni-bielefeld.de