@Override protected void Fill_stmt(Db_stmt stmt, int bgn, int end) { for (int i = bgn; i < end; i++) { Xowd_page_itm page = (Xowd_page_itm) hash.Get_at(i); stmt.Crt_int(page_tbl.Fld_page_ns(), page.Ns_id()); stmt.Crt_bry_as_str(page_tbl.Fld_page_title(), page.Ttl_page_db()); } }
int[] Xto_int_ary(List_adp rslts) { int len = rslts.Count(); int[] rv = new int[len]; for (int i = 0; i < len; i++) { Xowd_page_itm page = (Xowd_page_itm) rslts.Get_at(i); rv[i] = page.Id(); } return rv; }
@Override protected Xowd_page_itm Get_page_or_null(Xowd_page_itm rdr_page) { Xow_ns ns = ns_mgr.Ids_get_or_null(rdr_page.Ns_id()); if (ns == null) return null; // NOTE: ns seems to "randomly" be null when threading during redlinks; guard // against null; DATE:2014-01-03 byte[] ttl_wo_ns = rdr_page.Ttl_page_db(); rdr_page.Ttl_(ns, ttl_wo_ns); return (Xowd_page_itm) hash.Get_by(rdr_page.Ttl_full_db()); }
public void Test_load_ttl(int ns_id, String ttl_str, Xowd_page_itm expd) { Xowe_wiki wiki = bldr_fxt.Wiki(); Xow_ns ns = wiki.Ns_mgr().Ids_get_or_null(ns_id); byte[] ttl_bry = Bry_.new_a7(ttl_str); wiki.Db_mgr_as_sql().Load_mgr().Load_by_ttl(actl, ns, ttl_bry); Tfds.Eq(expd.Id(), actl.Id()); Tfds.Eq_date(expd.Modified_on(), actl.Modified_on()); Tfds.Eq(expd.Redirected(), actl.Redirected()); Tfds.Eq(expd.Text_len(), actl.Text_len()); }
public byte[] Get_by(int ns_id, byte[] ttl) { Xowd_page_itm rv = (Xowd_page_itm) pages.Get_by(Make_key(ns_id, ttl)); return rv == null ? null : rv.Text(); }
public void Test_load_page(int ns_id, int page_id, String expd) { Xowe_wiki wiki = bldr_fxt.Wiki(); Xow_ns ns = wiki.Ns_mgr().Ids_get_or_null(ns_id); wiki.Db_mgr_as_sql().Load_mgr().Load_page(actl.Id_(page_id), ns, false); Tfds.Eq(expd, String_.new_a7(actl.Text())); }