wiki:FactoryManual/StandardFactory/CLI

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

--

Factory Manual: CLI Backend

Previous: OOOServer backend | Next: Creating new backends >>

The CLI backend implements a generic interface for applications that can convert documents using the commandline. You can find default configurations for applications that support this, like AbiWord?, in the config.default.ini file.

Besides the standard configuration options, you need to set the following options for the CLI backend.

command
The command to execute. This command should generate a file on your computer containing the converted document. You can use various placeholders in this command. See CLI placeholders.
result
Full path to the file that contains the converted document after the command has run. You can use various placeholders in this command. See CLI placeholders
default_format
The default format code to use if the user did not specify a desired output format.

CLI placeholders

You can use various placeholders in the command and result configuration options.

%source_path
The full path to the source file to convert. For example, /tmp/officeshots/test.odt.
%source_dir
The directory where the source file is located. Usually this is equal to the directory where Officeshots stores it's temporary files, for example /tmp/officeshots.
%source_file
The filename of the source file, for example test.odt.
%source_base
The basename of the source file. That is, the name without the extension. If the filename of the source file is test.odt then the basename would be test. At the moment, the CLI backend stores it's temprary files using the job unique ID as it's filename, so usually this value will be equal to the %jobid placeholder.
%source_ext
The filename extension of the source file. If the filename of the source file is test.odt then the extension would be odt.
%jobid
The unique ID (UUID) for the job that you are processing.
%format
The format code for this job. If the user did not request a specific format then this will be set to the default format that you configured.
%dest_ext
The default file extension that should be used for the result document.
%temp_dir
Path to the directory where Officeshots stores temporary files. For example /tmp/officeshots.

Previous: OOOServer backend | Next: Creating new backends >>