egroupware/importexport/doc/README_developers.txt

63 lines
2.4 KiB
Plaintext
Raw Permalink Normal View History

2007-06-08 00:08:38 +02:00
= importexport =
Importexport is a framework for egroupware to handle imports and exports.
2007-06-08 00:08:38 +02:00
The idea behind importexport is to have a common userinterface in all apps
regarding import and export stuff AND to have common backends whitch
handle the stuff. Importexport can nothing without the plugins of the
applications and its specific definitions.
2007-06-08 00:08:38 +02:00
== plugins ==
Attending importeport framework with you application is pretty easy.
You just need to have your plugins in files which start with
2012-10-15 23:28:33 +02:00
class.<app>_import_<name> or
class.<app>_export_<name>
in
2012-10-15 23:28:33 +02:00
EGW_INCLUDE_ROOT/YourApp/inc/
2007-06-08 00:08:38 +02:00
2012-10-15 23:28:33 +02:00
These plugins only need to implement the corresponding interface
2007-06-08 00:08:38 +02:00
EGW_INCLUDE_ROOT/importexport/inc/class.iface_import_plugin.inc.php or
EGW_INCLUDE_ROOT/importexport/inc/class.iface_export_plugin.inc.php
Thats all, pretty easy, isn't it?
2012-10-15 23:28:33 +02:00
For CSV, just extend importexport/inc/class.importexport_basic_import_csv.inc.php
and override the init(), import_record() and action() methods. You'll get common
functionallity for very little extra effort.
== definitions ==
The bases of all imports and exports is the '''definition'''.
2007-06-08 00:08:38 +02:00
A definition defines all nessesary parameters to perform the desired action.
Moreover definitions can be stored and thus the same import / export can be redone
by loading the definition. Definitions are also reachable by the importexport
'''command line interface'''.
2007-06-08 00:08:38 +02:00
An important point is, that the ACLs for import/export actions are given by the definitions.
That means, that your plugin can not work w.o. a definition. However, your plugin don't
need to parse that definition. This is up to you.
Definitions can be created in admin->importexport->define{im|ex}ports. They are stored
2012-10-15 23:28:33 +02:00
in the database but can also be {im|ex}ported to / from other systems.
2007-06-08 00:08:38 +02:00
2012-10-15 23:28:33 +02:00
Definitions (as xml files) residing in the folder <yourapp/setup/*.xml>
2007-06-08 00:08:38 +02:00
will be imported at apps installation time automatically.
== import ==
== export ==
2012-10-15 23:28:33 +02:00
Starting an export is as easy as using the sidebox button. Once your plugins are detected
(they are cached and refreshed hourly), Import/Export will add the needed entries to the sidebox.
Alternatively, you can go to Admin -> Define Imports | Exports.
NOTE: javascript function get_selection() is the only function which is not part of an interface yet.
==Discussion of interfaces==
2012-10-15 23:28:33 +02:00
To make life easy there are several general plugins which can be found
EGW_INCLUDE_ROOT/importexport/inc/import_...
EGW_INCLUDE_ROOT/importexport/inc/export_...