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

OnlyOffice connector should allow to create and edit OpenDocument formats without conversion #25

Closed
ldubost opened this issue Apr 28, 2022 · 3 comments · Fixed by #26
Closed

Comments

@ldubost
Copy link
Contributor

ldubost commented Apr 28, 2022

Currently it does a conversion, but it could do the full conversion on the fly when editing/saving

@trrenty trrenty self-assigned this Jul 20, 2022
trrenty added a commit to trrenty/application-onlyoffice-connector that referenced this issue Jul 22, 2022
trrenty added a commit to trrenty/application-onlyoffice-connector that referenced this issue Aug 5, 2022
…mats without conversion xwikisas#25

* Escaped the content of the scrip tagt added through theh UI Extension
@trrenty trrenty added this to the 2.0RC1 milestone Aug 5, 2022
@trrenty trrenty closed this as completed Aug 5, 2022
trrenty added a commit that referenced this issue Aug 5, 2022
…mats without conversion #25 (#26)

* Move JavaScript code and images from the attachments of XooEdit to the WebJar module.

* Documents do not save with onlyoffice-documentserver 7.0.0 #24

* OnlyOffice connector should allow to create and edit OpenDocument formats without conversion #25

* [Misc] Upgraded licensor dependency to 1.22.1

* Saving non-OOXML files would save them as OOXML but set wrong extension

* Enable the admin to choose how the odt files should be converted when editing them.

* Added config class property 'conversion'
* Adapted the code to work with the new property
* Created API module for conversion of attachments using libre office

* [Misc] Code changes

* Added UI extension for loading necessary JS file that decorates the attachments with OnlyOffice buttons
* Other small code changes

* OnlyOffice connector should allow to create and edit OpenDocument formats without conversion #25

* Escaped the content of the scrip tagt added through theh UI Extension
@trrenty
Copy link
Contributor

trrenty commented Aug 5, 2022

The Open Document Format (ODF) files can now be edited inside XWiki. First, the Admin has to change the "Conversion" field in the Administration Section of the OnlyOffice App.

image

The Admin can choose between three methods of editing an ODF file (I will now use ODT to refer to ODF and DOCX to refer to OOXML):

  • Convert to a different file - the default (old) behaviour. When editing an ODT file, the user needs to convert it to DOCX and then edit the newly created file.
  • On the fly using OnlyOffice - the user can open and edit the ODT file but, because of the inner workings of OnlyOffice, the file will be converted to DOCX on the fly and, when saving the file, convert it back to ODT
  • On the fly using Office Server - the user can open and edit the ODT file but before opening it in OnlyOffice it will be converted to DOCX using the configured Office server. When saving the file, it will be converted back to ODT using the same method. Note that the wiki instance should be connected to an Office Server and the have a configuration that allows conversion betweeen DOCX and ODT. The default configuration of XWiki doesnt support ODT to DOCX conversion. See https://forum.xwiki.org/t/office-conversion-configuration-document-formats-js-is-not-up-to-date/10786.

If the user selects the third method and the Office Server is not connected, a warning will be displayed:

image

Some UI changes had to be made:

  • Creating a new file will prompt the user to select from the available formats
    image

  • Similarly, when opening a file that needs conversion, It will prompt the user to select the format in which to convert.
    image

  • When editing a file that needs conversion but versions of it that are in editable formats exist, the user will need to select the desired version to edit.
    image

image

@lucaa
Copy link

lucaa commented Sep 13, 2022

A fix was added in platform version 14.4.3 which may have an impact on the docx to odt conversion https://jira.xwiki.org/browse/XWIKI-19818 . Please make sure to test on XWIKI 14.4.3+ or 14.6+

@trrenty
Copy link
Contributor

trrenty commented Sep 16, 2022

Tested on Kubuntu 22.04 XWiki 14.4.3 Jetty HSQLDB.

  • Uploaded an ODT file.
  • Select "Convert using Office Server" in admin section.
  • Edit ODT file.
  • The file was successfully converted to DOCX using the OfficeServer and uploaded to OnlyOffice server.
  • Modified the file and saved.
  • The file was successfully downloaded from the OnlyOffice server as DOCX, converted to ODT using OfficeServer and saved to the XWiki page.

Downloading and opening the file in LibreOffice displays a normal ODT file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment