-
Notifications
You must be signed in to change notification settings - Fork 0
/
inventory_app.feeds_importer_default.inc
151 lines (148 loc) · 4.11 KB
/
inventory_app.feeds_importer_default.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?php
/**
* @file
* inventory_app.feeds_importer_default.inc
*/
/**
* Implements hook_feeds_importer_default().
*/
function inventory_app_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 = 'page_inventory';
$feeds_importer->config = array(
'name' => 'Inventory importer',
'description' => 'Imports a CSV file of page inventory data',
'fetcher' => array(
'plugin_key' => 'FeedsFileFetcher',
'config' => array(
'direct' => FALSE,
'allowed_extensions' => 'txt csv tsv xml opml',
'directory' => 'public://feeds',
'allowed_schemes' => array(
0 => 'public',
),
),
),
'parser' => array(
'plugin_key' => 'FeedsCSVParser',
'config' => array(
'delimiter' => ',',
'no_headers' => 0,
),
),
'processor' => array(
'plugin_key' => 'FeedsNodeProcessor',
'config' => array(
'bundle' => 'inventory_page',
'update_existing' => '1',
'expire' => '-1',
'mappings' => array(
0 => array(
'source' => 'row_num',
'target' => 'guid',
'unique' => 1,
),
1 => array(
'source' => 'row_num',
'target' => 'field_row_number',
'unique' => FALSE,
),
2 => array(
'source' => 'other_title',
'target' => 'title',
'unique' => FALSE,
),
3 => array(
'source' => 'current_id',
'target' => 'field_current_id',
'unique' => FALSE,
),
4 => array(
'source' => 'current_url',
'target' => 'field_current_url',
'unique' => FALSE,
),
5 => array(
'source' => 'Title',
'target' => 'field_site_map_label',
'unique' => FALSE,
),
6 => array(
'source' => 'future_id',
'target' => 'field_future_id',
'unique' => FALSE,
),
7 => array(
'source' => 'future_url',
'target' => 'field_future_url',
'unique' => FALSE,
),
8 => array(
'source' => 'body',
'target' => 'body',
'unique' => FALSE,
),
9 => array(
'source' => 'published',
'target' => 'created',
'unique' => FALSE,
),
10 => array(
'source' => 'topic',
'target' => 'field_topic',
'term_search' => '0',
'autocreate' => 1,
),
11 => array(
'source' => 'disposition',
'target' => 'field_disposition',
'term_search' => '0',
'autocreate' => 1,
),
12 => array(
'source' => 'app_or_content',
'target' => 'field_app_or_content',
'term_search' => '0',
'autocreate' => 1,
),
13 => array(
'source' => 'future_template',
'target' => 'field_future_template',
'term_search' => '0',
'autocreate' => 1,
),
14 => array(
'source' => 'notes',
'target' => 'field_notes',
'unique' => FALSE,
),
15 => array(
'source' => 'locales',
'target' => 'field_locales',
'unique' => FALSE,
),
16 => array(
'source' => 'level',
'target' => 'field_level',
'unique' => FALSE,
),
),
'input_format' => 'plain_text',
'author' => 0,
'authorize' => 1,
'skip_hash_check' => 0,
),
),
'content_type' => '',
'update' => 0,
'import_period' => '-1',
'expire_period' => 3600,
'import_on_create' => 1,
'process_in_background' => 0,
);
$export['page_inventory'] = $feeds_importer;
return $export;
}