Blogs

Online edition with Libreoffice in Alfresco 5

Last days I was asked for a tip (again) for enabling online edition via webdav with Libreoffice in Alfresco 5. It is tested with this setup:
  • Ubuntu 14.04 LTS (although it can work in other Linux)
  • Libreoffice 4.2.8.2 (it comes with the Linux distro)
  • Alfresco CE 5.0c && 5.0d (the jar is valid for Alfresco 4 too)
  • Last versions of Firefox and Chrome
So, in your Alfresco 5 server you need to download the jar file and copy in $ALF_HOME/tomcat/shared/lib directory, restarting alfresco service:
 
 
Once, you should see "Edit. Online" action for MS-Office and Libreoffice mimetypes. It is clear that you need webdav enabled in your repository (and access to the webdav context).
 
Then, for make it work, you need to register an url-handler based protocol for dav:// and davs:// urls with Libreoffice. This can be done via two methods (that can work in different versions of Linux).
 
Method 1:
 
Create the next file, and the corresponding path, if it does not exist.
 
$ vim ~/.local/share/applications/libreoffice-alf.desktop 
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Name=LibreOffice for Alfresco
GenericName=LibreOffice for Alfresco
Comment=Online Editing in Alfresco via webdav
Icon=libreoffice-writer
TryExec=soffice
Exec=soffice %U
Terminal=false
Type=Application
Categories=Office;
MimeType=x-scheme-handler/davs;x-scheme-handler/dav;x-scheme-handler/vnd.sun.star.webdavs;x-scheme-handler/vnd.sun.star.webdav
 
2. Create the mimeapps.list file, if it does not exist. If it exist, just add the two x-scheme handlers,
 
$ vim ~/.local/share/applications/mimeapps.list
[Added Associations]
x-scheme-handler/davs=libreoffice-alf.desktop;
x-scheme-handler/dav=libreoffice-alf.desktop;
x-scheme-handler/vnd.sun.star.webdavs=libreoffice-alf.desktop; 
x-scheme-handler/vnd.sun.star.webdav=libreoffice-alf.desktop;
 
Method 2: 
 
This is done for all users of the operating systems, you need sudoer privileges
 
1. Just create the file in the next path:
 
$ sudo vim /usr/share/applications/libreoffice-alf.desktop
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Name=LibreOffice for Alfresco
GenericName=LibreOffice for Alfresco
Comment=Online Editing in Alfresco via webdav
Icon=libreoffice-writer
TryExec=soffice
Exec=soffice %U
Terminal=false
Type=Application
Categories=Office;
MimeType=x-scheme-handler/davs;x-scheme-handler/dav;x-scheme-handler/vnd.sun.star.webdavs;x-scheme-handler/vnd.sun.star.webdav
 
2. Add x-scheme-handlers to mimeinfo.cache
 
$ sudo vim /usr/share/applications/mimeinfo.cache
# Add to the file
x-scheme-handler/davs=libreoffice-alf.desktop;
x-scheme-handler/dav=libreoffice-alf.desktop;
x-scheme-handler/vnd.sun.star.webdavs=libreoffice-alf.desktop; 
x-scheme-handler/vnd.sun.star.webdav=libreoffice-alf.desktop;
 
3. Update desktop cache
 
$ sudo update-desktop-database 
 
Then when you "Edit. online", you see some dialog for remembering the action for opening the url. Libreoffice asks for your credentials once in a session.
 
For Windows users, it is possible to register the protocol too, with the help of (there is also a .reg file in the downloads section of the googlecode project - put the correct path for the Libreoffice command):
 

More Blog Entries

Usando yarn y slider para levantar procesos en un cluster de hortonworks

Siguiendo con las pruebas y las arquitecturas relacionados con bigdata vamos a inspeccionar...

Avro RCP yarn and slider

Siguiendo con los artículos relacionados con YARN, SLIDER y arquitecturas relacionadas con...

4 Comments

JB
John Black 1 Year Ago

Latest LibreOffice Online v2.0 is available for free in the website http://www.offidocs.com/

JP
Juanma P 8 Months Ago

Sólo quería comentar que he probado la versión 0.3 del  y funciona para LibreOffice 5.1, aunque hay que cambiar la línea Exec del fichero libreoffice-alf.desktop, e indicar en su lugar el directorio donde tenemos instalado el LibreOffice. En mi caso, el fichero queda:

 

[Desktop Entry] Encoding=UTF-8 Version=1.0 Name=LibreOffice for Alfresco GenericName=LibreOffice for Alfresco Comment=Online Editing in Alfresco via webdav Icon=libreoffice-writer Exec=/usr/bin/libreoffice5.1 %U Terminal=false Type=Application Categories=Office MimeType=x-scheme-handler/davs;x-scheme-handler/dav;x-scheme-handler/vnd.sun.star.webdavs;x-scheme-handler/vnd.sun.star.webdav

 

Saludos.

JP
Juanma P 8 Months ago in reply to Juanma P .

Ha quedado desconfigurado el texto, la línea clave es:

Exec=/usr/bin/libreoffice5.1 %U

ZS
Zdeněk Sklenář 7 Months Ago

Hello i have problem, i did everything above and i see only logo of libreoffice5 then it asks for credentials. When i login with my credentials nothing is happen the window only dissapear and nothing new is appearing. Action simply end, no error in console, nothing i don't know where to find the problem. I use Alfresco 5.2 and libreoffice 5 on Ubuntu16x64