[ADD] dms_libreoffice_preview: server-side office→PDF preview handler - #6
Closed
dnplkndll wants to merge 0 commit into
Closed
[ADD] dms_libreoffice_preview: server-side office→PDF preview handler#6dnplkndll wants to merge 0 commit into
dnplkndll wants to merge 0 commit into
Conversation
dnplkndll
added a commit
that referenced
this pull request
May 25, 2026
The new module addition (dms_libreoffice_preview) pushed after a burst of activity on PR #3 / PR #5 today \u2014 GitHub's anti-abuse heuristic silently dropped the pull_request trigger for PR #6. workflow_dispatch lets us `gh workflow run` manually when this happens. Same pattern used on the 19.0-imp-dms-ux + 19.0-ci-ui-artifacts branches.
dnplkndll
added a commit
that referenced
this pull request
May 25, 2026
The new module addition (dms_libreoffice_preview) pushed after a burst of activity on PR #3 / PR #5 today \u2014 GitHub's anti-abuse heuristic silently dropped the pull_request trigger for PR #6. workflow_dispatch lets us `gh workflow run` manually when this happens. Same pattern used on the 19.0-imp-dms-ux + 19.0-ci-ui-artifacts branches.
dnplkndll
force-pushed
the
19.0-add-dms-libreoffice-preview
branch
from
May 25, 2026 20:25
ad6c14d to
5c2f379
Compare
dnplkndll
added a commit
that referenced
this pull request
May 25, 2026
The new module addition (dms_libreoffice_preview) pushed after a burst of activity on PR #3 / PR #5 today \u2014 GitHub's anti-abuse heuristic silently dropped the pull_request trigger for PR #6. workflow_dispatch lets us `gh workflow run` manually when this happens. Same pattern used on the 19.0-imp-dms-ux + 19.0-ci-ui-artifacts branches.
dnplkndll
force-pushed
the
19.0-add-dms-libreoffice-preview
branch
from
May 25, 2026 20:26
5c2f379 to
55bfe72
Compare
dnplkndll
added a commit
that referenced
this pull request
May 25, 2026
…TP tests Two CI failures from the first run on PR #6: 1. test_cache_invalidation: previous version keyed the cache on write_date, which doesn't reliably bump between a .write() call and the very next read in the same transaction \u2014 both calls hit the same cached attachment id and the assertion failed. Switch the cache key to dms.file.checksum (SHA1 of content, already maintained by base dms). Renaming a file no longer triggers re-conversion; only an actual content change does. Test renamed to test_cache_invalidation_on_content_change and writes a fresh ODT body via a seeded _build_minimal_odt(seed=...) helper. 2. test_controller_returns_pdf returned 404 because admin isn't in DocumentsBaseCase.access_group; check_access('read') failed and the controller short-circuited. Authenticate as dms-user (which IS in the group) and set its password since new_test_user() leaves it blank by default.
dnplkndll
force-pushed
the
19.0-add-dms-libreoffice-preview
branch
2 times, most recently
from
May 25, 2026 21:36
794f0ef to
5f2f1e1
Compare
dnplkndll
force-pushed
the
19.0-add-dms-libreoffice-preview
branch
from
May 25, 2026 22:08
5f2f1e1 to
2c7584a
Compare
dnplkndll
force-pushed
the
19.0-imp-dms-ux
branch
from
May 25, 2026 22:09
7376dd1 to
e0eb62c
Compare
dnplkndll
force-pushed
the
19.0-add-dms-libreoffice-preview
branch
from
May 25, 2026 22:09
2c7584a to
a9f9ba7
Compare
dnplkndll
force-pushed
the
19.0-imp-dms-ux
branch
from
May 25, 2026 22:31
e0eb62c to
bceef7c
Compare
dnplkndll
force-pushed
the
19.0-add-dms-libreoffice-preview
branch
from
May 25, 2026 22:31
a9f9ba7 to
d9c2f07
Compare
dnplkndll
force-pushed
the
19.0-imp-dms-ux
branch
2 times, most recently
from
May 25, 2026 23:21
095f9d7 to
e8ffea4
Compare
dnplkndll
force-pushed
the
19.0-add-dms-libreoffice-preview
branch
from
May 25, 2026 23:21
d9c2f07 to
38cf981
Compare
dnplkndll
force-pushed
the
19.0-imp-dms-ux
branch
from
May 25, 2026 23:34
e8ffea4 to
cbb1ac7
Compare
dnplkndll
force-pushed
the
19.0-add-dms-libreoffice-preview
branch
from
May 25, 2026 23:34
38cf981 to
cbb1ac7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #3. Needs PR #3's preview-handlers registry (dms.preview_handlers, introduced in Phase 3 of the UX work) — the JS handler in this module imports from
@dms/js/components/preview/preview_registry.esmwhich only exists with #3 applied. PR base targets19.0-imp-dms-uxaccordingly.First downstream consumer of the Phase 13 preview registry introduced in OCA/dms 19.0. Fork-only PR for runboat preview + stakeholder review; will reopen against
OCA/dmsonce the 19.0.1.0.0 base wheel ships.What's shipped
A new sibling addon
dms_libreoffice_preview/that converts office files to PDF on the server via headless LibreOffice and routes them through the existing side-pane preview, replacing the OfficeFallbackPreview download card.ir.attachmentof the sourcedms.file(res_model/res_id), keyed onwrite_datein thedescriptionfield. Cache auto-invalidates when the source changes and auto-cascades on file deletion.dms.file.check_access('read')before serving; the preview attachment inherits the parent's permissions..~lockcollisions between concurrent workers. Daemon mode (unoserver) is a future optimization, not v1.10— beats the score-0OfficeFallbackPreviewin base dms, leaves room for a futuredms_onlyofficeat score 20.o_dms_preview__iframeclass so the browser's native PDF viewer renders the result identically to source-PDF files.Architecture
External dependency
LibreOffice + fonts. Declared via
external_dependencies.debin__manifest__.pyso OCA CI'soca_install_apt_packagespicks them up automatically:fonts-noto+fonts-liberationmatter even in containers that already have a base font set — headless LibreOffice substitutes ugly fallbacks for missing common fonts and you end up with unreadable PDFs.Tests
_ensure_libreoffice_preview()produces a PDF attachment with%PDF-magic bytesir.attachment.id, no new subprocesswrite_datedrift forces a new conversionFileNotFoundError→UserErrorwith install hintapplication/pdffor office filesLibreofficePreviewat score10srcincludes/dms/file/<id>/libreoffice_preview+v=cache-bustsoffice-dependent tests skip cleanly when the binary isn't on PATH (covers local dev environments without LibreOffice installed).
Composes with future
dms_onlyofficeOnlyOffice Document Server is a different product (live editing + collab, separate container, AGPL or commercial). When/if
dms_onlyofficeships, it registers at score20and wins over this module for office mimetypes — both can coexist; the higher score wins. See memory:dms_onlyoffice_prior_art.mdfor the bringout 16.0 adapter as a starting point if/when we go that route.Out of scope