From f0a86fd84933cc9ebf69f447ce3251b76214574e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20C=C3=A1mara?= Date: Tue, 23 Feb 2016 23:44:25 +0100 Subject: [PATCH] Task #40 - Created specific csv importer for nacion rotonda. --- ...arios_feeds_csv.feeds_importer_default.inc | 85 +++++++++++++++++++ .../ft_c_inmobiliarios_feeds_csv.info | 1 + 2 files changed, 86 insertions(+) diff --git a/docroot/profiles/c_inmobiliarios/modules/features/content/ft_c_inmobiliarios_feeds_csv/ft_c_inmobiliarios_feeds_csv.feeds_importer_default.inc b/docroot/profiles/c_inmobiliarios/modules/features/content/ft_c_inmobiliarios_feeds_csv/ft_c_inmobiliarios_feeds_csv.feeds_importer_default.inc index 1d0e4b6..4bb4bbd 100644 --- a/docroot/profiles/c_inmobiliarios/modules/features/content/ft_c_inmobiliarios_feeds_csv/ft_c_inmobiliarios_feeds_csv.feeds_importer_default.inc +++ b/docroot/profiles/c_inmobiliarios/modules/features/content/ft_c_inmobiliarios_feeds_csv/ft_c_inmobiliarios_feeds_csv.feeds_importer_default.inc @@ -416,5 +416,90 @@ function ft_c_inmobiliarios_feeds_csv_feeds_importer_default() { ); $export['corpses_csv'] = $feeds_importer; + $feeds_importer = new stdClass(); + $feeds_importer->disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */ + $feeds_importer->api_version = 1; + $feeds_importer->id = 'nacion_rotonda_importer'; + $feeds_importer->config = array( + 'name' => 'Nación Rotonda Importer', + 'description' => 'CSV importer for Urban corpses from Nación Rotonda', + 'fetcher' => array( + 'plugin_key' => 'FeedsFileFetcher', + 'config' => array( + 'allowed_extensions' => 'txt csv tsv xml opml', + 'direct' => FALSE, + 'directory' => 'private://feeds', + 'allowed_schemes' => array( + 0 => 'public', + 1 => 'private', + ), + ), + ), + 'parser' => array( + 'plugin_key' => 'FeedsCSVParser', + 'config' => array( + 'delimiter' => ',', + 'no_headers' => 0, + ), + ), + 'processor' => array( + 'plugin_key' => 'FeedsNodeProcessor', + 'config' => array( + 'expire' => '-1', + 'author' => 0, + 'authorize' => 1, + 'mappings' => array( + 0 => array( + 'source' => 'nombre_promocional', + 'target' => 'title', + 'unique' => 1, + ), + 1 => array( + 'source' => 'longitud', + 'target' => 'field_gl_address:longitude', + 'unique' => FALSE, + ), + 2 => array( + 'source' => 'latitud', + 'target' => 'field_gl_address:latitude', + 'unique' => FALSE, + ), + 3 => array( + 'source' => 'enlace_web', + 'target' => 'field_url:url', + 'unique' => FALSE, + ), + 4 => array( + 'source' => 'corpse_category', + 'target' => 'field_corpse_category', + 'unique' => FALSE, + ), + 5 => array( + 'source' => 'creator', + 'target' => 'user_name', + 'unique' => FALSE, + ), + 6 => array( + 'source' => 'fuente', + 'target' => 'field_corpse_source', + 'unique' => FALSE, + ), + ), + 'update_existing' => '2', + 'update_non_existent' => 'skip', + 'input_format' => 'plain_text', + 'skip_hash_check' => 0, + 'bundle' => 'corpse', + ), + ), + 'content_type' => '', + 'update' => 0, + 'import_period' => '-1', + 'expire_period' => 3600, + 'import_on_create' => 1, + 'process_in_background' => 0, + ); + $export['nacion_rotonda_importer'] = $feeds_importer; + return $export; } diff --git a/docroot/profiles/c_inmobiliarios/modules/features/content/ft_c_inmobiliarios_feeds_csv/ft_c_inmobiliarios_feeds_csv.info b/docroot/profiles/c_inmobiliarios/modules/features/content/ft_c_inmobiliarios_feeds_csv/ft_c_inmobiliarios_feeds_csv.info index 78c188b..30c72a4 100644 --- a/docroot/profiles/c_inmobiliarios/modules/features/content/ft_c_inmobiliarios_feeds_csv/ft_c_inmobiliarios_feeds_csv.info +++ b/docroot/profiles/c_inmobiliarios/modules/features/content/ft_c_inmobiliarios_feeds_csv/ft_c_inmobiliarios_feeds_csv.info @@ -15,6 +15,7 @@ features[ctools][] = feeds:feeds_importer_default:1 features[ctools][] = feeds_tamper:feeds_tamper_default:2 features[features_api][] = api:2 features[feeds_importer][] = corpses_csv +features[feeds_importer][] = nacion_rotonda_importer features[feeds_tamper][] = corpses_csv-arquitecto_o_tecnico_redactor-explode features[feeds_tamper][] = corpses_csv-constructor-explode features[feeds_tamper][] = corpses_csv-enlace_web-explode