| 1 | = ZOO Kernel using !OpenOffice UNO support = |
| 2 | |
| 3 | To be able to use the Exporter ZOO Service Provider, you'll have to follow this intructions. |
| 4 | |
| 5 | == Install !OpenOffice and start it in server mode == |
| 6 | |
| 7 | First of all, you'll have to setup OpenOffice on your machine, then use the following commnd to start OpenOffice Server : |
| 8 | |
| 9 | {{{ |
| 10 | #!sh |
| 11 | soffice -nofirststartwizard -norestore \ |
| 12 | -nocrashreport -norecovery \ |
| 13 | -accept="socket,host=127.0.0.1,port=3662;urp" |
| 14 | }}} |
| 15 | |
| 16 | Now, you should get an OpenOffice server ready to be used remotly, using {{{127.0.0.1}}} ip adress and {{{3662}}} port. |
| 17 | |
| 18 | Make sure your OpenOffice Server started correctly using the following command (replace {{{grep}}} by {{{findstr}}} on WIN32 platform) : |
| 19 | |
| 20 | {{{ |
| 21 | #!sh |
| 22 | netstat -na | grep "LISTEN " | grep 3662 |
| 23 | }}} |
| 24 | |
| 25 | == Compile ZOO Kernel == |
| 26 | |
| 27 | First compile using your local Python installation. Then edit the Makefile and set {{{PYTHONCFLAGS}}} to your local OpenOffice Python headers installation path as for {{{PYTHONLDFLAGS}}} to the python shared library provided by OpenOffice. |
| 28 | |
| 29 | Here, you'll find the specific section sample you can copy/paste in your local Makefile : |
| 30 | |
| 31 | {{{ |
| 32 | PYTHONCFLAGS=-I/opt/openoffice.org/basis3.0/program/python-core-2.3.4/include/python2.3/ -fno-strict-aliasing -DNDEBUG |
| 33 | PYTHONLDFLAGS=-L/opt/openoffice.org/basis3.0/program/ -lpthread -ldl -lutil -lm /opt/openoffice.org/basis3.0/program/libpython2.3.so.1.0 |
| 34 | }}} |
| 35 | |
| 36 | Now, recompile your ZOO Kernel then copy it into your apache cgi-bin directory using the following commands : |
| 37 | |
| 38 | {{{ |
| 39 | #!sh |
| 40 | make clean |
| 41 | make |
| 42 | cp zoo_loader.cgi /var/www/localhost/cgi-bin/zoo_loader_oo.cgi |
| 43 | }}} |
| 44 | |
| 45 | Now update your {{{/etc/ld.so.conf}}} to add the directory where the OpenOffice shared lilbraries are located. |
| 46 | |
| 47 | {{{ |
| 48 | /opt/openoffice.org3/basis-link/program/ |
| 49 | }}} |
| 50 | |
| 51 | Note that if you already have a {{{/libpython2.3.so.1.0}}} installed in your {{{/usr/lib}}} directory then you'll have to save then create a symbolic link from {{{/usr/lib}}} to your OpenOffice corresponding library. |
| 52 | |
| 53 | == Configure your ZOO Kernel == |
| 54 | |
| 55 | To make the Exporter ZOO ServiceProvider working, you'll have to edit the main ZOO configuration file ({{{main.cfg}}}) located in the same directory as you kernel to add some specific parameters needed by Python to support UNO. |
| 56 | |
| 57 | First, set the paths in {{{[env]}}} section, as for other parameters in this section they will be automaticaly setted by ZOO Kernl before calling ZOO ServiceProvider. Then, add the {{{[oo]}}} section containing the parameter {{{server}}} which contain the UNO connection string (setted to your local OpenOffice Server listen adress and port). |
| 58 | |
| 59 | {{{ |
| 60 | [env] |
| 61 | LD_LIBRARY_PATH=/opt/openoffice.org3/basis-link/program/ |
| 62 | URE_BOOTSTRAP=vnd.sun.star.pathname:/opt/openoffice.org3/program/fundamentalrc |
| 63 | PYTHONHOME=/opt/openoffice.org3/program/../basis-link/program/python-core-2.3.4 |
| 64 | PYTHONPATH=/opt/openoffice.org3/program/../basis-link/program:/opt/openoffice.org3/program/../basis-link/program:/opt/openoffice.org3/program/../basis-link/program/python-core-2.3.4/lib:/opt/openoffice.org3/program/../basis-link/program/python-core-2.3.4/lib/lib-dynload:/opt/openoffice.org3/program/../basis-link/program/python-core-2.3.4/lib/lib-tk:/opt/openoffice.org3/program/../basis-link/program/python-core-2.3.4/lib/site-packages:/opt/openoffice.org3/basis-link/program:/opt/openoffice.org3/basis-link/program/python-core-2.3.4/lib:/opt/openoffice.org3/basis-link/program/python-core-2.3.4/lib/lib-dynload:/opt/openoffice.org3/basis-link/program/python-core-2.3.4/lib/lib-tk:/opt/openoffice.org3/basis-link/program/python-core-2.3.4/lib/site-packages:/opt/openoffice.org3/basis-link/program/python-core-2.3.4/lib/python23.zip:/opt/openoffice.org3/basis-link/program/python-core-2.3.4/lib/python2.3:/opt/openoffice.org3/basis-link/program/python-core-2.3.4/lib/python2.3/plat-linux2:/opt/openoffice.org3/basis-link/program/python-core-2.3.4/lib/python2.3/lib-tk:/opt/openoffice.org3/basis-link/program/python-core-2.3.4/lib/python2.3/lib-dynload:. |
| 65 | |
| 66 | [oo] |
| 67 | server=uno:socket,host::127.0.0.1,port::3662;urp;StarOffice.ComponentContext |
| 68 | }}} |
| 69 | |
| 70 | Also ensure that the following parameters are present in your {{{[main]}}} section : |
| 71 | * {{{dataPath}}} path to find the original document (sample value : /var/www/localhost/htdocs/data-srtm) |
| 72 | * {{{tmpPath}}} path to store produced document (sample value: /var/www/localhost/htdocs/ms_tmp) |
| 73 | * {{{tmpUrl}}} (Optional) url to get back produced document - relative to the ZOO Kernel location (sample value : /ms_tmp/) |
| 74 | |
| 75 | |
| 76 | To check which are your local parameters, please use the following commands : |
| 77 | |
| 78 | {{{ |
| 79 | #!sh |
| 80 | /opt/openoffice.org3/program/python |
| 81 | >>> import sys |
| 82 | >>> print sys.path |
| 83 | }}} |
| 84 | |
| 85 | == Test it ! == |
| 86 | |
| 87 | Last thing to do before testing your ZOO ServiceProvider is to deploy it in your local installation. |
| 88 | |
| 89 | {{{ |
| 90 | #!sh |
| 91 | cp zoo-project/zoo-services/openoffice/cgi-env/ /var/www/localhost/cgi-bin/ |
| 92 | }}} |
| 93 | |
| 94 | Now evertyhing should be correctly settled up on your local system. To test your local !OpenOffice !ServiceProvider, please use following urls (supposing that you get a {{{demoDoc.odt}}} file located in your {{{dataPath}}} directory) : |
| 95 | |
| 96 | {{{ |
| 97 | http://localhost/zoo/?Service=WPS&Request=Execute&Version=1.0.0&Identifier=OdtConverter&DataInputs=InputDoc=demoDoc.odt@dataType=string;OutputDoc=demoDoc.pdf@dataType=string |
| 98 | }}} |
| 99 | |
| 100 | You can also consult our local ZOO Kernel installation using [http://www.zoo-project.orgindex.php?left=zoodemo-odtconverter&special=1 this form] ! |