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.
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.
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
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-
com.openexchange.api2and are named *SQLInterface for some strange reason.
com.openexchange.groupware.containerand end with *Object.
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
The file looks like this, just go to the two comment lines and do like people before you did:
<beans> <bean id="importerExporter" class="com.openexchange.groupware.importexport.ImporterExporter"> <property name="exporters"> <list> <ref bean="iCalExporter" /> <ref bean="vCardExporter" /> <ref bean="csvContactExporter" /> <!-- add reference to your class here --> </list> </property> </bean> <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 --> </beans>
Yep, this is Spring . Now you know what you need those
spring-beans.jar thingies for.