1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2016-01-17 23:18:07 -05:00
parent 096045614c
commit 235228976e
314 changed files with 4458 additions and 2694 deletions

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.xowa.xtns.cldrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
import gplx.dbs.*;
class Cldr_lang_tbl implements Rls_able {
private final String tbl_name = "cldr_lang"; private final Db_meta_fld_list flds = Db_meta_fld_list.new_();
private final String tbl_name = "cldr_lang"; private final Dbmeta_fld_list flds = Dbmeta_fld_list.new_();
private final String fld_cldr_code, fld_lang_code, fld_lang_name;
private final Db_conn conn; private Db_stmt stmt_select, stmt_insert;
public Cldr_lang_tbl(Db_conn conn) {
@@ -28,7 +28,7 @@ class Cldr_lang_tbl implements Rls_able {
this.fld_lang_name = flds.Add_str("lang_name", 2048);
conn.Rls_reg(this);
}
public void Create_tbl() {conn.Ddl_create_tbl(Db_meta_tbl.new_(tbl_name, flds, Db_meta_idx.new_unique_by_tbl(tbl_name, "main", fld_cldr_code, fld_lang_code)));}
public void Create_tbl() {conn.Ddl_create_tbl(Dbmeta_tbl_itm.New(tbl_name, flds, Dbmeta_idx_itm.new_unique_by_tbl(tbl_name, "main", fld_cldr_code, fld_lang_code)));}
public void Insert_bgn() {conn.Txn_bgn("cldr_lang__inser"); 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(byte[] cldr_code, byte[] lang_code, byte[] lang_name) {

View File

@@ -89,7 +89,7 @@ public class Gallery_html_wtr {
}
byte[] lnki_ttl = lnki.Ttl().Page_txt();
Xoa_ttl lnki_link_ttl = itm_ttl; // default href to ttl
if ( itm.Link_bgn() != Bry_find_.Not_found // link is not -1; EX: "A.png" has no link specified
if ( itm.Link_bgn() != Bry_find_.Not_found // link is not -1; EX: "A.png" has no link specified
&& (itm.Link_end() - itm.Link_bgn()) > 0 // and link_end - link_bgn > 0; EX: "A.png|link="; DATE:2014-06-15
)
lnki_link_ttl = Xoa_ttl.parse(wiki, Bry_.Mid(src, itm.Link_bgn(), itm.Link_end()));

View File

@@ -82,7 +82,7 @@ public abstract class Gallery_mgr_base {
public static byte File_found_mode = Bool_.__byte;
public void Write_html_itm(Bry_bfr bfr, Bry_bfr tmp_bfr, Xoae_app app, Xowe_wiki wiki, Xoae_page page, Xop_ctx ctx, Xoh_html_wtr html_wtr, Xoh_wtr_ctx hctx, byte[] src, Gallery_xnde xnde, byte[] gallery_ul_id, int i, Xof_file_itm xfer_itm, boolean hctx_is_hdump) {
Gallery_itm itm = (Gallery_itm)xnde.Itms_get_at(i);
Xoa_ttl ttl = itm.Ttl();
Xoa_ttl ttl = itm.Ttl(); if (Bry_.Len_eq_0(ttl.Page_db())) return; // if file ttl is invalid, do not write; EX:File:#A.png; DATE:2016-01-12
byte[] itm_caption = itm.Caption_bry(); if (itm_caption == null) itm_caption = Bry_.Empty;
Xop_lnki_tkn lnki = itm.Lnki_tkn();
@@ -187,14 +187,7 @@ public abstract class Gallery_mgr_base {
if (!hctx_is_hdump)
Gfh_wtr.Write_atr_bry(bfr, Gfh_atr_.Bry__id, gallery_ul_uid);
Gfh_wtr.Write_atr_bry(bfr, Gfh_atr_.Bry__class, cls);
// if (hctx_is_hdump) {
// bfr.Add_byte_space();
// bfr.Add(Xoh_make_trie_.Bry__gallery_box_max);
// bfr.Add_int_variable(uid);
// bfr.Add_byte_apos();
// }
// else
Gfh_wtr.Write_atr_bry(bfr, Gfh_atr_.Bry__style, style);
Gfh_wtr.Write_atr_bry(bfr, Gfh_atr_.Bry__style, style);
if (xatr_list != null) {
int len = xatr_list.Count();
for (int i = 0; i < len; i++) {

View File

@@ -133,7 +133,10 @@ public class Gallery_mgr_base_basic_tst {
);
}
@Test public void Link_is_empty() { // PURPOSE: "link=" causes null pointer exception; DATE:2014-06-15
fxt.Test_html_frag("<gallery>File:A.png|link=</gallery>", "href=\"/wiki/File:A.png\"");
fxt.Test_html_frag("<gallery>File:A.png|link=</gallery>", String_.Concat_lines_nl_skip_last
( "<div style=\"margin:15px auto;\">"
, " <img id=\"xoimg_0\" alt=\"A.png\" src=\"file:///mem/wiki/repo/trg/thumb/7/0/A.png/120px.png\" width=\"120\" height=\"120\" />"
));
}
@Test public void Dangling_autcloses() { // PURPOSE: dangling gallery should auto-close, not escape; PAGE:en.w:Wikipedia:Featured_pictures_thumbs_43 DATE:2014-08-23
fxt.Test_html_frag("<gallery>File:A.png|b", "<ul id=\"xowa_gallery_ul_0\"");
@@ -157,6 +160,13 @@ public class Gallery_mgr_base_basic_tst {
// , "<li class='gallerycaption'>B</li>"
// );
// }
@Test public void Invalid() { // PURPOSE: ignore invalid file names; DATE:2016-01-12
fxt.Test_html_str("<gallery>File:#A.png|a</gallery>"
, String_.Concat_lines_nl_skip_last
( "<ul id=\"xowa_gallery_ul_0\" class=\"gallery mw-gallery-traditional\">"
, "</ul>"
));
}
}
class Gallery_mgr_base_fxt {
public void Reset() {

View File

@@ -61,6 +61,5 @@ class Imap_html_fmtrs {
, " </a>"
, " </div>"
), "margin_left", "margin_top", "img_href", "msg_desc", "icon_url"
)
;
);
}

View File

@@ -17,37 +17,45 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.xtns.imaps; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
import gplx.core.primitives.*; import gplx.core.brys.fmtrs.*;
import gplx.xowa.htmls.core.htmls.*; import gplx.xowa.htmls.core.wkrs.lnkis.htmls.*;
import gplx.xowa.files.*; import gplx.xowa.parsers.lnkis.*;
import gplx.langs.htmls.*; import gplx.xowa.htmls.core.htmls.*; import gplx.xowa.htmls.core.wkrs.lnkis.htmls.*; import gplx.xowa.htmls.core.wkrs.imgs.*; import gplx.xowa.htmls.core.wkrs.imgs.atrs.*;
import gplx.xowa.parsers.*;
class Imap_img_fmtr_arg implements gplx.core.brys.Bfr_arg {
private Xoh_wtr_ctx hctx; private Imap_map map; private Imap_xtn_mgr xtn_mgr; // private byte[] src;
private int img_elem_id, img_w, img_h;
private byte[] img_alt, img_src, img_cls, img_href;
private byte[] img_alt, img_src, img_cls, img_href, lnki_ttl;
private Int_2_ref margin_calc = new Int_2_ref();
public void Init(Xoh_wtr_ctx hctx, Imap_xtn_mgr xtn_mgr, Imap_map map, byte[] src, int img_elem_id, byte[] img_alt, byte[] img_src, int img_w, int img_h, byte[] img_cls, byte[] img_href) {
public void Init(Xoh_wtr_ctx hctx, Imap_xtn_mgr xtn_mgr, Imap_map map, byte[] src, int img_elem_id, byte[] img_alt, byte[] img_src, int img_w, int img_h, byte[] img_cls, byte[] img_href, byte[] lnki_ttl) {
this.hctx = hctx; this.map = map; this.xtn_mgr = xtn_mgr; // this.src = src;
this.img_elem_id = img_elem_id; this.img_w = img_w; this.img_h = img_h;
this.img_alt = img_alt;
this.img_src = img_src;
this.img_cls = img_cls;
this.img_href = img_href;
this.img_alt = img_alt; this.img_src = img_src; this.img_cls = img_cls; this.img_href = img_href;
this.lnki_ttl = lnki_ttl;
}
public void Bfr_arg__add(Bry_bfr bfr) {
Bry_fmtr fmtr = Imap_html_fmtrs.Img_anchor_none;
byte[] anchor_href = Bry_.Empty, anchor_text = Bry_.Empty;
Imap_itm_dflt itm_dflt = map.Dflt();
boolean hctx_is_hdump = hctx.Mode_is_hdump();
Xoh_arg_img_core img_core_fmtr = xtn_mgr.Img_core_fmtr(hctx_is_hdump);
img_core_fmtr.Init(img_elem_id, img_src, img_w, img_h);
if (itm_dflt != null) {
// Xowe_wiki wiki = map.Xtn_mgr().Wiki();
// if (src.length != 0) // imap update will pass 0 src
// Imap_link_owner_.Write(itm_dflt, wiki.Appe(), wiki, hctx, src);
fmtr = itm_dflt.Link_tid() == Xop_tkn_itm_.Tid_lnki ? Imap_html_fmtrs.Img_anchor_lnki : Imap_html_fmtrs.Img_anchor_lnke;
anchor_href = itm_dflt.Link_href();
anchor_text = itm_dflt.Link_text();
if (hctx.Mode_is_hdump()) {
Bry_bfr tmp_bfr = xtn_mgr.Tmp_bfr;
byte[] data_xowa_image = Xoh_file_html_fmtr__hdump.Bld_xowa_image_data(tmp_bfr, Xop_lnki_type.Id_none, img_w, img_h, Xop_lnki_tkn.Upright_null, Xof_lnki_time.Null, Xof_lnki_page.Null);
byte[] data_xowa_title = Gfh_atr_.Make(tmp_bfr, Xoh_img_xoimg_data.Bry__data_xowa_title, lnki_ttl);
byte[] usemap = tmp_bfr.Add(Imap_xtn_mgr.Bry__usemap__html).Add_int_variable(map.Id()).Add_byte_quote().To_bry_and_clear();
Xoh_file_html_fmtr__hdump.Bld_anch_n(tmp_bfr, data_xowa_title, data_xowa_image, Xoh_img_cls_.Tid__thumbimage, Bry_.Empty, Bry_.Empty, usemap);
bfr.Add_bfr_and_clear(tmp_bfr);
}
else {
Xoh_arg_img_core img_core_fmtr = xtn_mgr.Img_core_fmtr;
img_core_fmtr.Init(img_elem_id, img_src, img_w, img_h);
if (itm_dflt != null) {
// Xowe_wiki wiki = map.Xtn_mgr().Wiki();
// if (src.length != 0) // imap update will pass 0 src
// Imap_link_owner_.Write(itm_dflt, wiki.Appe(), wiki, hctx, src);
fmtr = itm_dflt.Link_tid() == Xop_tkn_itm_.Tid_lnki ? Imap_html_fmtrs.Img_anchor_lnki : Imap_html_fmtrs.Img_anchor_lnke;
anchor_href = itm_dflt.Link_href();
anchor_text = itm_dflt.Link_text();
}
fmtr.Bld_bfr_many(bfr, map.Id(), img_elem_id, img_alt, img_core_fmtr, img_cls, anchor_href, anchor_text);
}
fmtr.Bld_bfr_many(bfr, map.Id(), img_elem_id, img_alt, img_core_fmtr, img_cls, anchor_href, anchor_text);
Imap_itm_desc itm_desc = map.Desc();
if (itm_desc != null) {
Imap_desc_tid.Calc_desc_margins(margin_calc, itm_desc.Desc_tid(), img_w, img_h);

View File

@@ -43,17 +43,17 @@ public class Imap_map implements Xoh_file_img_wkr, Js_img_wkr {
xfer_itm.Html_img_wkr_(this);
xfer_itm.Html_elem_tid_(Xof_html_elem.Tid_imap);
this.a_href = a_href; this.img_alt = img_alt; this.img_cls_tid = img_cls; this.img_cls_other = img_cls_other;
Write_imap_div(tmp_bfr, page.Wikie(), hctx, src, uid, img_w, img_h, img_src, xfer_itm.Orig_w(), xfer_itm.Orig_h());
Write_imap_div(tmp_bfr, page.Wikie(), hctx, src, uid, img_w, img_h, img_src, xfer_itm.Orig_w(), xfer_itm.Orig_h(), a_xowa_title);
if (hctx.Mode_is_hdump())
page.Hdump_data().Imgs_add_img(new Xohd_img_itm__img(), xfer_itm, Xohd_img_itm__gallery_itm.Tid_basic);
}
public void Html_update(Xoa_page page, Xog_js_wkr js_wkr, int html_uid, int html_w, int html_h, Io_url html_view_url, int orig_w, int orig_h, Io_url html_orig_url, byte[] lnki_ttl) {
Xowe_wiki wiki = xtn_mgr.Wiki();
Bry_bfr tmp_bfr = wiki.Utl__bfr_mkr().Get_k004();
Write_imap_div(tmp_bfr, (Xowe_wiki)page.Wiki(), Xoh_wtr_ctx.Basic, Bry_.Empty, html_uid, html_w, html_h, html_view_url.To_http_file_bry(), orig_w, orig_h);
Write_imap_div(tmp_bfr, (Xowe_wiki)page.Wiki(), Xoh_wtr_ctx.Basic, Bry_.Empty, html_uid, html_w, html_h, html_view_url.To_http_file_bry(), orig_w, orig_h, lnki_ttl);
js_wkr.Html_elem_replace_html("imap_div_" + Int_.To_str(html_uid), tmp_bfr.To_str_and_rls());
}
private void Write_imap_div(Bry_bfr bfr, Xowe_wiki wiki, Xoh_wtr_ctx hctx, byte[] src, int html_uid, int html_w, int html_h, byte[] html_src, int orig_w, int orig_h) {
private void Write_imap_div(Bry_bfr bfr, Xowe_wiki wiki, Xoh_wtr_ctx hctx, byte[] src, int html_uid, int html_w, int html_h, byte[] html_src, int orig_w, int orig_h, byte[] lnki_ttl) {
byte[] desc_style = Calc_desc_style(html_w, html_h);
// int shapes_len = shapes.length;
// for (int i = 0; i < shapes_len; ++i) {
@@ -61,7 +61,7 @@ public class Imap_map implements Xoh_file_img_wkr, Js_img_wkr {
// Imap_link_owner_.Write(shape, wiki.Appe(), wiki, hctx, src);
// }
map_fmtr_arg.Init(id, shapes, Calc_scale(orig_w, orig_h, html_w, html_h));
img_fmtr_arg.Init(hctx, xtn_mgr, this, src, html_uid, img_alt, html_src, html_w, html_h, Xoh_img_cls_.To_html(img_cls_tid, img_cls_other), a_href);
img_fmtr_arg.Init(hctx, xtn_mgr, this, src, html_uid, img_alt, html_src, html_w, html_h, Xoh_img_cls_.To_html(img_cls_tid, img_cls_other), a_href, lnki_ttl);
Imap_html_fmtrs.All.Bld_bfr_many(bfr, html_uid, desc_style, map_fmtr_arg, img_fmtr_arg);
}
private byte[] Calc_desc_style(int html_w, int html_h) {

View File

@@ -32,8 +32,9 @@ public class Imap_xtn_mgr extends Xox_mgr_base implements GfoInvkAble {
public Btrie_slim_mgr Desc_trie() {return desc_trie;} private Btrie_slim_mgr desc_trie;
public byte[] Desc_msg() {return desc_msg;} private byte[] desc_msg;
public byte[] Desc_icon_url() {return desc_icon_url;} private byte[] desc_icon_url;
public Xoh_arg_img_core Img_core_fmtr(boolean hctx_is_hdump) {return hctx_is_hdump ? img_core_hdump : img_core_basic;}
private final Xoh_arg_img_core img_core_basic = new Xoh_arg_img_core__basic(), img_core_hdump = new Xoh_arg_img_core__hdump();
public final Xoh_arg_img_core Img_core_fmtr = new Xoh_arg_img_core__basic();
public final Xoh_file_html_fmtr__hdump Img_html_hdump_bldr = Xoh_file_html_fmtr__hdump.Hdump;
public final Bry_bfr Tmp_bfr = Bry_bfr.new_(255);
@Override public Xox_mgr Clone_new() {return new Imap_xtn_mgr();}
@Override public void Xtn_init_by_wiki(Xowe_wiki wiki) {
this.wiki = wiki;
@@ -43,6 +44,9 @@ public class Imap_xtn_mgr extends Xox_mgr_base implements GfoInvkAble {
parser = new Imap_parser(this);
init = true;
}
public void Clear() {
}
public static final byte[]
Bry__usemap__html = Bry_.new_a7(" usemap=\"#imagemap_1_")
, Bry__usemap__name = Bry_.new_a7("usemap")
, Bry__usemap__prefix = Bry_.new_a7("#imagemap_1_")
;
}

View File

@@ -37,13 +37,13 @@ public class Pfunc_ifexist_tst {
}
@Test public void Media_y_commons() {// DATE:2014-07-04
Pfunc_ifexist.Mgr.Clear();
Xowe_wiki commons_wiki = fxt.App().Wiki_mgr().Get_by_key_or_make(gplx.xowa.wikis.domains.Xow_domain_itm_.Bry__commons);
Xowe_wiki commons_wiki = fxt.App().Wiki_mgr().Get_by_or_make(gplx.xowa.wikis.domains.Xow_domain_itm_.Bry__commons);
fxt.Init_page_create(commons_wiki, "File:A.png", "");
fxt.Test_parse_tmpl_str_test("{{#ifexist:Media:A.png|y|n}}", "{{test}}", "y");
}
@Test public void Media_y_file_v1() {// DATE:2014-07-04
Pfunc_ifexist.Mgr.Clear();
Xof_meta_itm meta_itm = fxt.Wiki().File_mgr().Meta_mgr().Get_itm_or_new(Bry_.new_a7("A.png"));
Xof_meta_itm meta_itm = fxt.Wiki().File_mgr().Dbmeta_mgr().Get_itm_or_new(Bry_.new_a7("A.png"));
meta_itm.Orig_exists_(Bool_.Y_byte);
fxt.Test_parse_tmpl_str_test("{{#ifexist:Media:A.png|y|n}}", "{{test}}", "y");
}

View File

@@ -97,7 +97,7 @@ class Pf_msg_mgr_fxt {
public void Init_msg_db(Xowe_wiki wiki, String ttl, String val) {
fxt.Init_page_create(wiki, "MediaWiki:" + ttl, val);
}
public Xowe_wiki Make_wiki(String domain) {return fxt.App().Wiki_mgr().Get_by_key_or_make(Bry_.new_u8(domain));}
public Xowe_wiki Make_wiki(String domain) {return fxt.App().Wiki_mgr().Get_by_or_make(Bry_.new_u8(domain));}
public void Test_parse_en(String raw, String expd) {
fxt.Test_parse_tmpl_str_test(raw, "{{test}}" , expd);
}

View File

@@ -51,7 +51,7 @@ public class Pfunc_filepath extends Pf_func_base {
private static Xoae_page Load_page(Xowe_wiki wiki, Xoa_ttl ttl) {
Xoae_page page = wiki.Data_mgr().Get_page(ttl, false);
if (page.Missing()) { // file not found in current wiki; try commons;
Xowe_wiki commons_wiki = wiki.Appe().Wiki_mgr().Get_by_key_or_null(wiki.Commons_wiki_key());
Xowe_wiki commons_wiki = (Xowe_wiki)wiki.Appe().Wiki_mgr().Get_by_or_null(wiki.Commons_wiki_key());
if (commons_wiki != null) { // commons_wiki not installed; exit; DATE:2013-06-08
if (!Env_.Mode_testing()) commons_wiki.Init_assert();// must assert load else page_zip never detected; DATE:2013-03-10
page = commons_wiki.Data_mgr().Get_page(ttl, false);

View File

@@ -72,7 +72,7 @@ public class Scrib_lib_title_tst {
fxt.Test_scrib_proc_str_ary(lib, Scrib_lib_title.Invk_getFileInfo, Object_.Ary("File:A.png") , file_info_exists("A.png", 220, 200));
}
@Test public void GetFileInfo_commons() { // PURPOSE: check that Scribunto GetFileInfo calls filepath.FileExists; DATE:2014-01-07
Xowe_wiki commons_wiki = fxt.Parser_fxt().Wiki().Appe().Wiki_mgr().Get_by_key_or_make(Xow_domain_itm_.Bry__commons).Init_assert();
Xowe_wiki commons_wiki = fxt.Parser_fxt().Wiki().Appe().Wiki_mgr().Get_by_or_make(Xow_domain_itm_.Bry__commons).Init_assert();
Wiki_orig_tbl__create(fxt.Core().Wiki());
Wiki_orig_tbl__insert(fxt.Core().Wiki(), "A.png", 220, 200);
fxt.Parser_fxt().Init_page_create(commons_wiki, "File:A.png", "text_is_blank");
@@ -112,7 +112,7 @@ public class Scrib_lib_title_tst {
}
// private static void Init_page_regy(Xowe_wiki wiki, String ttl, int id, boolean is_redirect) {
// String url_str = "test/en.wikipedia.org/wiki_page_regy";
// Db_meta_tbl meta = new Xowd_page_tbl().new_meta();
// Dbmeta_tbl_itm meta = new Xowd_page_tbl().new_meta();
// Db_conn_pool.Instance.Set_mem(url_str, meta);
// Db_conn_info url = Db_conn_info_.mem_(url_str);
// Xowd_page_tbl tbl = new Xowd_page_tbl(Bool_.N, url);

View File

@@ -40,7 +40,7 @@ public class Wdata_wiki_mgr implements GfoEvObj, GfoInvkAble {
public GfoEvMgr EvMgr() {return evMgr;} private GfoEvMgr evMgr;
public boolean Enabled() {return enabled;} public void Enabled_(boolean v) {enabled = v;} private boolean enabled = true;
public byte[] Domain() {return domain;} public void Domain_(byte[] v) {domain = v;} private byte[] domain = Bry_.new_a7("www.wikidata.org");
public Xowe_wiki Wdata_wiki() {if (wdata_wiki == null) wdata_wiki = app.Wiki_mgr().Get_by_key_or_make(domain).Init_assert(); return wdata_wiki;} private Xowe_wiki wdata_wiki;
public Xowe_wiki Wdata_wiki() {if (wdata_wiki == null) wdata_wiki = app.Wiki_mgr().Get_by_or_make(domain).Init_assert(); return wdata_wiki;} private Xowe_wiki wdata_wiki;
public Json_parser Jdoc_parser() {return jdoc_parser;} private Json_parser jdoc_parser = new Json_parser();
public void Init_by_app() {}
public Wdata_doc_parser Wdoc_parser(Json_doc jdoc) {

View File

@@ -58,7 +58,7 @@ public class Wdata_itemByTitle_page implements Xows_page {
private static boolean Navigate(Gfo_usr_dlg usr_dlg, Xoae_app app, Wdata_wiki_mgr wdata_mgr, Xoae_page page, byte[] site_bry, byte[] page_bry) {
page_bry = gplx.langs.htmls.encoders.Gfo_url_encoder_.Http_url.Decode(page_bry); // NOTE: space is converted to + on postback to url; decode
byte[] wiki_domain = Xow_abrv_wm_.Parse_to_domain_bry(site_bry); if (wiki_domain == null) {usr_dlg.Warn_many("", "", "site_bry parse failed; site_bry:~{0}", String_.new_u8(site_bry)); return false;}
Xowe_wiki wiki = app.Wiki_mgr().Get_by_key_or_make(wiki_domain); if (wiki == null) {usr_dlg.Warn_many("", "", "wiki_domain does not exist; wiki_domain:~{0}", String_.new_u8(wiki_domain)); return false;}
Xowe_wiki wiki = app.Wiki_mgr().Get_by_or_make(wiki_domain); if (wiki == null) {usr_dlg.Warn_many("", "", "wiki_domain does not exist; wiki_domain:~{0}", String_.new_u8(wiki_domain)); return false;}
Xoa_ttl wdata_ttl = Xoa_ttl.parse(wiki, page_bry); if (wdata_ttl == null) {usr_dlg.Warn_many("", "", "ttl is invalid; ttl:~{0}", String_.new_u8(page_bry)); return false;}
Wdata_doc doc = wdata_mgr.Pages_get(wiki, wdata_ttl); if (doc == null) {usr_dlg.Warn_many("", "", "ttl cannot be found in wikidata; ttl:~{0}", String_.new_u8(wdata_ttl.Raw())); return false;}
byte[] qid_bry = doc.Qid();