Revision 3653
Added by Aaron Marcuse-Kubitza over 12 years ago
bin/map | ||
---|---|---|
157 | 157 |
doc = xml_dom.create_doc() |
158 | 158 |
root = doc.documentElement |
159 | 159 |
out_is_xml_ref = [False] |
160 |
|
|
160 | 161 |
in_label_ref = [None] |
162 |
col_defaults = {} |
|
161 | 163 |
def update_in_label(): |
162 | 164 |
if in_label_ref[0] != None: |
163 | 165 |
xpath.get(root, '/_ignore/inLabel="'+in_label_ref[0]+'"', True) |
166 |
# TODO: Move this to the mappings as some kind of metadata |
|
167 |
col_defaults['datasource_id'] = xpath.path2xml( |
|
168 |
'party/organizationname="'+in_label_ref[0]+'"') |
|
169 |
|
|
164 | 170 |
def prep_root(): |
165 | 171 |
root.clear() |
166 | 172 |
update_in_label() |
... | ... | |
343 | 349 |
|
344 | 350 |
# Import rows |
345 | 351 |
in_row_ct_ref = [0] |
346 |
# TODO: Move this to the mappings as some kind of metadata |
|
347 |
col_defaults = {'datasource_id': xpath.path2xml( |
|
348 |
'party/organizationname="'+in_label_ref[0]+'"')} |
|
349 | 352 |
db_xml.put_table(in_db, root.firstChild, table, in_row_ct_ref, |
350 | 353 |
row_ins_ct_ref, n, start, on_error, col_defaults) |
351 | 354 |
row_ct = in_row_ct_ref[0] |
... | ... | |
434 | 437 |
try: |
435 | 438 |
sql.with_savepoint(out_db, |
436 | 439 |
lambda: db_xml.put(out_db, row_root.firstChild, |
437 |
row_ins_ct_ref, on_error)) |
|
440 |
row_ins_ct_ref, on_error, col_defaults))
|
|
438 | 441 |
except sql.DatabaseErrors, e: on_error(e) |
439 | 442 |
|
440 | 443 |
row_ct = process_inputs(root, row_ready) |
Also available in: Unified diff
bin/map: out_is_db: Use col_defaults in row-based mode as well