| 1 |
====== |
|---|
| 2 |
README |
|---|
| 3 |
====== |
|---|
| 4 |
|
|---|
| 5 |
:Author: Marc-Aurèle DARCHE |
|---|
| 6 |
:Revision: $Id$ |
|---|
| 7 |
|
|---|
| 8 |
.. sectnum:: :depth: 4 |
|---|
| 9 |
.. contents:: :depth: 4 |
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
Presentation |
|---|
| 13 |
============ |
|---|
| 14 |
|
|---|
| 15 |
CPSOOo is a product that installs a new document type which holds an |
|---|
| 16 |
OpenOffice.org file to generate a DocBook XML semantic document from it and |
|---|
| 17 |
the associated DocBook XML high-quality normative HTML output. |
|---|
| 18 |
|
|---|
| 19 |
All the dependencies of CPSOOo are described in DEPENDENCIES.txt_. Be sure to |
|---|
| 20 |
read this file. |
|---|
| 21 |
|
|---|
| 22 |
.. _DEPENDENCIES.txt: DEPENDENCIES.txt |
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
Logic |
|---|
| 26 |
===== |
|---|
| 27 |
|
|---|
| 28 |
CPSOOo relies on 2 chained transformations from PortalTransforms: |
|---|
| 29 |
|
|---|
| 30 |
`ooo_to_docbook` -> `docbook_to_html` |
|---|
| 31 |
|
|---|
| 32 |
CPSOOo does not use nor rely on the `ooo_to_html` transform. |
|---|
| 33 |
|
|---|
| 34 |
Preview and indexation |
|---|
| 35 |
---------------------- |
|---|
| 36 |
|
|---|
| 37 |
The "preview" link will only appear if the `docbook_to_html` has been successful |
|---|
| 38 |
and thus that an HTML preview of an OpenOffice.org DocBook DocBook exists. |
|---|
| 39 |
|
|---|
| 40 |
Also note that the indexation of an OpenOffice.org DocBook Document will only |
|---|
| 41 |
happen if the "preview" link is present. This is because indexation if made |
|---|
| 42 |
through the `html_to_text` transform after the HTML preview of the document. |
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
Troubleshooting |
|---|
| 46 |
=============== |
|---|
| 47 |
|
|---|
| 48 |
Check the dependencies |
|---|
| 49 |
---------------------- |
|---|
| 50 |
|
|---|
| 51 |
All the dependencies of CPSOOo are described in DEPENDENCIES.txt_. Be sure to |
|---|
| 52 |
read this file since missing dependencies are a usual cause of errors. |
|---|
| 53 |
|
|---|
| 54 |
Problems might lie in one of the transforms ooo_to_docbook, docbook_to_html, or |
|---|
| 55 |
both. |
|---|
| 56 |
|
|---|
| 57 |
Some dependencies related problems have the following symptoms: |
|---|
| 58 |
|
|---|
| 59 |
- PyXML dependency missing: |
|---|
| 60 |
|
|---|
| 61 |
- In Zope logs at startup or when lauching tests: "CPSOOo cannot be loaded |
|---|
| 62 |
because there are some dependencies missing: No module named ext" |
|---|
| 63 |
- When lauching tests: "ImportError: No module named ext" |
|---|
| 64 |
|
|---|
| 65 |
- Other errors that may be consequences of missing dependencies (PyXML is |
|---|
| 66 |
one of them) |
|---|
| 67 |
|
|---|
| 68 |
- When lauching tests: "KeyError: 'CPSOOo:default'" |
|---|
| 69 |
- When lauching the CPSOOo installer (the old one, using CPSInstaller and |
|---|
| 70 |
CMFQuickInstallerTool if present), in tests or for real: "ValueError: |
|---|
| 71 |
Not a registered directory: CPSOOo/skins/cpsooo" |
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 |
Check mime-types presence |
|---|
| 75 |
------------------------- |
|---|
| 76 |
|
|---|
| 77 |
Check that both of the following mime-types are available in the |
|---|
| 78 |
`mimetypes_registry` (located at the root of your CPS instance): |
|---|
| 79 |
|
|---|
| 80 |
- `application/vnd.sun.xml.writer` |
|---|
| 81 |
- `application/docbook+xml` |
|---|
| 82 |
- `text/html` |
|---|
| 83 |
- `text/plain` |
|---|
| 84 |
|
|---|
| 85 |
If there are some mime-types missing, you should delete and then reinstall the |
|---|
| 86 |
`mimetypes_registry`: |
|---|
| 87 |
|
|---|
| 88 |
- With CPS >= 3.4.0 : reinstalling can be done through the `portal_setup` tool |
|---|
| 89 |
(located at the root of your CPS instance) by importing the `Required tools` |
|---|
| 90 |
import step from the "Import" tab. |
|---|
| 91 |
|
|---|
| 92 |
- With CPS version < 3.4.0 : reinstalling can be done through the External |
|---|
| 93 |
Method `portal_transforms_installer` (located at the root of the CPSinstance) by |
|---|
| 94 |
selecting the "Test" tab. |
|---|
| 95 |
|
|---|
| 96 |
Check transforms presence |
|---|
| 97 |
------------------------- |
|---|
| 98 |
|
|---|
| 99 |
Check that both `ooo_to_docbook` and `docbook_to_html` transforms are available |
|---|
| 100 |
in the `portal_transforms` tool (located at the root of your CPS instance). |
|---|
| 101 |
|
|---|
| 102 |
If there are some transforms missing, you should delete and then reinstall the |
|---|
| 103 |
`portal_transforms` tool: |
|---|
| 104 |
|
|---|
| 105 |
- With CPS >= 3.4.0 : reinstalling can be done through the `portal_setup` tool |
|---|
| 106 |
(located at the root of your CPS instance) by importing the `Required tools` |
|---|
| 107 |
import step from the "Import" tab. |
|---|
| 108 |
|
|---|
| 109 |
- With CPS version < 3.4.0 : reinstalling can be done through the External |
|---|
| 110 |
Method `portal_transforms_installer` (located at the root of the CPSinstance) by |
|---|
| 111 |
selecting the "Test" tab. |
|---|
| 112 |
|
|---|
| 113 |
If some transforms still don't show up in the portal_transforms tool it means |
|---|
| 114 |
that they cannot be found or executed by the tool. So examine each transform to |
|---|
| 115 |
find out the binary on which they might depend. This is the variable |
|---|
| 116 |
`binaryName` in the Python code of each transform. |
|---|
| 117 |
|
|---|
| 118 |
Typical problems |
|---|
| 119 |
~~~~~~~~~~~~~~~~ |
|---|
| 120 |
|
|---|
| 121 |
- ooo2dbk has not the right permissions: |
|---|
| 122 |
|
|---|
| 123 |
Solution:: |
|---|
| 124 |
|
|---|
| 125 |
$ chmod a+x /usr/local/zope/instance/cps1/Products/PortalTransforms/transforms/ooo2dbk/ooo2dbk |
|---|
| 126 |
|
|---|
| 127 |
- xsltproc is not in the classical `PATH` |
|---|
| 128 |
`/usr/local/bin:/usr/bin:/bin`: |
|---|
| 129 |
|
|---|
| 130 |
Diagnostic:: |
|---|
| 131 |
|
|---|
| 132 |
$ which xsltproc |
|---|
| 133 |
/usr/local/webhosting/libxslt-1.1.15/bin/xsltproc |
|---|
| 134 |
|
|---|
| 135 |
Solution: |
|---|
| 136 |
|
|---|
| 137 |
Create a link from `/usr/local/bin/xsltproc` to |
|---|
| 138 |
`/usr/local/webhosting/libxslt-1.1.15/bin/xsltproc` |
|---|
| 139 |
or (not recommended) edit |
|---|
| 140 |
/usr/local/zope/instance/cps1/Products/PortalTransforms/libtransforms/utils.py |
|---|
| 141 |
and in this file modify the variable `bin_search_path` so that it includes, |
|---|
| 142 |
for example, the path `/usr/local/webhosting/libxslt-1.1.15/bin`. |
|---|
| 143 |
|
|---|
| 144 |
|
|---|
| 145 |
Check transforms transformation logs |
|---|
| 146 |
------------------------------------ |
|---|
| 147 |
|
|---|
| 148 |
If you have all those needed components and transforms the error might be deeper |
|---|
| 149 |
and debugging through log reading might be needed. This is easy to do and doing |
|---|
| 150 |
this, it is easy to spot where problems lie. |
|---|
| 151 |
|
|---|
| 152 |
You just have to comment the following line which appears both in |
|---|
| 153 |
`PortalTransforms/transforms/ooo_to_docbook.py` and |
|---|
| 154 |
`PortalTransforms/transforms/docbook_to_html.py`:: |
|---|
| 155 |
|
|---|
| 156 |
self.cleanDir(tmpdir) |
|---|
| 157 |
|
|---|
| 158 |
Then you need to reload the transforms you have modified. This can be achieved |
|---|
| 159 |
by either restarting your Zope instance or selecting the "Reload transforms" tab |
|---|
| 160 |
of the portal_transforms tool at the root of your CPS instance. |
|---|
| 161 |
|
|---|
| 162 |
Finally you can create a new OpenOffice.org DocBook Document in CPS and read the |
|---|
| 163 |
log (which are usually in log/event.log) for lines such as:: |
|---|
| 164 |
|
|---|
| 165 |
2006-02-15T17:10:02 DEBUG(-200) ooo_to_docbook cmd = cd "/tmp/tmpJ8WHg_" && |
|---|
| 166 |
/usr/local/zope/instance/cps1/Products/PortalTransforms/transforms/ooo2dbk/ooo2dbk |
|---|
| 167 |
--dbkfile unknown.docb.xml /tmp/tmpJ8WHg_/unknown.sxw 2>"unknown.log-xsltproc" |
|---|
| 168 |
|
|---|
| 169 |
2006-02-15T17:10:03 DEBUG(-200) docbook_to_html cmd = cd "/tmp/tmp-77uq_" && |
|---|
| 170 |
/usr/bin/xsltproc --novalid |
|---|
| 171 |
/usr/local/zope/instance/cps1/Products/PortalTransforms/transforms/docbook/custom-xhtml.xsl |
|---|
| 172 |
/tmp/tmp-77uq_/unknown.docb.xml>>"unknown.docb.html" 2>"unknown.docb.log-xsltproc" |
|---|
| 173 |
|
|---|
| 174 |
|
|---|
| 175 |
You can then read the files in `/tmp/tmpJ8WHg_/` and `/tmp/tmp-77uq_` |
|---|
| 176 |
to find out where the problem lies. The files `unknown.log-xsltproc` and |
|---|
| 177 |
`unknown.docb.log-xsltproc` contain the output of the ooo2dbk and xsltproc |
|---|
| 178 |
programs. |
|---|
| 179 |
|
|---|
| 180 |
Note that the files `/tmp/tmpJ8WHg_/` and `/tmp/tmp-77uq_` are temporary files |
|---|
| 181 |
with random generated names that are different each time a new transformation |
|---|
| 182 |
runs. |
|---|
| 183 |
|
|---|
| 184 |
|
|---|
| 185 |
|
|---|
| 186 |
.. Local Variables: |
|---|
| 187 |
.. mode: rst |
|---|
| 188 |
.. End: |
|---|
| 189 |
.. vim: set filetype=rst: |
|---|