wiki:FactoryManual/StandardFactory

Version 6 (modified by sander, 8 years ago) (diff)

--

Factory Manual: Using the standard factory

<< Previous: Setting up your account | Next: OOOServer backend >>

This chapter details the installation and configuration of the standard factory that is distributed by Officeshots.org. If you are implementing your own factory from scratch you can skip this chapter, but if you want to develop a factory builds on the standard factory then you want to read this so you understand how configuration works.

Downloading and installing the standard factory

You can download the standard factory from our Subversion repository at http://code.officeshots.org/officeshots. You can also download a tar.gz package but it is easier to keep up-to-date when you download it from Subversion. Use the following command to download the latest version of the factory from Subversion:

$> svn checkout http://code.officeshots.org/officeshots/trunk/factory

To update your factory to the latest version, go to the directory where the factory is and run:

$> svn update

Next, copy conf/config.default.ini to conf/config.ini and open it in a text editor. Change the settings in the global section according to your preferences.

factory_name
The name of your factory. This must match the name of the factory that you created on the website. You can pick any name you like but all your factories must have a different name.
transport
Which SSL transport you want to use. Not all transports work on all platforms. Currently supported are m2crypto which requires the Python M2Crypto library, and pyssl which uses Python's built-in HTTPS connection. The default is currently mycrypto because it allows the use of PEM encrypted SSL client certificates.
log_file
The logfile that you want to log to.

By default log_file is set to /var/log/officeshots.org. On most Unix/Linux? systems you are not allowed to write to this directory with your normal account. You are strongly suggested to change this parameter.

log_level
Determines the verbosity of the log. Can be set to one of debug, info, warning, error or critical.
log_format
Determines the format of the log entries. Please see the Python documentation on logging for more detail.
xmlrpc_endpoint
The XML-RPC endpoint. This should normally be https://www.officeshots.org/xmlrpc
tls_certificate_file
A full path pointing to the file containing your PEM-encoded SSL/TLS certificate.
tls_key_file
Full path pointing to the file containing your PEM-encoded SSL/TLS private key. This can be the same file as your certificate.
load_max
The maximum system load. If the system load is greater than this value then the factory will sleep instead of poll for new jobs. This has currently no effect on Windows.
tmp_files
Path to a directory that will be used to store temporary files.
backends
A comma separated list of backends (applications) that are enabled. For every worker that you added to your factory on the server you should have a backend in your configuration file. See below for more information about backends.

Configuring backends

For every worker that you added to your factory on the Officeshots website you should have a backend in your configuration file. You can name the backends any way you like. Add them all to the backends in a comma separated list. Then, for all the backends in that list you need to have a separate configuration section. For example, if you added AbiWord? and Gnumeric as workers on the Officeshots website then you need two backends in your configuration file.

Example configuration

[Global]
backends = my_abiword, some_old_gnumeric

[my_abiword]
# Configuration options for AbiWord

[some_old_gnumeric]
# Configuration options for Gnumeric

If you do not want to use certain backends/sections then you only need to remove them from the backends line. You do not need to remove the entire sections. All the backends have at least a few configuration options in common.

If you do not want to use certain backends/sections then you only need to remove them from the backends line. You do not need to remove the entire sections. All the backends have at least a few configuration options in common.

application
The name of the application. This must be the same as the application name configured on the website.
version
The version number of the application, such as "3.0" or "2003 SP2".
doctypes
A comma separated list of doctypes codes that the application can handle, such as odt, ods or odp. This must be a subset of the doctypes that the application can handle according to the server. For example, OfficeReader? can handle odt, ods and odp files. You can skip processing of presentations by configuring the backend to only accept odt and ods files.

These are document type codes

formats
A comma separated list of format codes that the application can process such as png, pdf or odf.
backend
The name of the Python backend class that implements the worker.

Backend classes

Besides these standard configuration options each backend can have extra configuration options depending on the backend type. Currently two different backend classes have been implemented:

Running the standard factory

To run the standard factory, execute the src/factory.py script. There are a couple of extra commandline arguments that you can pass to this script.

--?, --h, --help
Show the help on the commandline options.
-c, --condig
Full path to the configuration file to use. By default conf/config.ini is used.
-d, --debug
Turn on debugging. When debugging is on the log_level will be set to debug, all log messages will appear on the console and all XML-RPC requests and responses will be echoed.

NoteBox(note, If you are running !OpenOffice.org on Windows then you must run the `factory.py` script with the Python version that was installed by !OpenOffice.org. The Python UNO bridge does not work with any other version of Python on Windows. However, you do need the other libraries from the standard Python since the !OpenOffice.org version of Python does not understand SSL connections.[[br?
To make this easier for Windows users, there is a script called utils/ooofactory.bat that automatically starts the factory with the correct Python versions and libraries. Make sure you have Python 2.6 installed. Then edit the ooofactory.bat script and make sure that the paths to Python 2.6 and OpenOffice.org are correct. The double-click the file to start the factory.)]]

Please install some extra fonts on the machine that you are running the factory. Fonts itself are not part of the ODF specification but are part of the system that the application is running on. Officeshots serves an international audience. If someone uploads a document with Chinese characters but you do not have such a font installed

<< Previous: Setting up your account | Next: OOOServer backend >>