This repository holds source code for OpenOffice/LibreOffice Calc macros used to download Red Hat documentation and create diffs. It simplifies performing documentation checks for our team (MSGQE). It may be also useful for a customer who is upgrading to a new minor release of a Red Hat product.
This repository is product-agnostic. There is another repo with MSGQE specific files.
This software holds a JVM rewrite of internal tool jbossqe-eap-docs, a set of OOBasic macros used by the JBoss EAP QE team.
The reasons for the rewrite are as follows.
- AFAICT, nobody on MSGQE team is comfortable with OOBasic.
- LibreOffice Java API offers at least some code completion in IDEs.
- Keeping the macros outside of the spreadsheet seemed better than embedding it.
- Can have unittests for the code, so making changes will be faster.
- image links are replaced with embedded images
- image size is preserved
- for better performance, doc text (HTML without any UI chrome) is fetched using API
This tool supports the following workflow.
- Take a snapshot of what is published.
- Create diff against previously checked snapshot.
- Check all features described in modified sections.
- Report issues to Jira.
- Commit new snapshot to git.
Snapshots allow keeping track of what was checked and when. Otherwise the documentation would keep changing under our hands.
Diffs allow focusing our attention on new and modified instructions. Which is what needs checking the most.
Tracking the snapshots and diffs in git keeps record of what was checked and enables sharing it among the team.
This tool is developed and used for LibreOffice. It should work with OpenOffice as well.
The tests require running soffice
that was given the -accept
flag:
soffice --headless --accept="socket,host=localhost,port=2002;urp;StarOffice.ServiceManager"
(no window will open and nothing will be printed; this is headless execution)
Some tests open dialog boxes for visual inspection. These tests require soffice running without the --headless
option.
This repository is built by Gradle. Use the wrapper (Unix or Windows version) to invoke Gradle. There is a custom task that installs the macro into your LibreOffice user directory.
./gradlew installMacro -Poo.scriptsdir=~/.config/libreofficedev/4/user/Scripts
(from https://ask.libreoffice.org/en/question/2641/convert-to-command-line-parameter/)
It is possible to change user profile directory. This way, multiple soffice instances may run at the same time.
Do not forget to install the macros to all profiles where they are needed.
soffice -env:UserInstallation=file:///tmp/tempprofile --headless --convert-to csv FileName
- Create a new Git repository.
- Copy the file
sheet.fods
there and name it with the name of the product, for exampleAMQ7.fods
. - Edit the sheet and set correct URLs.
The .fods
document contains these sheets:
- Files -- downloading documentation, converting to FODT & PDF formats
- Comparisons -- detecting changed books, generating diff documents, exporting diffs to PDF format
- Settings -- configuration for the macros
- <PRODUCT_BUILD> -- new sheet is created after each download using Files sheet; it includes books downloaded with a particular build, specifies path to downloaded books
The following tasks can be performed:
- In column 'B' specify URL which the book should be downloaded from (multiple URLs can be specified to download multiple books in one step)
- Make sure column 'A' does not contain string 'Finished' (if it does, delete it)
- Click 'Download documentation (click to download selected documentation)'
- Enter version parameter (last used is pre-filled) and click 'OK'
- Books specified in step 1 are downloaded and stored in EAP- directory
- If there is a row without 'Finished' in column 'A', then the book specified in the row has changed since last build
- Click 'Click to compare documents which were not yet compared' to compare the changed books
- Wait, it may take some time
- Diff documents are stored in EAP-/comparison directory
- In column 'B:Original' specify path to ODT format of original book
- In column 'C:New' specify path to ODT format of new book
- In column 'D:Destination' specify path where the result should be stored; see bellow for diagram of directory structure
- Click 'Click to compare documents which were not yet compared' to compare specified books
- Diff documents are stored in directory specified in step 3
- Macros must be enabled in the document; Default LibreOffice Security changes must be modified in order to do so.
- The LibreOffice GUI freezes while the macros run. There is probably nothing that can be done about it.
Example of directory structure for EAP 6.3.0 (explanation below):
jbossqe-eap-docs/
|-- EAP6ComparisonSheet.ods
|-- EAP7ComparisonSheet.ods
|-- EAP-6.3.0.ER1
| `-- ODT and PDF formats of full books
|-- EAP-6.3.0.ER2
| |-- comparison
| | `-- ODT and PDF formats of comparison documents - compared to previous build (EAP-6.3.0.ER1)
| `-- ODF and PDF formats of full books
`-- EAP-6.3.0.ER2-rebuild1
|-- comparison
| |-- EAP-6.3.0.ER1
| | `-- ODT and PDF formats of comparison documents - compared to specified build (EAP-6.3.0.ER1)
| `-- ODT and PDF formats of comparison documents - compared to previous build (EAP-6.3.0.ER2)
`-- ODF and PDF formats of full books
- EAP6ComparisonSheet.ods -- tool for automated documents download and comparison, used for EAP 6
- EAP7ComparisonSheet.ods -- tool for automated documents download and comparison, used for EAP 7
- EAP-6.3.0.ER1 -- first build of particular EAP release, all books in PDF and ODT format are stored
- EAP-6.3.0.ER2 -- following builds (starting with ER2) in addition contain comparison directory
- comparison -- diff to previous version in PDF and ODT format; if it is needed, diff to another version can be generated and it is stored under comparison/<another_version> directory
Guidelines for EAP 6 documentation check in mojo: https://mojo.redhat.com/docs/DOC-953899 Guidelines for EAP 7 documentation check in mojo: https://mojo.redhat.com/docs/DOC-1049012
[email protected] author of this Java fork
[email protected] EAP documentation check coordinator [email protected] backup contact for EAP documentation check coordination