Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doxf/oform support #3282

Open
4 tasks
juliushaertl opened this issue Nov 10, 2023 · 1 comment
Open
4 tasks

doxf/oform support #3282

juliushaertl opened this issue Nov 10, 2023 · 1 comment
Labels
0. Needs triage enhancement New feature or request

Comments

@juliushaertl
Copy link
Member

juliushaertl commented Nov 10, 2023

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');
        }
@juliushaertl juliushaertl added enhancement New feature or request 0. Needs triage labels Nov 10, 2023
@juliushaertl
Copy link
Member Author

@pedropintosilva Successfully tested with a couple of patches, two notes:

  • Collabora does not announce the mimetype/extension in discovery
  • Files are read only for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant