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

[Workaround] WOPI / OnlyOffice create new form file #6989

Closed
wkloucek opened this issue Aug 8, 2023 · 4 comments
Closed

[Workaround] WOPI / OnlyOffice create new form file #6989

wkloucek opened this issue Aug 8, 2023 · 4 comments
Assignees
Labels
Category:Enhancement Add new functionality

Comments

@wkloucek
Copy link
Contributor

wkloucek commented Aug 8, 2023

Is your feature request related to a problem? Please describe.

I want to create new files for the OnlyOffice form editor. Forms to be created have the .docxf file extension (https://www.onlyoffice.com/blog/de/2022/03/onlyoffice-formulare-oform-docxf). It seems like there is no mimetype for it.

When looking at the /hosting/discovery endpoint of OO 7.4 it looks like the editor is the same for docx and docxf:

<action name="view" ext="docx" urlsrc="https://onlyoffice.kube.owncloud.test/hosting/wopi/word/view?&<rs=DC_LLCC&><dchat=DISABLE_CHAT&><embed=EMBEDDED&><fs=FULLSCREEN&><hid=HOST_SESSION_ID&><rec=RECORDING&><sc=SESSION_CONTEXT&><thm=THEME_ID&><ui=UI_LLCC&><wopisrc=WOPI_SOURCE&>&"/>
<action name="embedview" ext="docx" urlsrc="https://onlyoffice.kube.owncloud.test/hosting/wopi/word/view?embed=1&<rs=DC_LLCC&><dchat=DISABLE_CHAT&><embed=EMBEDDED&><fs=FULLSCREEN&><hid=HOST_SESSION_ID&><rec=RECORDING&><sc=SESSION_CONTEXT&><thm=THEME_ID&><ui=UI_LLCC&><wopisrc=WOPI_SOURCE&>&"/>
<action name="mobileView" ext="docx" urlsrc="https://onlyoffice.kube.owncloud.test/hosting/wopi/word/view?mobile=1&<rs=DC_LLCC&><dchat=DISABLE_CHAT&><embed=EMBEDDED&><fs=FULLSCREEN&><hid=HOST_SESSION_ID&><rec=RECORDING&><sc=SESSION_CONTEXT&><thm=THEME_ID&><ui=UI_LLCC&><wopisrc=WOPI_SOURCE&>&"/>
<action name="editnew" ext="docx" requires="locks,update" urlsrc="https://onlyoffice.kube.owncloud.test/hosting/wopi/word/edit?&<rs=DC_LLCC&><dchat=DISABLE_CHAT&><embed=EMBEDDED&><fs=FULLSCREEN&><hid=HOST_SESSION_ID&><rec=RECORDING&><sc=SESSION_CONTEXT&><thm=THEME_ID&><ui=UI_LLCC&><wopisrc=WOPI_SOURCE&>&"/>
<action name="edit" ext="docx" default="true" requires="locks,update" urlsrc="https://onlyoffice.kube.owncloud.test/hosting/wopi/word/edit?&<rs=DC_LLCC&><dchat=DISABLE_CHAT&><embed=EMBEDDED&><fs=FULLSCREEN&><hid=HOST_SESSION_ID&><rec=RECORDING&><sc=SESSION_CONTEXT&><thm=THEME_ID&><ui=UI_LLCC&><wopisrc=WOPI_SOURCE&>&"/>
<action name="mobileEdit" ext="docx" requires="locks,update" urlsrc="https://onlyoffice.kube.owncloud.test/hosting/wopi/word/edit?mobile=1&<rs=DC_LLCC&><dchat=DISABLE_CHAT&><embed=EMBEDDED&><fs=FULLSCREEN&><hid=HOST_SESSION_ID&><rec=RECORDING&><sc=SESSION_CONTEXT&><thm=THEME_ID&><ui=UI_LLCC&><wopisrc=WOPI_SOURCE&>&"/>

<action name="view" ext="docxf" urlsrc="https://onlyoffice.kube.owncloud.test/hosting/wopi/word/view?&<rs=DC_LLCC&><dchat=DISABLE_CHAT&><embed=EMBEDDED&><fs=FULLSCREEN&><hid=HOST_SESSION_ID&><rec=RECORDING&><sc=SESSION_CONTEXT&><thm=THEME_ID&><ui=UI_LLCC&><wopisrc=WOPI_SOURCE&>&"/>
<action name="embedview" ext="docxf" urlsrc="https://onlyoffice.kube.owncloud.test/hosting/wopi/word/view?embed=1&<rs=DC_LLCC&><dchat=DISABLE_CHAT&><embed=EMBEDDED&><fs=FULLSCREEN&><hid=HOST_SESSION_ID&><rec=RECORDING&><sc=SESSION_CONTEXT&><thm=THEME_ID&><ui=UI_LLCC&><wopisrc=WOPI_SOURCE&>&"/>
<action name="mobileView" ext="docxf" urlsrc="https://onlyoffice.kube.owncloud.test/hosting/wopi/word/view?mobile=1&<rs=DC_LLCC&><dchat=DISABLE_CHAT&><embed=EMBEDDED&><fs=FULLSCREEN&><hid=HOST_SESSION_ID&><rec=RECORDING&><sc=SESSION_CONTEXT&><thm=THEME_ID&><ui=UI_LLCC&><wopisrc=WOPI_SOURCE&>&"/>
<action name="editnew" ext="docxf" requires="locks,update" urlsrc="https://onlyoffice.kube.owncloud.test/hosting/wopi/word/edit?&<rs=DC_LLCC&><dchat=DISABLE_CHAT&><embed=EMBEDDED&><fs=FULLSCREEN&><hid=HOST_SESSION_ID&><rec=RECORDING&><sc=SESSION_CONTEXT&><thm=THEME_ID&><ui=UI_LLCC&><wopisrc=WOPI_SOURCE&>&"/>
<action name="edit" ext="docxf" default="true" requires="locks,update" urlsrc="https://onlyoffice.kube.owncloud.test/hosting/wopi/word/edit?&<rs=DC_LLCC&><dchat=DISABLE_CHAT&><embed=EMBEDDED&><fs=FULLSCREEN&><hid=HOST_SESSION_ID&><rec=RECORDING&><sc=SESSION_CONTEXT&><thm=THEME_ID&><ui=UI_LLCC&><wopisrc=WOPI_SOURCE&>&"/>
<action name="mobileEdit" ext="docxf" requires="locks,update" urlsrc="https://onlyoffice.kube.owncloud.test/hosting/wopi/word/edit?mobile=1&<rs=DC_LLCC&><dchat=DISABLE_CHAT&><embed=EMBEDDED&><fs=FULLSCREEN&><hid=HOST_SESSION_ID&><rec=RECORDING&><sc=SESSION_CONTEXT&><thm=THEME_ID&><ui=UI_LLCC&><wopisrc=WOPI_SOURCE&>&"/>

Therefore you can just create a .docxf file and edit it in the form editor view.

But I cannot configure oCIS to allow creating docxf forms without cannibalizing a different file format.

Describe the solution you'd like

A possible solution / workaround is to make up a mimetype for docxf files in REVA's pkg/mime/mime.go:

"docxf":                    "application/vnd.openxmlformats-officedocument.wordprocessingml.form",

Then I can configure following actions in the mimetypes section (in this example via the oCIS Helm chart (https://github.com/owncloud/ocis-charts/blob/49eea9b36cffa590b3e40b9e9aa0db1717101bbc/charts/ocis/values.yaml#L232-L243):

- mime_type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
  extension: docx
  name: Text document
  description: Text document
  icon: image-edit
  default_app: "OnlyOffice"
  allow_creation: true
- mime_type: application/vnd.openxmlformats-officedocument.wordprocessingml.form
  extension: docxf
  name: Form document
  description: Form document
  icon: image-edit
  default_app: "OnlyOffice"
  allow_creation: true
...
...

It'll leave me with this "New file" menu in Web:

image

Describe alternatives you've considered

Probably we're doing something really complicated with the mime type to file extension conversion. We could probably unclutter that.

@wkloucek wkloucek added the Category:Enhancement Add new functionality label Aug 8, 2023
@kobergj
Copy link
Collaborator

kobergj commented Aug 16, 2023

Not sure if you prefer another solution and/or more investigation. But if it helps to just add this mimetype you can have it quick and easy: cs3org/reva#4116

@wkloucek
Copy link
Contributor Author

I think adding non well known mimetypes is only a workaround. I think we should look at why we're doing a lot of complicated mime type to file extension conversions and vice versa.

@kobergj
Copy link
Collaborator

kobergj commented Aug 16, 2023

Then let's plan this ticket properly for one of the next sprints. It is more a story than a bug anyways

@dj4oC
Copy link
Contributor

dj4oC commented Aug 21, 2023

@tbsbdr please schedule.

@micbar micbar changed the title WOPI / OnlyOffice create new form file [Workaround] WOPI / OnlyOffice create new form file Oct 30, 2023
@dragonchaser dragonchaser self-assigned this Nov 21, 2023
This was referenced Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:Enhancement Add new functionality
Projects
Status: Done
Development

No branches or pull requests

4 participants