You want to export a format the current exporters do not offer? Build a new one!

There are three steps to complete to write an exporter.

  • Defining a new format in com.openexchange.groupware.importexport.Format
  • Write an exporter by implementing the com.openexchange.groupware.importexport.Exporter interface.
  • Plug the exporter into the file /conf/groupware/importerExporter.xml

A new format

Now this should be easy: Open the file, write a new enum with a different identifier and you are done. In case you want to extend an existing format (CSV comes to mind) to import something different than Contacts (which currently is the only use for it), you do not need to define a new format.

Implementing the Exporter interface

For the most current information, have a look the JavaDoc for the Importer Interface. Here are just two notes on the main methods:


This method is called by the class which selects an appropriate exporter. So make sure to use all your checking here, like

  • Is this the format I am responsible for?
  • Are the folders I am supposed to export from meant for this kind of data (example: You can only make vCards from Contacts)? This usually means asking the type of the FolderObject and comparing it to the constants (like FolderObject.CONTACT).
  • Is this user allowed to read from this folder?


These methods do the export itself - one exports only one entry, one all of a folder. I'd recommend that they internally call canExport to be sure the preconditions are met. The main job consists of reading data from the folder and wrapping these objects up nicely in the appropriate format-

  • The readers for the database usually hide in com.openexchange.api2 and are named *SQLInterface for some strange reason.
  • The objects resulting from reading the database are found in com.openexchange.groupware.container and end with *Object.

Plugging the new Exporter in

As said, open the file importerExporter.xml. After checking out the projects, this should be in the main project at /conf/groupware, if installed, it ought to be somewhere like /opt/open-xchange/groupware. The file looks like this, just go to the two comment lines and do like people before you did:

   <bean id="importerExporter" class="com.openexchange.groupware.importexport.ImporterExporter">
     <property name="exporters">
         <ref bean="iCalExporter" />
         <ref bean="vCardExporter" />
         <ref bean="csvContactExporter" />
         <!-- add reference to your class here -->
   <bean id="iCalExporter"       class="com.openexchange.groupware.importexport.exporters.ICalExporter" />
   <bean id="vCardExporter"      class="com.openexchange.groupware.importexport.exporters.VCardExporter" />
   <bean id="csvContactExporter" class="com.openexchange.groupware.importexport.exporters.CSVContactExporter" />
   <!-- add your class here -->

Yep, this is Spring [1]. Now you know what you need those spring-core.jar and spring-beans.jar thingies for.