Repository navigation
[stable34] feat(direct-editing): integrate with OCP\DirectEditing API - #5734
Merged
Merged
Conversation
Plug richdocuments into the server's shared Direct Editing API so
mobile apps (and any other clients) can open Collabora documents
through the standard /ocs/v2.php/apps/files/api/v1/directEditing/...
endpoints, alongside other editors registered via OCP\DirectEditing.
- Add OfficeDirectEditor (IEditor) and four ACreateFromTemplate
creators (document, spreadsheet, presentation, drawing) backed by
the existing TemplateManager and FileCreatedFromTemplateListener.
- Extract the user/file render branch of DirectViewController::show
into DirectEditingViewService so both the new IEditor::open path
and the legacy /direct/{token} webview share one implementation
(federation redirect, template-aware WOPI token, document template
response).
- Route the legacy OCS endpoints (/api/v1/document and
/api/v1/templates/new) through OCP\DirectEditing\IManager and mark
them deprecated; response shape unchanged.
- Keep the share/federation flows (/api/v1/share,
/api/v1/direct/share/initiator and the /direct/{token} webview)
untouched -- they have no equivalent in OCP\DirectEditing.
- Factor Capabilities mimetype dedup into helpers so the editor and
the capability advert read from one source of truth.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Julius Knorr <jus@bitgrid.net>
…w" wording Signed-off-by: Julius Knorr <jus@bitgrid.net>
array_diff preserves the original keys, which makes JSON encode the capability as an object instead of a list when application/pdf is removed. Reindex with array_values so the response stays a list. AI-assistant: claude-code 2.0.45 (claude-opus-4-7) Signed-off-by: Julius Knorr <jus@bitgrid.net>
The render() docblock was sitting above primeTemplateSource() with no method attached, so IDE/static analysis tooling could not associate it with the method it describes. Move it to render() where it belongs. AI-assistant: claude-code 2.0.45 (claude-opus-4-7) Signed-off-by: Julius Knorr <jus@bitgrid.net>
$userFolder->getRelativePath() can return null for nodes outside the user folder, which would TypeError when passed to IManager::open(string $filePath, ...). Fall back to the file name — Manager::open resolves the node by the supplied fileId anyway. AI-assistant: claude-code 2.0.45 (claude-opus-4-7) Signed-off-by: Julius Knorr <jus@bitgrid.net>
The previous code took the file extension from the requested target path. Filenames don't require an extension and a caller can also pick one that disagrees with the chosen template, which would route the call to the wrong creator and fail. Look up the template and resolve the creator from its mimetype instead. Adds TemplateManager::getTemplateTypeForMime() as the mime ↔ type counterpart of the existing getTemplateTypeForExtension(). AI-assistant: claude-code 2.0.45 (claude-opus-4-7) Signed-off-by: Julius Knorr <jus@bitgrid.net>
UI menu items are capitalised ('Document', 'Spreadsheet', …) but
callers pass lowercase ('document', …). The cy.contains() match was
failing for that reason. Capitalise the first letter and lowercase
the rest before searching so existing call sites keep working.
AI-assistant: claude-code 2.0.45 (claude-opus-4-7)
Signed-off-by: Julius Knorr <jus@bitgrid.net>
Other editors integrating with OCP\DirectEditing on mobile (notably the text app) send a generic 'loaded' message when their editor is ready. Emit the same alongside the long-standing richdocuments-specific 'documentLoaded' so clients that listen to the shared signal work without an editor-specific branch. AI-assistant: claude-code 2.0.45 (claude-opus-4-7) Signed-off-by: Julius Knorr <jus@bitgrid.net>
Older iOS/Android clients already drive document editing through the legacy /apps/richdocuments/api/v1/document endpoint. They have no integration with the new OCP\DirectEditing flow, so listing the richdocuments editor in /apps/files/api/v1/directEditing would only confuse them. Skip registration in the listener when the request comes from a Nextcloud iOS/Android client whose major version is below 34. The legacy OCS endpoints register the editor directly on the manager so the in-process delegation to IManager keeps working for those older clients (they still hit /api/v1/document and get a valid direct-editing URL back). AI-assistant: claude-code 2.0.45 (claude-opus-4-7) Signed-off-by: Julius Knorr <jus@bitgrid.net>
Signed-off-by: Julius Knorr <jus@bitgrid.net>
elzody
approved these changes
Jun 9, 2026
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.
Backport of PR #5656