Setup:Installation Guide/Advanced/Maintenance scripts/export and AutoDoc:BlueSpiceExportTables: Difference between pages

(Difference between pages)
(Created page with "== Running the script == The script to export wiki pages to PDF is executed from: <syntaxhighlight lang="text"> php {MW_ROOT}/extensions/BlueSpiceUniversalExport/maintenance/e...")
 
m (1 revision imported)
 
Line 1: Line 1:
== Running the script ==
==DescriptionMsg==
The script to export wiki pages to PDF is executed from: <syntaxhighlight lang="text">
{{AutoDocDescriptionMsg
php {MW_ROOT}/extensions/BlueSpiceUniversalExport/maintenance/export.php --specification-file=spec.json
|name = BlueSpiceExportTables
</syntaxhighlight>The specification file spec.json can have the following content:<syntaxhighlight lang="text">
|desc = {{int:bs-exporttables-extension-description
{
}}
    "module": "pdf",
}}
    "attachments": 1,
==License==
    "recursive": 1,
{{AutoDocLicense
    "title": "PDF",
|name = GPL-3.0-only
    "target": "localfilesystem",
}}
    "target-file-name": "All.pdf",
==Requirements==
    "target-file-path": "/path/to/target-file"
{{AutoDocRequirements
}
|mediawiki = {{AutoDocVersion
</syntaxhighlight>
|name = MediaWiki
{| class="wikitable" style="width: 100%;"
|version = 1.36.0
|+
}}
! style="width:200px;" |Key
|extensions = {{AutoDocVersion
! style="width:200px;" |Value
|name = BlueSpiceFoundation
!Description
|version = 4.1
|-
}}
| style="width:200px;" |module
{{AutoDocVersion
| style="width:200px;" |pdf
|name = BlueSpiceUEModuleTable2Excel
|
|version = 4.1
|-
}}
| style="width:200px;" |attachments
}}
| style="width:200px;" |1
==IntegratesInto==
0
{{AutoDocIntegratesInto
|
|into = {{AutoDocListItem
|-
|item = BlueSpiceExtendedStatistics
| style="width:200px;" |recursive
}}
| style="width:200px;" |1
{{AutoDocListItem
0
|item = BlueSpiceVisualEditorConnector
|
}}
|-
}}
| style="width:200px;" |title
==Config==
| style="width:200px;" |string
{{AutoDocConfig
|
|config = {{AutoDocOption
|-
|name = ExportTablesMenuTargetSelector
| style="width:200px;" |target
|value = <nowiki>'#mw-content-text table.bs-exportable, .mw-datatable'</nowiki>
| style="width:200px;" |localfilesystem
}}
|
}}
|-
==Hooks==
| style="width:200px;" |target-file-name
{{AutoDocHooks
| style="width:200px;" |
|Hooks = {{AutoDocCallback
|
|name = [https://www.mediawiki.org/wiki/Manual:Hooks/BeforePageDisplay BeforePageDisplay]
|-
|callback = \BlueSpice\ExportTables\Hook\BeforePageDisplay\AddResources::callback
| style="width:200px;" |target-file-path
}}
| style="width:200px;" |
}}
|
|}


== Creating a page list for the export ==
The pages to be exported are defined in the wiki page that is shown as the <code>title</code> in the json-file. (In the example above, this is the page <code>PDF</code> .)
The page <code>PDF</code> now needs to list all pages  that will be exported to PDF.
This list can be created with an [[SMW queries|SMW inline query]] (BlueSpice free) or with a [[Manual:Extension/DynamicPageList3|DPL3 list]] (BlueSpice free).
Example of an SMW query to create an export for all pages in the categories <code>Process</code> and <code>Work instruction</code>:<syntaxhighlight lang="text">
==All processes==
{{#ask:[[Process:+]]|format=ul|limit=99999}}
==All work instructions==
{{#ask:[[Work instruction:+]]|format=ul|limit=99999}}
</syntaxhighlight>The same list can be created with the following DPL3 syntax:<syntaxhighlight lang="text">
==All processes==
{{#dpl:category=Process}}
==All work instructions==
{{#dpl:category=Work instruction}}
</syntaxhighlight>
== Setting up a CronJob ==
To automate the export, the following CronJob is available:<syntaxhighlight lang="text">
CronJob für Export
php {MW_ROOT}/extensions/BlueSpiceUniversalExport/maintenance/export.php --specification-file={MW_ROOT}/extensions/BlueSpiceFoundation/data/notfall.json
</syntaxhighlight>

Revision as of 12:44, 22 June 2023

DescriptionMsg

Allows export of tables to Excel and CSV

License

GPL-3.0-only

Requirements

  • MediaWiki: 1.36.0
  • BlueSpiceFoundation: 4.1

BlueSpiceUEModuleTable2Excel: 4.1

IntegratesInto

  • BlueSpiceExtendedStatistics
  • BlueSpiceVisualEditorConnector

Config

Configuration

Name Value
ExportTablesMenuTargetSelector '#mw-content-text table.bs-exportable, .mw-datatable'

Hooks

Hooks



To submit feedback about this documentation, visit our community forum.

No categories assignedEdit

Discussions