mirror of
https://github.com/gnosygnu/xowa.git
synced 2024-10-27 20:34:16 +00:00
Dev: Log page for messages of form 'wbase:could not find datatype for pid' [#351]
This commit is contained in:
parent
2fa5d9bc03
commit
298c83a806
@ -174,7 +174,7 @@ public class Scrib_lib_wikibase implements Scrib_lib {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Wbase_prop_mgr prop_mgr = core.Wiki().Appe().Wiki_mgr().Wdata_mgr().Prop_mgr();
|
Wbase_prop_mgr prop_mgr = core.Wiki().Appe().Wiki_mgr().Wdata_mgr().Prop_mgr();
|
||||||
return rslt.Init_obj(Scrib_lib_wikibase_srl.Srl(prop_mgr, wdoc, true, false)); // "false": wbase now always uses v2; PAGE:ja.w:東京競馬場; DATE:2015-07-28
|
return rslt.Init_obj(Scrib_lib_wikibase_srl.Srl(prop_mgr, wdoc, true, false, core.Page().Url_bry_safe())); // "false": wbase now always uses v2; PAGE:ja.w:東京競馬場; DATE:2015-07-28
|
||||||
}
|
}
|
||||||
public boolean GetEntityUrl(Scrib_proc_args args, Scrib_proc_rslt rslt) {
|
public boolean GetEntityUrl(Scrib_proc_args args, Scrib_proc_rslt rslt) {
|
||||||
byte[] entityId = args.Pull_bry(0);
|
byte[] entityId = args.Pull_bry(0);
|
||||||
@ -191,7 +191,7 @@ public class Scrib_lib_wikibase implements Scrib_lib {
|
|||||||
if (statements == null) return rslt.Init_null();
|
if (statements == null) return rslt.Init_null();
|
||||||
|
|
||||||
String propertyIdAsString = String_.new_u8(propertyId);
|
String propertyIdAsString = String_.new_u8(propertyId);
|
||||||
return rslt.Init_obj(Keyval_.new_(propertyIdAsString, Scrib_lib_wikibase_srl.Srl_claims_prop_ary(prop_mgr, propertyIdAsString, statements, 1)));
|
return rslt.Init_obj(Keyval_.new_(propertyIdAsString, Scrib_lib_wikibase_srl.Srl_claims_prop_ary(prop_mgr, propertyIdAsString, statements, 1, core.Page().Url_bry_safe())));
|
||||||
}
|
}
|
||||||
public boolean RenderSnak(Scrib_proc_args args, Scrib_proc_rslt rslt) {
|
public boolean RenderSnak(Scrib_proc_args args, Scrib_proc_rslt rslt) {
|
||||||
Xowe_wiki wiki = core.Wiki();
|
Xowe_wiki wiki = core.Wiki();
|
||||||
|
@ -16,7 +16,7 @@ Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
|||||||
package gplx.xowa.xtns.scribunto.libs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.scribunto.*;
|
package gplx.xowa.xtns.scribunto.libs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.scribunto.*;
|
||||||
import gplx.xowa.xtns.wbases.*; import gplx.xowa.xtns.wbases.core.*; import gplx.xowa.xtns.wbases.claims.*; import gplx.xowa.xtns.wbases.claims.enums.*; import gplx.xowa.xtns.wbases.claims.itms.*; import gplx.xowa.xtns.wbases.parsers.*; import gplx.xowa.xtns.wbases.stores.*;
|
import gplx.xowa.xtns.wbases.*; import gplx.xowa.xtns.wbases.core.*; import gplx.xowa.xtns.wbases.claims.*; import gplx.xowa.xtns.wbases.claims.enums.*; import gplx.xowa.xtns.wbases.claims.itms.*; import gplx.xowa.xtns.wbases.parsers.*; import gplx.xowa.xtns.wbases.stores.*;
|
||||||
public class Scrib_lib_wikibase_srl {
|
public class Scrib_lib_wikibase_srl {
|
||||||
public static Keyval[] Srl(Wbase_prop_mgr prop_mgr, Wdata_doc wdoc, boolean header_enabled, boolean legacy_style) {// REF.MW:/Wikibase/lib/includes/serializers/EntitySerializer.php!getSerialized; http://www.mediawiki.org/wiki/Extension:Wikibase_Client/Lua
|
public static Keyval[] Srl(Wbase_prop_mgr prop_mgr, Wdata_doc wdoc, boolean header_enabled, boolean legacy_style, byte[] page_url) {// REF.MW:/Wikibase/lib/includes/serializers/EntitySerializer.php!getSerialized; http://www.mediawiki.org/wiki/Extension:Wikibase_Client/Lua
|
||||||
int base_adj = legacy_style ? 0 : 1;
|
int base_adj = legacy_style ? 0 : 1;
|
||||||
List_adp rv = List_adp_.New();
|
List_adp rv = List_adp_.New();
|
||||||
if (header_enabled) {
|
if (header_enabled) {
|
||||||
@ -29,14 +29,14 @@ public class Scrib_lib_wikibase_srl {
|
|||||||
// for Property pages, add a "datatype" property PAGE:ru.w:Маргарян,_Андраник_Наапетович; wd:Property:P18; DATE:2017-03-27
|
// for Property pages, add a "datatype" property PAGE:ru.w:Маргарян,_Андраник_Наапетович; wd:Property:P18; DATE:2017-03-27
|
||||||
if (!doc_is_qid) {
|
if (!doc_is_qid) {
|
||||||
String pid_name = String_.new_u8(Bry_.Mid(qid, Wdata_wiki_mgr.Ns_property_name_bry.length + 1));// +1 for ":" in "Property:"
|
String pid_name = String_.new_u8(Bry_.Mid(qid, Wdata_wiki_mgr.Ns_property_name_bry.length + 1));// +1 for ":" in "Property:"
|
||||||
rv.Add(Keyval_.new_("datatype", prop_mgr.Get_or_null(pid_name)));
|
rv.Add(Keyval_.new_("datatype", prop_mgr.Get_or_null(pid_name, page_url)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Srl_root(rv, Wdata_doc_parser_v2.Str_labels , Srl_langtexts (Wdata_dict_langtext.Itm__language.Key_str(), Wdata_dict_langtext.Itm__value.Key_str(), wdoc.Label_list()));
|
Srl_root(rv, Wdata_doc_parser_v2.Str_labels , Srl_langtexts (Wdata_dict_langtext.Itm__language.Key_str(), Wdata_dict_langtext.Itm__value.Key_str(), wdoc.Label_list()));
|
||||||
Srl_root(rv, Wdata_doc_parser_v2.Str_descriptions , Srl_langtexts (Wdata_dict_langtext.Itm__language.Key_str(), Wdata_dict_langtext.Itm__value.Key_str(), wdoc.Descr_list()));
|
Srl_root(rv, Wdata_doc_parser_v2.Str_descriptions , Srl_langtexts (Wdata_dict_langtext.Itm__language.Key_str(), Wdata_dict_langtext.Itm__value.Key_str(), wdoc.Descr_list()));
|
||||||
Srl_root(rv, Wdata_doc_parser_v2.Str_sitelinks , Srl_sitelinks (Wdata_dict_sitelink.Itm__site.Key_str() , Wdata_dict_sitelink.Itm__title.Key_str(), wdoc.Slink_list(), base_adj));
|
Srl_root(rv, Wdata_doc_parser_v2.Str_sitelinks , Srl_sitelinks (Wdata_dict_sitelink.Itm__site.Key_str() , Wdata_dict_sitelink.Itm__title.Key_str(), wdoc.Slink_list(), base_adj));
|
||||||
Srl_root(rv, Wdata_doc_parser_v2.Str_aliases , Srl_aliases (base_adj, wdoc.Alias_list()));
|
Srl_root(rv, Wdata_doc_parser_v2.Str_aliases , Srl_aliases (base_adj, wdoc.Alias_list()));
|
||||||
Srl_root(rv, Wdata_doc_parser_v2.Str_claims , Srl_claims (base_adj, legacy_style, prop_mgr, wdoc.Claim_list()));
|
Srl_root(rv, Wdata_doc_parser_v2.Str_claims , Srl_claims (base_adj, legacy_style, prop_mgr, wdoc.Claim_list(), page_url));
|
||||||
return (Keyval[])rv.To_ary(Keyval.class);
|
return (Keyval[])rv.To_ary(Keyval.class);
|
||||||
}
|
}
|
||||||
private static void Srl_root(List_adp rv, String label, Keyval[] ary) {
|
private static void Srl_root(List_adp rv, String label, Keyval[] ary) {
|
||||||
@ -94,7 +94,7 @@ public class Scrib_lib_wikibase_srl {
|
|||||||
}
|
}
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
private static Keyval[] Srl_claims(int base_adj, boolean legacy_style, Wbase_prop_mgr prop_mgr, Ordered_hash claim_grps) {
|
private static Keyval[] Srl_claims(int base_adj, boolean legacy_style, Wbase_prop_mgr prop_mgr, Ordered_hash claim_grps, byte[] page_url) {
|
||||||
int len = claim_grps.Count(); if (len == 0) return null;
|
int len = claim_grps.Count(); if (len == 0) return null;
|
||||||
Scrib_lib_wikibase_srl_visitor visitor = new Scrib_lib_wikibase_srl_visitor();
|
Scrib_lib_wikibase_srl_visitor visitor = new Scrib_lib_wikibase_srl_visitor();
|
||||||
int rv_len = legacy_style ? len * 2 : len; // NOTE: legacyStyle returns 2 sets of properties: official "P" and legacy "p"; DATE:2014-05-11
|
int rv_len = legacy_style ? len * 2 : len; // NOTE: legacyStyle returns 2 sets of properties: official "P" and legacy "p"; DATE:2014-05-11
|
||||||
@ -102,42 +102,42 @@ public class Scrib_lib_wikibase_srl {
|
|||||||
for (int i = 0; i < len; i++) {
|
for (int i = 0; i < len; i++) {
|
||||||
Wbase_claim_grp grp = (Wbase_claim_grp)claim_grps.Get_at(i);
|
Wbase_claim_grp grp = (Wbase_claim_grp)claim_grps.Get_at(i);
|
||||||
String pid_str = Int_.To_str(grp.Id());
|
String pid_str = Int_.To_str(grp.Id());
|
||||||
Keyval[] grp_val = Srl_claims_prop_grp(prop_mgr, visitor, "P" + pid_str, grp, base_adj);
|
Keyval[] grp_val = Srl_claims_prop_grp(prop_mgr, visitor, "P" + pid_str, grp, base_adj, page_url);
|
||||||
rv[i] = Keyval_.new_("P" + pid_str, grp_val);
|
rv[i] = Keyval_.new_("P" + pid_str, grp_val);
|
||||||
if (legacy_style)
|
if (legacy_style)
|
||||||
rv[i + len] = Keyval_.new_("p" + pid_str, grp_val); // SEE:WikibaseLuaBindings.php; This is a B/C hack to allow existing lua code to use hardcoded IDs in both lower (legacy) and upper case.; DATE:2014-05-11
|
rv[i + len] = Keyval_.new_("p" + pid_str, grp_val); // SEE:WikibaseLuaBindings.php; This is a B/C hack to allow existing lua code to use hardcoded IDs in both lower (legacy) and upper case.; DATE:2014-05-11
|
||||||
}
|
}
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
private static Keyval[] Srl_claims_prop_grp(Wbase_prop_mgr prop_mgr, Scrib_lib_wikibase_srl_visitor visitor, String pid, Wbase_claim_grp grp, int base_adj) {
|
private static Keyval[] Srl_claims_prop_grp(Wbase_prop_mgr prop_mgr, Scrib_lib_wikibase_srl_visitor visitor, String pid, Wbase_claim_grp grp, int base_adj, byte[] page_url) {
|
||||||
int len = grp.Len();
|
int len = grp.Len();
|
||||||
Keyval[] rv = new Keyval[len];
|
Keyval[] rv = new Keyval[len];
|
||||||
for (int i = 0; i < len; i++) {
|
for (int i = 0; i < len; i++) {
|
||||||
Wbase_claim_base itm = grp.Get_at(i);
|
Wbase_claim_base itm = grp.Get_at(i);
|
||||||
rv[i] = Keyval_.int_(i + base_adj, Srl_claims_prop_itm(prop_mgr, visitor, pid, itm, base_adj)); // NOTE: must be super 0 or super 1; DATE:2014-05-09
|
rv[i] = Keyval_.int_(i + base_adj, Srl_claims_prop_itm(prop_mgr, visitor, pid, itm, base_adj, page_url)); // NOTE: must be super 0 or super 1; DATE:2014-05-09
|
||||||
}
|
}
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
public static Keyval[] Srl_claims_prop_ary(Wbase_prop_mgr prop_mgr, String pid, Wbase_claim_base[] itms, int base_adj) {
|
public static Keyval[] Srl_claims_prop_ary(Wbase_prop_mgr prop_mgr, String pid, Wbase_claim_base[] itms, int base_adj, byte[] page_url) {
|
||||||
Scrib_lib_wikibase_srl_visitor visitor = new Scrib_lib_wikibase_srl_visitor();
|
Scrib_lib_wikibase_srl_visitor visitor = new Scrib_lib_wikibase_srl_visitor();
|
||||||
int len = itms.length;
|
int len = itms.length;
|
||||||
Keyval[] rv = new Keyval[len];
|
Keyval[] rv = new Keyval[len];
|
||||||
for (int i = 0; i < len; i++) {
|
for (int i = 0; i < len; i++) {
|
||||||
Wbase_claim_base itm = itms[i];
|
Wbase_claim_base itm = itms[i];
|
||||||
rv[i] = Keyval_.int_(i + base_adj, Srl_claims_prop_itm(prop_mgr, visitor, pid, itm, base_adj)); // NOTE: must be super 0 or super 1; DATE:2014-05-09
|
rv[i] = Keyval_.int_(i + base_adj, Srl_claims_prop_itm(prop_mgr, visitor, pid, itm, base_adj, page_url)); // NOTE: must be super 0 or super 1; DATE:2014-05-09
|
||||||
}
|
}
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
private static Keyval[] Srl_claims_prop_itm(Wbase_prop_mgr prop_mgr, Scrib_lib_wikibase_srl_visitor visitor, String pid, Wbase_claim_base itm, int base_adj) {
|
private static Keyval[] Srl_claims_prop_itm(Wbase_prop_mgr prop_mgr, Scrib_lib_wikibase_srl_visitor visitor, String pid, Wbase_claim_base itm, int base_adj, byte[] page_url) {
|
||||||
List_adp list = List_adp_.New();
|
List_adp list = List_adp_.New();
|
||||||
list.Add(Keyval_.new_("id", pid));
|
list.Add(Keyval_.new_("id", pid));
|
||||||
list.Add(Keyval_.new_("mainsnak", Srl_claims_prop_itm_core(prop_mgr, visitor, pid, itm)));
|
list.Add(Keyval_.new_("mainsnak", Srl_claims_prop_itm_core(prop_mgr, visitor, pid, itm, page_url)));
|
||||||
list.Add(Keyval_.new_(Wdata_dict_claim_v1.Str_rank, Wbase_claim_rank_.Reg.Get_str_or_fail(itm.Rank_tid())));
|
list.Add(Keyval_.new_(Wdata_dict_claim_v1.Str_rank, Wbase_claim_rank_.Reg.Get_str_or_fail(itm.Rank_tid())));
|
||||||
list.Add(Keyval_.new_("type", itm.Prop_type()));
|
list.Add(Keyval_.new_("type", itm.Prop_type()));
|
||||||
Srl_root(list, Wdata_dict_claim.Itm__qualifiers.Key_str(), Srl_qualifiers(prop_mgr, visitor, itm.Qualifiers(), base_adj));
|
Srl_root(list, Wdata_dict_claim.Itm__qualifiers.Key_str(), Srl_qualifiers(prop_mgr, visitor, itm.Qualifiers(), base_adj, page_url));
|
||||||
return (Keyval[])list.To_ary_and_clear(Keyval.class);
|
return (Keyval[])list.To_ary_and_clear(Keyval.class);
|
||||||
}
|
}
|
||||||
private static Keyval[] Srl_qualifiers(Wbase_prop_mgr prop_mgr, Scrib_lib_wikibase_srl_visitor visitor, Wbase_claim_grp_list list, int base_adj) {
|
private static Keyval[] Srl_qualifiers(Wbase_prop_mgr prop_mgr, Scrib_lib_wikibase_srl_visitor visitor, Wbase_claim_grp_list list, int base_adj, byte[] page_url) {
|
||||||
if (list == null) return null;
|
if (list == null) return null;
|
||||||
int list_len = list.Len(); if (list_len == 0) return Keyval_.Ary_empty;
|
int list_len = list.Len(); if (list_len == 0) return Keyval_.Ary_empty;
|
||||||
List_adp rv = List_adp_.New();
|
List_adp rv = List_adp_.New();
|
||||||
@ -149,13 +149,13 @@ public class Scrib_lib_wikibase_srl {
|
|||||||
String itm_pid = grp.Id_str();
|
String itm_pid = grp.Id_str();
|
||||||
for (int j = 0; j < grp_len; ++j) {
|
for (int j = 0; j < grp_len; ++j) {
|
||||||
Wbase_claim_base itm = grp.Get_at(j);
|
Wbase_claim_base itm = grp.Get_at(j);
|
||||||
pid_list.Add(Keyval_.int_(j + base_adj, Srl_claims_prop_itm_core(prop_mgr, visitor, itm_pid, itm))); // NOTE: was originally "+ 1"; changed to base_adj; PAGE:ru.w:Tor ru.w:Кактусовые DATE:2014-10-25
|
pid_list.Add(Keyval_.int_(j + base_adj, Srl_claims_prop_itm_core(prop_mgr, visitor, itm_pid, itm, page_url))); // NOTE: was originally "+ 1"; changed to base_adj; PAGE:ru.w:Tor ru.w:Кактусовые DATE:2014-10-25
|
||||||
}
|
}
|
||||||
rv.Add(Keyval_.new_(itm_pid, (Keyval[])pid_list.To_ary_and_clear(Keyval.class)));
|
rv.Add(Keyval_.new_(itm_pid, (Keyval[])pid_list.To_ary_and_clear(Keyval.class)));
|
||||||
}
|
}
|
||||||
return (Keyval[])rv.To_ary_and_clear(Keyval.class);
|
return (Keyval[])rv.To_ary_and_clear(Keyval.class);
|
||||||
}
|
}
|
||||||
private static Keyval[] Srl_claims_prop_itm_core(Wbase_prop_mgr prop_mgr, Scrib_lib_wikibase_srl_visitor visitor, String pid, Wbase_claim_base itm) {
|
private static Keyval[] Srl_claims_prop_itm_core(Wbase_prop_mgr prop_mgr, Scrib_lib_wikibase_srl_visitor visitor, String pid, Wbase_claim_base itm, byte[] page_url) {
|
||||||
boolean snak_is_valued = itm.Snak_tid() == Wbase_claim_value_type_.Tid__value; // PURPOSE: was != Wbase_claim_value_type_.Tid__novalue; PAGE:it.s:Autore:Anonimo DATE:2015-12-06
|
boolean snak_is_valued = itm.Snak_tid() == Wbase_claim_value_type_.Tid__value; // PURPOSE: was != Wbase_claim_value_type_.Tid__novalue; PAGE:it.s:Autore:Anonimo DATE:2015-12-06
|
||||||
int snak_is_valued_adj = snak_is_valued ? 1 : 0;
|
int snak_is_valued_adj = snak_is_valued ? 1 : 0;
|
||||||
Keyval[] rv = new Keyval[3 + snak_is_valued_adj];
|
Keyval[] rv = new Keyval[3 + snak_is_valued_adj];
|
||||||
@ -165,7 +165,7 @@ public class Scrib_lib_wikibase_srl {
|
|||||||
rv[1 + snak_is_valued_adj] = Keyval_.new_("snaktype", Wbase_claim_value_type_.Reg.Get_str_or_fail(itm.Snak_tid()));
|
rv[1 + snak_is_valued_adj] = Keyval_.new_("snaktype", Wbase_claim_value_type_.Reg.Get_str_or_fail(itm.Snak_tid()));
|
||||||
|
|
||||||
// get prop datatype; NOTE: datatype needed for Modules; PAGE:eo.w:WikidataKoord; DATE:2015-11-08
|
// get prop datatype; NOTE: datatype needed for Modules; PAGE:eo.w:WikidataKoord; DATE:2015-11-08
|
||||||
String datatype = prop_mgr.Get_or_null(pid);
|
String datatype = prop_mgr.Get_or_null(pid, page_url);
|
||||||
if (datatype == null) // if null, fallback to value based on tid; needed for (a) tests and (b) old wbase dbs that don't have wbase_prop tbl; DATE:2016-12-01
|
if (datatype == null) // if null, fallback to value based on tid; needed for (a) tests and (b) old wbase dbs that don't have wbase_prop tbl; DATE:2016-12-01
|
||||||
datatype = Wbase_claim_type_.Get_scrib_or_unknown(itm.Val_tid());
|
datatype = Wbase_claim_type_.Get_scrib_or_unknown(itm.Val_tid());
|
||||||
rv[2 + snak_is_valued_adj] = Keyval_.new_("datatype", datatype);
|
rv[2 + snak_is_valued_adj] = Keyval_.new_("datatype", datatype);
|
||||||
|
@ -182,7 +182,7 @@ class Wbase_snak_utl_ {
|
|||||||
return Keyval_.Ary(Keyval_.int_(1, snak_props));
|
return Keyval_.Ary(Keyval_.int_(1, snak_props));
|
||||||
}
|
}
|
||||||
private static Keyval[] Get_snaks(Wdata_wiki_mgr_fxt wdata_fxt, Wdata_doc wdoc) {
|
private static Keyval[] Get_snaks(Wdata_wiki_mgr_fxt wdata_fxt, Wdata_doc wdoc) {
|
||||||
Keyval[] wdoc_root = Scrib_lib_wikibase_srl.Srl(wdata_fxt.Wdata_mgr().Prop_mgr(), wdoc, false, false);
|
Keyval[] wdoc_root = Scrib_lib_wikibase_srl.Srl(wdata_fxt.Wdata_mgr().Prop_mgr(), wdoc, false, false, Bry_.new_u8("Test_page"));
|
||||||
Keyval[] snaks = Get_subs_by_path(wdoc_root, 0, 0);
|
Keyval[] snaks = Get_subs_by_path(wdoc_root, 0, 0);
|
||||||
int snaks_len = snaks.length;
|
int snaks_len = snaks.length;
|
||||||
Keyval[] rv = new Keyval[snaks_len];
|
Keyval[] rv = new Keyval[snaks_len];
|
||||||
|
@ -47,13 +47,13 @@ public class Srl__fxt {
|
|||||||
public Srl__fxt Init_prop(Wbase_claim_base prop) {wdoc_bldr.Add_claims(prop); return this;}
|
public Srl__fxt Init_prop(Wbase_claim_base prop) {wdoc_bldr.Add_claims(prop); return this;}
|
||||||
public Srl__fxt Test(String... expd) {return Test(false, expd);}
|
public Srl__fxt Test(String... expd) {return Test(false, expd);}
|
||||||
public Srl__fxt Test(boolean base0, String... expd) {
|
public Srl__fxt Test(boolean base0, String... expd) {
|
||||||
Keyval[] actl = Scrib_lib_wikibase_srl.Srl(prop_mgr, wdoc_bldr.Xto_wdoc(), header_enabled, base0);
|
Keyval[] actl = Scrib_lib_wikibase_srl.Srl(prop_mgr, wdoc_bldr.Xto_wdoc(), header_enabled, base0, Bry_.new_u8("Test_page"));
|
||||||
Tfds.Eq_ary_str(expd, String_.SplitLines_nl(Xto_str(actl)));
|
Tfds.Eq_ary_str(expd, String_.SplitLines_nl(Xto_str(actl)));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
public Srl__fxt Test(Wdata_doc wdoc, String... expd) {return Test(false, wdoc, expd);}
|
public Srl__fxt Test(Wdata_doc wdoc, String... expd) {return Test(false, wdoc, expd);}
|
||||||
public Srl__fxt Test(boolean base0, Wdata_doc wdoc, String... expd) {
|
public Srl__fxt Test(boolean base0, Wdata_doc wdoc, String... expd) {
|
||||||
Keyval[] actl = Scrib_lib_wikibase_srl.Srl(prop_mgr, wdoc, header_enabled, base0);
|
Keyval[] actl = Scrib_lib_wikibase_srl.Srl(prop_mgr, wdoc, header_enabled, base0, Bry_.new_u8("Test_page"));
|
||||||
Tfds.Eq_ary_str(expd, String_.SplitLines_nl(Xto_str(actl)));
|
Tfds.Eq_ary_str(expd, String_.SplitLines_nl(Xto_str(actl)));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -26,13 +26,13 @@ public class Wbase_prop_mgr { // lang-agnostic registry of props; EX: "p15" -> c
|
|||||||
loader = v;
|
loader = v;
|
||||||
init_needed = true;
|
init_needed = true;
|
||||||
}
|
}
|
||||||
public String Get_or_null(String pid) {
|
public String Get_or_null(String pid, byte[] page_url) {
|
||||||
if (init_needed) Init();
|
if (init_needed) Init();
|
||||||
if (cache == null) return null;
|
if (cache == null) return null;
|
||||||
pid = Wbase_pid.Ucase_pid_as_str(pid);
|
pid = Wbase_pid.Ucase_pid_as_str(pid);
|
||||||
String rv = (String)cache.Get_by(pid);
|
String rv = (String)cache.Get_by(pid);
|
||||||
if (rv == null) {
|
if (rv == null) {
|
||||||
Gfo_usr_dlg_.Instance.Warn_many("", "", "wbase:could not find datatype for pid; pid=~{0}", pid);
|
Gfo_usr_dlg_.Instance.Warn_many("", "", "wbase:could not find datatype for pid; pid=~{0} url=~{1}", pid, page_url);
|
||||||
}
|
}
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user