nextcloud / nextcloud/richdocuments

doxf/oform support

Open
#3,282 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage enhancement
Dominant language
JavaScript
Stars
453
Forks
147
Avg merge
14h 54m
Merged PRs (30d)
83

Description

Patch to add mimetypes for richdocuments and work around missing discovery entry of online:

diff --git a/lib/Capabilities.php b/lib/Capabilities.php
index 96e811dd..f3c795d6 100644
--- a/lib/Capabilities.php
+++ b/lib/Capabilities.php
@@ -70,6 +70,8 @@ class Capabilities implements ICapability {
                'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
                'application/vnd.ms-powerpoint.template.macroEnabled.12',
                'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
+               'application/vnd.openxmlformats-officedocument.wordprocessingml.document.oform',
+               'application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxf',
                'text/csv',
        ];

diff --git a/lib/WOPI/Parser.php b/lib/WOPI/Parser.php
index 8480bef8..cf231cd8 100644
--- a/lib/WOPI/Parser.php
+++ b/lib/WOPI/Parser.php
@@ -64,6 +64,14 @@ class Parser {
                        ];
                }

+               $result = $discoveryParsed->xpath(sprintf('/wopi-discovery/net-zone/app[@name=\'%s\']/action', 'application/vnd.oasis.opendocument.text'));
+               if ($result && count($result) > 0) {
+                       return [
+                               'urlsrc' => (string)$result[0]['urlsrc'],
+                               'action' => (string)$result[0]['name'],
+                       ];
+               }
+
                $this->logger->error('Didn\'t find urlsrc for mimetype {mimetype} in this WOPI discovery response: {discovery}', ['mimetype' => $mimetype, 'discovery' => $discovery]);
                throw new \Exception('Could not find urlsrc in WOPI');
        }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review lib/Capabilities.php and lib/WOPI/Parser.php, then inspect the WIP branch and the linked Nextcloud PRs. Verify Collabora discovery and read-only behavior for the oform/docxf mimetypes, and confirm that supported files upload and open correctly once the related dependencies are resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.