Version 2 (modified by djay, 15 years ago) |
---|
ZOO Kernel using OpenOffice UNO support
To be able to use the Exporter ZOO Service Provider, you'll have to follow this intructions.
Install OpenOffice and start it in server mode
First of all, you'll have to setup OpenOffice? on your machine, then use the following commnd to start OpenOffice? Server :
soffice -nofirststartwizard -norestore \ -nocrashreport -norecovery \ -accept="socket,host=127.0.0.1,port=3662;urp"
Now, you should get an OpenOffice? server ready to be used remotly, using 127.0.0.1 ip adress and 3662 port.
Make sure your OpenOffice? Server started correctly using the following command (replace grep by findstr on WIN32 platform) :
netstat -na | grep "LISTEN " | grep 3662
Compile ZOO Kernel
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?.
Here, you'll find the specific section sample you can copy/paste in your local Makefile :
PYTHONCFLAGS=-I/opt/openoffice.org/basis3.0/program/python-core-2.3.4/include/python2.3/ -fno-strict-aliasing -DNDEBUG PYTHONLDFLAGS=-L/opt/openoffice.org/basis3.0/program/ -lpthread -ldl -lutil -lm /opt/openoffice.org/basis3.0/program/libpython2.3.so.1.0
Now, recompile your ZOO Kernel then copy it into your apache cgi-bin directory using the following commands :
make clean make cp zoo_loader.cgi /var/www/localhost/cgi-bin/zoo_loader_oo.cgi
Now update your /etc/ld.so.conf to add the directory where the OpenOffice? shared lilbraries are located.
/opt/openoffice.org3/basis-link/program/
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.
Configure your ZOO Kernel
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.
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).
[env] LD_LIBRARY_PATH=/opt/openoffice.org3/basis-link/program/ URE_BOOTSTRAP=vnd.sun.star.pathname:/opt/openoffice.org3/program/fundamentalrc PYTHONHOME=/opt/openoffice.org3/program/../basis-link/program/python-core-2.3.4 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:. [oo] server=uno:socket,host::127.0.0.1,port::3662;urp;StarOffice.ComponentContext
Also ensure that the following parameters are present in your [main] section :
- dataPath path to find the original document (sample value : /var/www/localhost/htdocs/data-srtm)
- tmpPath path to store produced document (sample value: /var/www/localhost/htdocs/ms_tmp)
- tmpUrl (Optional) url to get back produced document - relative to the ZOO Kernel location (sample value : /ms_tmp/)
To check which are your local parameters, please use the following commands :
/opt/openoffice.org3/program/python >>> import sys >>> print sys.path
Test it !
Last thing to do before testing your ZOO ServiceProvider? is to deploy it in your local installation.
cp zoo-project/zoo-services/openoffice/cgi-env/* /var/www/localhost/cgi-bin/
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) :
http://localhost/zoo/?Service=WPS&Request=Execute&Version=1.0.0&Identifier=OdtConverter&DataInputs=InputDoc=demoDoc.odt@dataType=string;OutputDoc=demoDoc.pdf@dataType=string
You can also consult our local ZOO Kernel installation using this form !