This repository has been archived by the owner on Jul 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding candidate data importers and other stuff
referenences #80
- Loading branch information
Sumeet Pareek
committed
Jan 27, 2014
1 parent
512b7f7
commit d286349
Showing
9 changed files
with
231 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
.../all/modules/custom/features/f_candidate_details/f_candidate_details.features.metatag.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
/** | ||
* @file | ||
* f_candidate_details.features.metatag.inc | ||
*/ | ||
|
||
/** | ||
* Implements hook_metatag_export_default(). | ||
*/ | ||
function f_candidate_details_metatag_export_default() { | ||
$config = array(); | ||
|
||
// Exported Metatag config instance: node:ct_candidate_details. | ||
$config['node:ct_candidate_details'] = array( | ||
'instance' => 'node:ct_candidate_details', | ||
'config' => array( | ||
'title' => array( | ||
'value' => '[node:field_cd_name] | [node:field_cd_pc] Constituency Candidate | India Lok Sabha Elections 2014 | [site:name]', | ||
), | ||
), | ||
); | ||
|
||
return $config; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 118 additions & 0 deletions
118
...odules/custom/features/f_candidate_details/f_candidate_details.feeds_importer_default.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
<?php | ||
/** | ||
* @file | ||
* f_candidate_details.feeds_importer_default.inc | ||
*/ | ||
|
||
/** | ||
* Implements hook_feeds_importer_default(). | ||
*/ | ||
function f_candidate_details_feeds_importer_default() { | ||
$export = array(); | ||
|
||
$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 = 'candidate_data_import'; | ||
$feeds_importer->config = array( | ||
'name' => 'Candidate Data Import', | ||
'description' => '', | ||
'fetcher' => array( | ||
'plugin_key' => 'FeedsFileFetcher', | ||
'config' => array( | ||
'allowed_extensions' => 'txt csv tsv xml opml', | ||
'direct' => 0, | ||
'directory' => 'private://feeds', | ||
'allowed_schemes' => array( | ||
'public' => 'public', | ||
'private' => 'private', | ||
), | ||
), | ||
), | ||
'parser' => array( | ||
'plugin_key' => 'FeedsCSVParser', | ||
'config' => array( | ||
'delimiter' => ',', | ||
'no_headers' => 0, | ||
), | ||
), | ||
'processor' => array( | ||
'plugin_key' => 'FeedsNodeProcessor', | ||
'config' => array( | ||
'expire' => '-1', | ||
'author' => '1', | ||
'authorize' => 0, | ||
'mappings' => array( | ||
0 => array( | ||
'source' => 'name', | ||
'target' => 'field_cd_name', | ||
'unique' => FALSE, | ||
), | ||
1 => array( | ||
'source' => 'state', | ||
'target' => 'field_cd_state', | ||
'unique' => FALSE, | ||
), | ||
2 => array( | ||
'source' => 'loksabha', | ||
'target' => 'field_cd_pc', | ||
'unique' => FALSE, | ||
), | ||
3 => array( | ||
'source' => 'mobile', | ||
'target' => 'field_cd_phone', | ||
'unique' => FALSE, | ||
), | ||
4 => array( | ||
'source' => 'email', | ||
'target' => 'field_cd_email', | ||
'unique' => FALSE, | ||
), | ||
5 => array( | ||
'source' => 'gender', | ||
'target' => 'field_cd_gender', | ||
'unique' => FALSE, | ||
), | ||
6 => array( | ||
'source' => 'dob', | ||
'target' => 'field_cd_dob_text', | ||
'unique' => FALSE, | ||
), | ||
7 => array( | ||
'source' => 'education', | ||
'target' => 'field_cd_education_qualification', | ||
'unique' => FALSE, | ||
), | ||
8 => array( | ||
'source' => 'name', | ||
'target' => 'title', | ||
'unique' => FALSE, | ||
), | ||
9 => array( | ||
'source' => 'link', | ||
'target' => 'field_cd_links:url', | ||
'unique' => FALSE, | ||
), | ||
10 => array( | ||
'source' => 'linktitle', | ||
'target' => 'field_cd_links:title', | ||
'unique' => FALSE, | ||
), | ||
), | ||
'update_existing' => '0', | ||
'input_format' => 'plain_text', | ||
'skip_hash_check' => 0, | ||
'bundle' => 'ct_candidate_details', | ||
), | ||
), | ||
'content_type' => '', | ||
'update' => 0, | ||
'import_period' => '-1', | ||
'expire_period' => 3600, | ||
'import_on_create' => 1, | ||
'process_in_background' => 0, | ||
); | ||
$export['candidate_data_import'] = $feeds_importer; | ||
|
||
return $export; | ||
} |
28 changes: 28 additions & 0 deletions
28
.../modules/custom/features/f_candidate_details/f_candidate_details.feeds_tamper_default.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* @file | ||
* f_candidate_details.feeds_tamper_default.inc | ||
*/ | ||
|
||
/** | ||
* Implements hook_feeds_tamper_default(). | ||
*/ | ||
function f_candidate_details_feeds_tamper_default() { | ||
$export = array(); | ||
|
||
$feeds_tamper = new stdClass(); | ||
$feeds_tamper->disabled = FALSE; /* Edit this to true to make a default feeds_tamper disabled initially */ | ||
$feeds_tamper->api_version = 2; | ||
$feeds_tamper->id = 'candidate_data_import-gender-convert_case'; | ||
$feeds_tamper->importer = 'candidate_data_import'; | ||
$feeds_tamper->source = 'gender'; | ||
$feeds_tamper->plugin_id = 'convert_case'; | ||
$feeds_tamper->settings = array( | ||
'mode' => '1', | ||
); | ||
$feeds_tamper->weight = 0; | ||
$feeds_tamper->description = 'Convert case'; | ||
$export['candidate_data_import-gender-convert_case'] = $feeds_tamper; | ||
|
||
return $export; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters