Running the script
The script to export wiki pages to PDF is executed from:
php {MW_ROOT}/extensions/BlueSpiceUniversalExport/maintenance/export.php --specification-file=spec.json
The specification file spec.json can have the following content:
{
"module": "pdf",
"attachments": 1,
"recursive": 1,
"title": "PDF",
"target": "localfilesystem",
"target-file-name": "All.pdf",
"target-file-path": "/path/to/target-file"
}
Key | Value | Description |
---|---|---|
module | ||
attachments | 1
0 |
|
recursive | 1
0 |
|
title | string | |
target | localfilesystem | |
target-file-name | ||
target-file-path |
Creating a page list for the export
The pages to be exported are defined in the wiki page that is shown as the title
in the json-file. (In the example above, this is the page PDF
.)
The page PDF
now needs to list all pages that will be exported to PDF.
This list can be created with an SMW inline query (BlueSpice free) or with a DPL3 list (BlueSpice free).
Example of an SMW query to create an export for all pages in the categories Process
and Work instruction
:
==All processes==
{{#ask:[[Process:+]]|format=ul|limit=99999}}
==All work instructions==
{{#ask:[[Work instruction:+]]|format=ul|limit=99999}}
The same list can be created with the following DPL3 syntax:
==All processes==
{{#dpl:category=Process}}
==All work instructions==
{{#dpl:category=Work instruction}}
Setting up a CronJob
To automate the export, the following CronJob is available:
CronJob für Export
php {MW_ROOT}/extensions/BlueSpiceUniversalExport/maintenance/export.php --specification-file={MW_ROOT}/extensions/BlueSpiceFoundation/data/notfall.json