cetra3 / onlyoffice-alfresco

Alfresco Onlyoffice Integration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Action not showing with some extensions

iwkse opened this issue · comments

commented

Hi,
I've tried the new integration with onlyoffice 4 and I notice that the action is not available with all document extensions as before.
For example odt, even if from onlyoffice you can save as odt.
I've also tested, txt,rtf
docx and doc

I found out the bean is missing the right mimetypes:
eg. application/vnd.oasis.opendocument.text for odt, ecc

Probably need to expand the mime types to include the other document formats.

Will need to compile a list of the mime types that are supported for editing

commented

Yes. I will test some and provide a pull request if it's fine for you

PRs are always welcome 👍

commented

Nice, I'm already testing some, I will do as soon as I finish, probably tomorrow

commented

I did some tests, it takes some time because I found strange behavior of onlyoffice. Now I don't know yet where is the cuprit but I have problems.

With ODT is the most problematic format in my tests. On the Onlyoffice page it's showed as perfectly compatible. I stress that such problems are only related to version 4 and not the previous one.

ODT, after saving the file, it changes the mimetype into Zip data (MIME type "K,("?)
Same issue I get with DOC which seems to be converted to docx apparently. I get this from alfresco log

Caused by: org.alfresco.service.cmr.rendition.RenditionServiceException: 09240241 Some error occurred during document transforming. Error message: 09240240 Transformation of (test.doc) has not taken place because the declared mimetype (application/msword) does not match the detected mimetype (application/vnd.openxmlformats-officedocument.wordprocessingml.document).

I've just tested now the PDF Toolkit User Guide.docx and while saving it it looses the format. Margins are lost.
Did you have such problem with doc,docx?

Looks like the mime type is incorrect to the file extension for some reason. Is the mime type correct when you upload a document to Alfresco?

commented

Yes, when uploading is fine but when saving with onlyoffice it's not. It seems everything is saved to docx no matter what format you use.
But even with docx you have issues with formatting (margins are lost)
If you try to edit a docx file (for test I used the PDF Toolkit Guide.docx) , file command says it's Microsoft Word 2007+ and after saving it's still this format. But you lose the margins.

When I try with an odt it's worse because it corrupts the document because it's changing the mimetype. When I upload it it's OpenDocument Text and after saving in onlyoffice it becames Microsoft Word 2007+ and alfresco is not able to preview it anymore.
When you download it and try to open with libreoffice it says the file is corrupted and offers to fix it.

Must be something weird happening somewhere. I was writing to onlyoffice because I wanted to test the upload of some documents with their demos. I'd like to test it far from alfresco and the integration to be 100% sure it's onlyoffice fault, but seems to be like that.

If you set the log to debug, you will see the download URL we receive from OnlyOffice. It may be automatically setting the format to docx.

commented

Hi cetra,
as pointed here http://stackoverflow.com/questions/40268665/onlyoffice-documentserver-4-1-5-alter-documents the issue is in onlyoffice. What I notice is that no matter what it changes the mimetype of the document and set it to a supported Ms Word one. LibreOffice uses application/vnd.oasis.opendocument instead of application/vnd.openxmlformats-officedocument.
I believe it could be workarounded by converting back the document into a libreoffice one. It could be for a temporary solution.

Ok, there might be a way to tell OnlyOffice to send a specific mime type back so we can enable different mime types. Needs a bit more investigation.