x-office-document.pngImport Office documents, spreadsheets and presentations into wiki pages (most major office suite formats are supported)
TypeXAR
Category
Developed by

XWiki Development Team

Rating
3 Votes
LicenseGNU Lesser General Public License 2.1
Bundled With

XWiki Standard

Compatibility
  • XWiki 1.8.4+
  • OpenOffice 3.0 or above
  • XWiki [1.8.4 - 10.11] with LibreOffice [3.6 - 6.0]
  • XWiki 10.11+ with LibreOffice 3.6+
  • The Office Importer requires a back-end Open Office or Libre Office server for its operations.
  • The Office Importer supports Office 2007 file formats only starting with XWiki version 2.2 Milestone 1.
  • The Office Importer used with Libre Office below 6.2 might led to timeouts when a TOC Macro is used (see XWIKI-16129).
  • The Office Importer below 10.11.8 with Libre Office 6.1+ won't embed the pictures when exporting the documents (see also XWIKI-16503).

Installable with the Extension Manager

Description

You should also check the Office Macro.

The Office Importer Application allows users to easily import Office documents like Word documents, spreadsheets and PowerPoint presentations into wiki pages. 

The Office Importer features include:

  • Convert existing documents into wiki pages
  • Use common office suites as wiki authoring tools

How to use

Once XWiki is configured correctly (and the Libre Office server is started), the Office Importer can be used in 3 ways:

  • when you want to create a page, via an option named "Page from Office"
    Import-Office-File-in-XWiki.png
    You just need fill the page name and select the "Page from Office" page type, then click on create. You will get the following self-explaining UI which makes it easy for you to import office documents:
    Office-Importer-Wizard.png
  • via a button in the WYSIWYG editor when editing a wiki page
    Import-Office-file-in-XWiki-from-WYSIWYG-editor.png
  • you can copy paste sections from an Office file directly into the rich text area while editing in WYSIWYG mode. See the CKEditor Integration documentation for more information

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:

  1. Log in the wiki with a user having Administration rights
  2. Go to the Administration page and select the Import category
  3. Follow the on-screen instructions to upload the downloaded XAR
  4. Click on the uploaded XAR and follow the instructions
  5. You'll also need to install all dependent Extensions that are not already installed in your wiki

The Office Importer application comes pre-bundled with XWiki versions greater than 1.8M1, so there is no need for a manual installation. The Office Importer makes use of a running Libre Office server to convert office documents into HTML before they are finally transformed into XWiki 2.0 syntax. Thus, a Libre Office server instance is required on the server computer which hosts your XWiki installation. Beginning with XWiki 1.8.4 you can configure a Libre Office or an OpenOffice server in the following ways described below.

Configuration Tutorials

  • Activating a LibreOffice server in 2 steps

Import-Office-files-in-XWiki-2-steps.gif

  • Video example of activating an OpenOffice server starting with 7.4.3 versions

If you've installed the Office Importer by installing a XAR it might happen that you've chosen options that reset Programming Rights (which are needed for this application). If this is the case you'll have to re-save the Office Importer Admin page. Go to Administer Wiki, click on the Office Server, and then change the link to : http://hostname:8080/xwiki/bin/edit/XWiki/OfficeImporterAdmin?editor=wiki. Click the Save and View button, and then try starting the server again.

Internally managed OpenOffice server process (default)

This is a very easy (and safe) option where your XWiki application takes care of managing the OpenOffice server process for you. To configure the OpenOffice server management scheme, you can use the WEB-INF/xwiki.properties configuration file:

In order to run the Office Importer configured as "Internally managed server instance" on the Windows platform you need to:

  • use a newer version of an Office application (for ex. LibreOffice 5+)
  • set openoffice.autoStart=true
  • use a similar format to this one for the homePath variable: openoffice.homePath=C:\Program Files (x86)\\LibreOffice 5
#----------------------------------------------------------------------------------
# Settings for the OpenOffice server instance consumed by the OfficeImporter component
#----------------------------------------------------------------------------------

#-# Type of the openoffice server instance used by officeimporter component.
#-# 0 - Internally managed server instance.
#-# 1 - Externally managed (local) server instance.
# openoffice.serverType=0

#-# Port numbers used for connecting to the openoffice server instances.
# openoffice.serverPorts=8100,8101

#-# If the openoffice server should be started / connected upon XE start.
# openoffice.autoStart=false

#-# Path to openoffice installation (serverType:0 only).
# openoffice.homePath=/opt/openoffice.org3/

#-# Path to openoffice execution profile (serverType:0 only).
# openoffice.profilePath=/home/user/.openoffice.org/3

#-# Maximum number of simultaneous conversion tasks to be handled by a single openoffice process (serverType:0 only).
# openoffice.maxTasksPerProcess=50

#-# Timeout for conversion tasks (in miliseconds) (serverType:0 only).
# openoffice.taskExecutionTimeout=60000

<12.1 the property openoffice.serverPort should be used with only one value instead of openoffice.serverPorts.

<11.10.11, <12.6.3, <12.8 the default value of property openoffice.taskExecutionTimeout was 30 seconds, it has been changed to 1 min afterwards.

Default values for homePath and profilePath configuration options will be calculated based on your operating environment. Even though this is the case, this calculation might not yield accurate results for some systems. So it's a good idea to configure these values manually by editing the xwiki.properties file.

If your XWiki instance fails to automatically locate the install path of the OO server, here are some default install paths of the OO on different operating systems:

  • Microsoft Windows XP/Vista/7:

    Example for OpenOffice 3 (32-bit):

    openoffice.profilePath=C:/Users/{user}/AppData/Roaming/openOffice.org/3
    openoffice.homePath=C:/Program Files/OpenOffice.org 3

    Example for LibreOffice 3.4 (32-bit):

    openoffice.profilePath=C:/Users/{user}/AppData/Roaming/LibreOffice/3
    openoffice.homePath=C:/Program Files/LibreOffice 3.4

    Example for OpenOffice 3 (64-bit):

    openoffice.profilePath=C:/Users/{user}/AppData/Roaming/openOffice.org/3
    openoffice.homePath=C:/Program Files (x86)/OpenOffice.org 3

    Example for LibreOffice 3.4 (64-bit):

    openoffice.profilePath=C:/Users/{user}/AppData/Roaming/LibreOffice/3
    openoffice.homePath=C:/Program Files (x86)/LibreOffice 3.4
    • The example paths above are for LibreOffice 3.4.x. For LibreOffice 3.3.x you have to replace the "3.4" in the path by "3.3".
    • The correct path to the LibreOffice's executable directory should be openoffice.homePath=C:/Program Files/LibreOffice 3.4/program, but XWiki automatically adds /program to the given path for a Windows environment.
  • Ubuntu Linux (10.04):
    openoffice.homePath=/usr/lib/openoffice/
  • Ubuntu Linux (11.10):
    openoffice.homePath=/usr/lib/libreoffice/
  • Fedora:
  • Mac OSX:

    Example for LibreOffice:

    openoffice.homePath=/Applications/LibreOffice.app/Contents

If you leave your XWiki application to manage the OpenOffice server process (which is the default behaviour), your Office Importer admin UI will look something like below:

admin1.png

Externally managed (local) OpenOffice server process

This option allows you (the system admin) to control the OpenOffice server process as desired. This is very useful if you wish to customize OpenOffice server start-up parameters. You can configure this behaviour within the xwiki.properties file as shown below:

#----------------------------------------------------------------------------------
# Settings for the OpenOffice server instance consumed by the OfficeImporter component
#----------------------------------------------------------------------------------

#-# Type of the openoffice server instance used by officeimporter component.
#-# 0 - Internally managed server instance.
#-# 1 - Externally managed (local) server instance.
openoffice.serverType=1

#-# Port number used for connecting to the openoffice server instance.
# openoffice.serverPort=8100

#-# If the openoffice server should be started / connected upon XE start.
# openoffice.autoStart=false

For the profilePath configuration option, you need to have an OpenOffice profile directory created somewhere on the system. This can be a problem in server environments where launching OpenOffice is not an option. In such situations you can create an OpenOffice profile on a local computer and upload it to the server running XE.

Once XWiki is configured in this manner, an OpenOffice server must be manually started as a separate process. You can issue the following command to accomplish this:

soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard

Don't forget to replace <soffice> with the path to your OpenOffice executable. More information regarding OpenOffice server deployment is provided here. Also note that the Office Importer admin UI will change reflecting the new configuration as shown below:

admin2.png

Linux users may refer to additional installation notes here.

Auto start / Auto connect (feature)

This feature was introduced beginning with the XWiki 1.8.4 version. With this option enabled, you don't need to worry about starting / connecting the OpenOffice server from the Office Importer admin UI every time you restart XE. This option can be configured from xwiki.properties file as shown below:

#-# If the openoffice server should be started / connected upon XE start.
openoffice.autoStart=true

Dependencies

Dependencies for this extension (org.xwiki.platform:xwiki-platform-office-ui 8.3):

Tags:
    

Get Connected