Onlyoffice.plone add custom content types

Does anyone use 'onlyoffice.plone'? I took a look at it today and it seems quite nice, but (basically) only works for 'File content type'. It makes more sense to me to have the functionality as a behavior, so I might try to do that (if anyone uses the add-on, that is):

Side note: I see that duplication the current File content type 'breaks the UI'.

PS: If there are reasons for not using the add-on, please let me know

My latest test results:

  1. Onlyoffice.plone connector does not support Python version 3.12, because I run failed in ubuntu 24.04.
  2. Onlyoffice.plone connector does not support plone with https, unless switched ONLYOFFICE Docs to HTTPS protocol and close JWT.
  3. If I switched ONLYOFFICE Docs to HTTPS protocol, onlyoffice cannot display double-byte characters.

If you need not view any double-byte characters or only use http, onlyoffice is great for plone, and can replace MS sharepoint.

If you run onlyoffice on the same server, I assume http is good enough (?)

PS: I did some testing yesterday, but it is hard to understand 'why it is not working with other content types', I will try 'more' and give feedback.

See How it works. Specially 5. and 9.:

5. Then ONLYOFFICE Docs downloads the document from Plone and the user begins editing.
...
9. Plone downloads a new version of the document, replacing the old one.

The downloaded document must implement ConversionForm for ONLYOFFICE be able to convert it. See the browser:page for IDocument.

If you run onlyoffice on the same server, I assume http is good enough (?)

Not work.

If I use the 'demo server', it seems to work with https, but if I use the installed (local) version, it does not connect ( I am helping someone else here, so it is not me that has set up the server so I dont know how that was done)

Does it not work to run onlyoffice and Plone on the same server ?? (why not)

onlyoffice and Plone can run on the same server. I mean the https issue not work

I use the 'demo server', it seems to work with https
Because the demo server is https. If plone use https, the onlyoffice must use https. If you installed local, aslo should disable JWT.

How do you disable it (I just installed it 'the regular way' (not docker))

You need to change the token.enable parameter to true/false.
You can fix this parameter in the file:
/etc/onlyoffice/documentserver/local.json

After that, you need leave blank the Secret key.

If not work, you maybe need change this: /etc/onlyoffice/documentserver/default.json 
 "services": {
    "CoAuthoring": {
        "request-filtering-agent" : {
            "allowPrivateIPAddress": true,
            ...
        }
    }
}

Update: the display double-byte characters issue is due to my browers incompatible.

I changed these settings, and now I get:

documentserver-jwt-status.sh 
Your JWT settings:
JWT enabled -  false

But, when I try http://localhost:444 in Plone control panel (Document Editting Service), I still got 'ONLYOFFICE can not be reached'. (I can access it with a browser, so it is running)

In 'local.json', I now have (Is this what you mean by 'leave blank' ?)

  "token": {
    "enable": {
      "request": {
        "inbox": false,
        "outbox": false
      },
      "browser": false
    },
    "inbox": {
      "header": "Authorization"
    },
    "outbox": {
      "header": "Authorization"
    }
  },

  "secret": {
    "inbox": {
      "string": ""
    },
    "outbox": {
      "string": ""
    },
    "session": {
      "string": ""
    }
  }

My steps:

  1. change token to false in /etc/onlyoffice/documentserver/local.json
"token": {
        "enable": {
          "request": {
            "inbox": false,
            "outbox": false
          },
          "browser": false
        },
  1. allowPrivateIPAddress to true in /etc/onlyoffice/documentserver/default.json
 "services": {
    "CoAuthoring": {
        "request-filtering-agent" : {
            "allowPrivateIPAddress": true,
            ...
        }
    }
}
  1. restart onlyoffice

  2. Go to you plone with HTTPS: https://your.plone.domain/your-site/@@onlyoffice-controlpanel

Input your https onlyoffice server https://your.onlyoffice.domain in Document Editing service.

Secret key (leave blank to disable), this is what I mean leave blank.

Save

My plone is use nginx as a HTTPS reverse proxy, and you should make sure to use a valid domain certificate in both nginx and onlyoffice server. Self signed certificate may neet more settings, I haven't tested it yet.

Thanks a lot.

It turns out that I need to include the trailing slash also, so in control panel I can use:

http://ubuntu.local:444/ (which is the machine both Plone and OpenOffice is running on)

(but I can not (yet) use 'http://localhost:444/ or http:/127.0.0.1:444 )

UPDATE: onlyoffice-plone checks content types to see if 'onlyoffice edit etc' should be avalable.

I would prefer to check if there is a 'File' field, but I am not sure 'what way is the best' (then I will make a pull request):

def getFileExt(context):
    portal_type = context.portal_type
    
    # Addedby espenm, check if File exists
    if hasattr(context, 'file'):
        #Check if file contains data
        filename = context.file.filename if context.file.getSize() and context.file.getSize() > 1 else None
    
    #The 'old' code:
    if portal_type == "Image" : 
        filename = context.image.filename if hasattr(context, "image") else None

    if portal_type == "File" or portal_type == "Document" :
        filename = context.file.filename if hasattr(context, "file") else None
        
    if filename :
        return filename[filename.rfind('.') + 1:].lower()

Do you know why? (Would probably be better to try to fix this than to 'hack around it')

I have no idea, maybe the trust verification method. Onlyoffice.plone not work with python 3.12 as well.