1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

Import: Do not assume same database schema for all Wikimedia wikis

This commit is contained in:
gnosygnu
2016-10-21 21:30:23 -04:00
parent 50a063c8de
commit df45117d43
9 changed files with 38 additions and 30 deletions

View File

@@ -42,11 +42,12 @@ public class Xob_catlink_cmd extends Xob_sql_dump_base implements Xosql_dump_cbk
case Fld__cl_timestamp: this.tmp_timestamp = Bry_.Mid(src, val_bgn, val_end); break;
case Fld__cl_sortkey_prefix: this.tmp_sortkey_prefix = Bry_.Mid(src, val_bgn, val_end); break;
case Fld__cl_collation: this.tmp_collation = Bry_.Mid(src, val_bgn, val_end); break;
case Fld__cl_type: this.tmp_type = Bry_.Mid(src, val_bgn, val_end);
mgr.On_cmd_row(tmp_page_id, tmp_ctg_ttl, tmp_sortkey, tmp_timestamp, tmp_sortkey_prefix, tmp_collation, tmp_type);
break;
case Fld__cl_type: this.tmp_type = Bry_.Mid(src, val_bgn, val_end); break;
}
}
public void On_row_done() {
mgr.On_cmd_row(tmp_page_id, tmp_ctg_ttl, tmp_sortkey, tmp_timestamp, tmp_sortkey_prefix, tmp_collation, tmp_type);
}
private static final byte Fld__cl_from = 0, Fld__cl_to = 1, Fld__cl_sortkey = 2, Fld__cl_timestamp = 3, Fld__cl_sortkey_prefix = 4, Fld__cl_collation = 5, Fld__cl_type = 6;
public static final String BLDR_CMD_KEY = "wiki.categorylinks";

View File

@@ -42,14 +42,14 @@ public class Xob_pageprop_cmd extends Xob_sql_dump_base implements Xosql_dump_cb
switch (fld_idx) {
case Fld__pp_page: this.tmp_id = Bry_.To_int_or(src, val_bgn, val_end, -1); break;
case Fld__pp_propname: this.tmp_key_is_hiddencat = Bry_.Eq(src, val_bgn, val_end, Key_hiddencat); break;
case Fld__pp_value:
if (tmp_key_is_hiddencat)
tbl.Insert_cmd_by_batch(tmp_id);
if (++rows % 10000 == 0) usr_dlg.Prog_many("", "", "parsing pageprops sql: row=~{0}", Int_.To_str_fmt(rows, "#,##0"));
break;
}
}
private static final byte Fld__pp_page = 0, Fld__pp_propname = 1, Fld__pp_value = 2;
public void On_row_done() {
if (tmp_key_is_hiddencat)
tbl.Insert_cmd_by_batch(tmp_id);
if (++rows % 10000 == 0) usr_dlg.Prog_many("", "", "parsing pageprops sql: row=~{0}", Int_.To_str_fmt(rows, "#,##0"));
}
private static final byte Fld__pp_page = 0, Fld__pp_propname = 1;
public static final String BLDR_CMD_KEY = "wiki.page_props";
@Override public String Cmd_key() {return BLDR_CMD_KEY;}