To use them, you need to create two files in the app/importexport directory, 'class.import_appname_csv.inc.php' and 'class.wizzard_import_appname_csv.inc.php'.
The minimum required files are shown below, but they can be modified as needed to override the basics and add capabilities.
class.import_appname_csv.inc.php:
<?php
require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.basic_import_csv.inc.php');
class import_appname_csv extends basic_import_csv {
protected function import_record(&$record, &$import_csv) {
// Handle one record here. Handle conditions and call action() as appropriate.
// See basic_import_csv.
}
protected function action($action, Array $record, $record_num = 0) {
// Take the given action (none, insert, delete, update) etc. as understood for your app.
// See basic_import_csv.
}
}
?>
class.wizzard_import_appname_csv.inc.php:
<?php
require_once(EGW_INCLUDE_ROOT . '/appname/importexport/class.import_appname_csv.inc.php');
require_once(EGW_INCLUDE_ROOT . '/importexport/inc/class.wizzard_basic_import_csv.inc.php');
class wizzard_import_appname_csv extends wizzard_basic_import_csv {
public function __construct() {
$this->mapping_fields = array(
// List of destination fields available in appname
'field' => lang('name')
);
$this->conditions = array(
// List of conditions supported by import_appname_csv
'field' => lang('name')
);
$this->actions = array(
// List of actions supported by import_appname_csv
'field' => lang('name')
);
}
}
?>
- Wizard now works to define input definitions; you can define the mapping, translations and conditions using the UI.
- Added ability to schedule imports / export using async services
Still a lot of work to be done...
Patch is mostly created by script in egroupware/doc/fix_depricated.php in separate commit.
I do NOT advice to apply this patch to a production system (it's commited to trunk!), as the automatic modified regular expressions have a good change to break something ...
which is required (but not declared) by importexport:
- added requirement to importexport/setup/setup.inc.php
- gracefully fail if dom is not available
- add dom extension to rpm requirements
--> this has been reported many times on the list as "missing wiki
pages", which is caused by suppressed fatal error in importexports
default-records, stoping other apps default records to run
- reworked plugin interfaces.
- charset is now an attribut of plugin_options only
- import / export function itselve is not static any more
- whiped out silly phpdoc tags generated by umbrello (kde uml modeler)
- reworked representation of plugin_options for definitions
- many fixes in uiexport and export_csv
- lang updates
export is quite clean at the moment, but import needs lots of work,
all the stuff is not really for production yet, but i import it now, so that the guy from metaways can also work on it.
most pending tasks:
- implement conversions based on regular expressions
- implement options of plugin
- rework import part (mostly ui)