mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.9.2.1'
This commit is contained in:
@@ -61,7 +61,7 @@ public class Xow_db_file {
|
||||
public Xowd_site_ns_tbl Tbl__ns() {return tbl__ns;} private final Xowd_site_ns_tbl tbl__ns;
|
||||
public Xowd_page_tbl Tbl__page() {return tbl__page;} private Xowd_page_tbl tbl__page;
|
||||
public Xowd_text_tbl Tbl__text() {return tbl__text;} private final Xowd_text_tbl tbl__text;
|
||||
public Xowd_html_tbl Tbl__html() {return tbl__html;} private final Xowd_html_tbl tbl__html;
|
||||
public Xowd_html_tbl Tbl__html() {return tbl__html;} private final Xowd_html_tbl tbl__html;
|
||||
public Xowd_css_core_tbl Tbl__css_core() {return tbl__css_core;} private final Xowd_css_core_tbl tbl__css_core;
|
||||
public Xowd_css_file_tbl Tbl__css_file() {return tbl__css_file;} private final Xowd_css_file_tbl tbl__css_file;
|
||||
public Xowd_cat_core_tbl Tbl__cat_core() {return tbl__cat_core;} private final Xowd_cat_core_tbl tbl__cat_core;
|
||||
|
||||
@@ -70,7 +70,7 @@ public class Xow_db_file__core_ {
|
||||
|
||||
public static boolean Is_core_fil_name(String domain_name, String fil_name) {
|
||||
Xow_domain_itm domain_itm = Xow_domain_itm_.parse(Bry_.new_u8(domain_name));
|
||||
if (domain_itm.Domain_type_id() == Xow_domain_tid_.Int__other) {
|
||||
if (domain_itm.Domain_type_id() == Xow_domain_tid_.Tid__other) {
|
||||
return String_.Has_at_end(fil_name, ".xowa");
|
||||
}
|
||||
String domain_str = domain_itm.Domain_str();
|
||||
|
||||
56
400_xowa/src/gplx/xowa/wikis/data/tbls/Select_in_cbk.java
Normal file
56
400_xowa/src/gplx/xowa/wikis/data/tbls/Select_in_cbk.java
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.wikis.data.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.data.*;
|
||||
import gplx.dbs.*;
|
||||
public interface Select_in_cbk {
|
||||
void Write_sql(Bry_bfr bfr, int idx);
|
||||
void Read_data(Db_rdr rdr);
|
||||
int Hash_max();
|
||||
}
|
||||
class Select_in_wkr {
|
||||
private final byte[] sql_bgn;
|
||||
public Select_in_wkr(byte[] sql_bgn) {this.sql_bgn = sql_bgn;}
|
||||
public int Make_sql_or_null(Bry_bfr bfr, Select_in_cbk cbk, int bgn) {
|
||||
// read 50 at a time
|
||||
int max = cbk.Hash_max();
|
||||
int end = bgn + 50; if (end > max) end = max;
|
||||
if (bgn == end) return -1; // at eos; return;
|
||||
|
||||
// concat itms
|
||||
bfr.Add(sql_bgn);
|
||||
for (int i = bgn; i < end; ++i) {
|
||||
if (i != bgn) bfr.Add_str_a7(", ");
|
||||
cbk.Write_sql(bfr, i);
|
||||
}
|
||||
bfr.Add_byte(Byte_ascii.Paren_end);
|
||||
return end;
|
||||
}
|
||||
public static Select_in_wkr New(Bry_bfr bfr, String tbl_name, String[] select_flds, String where_fld) {
|
||||
bfr.Add_str_a7("SELECT ");
|
||||
int select_flds_len = select_flds.length;
|
||||
for (int i = 0; i < select_flds_len; ++i) {
|
||||
String select_fld = select_flds[i];
|
||||
if (i != 0) bfr.Add_str_a7(", ");
|
||||
bfr.Add_str_u8(select_fld);
|
||||
}
|
||||
bfr.Add_str_a7(" FROM ").Add_str_u8(tbl_name);
|
||||
bfr.Add_str_a7(" WHERE ").Add_str_u8(where_fld);
|
||||
bfr.Add_str_a7(" IN (");
|
||||
return new Select_in_wkr(bfr.To_bry_and_clear());
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.wikis.data.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.data.*;
|
||||
import gplx.dbs.*;
|
||||
public class Xowd_cat_core_tbl implements Rls_able {
|
||||
public class Xowd_cat_core_tbl implements Db_tbl {
|
||||
private final String tbl_name; private final Dbmeta_fld_list flds = new Dbmeta_fld_list();
|
||||
private final String fld_id, fld_pages, fld_subcats, fld_files, fld_hidden, fld_link_db_id;
|
||||
private final Db_conn conn; private Db_stmt stmt_insert, stmt_update, stmt_select;
|
||||
@@ -37,7 +37,8 @@ public class Xowd_cat_core_tbl implements Rls_able {
|
||||
in_wkr.Ctor(this, tbl_name, flds, fld_id);
|
||||
conn.Rls_reg(this);
|
||||
}
|
||||
public Xowd_cat_core_tbl Create_tbl() {conn.Meta_tbl_create(Dbmeta_tbl_itm.New(tbl_name, flds)); return this;}
|
||||
public String Tbl_name() {return tbl_name;}
|
||||
public void Create_tbl() {conn.Meta_tbl_create(Dbmeta_tbl_itm.New(tbl_name, flds));}
|
||||
public void Insert_bgn() {conn.Txn_bgn("schema__cat_core__insert"); stmt_insert = conn.Stmt_insert(tbl_name, flds);}
|
||||
public void Insert_end() {conn.Txn_end(); stmt_insert = Db_stmt_.Rls(stmt_insert);}
|
||||
public void Insert_cmd_by_batch(int id, int pages, int subcats, int files, byte hidden, int link_db_id) {
|
||||
@@ -61,6 +62,20 @@ public class Xowd_cat_core_tbl implements Rls_able {
|
||||
in_wkr.Init(rv);
|
||||
in_wkr.Select_in(cancelable, conn, bgn, end);
|
||||
}
|
||||
public void Select_by_cat_id_many(Select_in_cbk cbk) {
|
||||
int pos = 0;
|
||||
Bry_bfr bfr = Bry_bfr_.New();
|
||||
Select_in_wkr wkr = Select_in_wkr.New(bfr, tbl_name, String_.Ary(fld_id, fld_pages, fld_subcats, fld_files, fld_hidden), fld_id);
|
||||
while (true) {
|
||||
pos = wkr.Make_sql_or_null(bfr, cbk, pos);
|
||||
if (pos == -1) break;
|
||||
Db_rdr rdr = conn.Stmt_sql(bfr.To_str_and_clear()).Exec_select__rls_auto();
|
||||
try {
|
||||
while (rdr.Move_next())
|
||||
cbk.Read_data(rdr);
|
||||
} finally {rdr.Rls();}
|
||||
}
|
||||
}
|
||||
public Xowd_category_itm new_itm(Db_rdr rdr) {
|
||||
return Xowd_category_itm.load_
|
||||
( rdr.Read_int(fld_id)
|
||||
|
||||
@@ -16,12 +16,11 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.wikis.data.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.data.*;
|
||||
import gplx.dbs.*; import gplx.dbs.qrys.*; import gplx.xowa.wikis.ctgs.*;
|
||||
public class Xowd_cat_link_tbl implements Rls_able {
|
||||
private final String tbl_name; private final Dbmeta_fld_list flds = new Dbmeta_fld_list();
|
||||
import gplx.dbs.*; import gplx.dbs.qrys.*; import gplx.xowa.addons.wikis.ctgs.*;
|
||||
public class Xowd_cat_link_tbl implements Db_tbl {
|
||||
private final Dbmeta_fld_list flds = new Dbmeta_fld_list();
|
||||
private final String fld_from, fld_to_id, fld_sortkey, fld_timestamp, fld_type_id;
|
||||
private final Db_conn conn; private Db_stmt stmt_insert, stmt_select_in;
|
||||
public Db_conn Conn() {return conn;}
|
||||
private Db_stmt stmt_insert, stmt_select_in;
|
||||
public Xowd_cat_link_tbl(Db_conn conn, boolean schema_is_1) {
|
||||
this.conn = conn;
|
||||
this.tbl_name = schema_is_1 ? "categorylinks" : "cat_link";
|
||||
@@ -32,7 +31,9 @@ public class Xowd_cat_link_tbl implements Rls_able {
|
||||
fld_timestamp = flds.Add_str ("cl_timestamp", 14);
|
||||
conn.Rls_reg(this);
|
||||
}
|
||||
public Xowd_cat_link_tbl Create_tbl() {conn.Meta_tbl_create(Dbmeta_tbl_itm.New(tbl_name, flds)); return this;}
|
||||
public Db_conn Conn() {return conn;} private final Db_conn conn;
|
||||
public String Tbl_name() {return tbl_name;} private final String tbl_name;
|
||||
public void Create_tbl() {conn.Meta_tbl_create(Dbmeta_tbl_itm.New(tbl_name, flds));}
|
||||
public void Create_idx() {
|
||||
conn.Meta_idx_create(Xoa_app_.Usr_dlg()
|
||||
, Dbmeta_idx_itm.new_normal_by_tbl(tbl_name, "main", fld_to_id, fld_type_id, fld_sortkey, fld_from)
|
||||
@@ -51,6 +52,7 @@ public class Xowd_cat_link_tbl implements Rls_able {
|
||||
.Exec_insert();
|
||||
}
|
||||
public void Delete_all() {conn.Stmt_delete(tbl_name, Dbmeta_fld_itm.Str_ary_empty).Exec_delete();}
|
||||
|
||||
public int Select_by_type(List_adp list, int cat_page_id, byte arg_tid, byte[] arg_sortkey, boolean arg_is_from, int limit) {
|
||||
String arg_sortkey_str = arg_sortkey == null ? "" : String_.new_u8(arg_sortkey);
|
||||
gplx.core.criterias.Criteria comp_crt = !arg_is_from
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.wikis.data.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.data.*;
|
||||
import gplx.core.primitives.*; import gplx.xowa.wikis.ctgs.*;
|
||||
import gplx.core.primitives.*; import gplx.xowa.addons.wikis.ctgs.*;
|
||||
public class Xowd_category_itm {
|
||||
public int Id() {return id;} private int id;
|
||||
public Int_obj_val Id_val() {if (id_val == null) id_val = new Int_obj_val(id); return id_val;} Int_obj_val id_val;
|
||||
|
||||
@@ -28,9 +28,10 @@ public class Xowd_page_itm {
|
||||
public boolean Redirected() {return redirected;} public Xowd_page_itm Redirected_(boolean v) {redirected = v; return this;} private boolean redirected;
|
||||
public int Text_len() {return text_len;} public Xowd_page_itm Text_len_(int v) {text_len = v; return this;} private int text_len;
|
||||
public int Text_db_id() {return text_db_id;} public Xowd_page_itm Text_db_id_(int v) {text_db_id = v; return this;} private int text_db_id;
|
||||
public int Html_db_id() {return html_db_id;} private int html_db_id;
|
||||
public int Cat_db_id() {return cat_db_id;} private int cat_db_id;
|
||||
public byte[] Text() {return text;} public Xowd_page_itm Text_(byte[] v) {text = v; if (v != null) text_len = v.length; return this;} private byte[] text;
|
||||
public int Random_int() {return random_int;} private int random_int;
|
||||
public int Html_db_id() {return html_db_id;} private int html_db_id;
|
||||
public int Redirect_id() {return redirect_id;} private int redirect_id;
|
||||
public DateAdp Modified_on() {return modified_on;} public Xowd_page_itm Modified_on_(DateAdp v) {modified_on = v; return this;} private DateAdp modified_on;
|
||||
public boolean Exists() {return exists;} private boolean exists;
|
||||
@@ -48,14 +49,16 @@ public class Xowd_page_itm {
|
||||
public void Init_by_load__idx(int id, int ns_id, byte[] ttl_page_db, int text_len) {
|
||||
this.exists = true; // COMMENT: DATE:2016-08-28
|
||||
this.id = id;
|
||||
this.id_val = null;
|
||||
this.ns_id = ns_id;
|
||||
this.ttl_page_db = ttl_page_db;
|
||||
this.text_len = text_len;
|
||||
}
|
||||
public void Init_by_load__all(int id, int ns_id, byte[] ttl_page_db, DateAdp modified_on, boolean redirected, int text_len, int random_int, int text_db_id, int html_db_id, int redirect_id, int score) {
|
||||
public void Init_by_load__all(int id, int ns_id, byte[] ttl_page_db, DateAdp modified_on, boolean redirected, int text_len, int random_int, int text_db_id, int html_db_id, int redirect_id, int score, int cat_db_id) {
|
||||
// same as Init_by_load__idx; COMMENT: DATE:2016-08-28
|
||||
this.exists = true;
|
||||
this.id = id;
|
||||
this.id_val = null;
|
||||
this.ns_id = ns_id;
|
||||
this.ttl_page_db = ttl_page_db;
|
||||
this.text_len = text_len;
|
||||
@@ -68,11 +71,13 @@ public class Xowd_page_itm {
|
||||
this.html_db_id = html_db_id;
|
||||
this.redirect_id = redirect_id;
|
||||
this.score = score;
|
||||
this.cat_db_id = cat_db_id;
|
||||
}
|
||||
public void Init_by_tdb(int id, int text_db_id, int tdb_row_idx, boolean redirected, int text_len, int ns_id, byte[] ttl_page_db) {
|
||||
// same as Init_by_load__idx; COMMENT: DATE:2016-08-28
|
||||
this.exists = true;
|
||||
this.id = id;
|
||||
this.id_val = null;
|
||||
this.ns_id = ns_id;
|
||||
this.ttl_page_db = ttl_page_db;
|
||||
this.text_len = text_len;
|
||||
@@ -120,7 +125,7 @@ public class Xowd_page_itm {
|
||||
redirected = exists = false;
|
||||
modified_on = DateAdp_.MinValue;
|
||||
id_val = null;
|
||||
html_db_id = -1;
|
||||
html_db_id = cat_db_id = -1;
|
||||
redirect_id = -1;
|
||||
return this;
|
||||
}
|
||||
@@ -139,6 +144,7 @@ public class Xowd_page_itm {
|
||||
this.modified_on = orig.modified_on;
|
||||
this.id_val = null;
|
||||
this.html_db_id = orig.html_db_id;
|
||||
this.cat_db_id = orig.cat_db_id;
|
||||
}
|
||||
public void Srl_save(Bry_bfr bfr) {gplx.xowa.wikis.tdbs.Xotdb_page_itm_.Txt_id_save(bfr, this);}
|
||||
public static final int Id_null = -1, Modified_on_null_int = 0, Redirect_id_null = -1;
|
||||
|
||||
@@ -32,8 +32,8 @@ public class Xowd_page_itm_sorter implements ComparerAble {
|
||||
case Tid_id: return Int_.Compare(lhs.Id(), rhs.Id());
|
||||
case Tid_ttl: return Bry_.Compare(lhs.Ttl_page_db(), rhs.Ttl_page_db());
|
||||
case Tid_ctg_tid_sortkey:
|
||||
gplx.xowa.wikis.ctgs.Xoctg_page_xtn lhs_xtn = (gplx.xowa.wikis.ctgs.Xoctg_page_xtn)lhs.Xtn();
|
||||
gplx.xowa.wikis.ctgs.Xoctg_page_xtn rhs_xtn = (gplx.xowa.wikis.ctgs.Xoctg_page_xtn)rhs.Xtn();
|
||||
gplx.xowa.addons.wikis.ctgs.Xoctg_page_xtn lhs_xtn = (gplx.xowa.addons.wikis.ctgs.Xoctg_page_xtn)lhs.Xtn();
|
||||
gplx.xowa.addons.wikis.ctgs.Xoctg_page_xtn rhs_xtn = (gplx.xowa.addons.wikis.ctgs.Xoctg_page_xtn)rhs.Xtn();
|
||||
if (lhs_xtn == null || rhs_xtn == null) return CompareAble_.Same;
|
||||
int tid_comparable = Byte_.Compare(lhs_xtn.Tid(), rhs_xtn.Tid());
|
||||
if (tid_comparable != CompareAble_.Same) return tid_comparable;
|
||||
@@ -45,9 +45,9 @@ public class Xowd_page_itm_sorter implements ComparerAble {
|
||||
byte compareType; int order;
|
||||
static final byte Tid_ns_ttl = 0, Tid_itm_len = 2, Tid_id = 3, Tid_ttl = 4, Tid_ctg_tid_sortkey = 5;
|
||||
static final int Asc = 1, Dsc = -1;
|
||||
public static final Xowd_page_itm_sorter TitleAsc = new Xowd_page_itm_sorter(Tid_ttl , Asc);
|
||||
public static final Xowd_page_itm_sorter EnyLenDsc = new Xowd_page_itm_sorter(Tid_itm_len , Dsc);
|
||||
public static final Xowd_page_itm_sorter IdAsc = new Xowd_page_itm_sorter(Tid_id , Asc);
|
||||
public static final Xowd_page_itm_sorter Ns_id_TtlAsc = new Xowd_page_itm_sorter(Tid_ns_ttl , Asc);
|
||||
public static final Xowd_page_itm_sorter Ctg_tid_sortkey_asc = new Xowd_page_itm_sorter(Tid_ctg_tid_sortkey , Asc);
|
||||
public static final Xowd_page_itm_sorter TitleAsc = new Xowd_page_itm_sorter(Tid_ttl , Asc);
|
||||
public static final Xowd_page_itm_sorter EnyLenDsc = new Xowd_page_itm_sorter(Tid_itm_len , Dsc);
|
||||
public static final Xowd_page_itm_sorter IdAsc = new Xowd_page_itm_sorter(Tid_id , Asc);
|
||||
public static final Xowd_page_itm_sorter Ns_id_TtlAsc = new Xowd_page_itm_sorter(Tid_ns_ttl , Asc);
|
||||
public static final Xowd_page_itm_sorter Ctg_tid_sortkey_asc = new Xowd_page_itm_sorter(Tid_ctg_tid_sortkey , Asc);
|
||||
}
|
||||
|
||||
@@ -23,15 +23,20 @@ public class Xowd_page_tbl implements Rls_able {
|
||||
private final Object thread_lock = new Object();
|
||||
private final String tbl_name = "page";
|
||||
public final boolean schema_is_1;
|
||||
private String fld_id, fld_ns, fld_title, fld_is_redirect, fld_touched, fld_len, fld_random_int, fld_score, fld_text_db_id, fld_html_db_id, fld_redirect_id;
|
||||
private String fld_id, fld_ns, fld_title, fld_is_redirect, fld_touched, fld_len, fld_random_int, fld_score, fld_text_db_id, fld_html_db_id, fld_redirect_id, fld_cat_db_id;
|
||||
private final Dbmeta_fld_list flds = new Dbmeta_fld_list();
|
||||
private Db_stmt stmt_select_all_by_ttl, stmt_select_all_by_id, stmt_select_id_by_ttl, stmt_insert;
|
||||
private final String[] flds_select_all, flds_select_idx;
|
||||
public Xowd_page_tbl(Db_conn conn, boolean schema_is_1) {
|
||||
this.conn = conn; this.schema_is_1 = schema_is_1;
|
||||
String fld_text_db_id_name = "";
|
||||
String fld_cat_db_id_name = Dbmeta_fld_itm.Key_null;
|
||||
if (schema_is_1) {fld_text_db_id_name = "page_file_idx";}
|
||||
else {fld_text_db_id_name = "page_text_db_id";}
|
||||
else {
|
||||
fld_text_db_id_name = "page_text_db_id";
|
||||
if (conn.Meta_fld_exists(tbl_name, "page_cat_db_id"))
|
||||
fld_cat_db_id_name = "page_cat_db_id";
|
||||
}
|
||||
fld_id = flds.Add_int_pkey("page_id"); // int(10); unsigned -- MW:same
|
||||
fld_ns = flds.Add_int("page_namespace"); // int(11); -- MW:same
|
||||
fld_title = flds.Add_str("page_title", 255); // varbinary(255); -- MW:blob
|
||||
@@ -43,7 +48,9 @@ public class Xowd_page_tbl implements Rls_able {
|
||||
fld_html_db_id = flds.Add_int_dflt("page_html_db_id", -1); // MW:XOWA
|
||||
fld_redirect_id = flds.Add_int_dflt("page_redirect_id", -1); // MW:XOWA
|
||||
fld_score = flds.Add_int_dflt(Fld__page_score__key, -1); // MW:XOWA
|
||||
flds_select_all = String_.Ary_wo_null(fld_id, fld_ns, fld_title, fld_touched, fld_is_redirect, fld_len, fld_random_int, fld_text_db_id, fld_html_db_id, fld_redirect_id, fld_score);
|
||||
if (fld_cat_db_id_name != Dbmeta_fld_itm.Key_null)
|
||||
fld_cat_db_id = flds.Add_int_dflt(fld_cat_db_id_name, -1);// MW:XOWA
|
||||
flds_select_all = String_.Ary_wo_null(fld_id, fld_ns, fld_title, fld_touched, fld_is_redirect, fld_len, fld_random_int, fld_text_db_id, fld_html_db_id, fld_redirect_id, fld_score, fld_cat_db_id);
|
||||
flds_select_idx = String_.Ary_wo_null(fld_ns, fld_title, fld_id, fld_len, fld_score);
|
||||
conn.Rls_reg(this);
|
||||
}
|
||||
@@ -89,6 +96,7 @@ public class Xowd_page_tbl implements Rls_able {
|
||||
.Val_int(fld_html_db_id, html_db_id)
|
||||
.Val_int(fld_redirect_id, -1)
|
||||
.Val_int(fld_score, -1)
|
||||
.Val_int(fld_cat_db_id, -1)
|
||||
.Exec_insert();
|
||||
}
|
||||
public void Insert_by_itm(Db_stmt stmt, Xowd_page_itm itm, int html_db_id) {
|
||||
@@ -104,8 +112,14 @@ public class Xowd_page_tbl implements Rls_able {
|
||||
.Val_int (fld_html_db_id , html_db_id)
|
||||
.Val_int (fld_redirect_id , itm.Redirect_id())
|
||||
.Val_int (fld_score , itm.Score())
|
||||
.Val_int (fld_cat_db_id , -1)
|
||||
.Exec_insert();
|
||||
}
|
||||
public Xowd_page_itm Select_by_ttl_as_itm_or_null(Xoa_ttl ttl) {
|
||||
Xowd_page_itm rv = new Xowd_page_itm();
|
||||
return Select_by_ttl(rv, ttl) ? rv : null;
|
||||
}
|
||||
public boolean Select_by_ttl(Xowd_page_itm rv, Xoa_ttl ttl) {return Select_by_ttl(rv, ttl.Ns(), ttl.Page_db());}
|
||||
public boolean Select_by_ttl(Xowd_page_itm rv, Xow_ns ns, byte[] ttl) {
|
||||
if (stmt_select_all_by_ttl == null) stmt_select_all_by_ttl = conn.Stmt_select(tbl_name, flds, String_.Ary(fld_ns, fld_title));
|
||||
synchronized (thread_lock) { // LOCK:stmt-rls; DATE:2016-07-06
|
||||
@@ -287,6 +301,7 @@ public class Xowd_page_tbl implements Rls_able {
|
||||
// handle page_score defaulting to page_len
|
||||
int page_len = rdr.Read_int(fld_len);
|
||||
int page_score = fld_score == Dbmeta_fld_itm.Key_null ? page_len : rdr.Read_int(fld_score);
|
||||
int cat_db_id = fld_cat_db_id == Dbmeta_fld_itm.Key_null ? -1 : rdr.Read_int(fld_cat_db_id);
|
||||
|
||||
page.Init_by_load__all
|
||||
( rdr.Read_int(fld_id)
|
||||
@@ -300,6 +315,7 @@ public class Xowd_page_tbl implements Rls_able {
|
||||
, rdr.Read_int(fld_html_db_id)
|
||||
, rdr.Read_int(fld_redirect_id)
|
||||
, page_score
|
||||
, cat_db_id
|
||||
);
|
||||
}
|
||||
public void Update__html_db_id(int page_id, int html_db_id) {
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.wikis.data.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.data.*;
|
||||
import org.junit.*; import gplx.xowa.bldrs.*; import gplx.xowa.wikis.ctgs.*; import gplx.dbs.*; import gplx.xowa.wikis.data.tbls.*;
|
||||
import org.junit.*; import gplx.xowa.bldrs.*; import gplx.xowa.addons.wikis.ctgs.*; import gplx.dbs.*; import gplx.xowa.wikis.data.tbls.*;
|
||||
public class Xowd_page_tbl_tst {
|
||||
private Xowd_page_tbl_fxt fxt = new Xowd_page_tbl_fxt();
|
||||
@Test public void Find_search_end() {
|
||||
|
||||
Reference in New Issue
Block a user