mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.7.3.1
This commit is contained in:
@@ -49,7 +49,7 @@ public class Xowd_db_file_ {
|
||||
case Tid_file_core: return Key_file_core;
|
||||
case Tid_file_data: return Key_file_data;
|
||||
case Tid_file_user: return Key_file_user;
|
||||
default: throw Exc_.new_unhandled(v);
|
||||
default: throw Err_.new_unhandled(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ class Xowd_db_file_hash {
|
||||
public void Clear() {hash.Clear(); count_total = 0;}
|
||||
public void Del(Xowd_db_file file) {
|
||||
Ordered_hash tids = (Ordered_hash)hash.Get_by(file.Tid());
|
||||
if (tids == null) throw Exc_.new_("unknown file.tid", "url", file.Url());
|
||||
if (!tids.Has(file.Id())) throw Exc_.new_("unknown file.id", "url", file.Url());
|
||||
if (tids == null) throw Err_.new_wo_type("unknown file.tid", "url", file.Url());
|
||||
if (!tids.Has(file.Id())) throw Err_.new_wo_type("unknown file.id", "url", file.Url());
|
||||
tids.Del(file.Id());
|
||||
--count_total;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class Xowd_db_layout {
|
||||
case Const_all: return Name_all;
|
||||
case Const_few: return Name_few;
|
||||
case Const_lot: return Name_lot;
|
||||
default: throw Exc_.new_unimplemented();
|
||||
default: throw Err_.new_unimplemented();
|
||||
}
|
||||
}
|
||||
public static final String Name_all = "all", Name_few = "few", Name_lot = "lot";
|
||||
@@ -41,6 +41,6 @@ public class Xowd_db_layout {
|
||||
if (String_.Eq(v, Name_all)) return Itm_all;
|
||||
else if (String_.Eq(v, Name_few)) return Itm_few;
|
||||
else if (String_.Eq(v, Name_lot)) return Itm_lot;
|
||||
else throw Exc_.new_unimplemented();
|
||||
else throw Err_.new_unimplemented();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public class Xowd_db_mgr {
|
||||
Dbs__set_by_tid(db);
|
||||
db_file_hash.Add_or_new(db);
|
||||
}
|
||||
wiki.Props().Init_by_load(Tbl__cfg());
|
||||
wiki.Props().Init_by_load(wiki.App(), Tbl__cfg());
|
||||
}
|
||||
public void Init_by_make(Xowd_core_db_props props, Xob_info_session info_session) {
|
||||
this.props = props;
|
||||
@@ -133,7 +133,7 @@ public class Xowd_db_mgr {
|
||||
case Xowd_db_layout.Const_all: return domain_name + ".xowa"; // EX: en.wikipedia.org.xowa
|
||||
case Xowd_db_layout.Const_few: return domain_name + "-text.xowa"; // EX: en.wikipedia.org-text.xowa
|
||||
case Xowd_db_layout.Const_lot: return domain_name + "-core.xowa"; // EX: en.wikipedia.org-core.xowa
|
||||
default: throw Exc_.new_unimplemented();
|
||||
default: throw Err_.new_unimplemented();
|
||||
}
|
||||
}
|
||||
private static byte Core_db_tid(Xowd_db_layout layout) {
|
||||
@@ -141,7 +141,7 @@ public class Xowd_db_mgr {
|
||||
case Xowd_db_layout.Const_all: return Xowd_db_file_.Tid_wiki_solo;
|
||||
case Xowd_db_layout.Const_few: return Xowd_db_file_.Tid_text_solo;
|
||||
case Xowd_db_layout.Const_lot: return Xowd_db_file_.Tid_core;
|
||||
default: throw Exc_.new_unimplemented();
|
||||
default: throw Err_.new_unimplemented();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class Xowd_category_itm {
|
||||
case Xoa_ctg_mgr.Tid_subc: return count_subcs;
|
||||
case Xoa_ctg_mgr.Tid_page: return count_pages;
|
||||
case Xoa_ctg_mgr.Tid_file: return count_files;
|
||||
default: throw Exc_.new_unhandled(tid);
|
||||
default: throw Err_.new_unhandled(tid);
|
||||
}
|
||||
}
|
||||
public static Xowd_category_itm load_(int id, int file_idx, boolean hidden, int count_subcs, int count_files, int count_pages) {
|
||||
|
||||
@@ -38,7 +38,7 @@ public class Xowd_page_itm_sorter implements ComparerAble {
|
||||
int tid_comparable = Byte_.Compare(lhs_xtn.Tid(), rhs_xtn.Tid());
|
||||
if (tid_comparable != CompareAble_.Same) return tid_comparable;
|
||||
return Bry_.Compare(lhs_xtn.Sortkey(), rhs_xtn.Sortkey());
|
||||
default: throw Exc_.new_unhandled(compareType);
|
||||
default: throw Err_.new_unhandled(compareType);
|
||||
}
|
||||
}
|
||||
Xowd_page_itm_sorter(byte compareType, int order) {this.compareType = compareType; this.order = order;}
|
||||
|
||||
@@ -293,7 +293,7 @@ public class Xowd_page_tbl implements RlsAble {
|
||||
.Exec_update();
|
||||
break;
|
||||
} catch (Exception exc) {
|
||||
if (String_.Has(Err_.Message_gplx_brief(exc), "columns page_namespace, page_random_int are not unique")) { // HACK: terrible hack, but moving pages across ns will break UNIQUE index
|
||||
if (String_.Has(Err_.Message_gplx_full(exc), "columns page_namespace, page_random_int are not unique")) { // HACK: terrible hack, but moving pages across ns will break UNIQUE index
|
||||
conn.Exec_sql_args("DROP INDEX {0}__name_random;", tbl_name); // is UNIQUE by default
|
||||
conn.Exec_sql_args("CREATE INDEX {0}__name_random ON {0} ({1}, {2});", tbl_name, fld_ns, fld_random_int);
|
||||
}
|
||||
|
||||
@@ -48,10 +48,10 @@ public class Xowd_search_temp_tbl {
|
||||
public void Create_idx(Gfo_usr_dlg usr_dlg, Xowd_search_link_tbl search_link_tbl, Xowd_search_word_tbl search_word_tbl) {
|
||||
conn.Ddl_delete_tbl(tbl_name);
|
||||
try {search_word_tbl.Create_idx();}
|
||||
catch (Exception e) {usr_dlg.Warn_many("", "", "bldr.search_word.unique_search_failed: err=~{0}", Err_.Message_gplx_brief(e));}
|
||||
catch (Exception e) {usr_dlg.Warn_many("", "", "bldr.search_word.unique_search_failed: err=~{0}", Err_.Message_gplx_full(e));}
|
||||
try {search_link_tbl.Create_idx_unique();}
|
||||
catch (Exception e) {
|
||||
usr_dlg.Warn_many("", "", "bldr.search_page.unique_search_failed: err=~{0}", Err_.Message_gplx_brief(e));
|
||||
usr_dlg.Warn_many("", "", "bldr.search_page.unique_search_failed: err=~{0}", Err_.Message_gplx_full(e));
|
||||
search_link_tbl.Create_idx_normal();;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public class Xowd_xowa_db_tbl {
|
||||
case Db_cmd_mode.Tid_update: stmt.Clear(); Commit_itm_vals(stmt, itm); stmt.Crt_int(fld_id, itm.Id()).Exec_update(); break;
|
||||
case Db_cmd_mode.Tid_delete: stmt.Clear().Crt_int(fld_id, itm.Id()).Exec_delete(); break;
|
||||
case Db_cmd_mode.Tid_ignore: break;
|
||||
default: throw Exc_.new_unhandled(itm.Cmd_mode());
|
||||
default: throw Err_.new_unhandled(itm.Cmd_mode());
|
||||
}
|
||||
itm.Cmd_mode_(Db_cmd_mode.Tid_ignore);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user