ODT Reportman Installation
These instructions for installation were checked on
Ubuntu Precise (12.04) and
Ubuntu Trusty (14.04) with downgrade to Apache 2.2
Packages
These packages are prerequisite for the ODT Report Manager:
apt-get -y install libxml-simple-perl
cpan XML::Simple::Sorted
cpan IPC::Run::SafeHandles
cpan Text::Balanced
Perlbrew
Because of
ODF::lpOD
incompatibility with the Perl version
5.14
, used by MasonSQL in some deployments, the Perlbrew must be installed to use a newer version of Perl.
See the
MasonSQL Configuration Matrix.
To install Perlbrew, with all the necessary libraries, run following
perlbrew-deploy.sh script as a
root
user:
sudo /opt/masonsql/utility/perlbrew-deploy.sh
Libreoffice
# Proceed with root privileges.
sudo su -
# Install latest System.LibreOffice (5.0 or later).
# Ubuntu Precise (12.04)
apt-get install python-software-properties
# Ubuntu Trusty (14.04)
# apt-get install software-properties-common
sudo add-apt-repository ppa:libreoffice/ppa
sudo apt-get update
apt-get install openjdk-9-jre libreoffice-writer
# Se si utilizzano anche i file ODS
apt-get install libreoffice-calc
# Install pdftk.
apt-get install pdftk
Unoconv Daemon
Unoconv can be used by ODT Report Manager to convert
.odt
files to
.pdf
format.
The
OdtConvEngine
environment variable must be configured with "OdtConvEngine" as an alternative to "libreoffice".
# Proceed with root privileges.
sudo su -
# Install latest Unoconv.
cd /tmp
apt-get install git
git clone https://github.com/dagwieers/unoconv
cd unoconv/
make install
cd ../
rm -rf unoconv/
# Ubuntu Trusty (14.04) - You must use python3
sed -i~ 's/^#!\/usr\/bin\/env python$/#!\/usr\/bin\/env python3/' /usr/bin/unoconv
# Install and start Unoconv daemon.
ln -s /opt/masonsql/etc/unoconvd /etc/init.d/unoconvd
update-rc.d unoconvd defaults
service unoconvd start
Tables
The queries for creating the ODT tables are in the
/opt/masonsql/utility/sql/odt_report_tables.mql
file.
Before applying the queries the owner name
postgres
must be changed to the new owner name
my_db_owner_name
.
Configuration
ODT Report Manager uses a couple of Apache configuration variables.
Following is an example configuration in the
/opt/my_app_name/etc/apache2.my_app_name-devel.my_domain_name.conf
file:
# Path of this apache configuration file
PerlSetVar ConfigPath /opt/my_app_name/etc/apache2.my_app_name-devel.my_domain_name.conf
# Temporary directory
PerlSetVar TmpDir /opt/my_app_name/tmp
# Default report engine configuration:
# rep = old Report Manager
# odt = new ODT Report printed in odt format
# pdf = new ODT Report printed in pdf format
PerlSetVar DefaultReportEngine "pdf"
# ODT Reportman's access to DB
PerlSetVar ReportDBIconnect "dbi:Pg:dbname=my_db_name;user=report;password=MyReportPassword"
# Archive for templates
PerlSetVar InputFilesArchive "/opt/my_app_name/archive"
The
InputFilesArchive
is used by
Files Component. The component stores its files in the sub-directories which must be created:
cd /opt/my_app_name/archive
mkdir public
chown www-data:www-data public
mkdir odt_reports
chown root:www-data odt_reports
chmod 775 odt_reports
Without correct access permissions for the application's Apache config file the ODT Report Manager returns an error. Example of correctly set permissions:
-rw-r----- 1 root www-data 10182 Aug 19 12:13 /opt/my_app_name/etc/apache2.labs.leader.it.conf
In order to apply changes, Apache configuration file must be reloaded:
/etc/init.d/apache2 reload
Functions and Permissions
Example setup of the ODT Reportman's permissions:
