CMIS support in LibreOffice Experimental Features

Since I upgraded the LibreOffice installation on my Macbook to version 3.6, I’ve been playing around with the CMIS integration built into this version. This is currently an experimental LibreOffice feature, which means you should not use this against a production server.
The integration allows LibreOffice to connect to a remote Alfresco server in order to open and save documents. This is a feature Microsoft Office has had for a long time, although limited to SharePoint-compatible servers (including Alfresco, via our SharePoint protocol support!). Now you can do the same thing with LibreOffice, via the magic of CMIS.
The first thing to do is to enable LibreOffice’s experimental features within the Preferences dialogue.

After you’ve confirmed that change, you can open a file stored in Alfresco using the standard Open menu. When the file browser loads, you should notice a small button next to the location drop-down menu labelled with an ellipsis (…).

Clicking that button allows you to add a server. LibreOffice supports a range of server types, including the CMIS AtomPub service provided by Alfresco.
First you must enter a name for the server – I entered ‘Alfresco’ – and select the server type. If you do not see CMIS (Atom Binding) in the list then check to ensure that you have LibreOffice 3.6+ and that you have enabled Experimental Features.

The binding URL for Alfresco 4.2 will be something like http://localhost:8080/alfresco/cmisatom if you are running a local instance. I found that if I used the legacy CMIS URL below /alfresco/service (or the short form /alfresco/s) then document saves did not work, but the newer URL worked great.
Next is the slightly tricky part, entering the CMIS repository ID. Your Alfresco instance will only expose one repository, but other CMIS providers provide others, and so you need to enter this.
Hitting the repository binding URL directly will give you the ID, but unfortunately the non-standard document MIME type returned means it does not open directly in a web browser. You could save the response to disk and then use a text editor to view its contents, but I found it easier to use curl at the command line, together with less.

curl -u admin:admin http://localhost:8080/alfresco/cmisatom | less

In the response, do a search for the string repositoryId and within that element you should see a GUID value which you can copy and paste into the dialogue in LibreOffice.
The last item you need to enter is the username that will be used to access Alfresco (you will enter the password later).

You should now have the full set of information needed to add the server. Click OK, and it should be added to the side panel on the left of the Open dialogue.
You can navigate through the folders below the repository’s Company Home space, and open any compatible document. I used the Word documents located under Sites > swsdp > documentLibrary > Meeting Notes, which opened perfectly.

You can make any modifications, hit Save and the content will be automatically saved back into Alfresco.

I also tried creating a new document from the New menu, and was able to save the document back to a folder Alfresco via the Save As dialogue. I found I needed to set the correct MIME type for new documents back in Alfresco Share to get previews to work, but this could easily be done using a rule.
All in all not bad for an experimental feature, and it will be interesting to see if this makes it into LibreOffice 3.7 for real.

20 thoughts on “CMIS support in LibreOffice Experimental Features

    • The screenshots are obviously not Windows-based, but I don’t see why the Windows builds of LibreOffice would lack this feature. Did you turn on the experimental features?

  1. Works great in Ubuntu 12.10 / LibreOffice 3.6 client and Alfresco Community 4,2.

  2. I, i try this feature on Alfresco 4.2.D and LibreOffice 4.0.0.3.
    CMIS works!
    One question, when i save new document how i assign a content model to the new document upload?

    • Good question, and I’m afraid not one I know the answer to. It would be worth asking this on the LibreOffice mailing lists. Do update this post if you get any additional info.

  3. May I ask which URL to use with Alfresco in the cloud? localhost will obviously not work. There’s no documentation available sadly.

    • Unfortunately I doubt that it will work with the cloud service, since it uses OAuth to authorize users. The CMIS client used in LibreOffice takes a username and password and performs Basic auth, and cannot negotiate access via OAuth.

  4. I test cmis support with LibreOffice 4 and Alfresco 4.0.d. It work fine. But if I use https instead of http, then the connection doesn’t work. LibreOffice can not load the list of repositories. Exists a limitation on the CMIS in LibreOffcie about the protocol?

    • I found I could not load the list of repositories if I used the default SOAP-based server URL that is suggested by the Add Server dialog. However if I use the AtomPub URL https://server/alfresco/cmisatom as my earlier post suggested then the list loads perfectly well for me.

  5. Wow thank for this great tutorial! Works just fine here.
    I noticed that to see the ellipsis, you might need to use the LibreOffice open/save dialog box and not the KDE/Gnome supplied ones. Tools > Options > General — check Use LibreOffice Dialogs.

    • Good point for those users using the Linux version, as I do myself on my home machine.

  6. Hi,
    I have a problem when using LibreOffice to access Alfresco 4 through CMIS. I’m only able to list repositories when I log in as admin, and if try with regular users it just crashes.
    Did anyone encountered similar problem?
    Thanks,
    Nikola

  7. In the same dialog, it is also important to check the option “Use LibreOffice dialogs”.
    It is disabled by default, at least on Ubuntu 2012.04.
    Keep up the great work!
    Nicolas Raoul

  8. Pingback: Incompatibility with Alfresco CE 4.2.d – LibreOffice won’t open #15Incompatibility with Alfresco CE 4.2.d – LibreOffice won’t open #15 | vienergie

  9. Pingback: Integrating LibreOffice 4 and Alfresco using CMIS | vienergie

Comments are closed.