"
- , "
"
- , "
~{ttl_label}"
- , "
(~{ttl})"
+ , "
"
+ , "
"
+ , "
~{ttl_label}"
+ , " (~{ttl})"
+ , "
"
+ , "
~{ttl_descr}"
+ , "
"
+ , "
"
+ , "
"
, "
"
- , "
"
- , " "
- , "
"
- , "
"
- , " ~{ttl_descr}"
- , "
"
- , "
"
- , "
"
- , "
"
- , "
"
- , "
~{hdr_aliases}"
- , "
"
- , "
"
- , "
"
), "ttl", "ttl_label", "ttl_descr", "hdr_aliases", "ttl_aliases"
);
private static byte[][] Alias_get_or_empty(OrderedHash list, byte[][] langs) {
@@ -94,7 +86,7 @@ class Wdata_fmtr__oview_alias_itm implements Bry_fmtr_arg {
}
private Bry_fmtr row_fmtr = Bry_fmtr.new_(String_.Concat_lines_nl_skip_last
( ""
- , "
~{itm}"
+ , "
~{itm}"
), "itm"
);
}
diff --git a/400_xowa/src/gplx/xowa/xtns/wdatas/hwtrs/Wdata_visitor__html_wtr_tst.java b/400_xowa/src/gplx/xowa/xtns/wdatas/hwtrs/Wdata_visitor__html_wtr_tst.java
index 36c64e9b0..181282535 100644
--- a/400_xowa/src/gplx/xowa/xtns/wdatas/hwtrs/Wdata_visitor__html_wtr_tst.java
+++ b/400_xowa/src/gplx/xowa/xtns/wdatas/hwtrs/Wdata_visitor__html_wtr_tst.java
@@ -51,8 +51,8 @@ public class Wdata_visitor__html_wtr_tst {
@Test public void Quantity_frac() {
fxt
.Test_claim_val
- ( fxt.Wdata_fxt().Make_claim_quantity(1, "+0.12345", "units", "+0.12346", "+0.12344")
- , "+0.12345 ±0.00001 units"
+ ( fxt.Wdata_fxt().Make_claim_quantity(1, "+0.1234", "units", "+0.1235", "+0.1233")
+ , "+0.1234 ±0.0001 units"
);
}
@Test public void Entity() {
diff --git a/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_site_ns_cmd.java b/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_site_ns_cmd.java
new file mode 100644
index 000000000..35eb713ce
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_site_ns_cmd.java
@@ -0,0 +1,36 @@
+/*
+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
.
+*/
+package gplx.xowa.xtns.wdatas.imports; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
+import gplx.dbs.*; import gplx.xowa.bldrs.*;
+public class Xob_site_ns_cmd implements Xob_cmd {
+ private final Xob_bldr bldr;
+ public Xob_site_ns_cmd(Xob_bldr bldr, Xow_wiki wiki) {this.bldr = bldr;}
+ public String Cmd_key() {return Xob_cmd_keys.Key_wbase_ns;}
+ public void Cmd_run() {
+ Xow_wmf_api_mgr api_mgr = new Xow_wmf_api_mgr();
+ Db_conn conn = Xowmf_site_tbl.Get_conn_or_new(bldr.App().Fsys_mgr().Root_dir());
+ Xowmf_site_tbl tbl_site = new Xowmf_site_tbl(conn); Xowmf_ns_tbl tbl_itm = new Xowmf_ns_tbl(conn);
+ Xow_wmf_api_wkr__ns api_wkr = new Xow_wmf_api_wkr__ns(tbl_site, tbl_itm);
+ api_mgr.Api_exec(api_wkr);
+ }
+ public void Cmd_init(Xob_bldr bldr) {}
+ public void Cmd_bgn(Xob_bldr bldr) {}
+ public void Cmd_end() {}
+ public void Cmd_term() {}
+ public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {return GfoInvkAble_.Rv_unhandled;}
+}
diff --git a/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_wbase_ns_parser.java b/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_wbase_ns_parser.java
new file mode 100644
index 000000000..e6763b0b3
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_wbase_ns_parser.java
@@ -0,0 +1,51 @@
+/*
+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
.
+*/
+package gplx.xowa.xtns.wdatas.imports; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
+import gplx.dbs.*;
+import gplx.xowa.wikis.*;
+class Xob_wbase_ns_parser {
+ private final Hash_adp_bry ns_mgr_hash = Hash_adp_bry.cs_();
+ private final Xowmf_site_tbl tbl_site; private final Xowmf_ns_tbl tbl_itm;
+ public Xob_wbase_ns_parser(Db_conn conn) {
+ this.tbl_site = new Xowmf_site_tbl(conn);
+ this.tbl_itm = new Xowmf_ns_tbl(conn);
+ }
+ public void Find(Xob_wbase_ns_parser_rslt rv, byte[] wiki_abrv, byte[] ttl) { // enwiki, Category:Abc
+ Xow_ns_mgr ns_mgr = (Xow_ns_mgr)ns_mgr_hash.Get_by_bry(wiki_abrv);
+ rv.Init(Xow_ns_.Id_main, 0); // default to Main ns
+ int ttl_len = ttl.length;
+ int colon_pos = Bry_finder.Find_fwd(ttl, Byte_ascii.Colon, 0, ttl_len); if (colon_pos == Bry_finder.Not_found) return;
+ if (ns_mgr == null) { // ns_mgr not found; load from db
+ wiki_abrv = Bry_.Replace(wiki_abrv, Byte_ascii.Underline, Byte_ascii.Dash);
+ byte[] wiki_domain = Xow_wiki_alias.Parse__domain_name(wiki_abrv, 0, wiki_abrv.length);
+ int site_id = tbl_site.Select_id(String_.new_utf8_(wiki_domain)); if (site_id == -1) {Xoa_app_.Usr_dlg().Warn_many("", "", "wbase.ns_parser:unknown wmf_abrv; abrv=~{0}", wiki_abrv); return;}
+ ns_mgr = new Xow_ns_mgr(gplx.xowa.langs.cases.Xol_case_mgr_.Utf8());
+ tbl_itm.Select_all(ns_mgr, site_id); if (ns_mgr.Count() == 0) {Xoa_app_.Usr_dlg().Warn_many("", "", "wbase.ns_parser:no ns found; abrv=~{0}", wiki_abrv); return;}
+ ns_mgr_hash.Add_bry_obj(wiki_abrv, ns_mgr);
+ }
+ Xow_ns ns = ns_mgr.Names_get_or_null(ttl, 0, colon_pos); if (ns == null) return; // not a ns; EX: "No_namespace:Page_title"
+ rv.Init(ns.Id(), colon_pos + 1);
+ }
+}
+class Xob_wbase_ns_parser_rslt {
+ public int Ns_id() {return ns_id;} private int ns_id;
+ public int Ttl_bgn() {return ttl_bgn;} private int ttl_bgn;
+ public void Init(int ns_id, int ttl_bgn) {
+ this.ns_id = ns_id; this.ttl_bgn = ttl_bgn;
+ }
+}
diff --git a/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_wdata_qid_base.java b/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_wdata_qid_base.java
index fa0ace4f3..54bd89ee1 100644
--- a/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_wdata_qid_base.java
+++ b/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_wdata_qid_base.java
@@ -18,104 +18,41 @@ along with this program. If not, see
.
package gplx.xowa.xtns.wdatas.imports; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
import gplx.json.*; import gplx.ios.*; import gplx.xowa.xtns.wdatas.core.*; import gplx.xowa.xtns.wdatas.parsers.*; import gplx.xowa.wikis.data.tbls.*;
public abstract class Xob_wdata_qid_base extends Xob_itm_dump_base implements Xobd_wkr, GfoInvkAble {
+ private Json_parser parser; private Xob_wbase_ns_parser ns_parser; private final Xob_wbase_ns_parser_rslt ns_parser_rslt = new Xob_wbase_ns_parser_rslt();
public Xob_wdata_qid_base Ctor(Xob_bldr bldr, Xowe_wiki wiki) {this.Cmd_ctor(bldr, wiki); return this;}
public abstract String Wkr_key();
public abstract void Qid_bgn();
- public abstract void Qid_add(byte[] wiki_key, Xow_ns ns, byte[] ttl, byte[] qid);
+ public abstract void Qid_add(byte[] wiki_key, int ns_id, byte[] ttl, byte[] qid);
public abstract void Qid_end();
public void Wkr_ini(Xob_bldr bldr) {}
public void Wkr_bgn(Xob_bldr bldr) {
this.Init_dump(this.Wkr_key(), wiki.Tdb_fsys_mgr().Site_dir().GenSubDir_nest("data", "qid")); // NOTE: must pass in correct make_dir in order to delete earlier version (else make_dirs will append)
- parser = bldr.App().Wiki_mgr().Wdata_mgr().Jdoc_parser();
+ this.parser = bldr.App().Wiki_mgr().Wdata_mgr().Jdoc_parser();
+ this.ns_parser = new Xob_wbase_ns_parser(Xowmf_site_tbl.Get_conn_or_new(bldr.App().Fsys_mgr().Root_dir()));
this.Qid_bgn();
- } private Json_parser parser;
+ }
public void Wkr_run(Xowd_page_itm page) {
if (page.Ns_id() != Xow_ns_.Id_main) return; // qid pages are only in the Main namespace
Json_doc jdoc = parser.Parse(page.Text());
- if (jdoc == null) {
- bldr.Usr_dlg().Warn_many(GRP_KEY, "json.invalid", "json is invalid: ns=~{0} id=~{1}", page.Ns_id(), String_.new_utf8_(page.Ttl_page_db()));
- return;
- }
+ if (jdoc == null) {bldr.Usr_dlg().Warn_many("", "", "json is invalid: ns=~{0} id=~{1}", page.Ns_id(), String_.new_utf8_(page.Ttl_page_db())); return;}
Wdata_doc_parser wdoc_parser = app.Wiki_mgr().Wdata_mgr().Wdoc_parser(jdoc);
- byte[] qid = wdoc_parser.Parse_qid(jdoc);
+ byte[] qid = wdoc_parser.Parse_qid(jdoc);
+ Bry_bfr tmp_bfr = Bry_bfr.reset_(255);
OrderedHash sitelinks = wdoc_parser.Parse_sitelinks(qid, jdoc);
int sitelinks_len = sitelinks.Count(); if (sitelinks_len == 0) return; // no subs; return;
- Wdata_sitelink_itm main_sitelink = null; // SEE:NOTE_1:non-english non-main titles
- for (int i = 0; i < sitelinks_len; i++) { // iterate links; find main_sitelink (hopefully enwiki)
+ for (int i = 0; i < sitelinks_len; i++) { // iterate sitelinks
Wdata_sitelink_itm sitelink = (Wdata_sitelink_itm)sitelinks.FetchAt(i);
- byte[] xwiki_key = sitelink.Site();
- if ( i == 0 // assume 1st item is mainlink_data; needed for null checks; also, if no links are enwiki, then hope / assume that first link will be to an article in correct ns
- || Bry_.Eq(xwiki_key, Xwiki_key_en) // assume enwiki item is to correct ns
- )
- main_sitelink = sitelink;
- }
-
- Xoa_ttl core_ttl = Xoa_ttl.parse_(wiki, main_sitelink.Name()); // NOTE: parse ttl to get ns; this may still be inaccurate as it is using wikidata's ns, not enwiki's; DATE:2014-07-23
- Xow_ns core_ns = core_ttl.Ns();
- boolean core_ns_is_main = core_ns.Id_main();
-
- for (int i = 0; i < sitelinks_len; i++) { // iterate links again; do parsing, but assume any ns is same as enwiki
- Wdata_sitelink_itm sitelink = (Wdata_sitelink_itm)sitelinks.FetchAt(i);
- byte[] data_ttl_bry = sitelink.Name();
- byte[] actl_ttl = null;
- if (core_ns_is_main) {
- Xoa_ttl data_ttl = Xoa_ttl.parse_(wiki, data_ttl_bry);
- actl_ttl = data_ttl.Page_db();
- }
- else { // naive extract ttl based on colon; note that upper casing 1st letter is not needed, b/c ttls should be already cased correctly; EX: Aide:Page_a does not need uppercasing of "P"
- int colon_pos = Bry_finder.Find_fwd(data_ttl_bry, Byte_ascii.Colon);
- int data_ttl_len = data_ttl_bry.length;
- if (colon_pos == Bry_.NotFound || colon_pos == data_ttl_len - 1) {
- bldr.App().Usr_dlg().Log_many(GRP_KEY, "ns_not_found", "namespace not found; qid=~{0} ns=~{1} ttl=~{2}", qid, core_ns.Name_str(), data_ttl_bry);
- actl_ttl = data_ttl_bry;
- }
- else
- actl_ttl = Bry_.Mid(data_ttl_bry, colon_pos + 1, data_ttl_len);
- }
- this.Qid_add(sitelink.Site(), core_ns, actl_ttl, qid);
+ byte[] sitelink_site = sitelink.Site(), sitelink_ttl = sitelink.Name();
+ ns_parser.Find(ns_parser_rslt, sitelink_site, sitelink_ttl);
+ int sitelink_ns = ns_parser_rslt.Ns_id();
+ if (sitelink_ns != Xow_ns_.Id_main) // ttl not in main; chop off ns portion; EX:Aide:French_title -> French_title
+ sitelink_ttl = Bry_.Mid(sitelink_ttl, ns_parser_rslt.Ttl_bgn(), sitelink_ttl.length);
+ sitelink_ttl = wiki.Lang().Case_mgr().Case_build_1st_upper(tmp_bfr, sitelink_ttl, 0, sitelink_ttl.length);
+ this.Qid_add(sitelink.Site(), sitelink_ns, sitelink_ttl, qid);
}
}
public void Wkr_end() {
this.Qid_end();
- } static final byte[] Xwiki_key_en = Bry_.new_ascii_("enwiki");
-
- public void Wkr_print() {}
- private static final String GRP_KEY = "xowa.wdata.qid_wkr";
-}
-class Wdata_idx_bldr_qid extends Wdata_idx_mgr_base {
- public Wdata_idx_bldr_qid Ctor(Xob_wdata_qid_base wkr, Xob_bldr bldr, Xowe_wiki wiki, int dump_fil_len) {super.Ctor(wkr, bldr, wiki, dump_fil_len); return this;}
- public void Add(String wiki_key, Xow_ns ns, byte[] ttl, byte[] qid) {
- Wdata_idx_wtr wtr = Get_or_new(wiki_key, ns);
- wtr.Write(ttl, qid);
- }
- Wdata_idx_wtr Get_or_new(String wiki_key, Xow_ns ns) {
- String wtr_key = wiki_key + "|" + ns.Num_str();
- Object rv = hash.Fetch(wtr_key);
- if (rv == null) {
- Wdata_idx_wtr wtr = Wdata_idx_wtr.new_qid_(wiki, wiki_key, ns.Num_str(), dump_fil_len);
- hash.Add(wtr_key, wtr);
- return wtr;
- }
- return (Wdata_idx_wtr)rv;
}
+ public void Wkr_print() {}
}
-/*
-NOTE_1:non-english non-main titles
-The problem is that sitelinks have full titles which namespace names. EX:frwiki|Aide:Page1
-. there is no way to know that "Aide" is "ns 6" in frwiki without loading up the ns names of frwiki
-. furthermore, ttls can have ":" in the main namespace; EX:frwiki|Aidex:Page1 is actually in ns 0
-The ideal approach is to load up a ns_mgr for every wiki. this is problematic:
-. memory space: potentially 800+ wikis
-. data availability: wikidata dump does not have ns names for other wikis, so they need to be provided beforehand (in a new xowa.gfs file)
-So, for now, employ the following workaround:
-. find the ns of the baseline sitelink: (a) enwiki; (b) wiki; (c) 1st (not commons)
-. parse each sitelink
-.. if a sitelink has no ":", it must be in the main ns
-.. if a sitelink has a ":"
-... try to parse import wikidata.org's ns_mgr. this will find simple ns like "Category", "File", etc.
-... if no ns, use the ns of the baseline sitelink
-Note that this approach still fails in following situations
-. baseline sitelink is in non-English ns.*; EX: fr.w|Aide:Page1 en.d|Help:Page1; fr.w is identified as main ns but en.d is put in Help ns
-. the wrong sitelink is chosen as baseline; EX:: en.w|Category:Page1 de.w|Page1 es.w|Page1 ru.w|MainNs:Page1; ru.w is put in Category Ns
-. a non-English title happens to have an English ns name in its main ns; EX:fr.w|Category:Page1; fr.w should be in Main ns (since no "Category" ns name in fr.w), but put in Category
-*/
diff --git a/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_wdata_qid_base_tst.java b/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_wdata_qid_base_tst.java
index 1299ed3b6..e677fe792 100644
--- a/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_wdata_qid_base_tst.java
+++ b/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_wdata_qid_base_tst.java
@@ -17,9 +17,13 @@ along with this program. If not, see
.
*/
package gplx.xowa.xtns.wdatas.imports; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
import org.junit.*;
-import gplx.xowa.wikis.*; import gplx.xowa.tdbs.*;
-public class Xob_wdata_qid_base_tst {
- @Before public void init() {fxt = new gplx.xowa.bldrs.Xob_fxt().Ctor_mem();} gplx.xowa.bldrs.Xob_fxt fxt; // NOTE: reset memory instance (don't just call clear)
+import gplx.xowa.wikis.*; import gplx.xowa.tdbs.*; import gplx.dbs.*;
+public class Xob_wdata_qid_base_tst {
+ private gplx.xowa.bldrs.Xob_fxt fxt; // NOTE: reset memory instance (don't just call clear)
+ @Before public void init() {
+ this.fxt = new gplx.xowa.bldrs.Xob_fxt().Ctor_mem();
+ gplx.dbs.Db_conn_bldr.I.Reg_default_mem();
+ }
@Test public void Basic() {
fxt.doc_ary_
( fxt.doc_wo_date_(2, "q2", Xob_wdata_pid_base_tst.json_("q2", "links", String_.Ary("enwiki", "q2_en", "frwiki", "q2_fr")))
@@ -50,7 +54,16 @@ public class Xob_wdata_qid_base_tst {
.Run(new Xob_wdata_qid_txt().Ctor(fxt.Bldr(), this.fxt.Wiki()))
;
}
- @Test public void Ns() {
+ @Test public void Ns() {
+ // setup db
+ Db_conn conn = Xowmf_site_tbl.Get_conn_or_new(fxt.App().Fsys_mgr().Root_dir());
+ Xowmf_site_tbl site_tbl = new Xowmf_site_tbl(conn);
+ site_tbl.Insert(1, "en.wikipedia.org");
+ site_tbl.Insert(2, "fr.wikipedia.org");
+ Xowmf_ns_tbl ns_tbl = new Xowmf_ns_tbl(conn);
+ ns_tbl.Insert(1, Xow_ns_.Id_help, Xow_ns_case_.Id_1st, Bry_.new_ascii_("Help"), Bry_.Empty);
+ ns_tbl.Insert(2, Xow_ns_.Id_help, Xow_ns_case_.Id_1st, Bry_.new_ascii_("Aide"), Bry_.Empty);
+ // run test
fxt.doc_ary_
( fxt.doc_wo_date_(1, "11", Xob_wdata_pid_base_tst.json_("q1", "links", String_.Ary("enwiki", "Help:Q1_en", "frwiki", "Aide:Q1_fr")))
)
diff --git a/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_wdata_qid_sql.java b/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_wdata_qid_sql.java
index 8d988ea10..39bfa22d9 100644
--- a/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_wdata_qid_sql.java
+++ b/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_wdata_qid_sql.java
@@ -30,8 +30,8 @@ public class Xob_wdata_qid_sql extends Xob_wdata_qid_base {
tbl.Create_tbl();
tbl.Insert_bgn();
}
- @Override public void Qid_add(byte[] wiki_key, Xow_ns ns, byte[] ttl, byte[] qid) {
- tbl.Insert_cmd_by_batch(wiki_key, ns.Id(), ttl, qid);
+ @Override public void Qid_add(byte[] wiki_key, int ns_id, byte[] ttl, byte[] qid) {
+ tbl.Insert_cmd_by_batch(wiki_key, ns_id, ttl, qid);
}
@Override public void Qid_end() {
tbl.Insert_end();
diff --git a/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_wdata_qid_txt.java b/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_wdata_qid_txt.java
index 599f3253b..d19b6ae71 100644
--- a/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_wdata_qid_txt.java
+++ b/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xob_wdata_qid_txt.java
@@ -17,15 +17,31 @@ along with this program. If not, see
.
*/
package gplx.xowa.xtns.wdatas.imports; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
public class Xob_wdata_qid_txt extends Xob_wdata_qid_base {
- @Override public String Wkr_key() {return gplx.xowa.bldrs.Xob_cmd_keys.Key_tdb_text_wdata_qid;}
-
- Wdata_idx_bldr_qid qid_bldr;
+ private Wdata_idx_bldr_qid qid_bldr;
+ @Override public String Wkr_key() {return gplx.xowa.bldrs.Xob_cmd_keys.Key_tdb_text_wdata_qid;}
@Override public void Qid_bgn() {qid_bldr = new Wdata_idx_bldr_qid().Ctor(this, bldr, wiki, dump_fil_len);}
- @Override public void Qid_add(byte[] wiki_key, Xow_ns ns, byte[] ttl, byte[] qid) {
- qid_bldr.Add(String_.new_utf8_(wiki_key), ns, ttl, qid);
+ @Override public void Qid_add(byte[] wiki_key, int ns_id, byte[] ttl, byte[] qid) {
+ qid_bldr.Add(String_.new_utf8_(wiki_key), Int_.Xto_str_pad_bgn_zero(ns_id, 3), ttl, qid);
}
@Override public void Qid_end() {
qid_bldr.Flush();
qid_bldr.Make();
}
}
+class Wdata_idx_bldr_qid extends Wdata_idx_mgr_base {
+ public Wdata_idx_bldr_qid Ctor(Xob_wdata_qid_base wkr, Xob_bldr bldr, Xowe_wiki wiki, int dump_fil_len) {super.Ctor(wkr, bldr, wiki, dump_fil_len); return this;}
+ public void Add(String wiki_key, String ns_num_str, byte[] ttl, byte[] qid) {
+ Wdata_idx_wtr wtr = Get_or_new(wiki_key, ns_num_str);
+ wtr.Write(ttl, qid);
+ }
+ private Wdata_idx_wtr Get_or_new(String wiki_key, String ns_num_str) {
+ String wtr_key = wiki_key + "|" + ns_num_str;
+ Object rv = hash.Fetch(wtr_key);
+ if (rv == null) {
+ Wdata_idx_wtr wtr = Wdata_idx_wtr.new_qid_(wiki, wiki_key, ns_num_str, dump_fil_len);
+ hash.Add(wtr_key, wtr);
+ return wtr;
+ }
+ return (Wdata_idx_wtr)rv;
+ }
+}
diff --git a/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xow_wmf_api_mgr.java b/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xow_wmf_api_mgr.java
new file mode 100644
index 000000000..d56149a32
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xow_wmf_api_mgr.java
@@ -0,0 +1,874 @@
+/*
+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
.
+*/
+package gplx.xowa.xtns.wdatas.imports; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
+interface Xow_wmf_api_wkr {
+ void Api_init();
+ void Api_term();
+ boolean Api_wiki_enabled(String wiki_domain);
+ String Api_qargs();
+ boolean Api_exec(String wiki_domain, byte[] rslt);
+}
+class Xow_wmf_api_mgr {
+ public void Trg_engine_key(String v) {this.trg_engine_key = v;} private String trg_engine_key = gplx.ios.IoEngine_.SysKey;
+ public void Api_exec(Xow_wmf_api_wkr wkr) {this.Api_exec(Wikis, wkr);}
+ public void Api_exec(String[] wiki_ary, Xow_wmf_api_wkr wkr) {
+ Gfo_usr_dlg usr_dlg = Xoa_app_.Usr_dlg();
+ int len = wiki_ary.length;
+ wkr.Api_init();
+ for (int i = 0; i < len; ++i) {
+ String wiki = wiki_ary[i];
+ if (!wkr.Api_wiki_enabled(wiki)) continue;
+ String call = String_.Format("https://{0}/w/api.php?{1}", wiki, wkr.Api_qargs()); // EX: https://en.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces
+ usr_dlg.Prog_many("", "", "wmf_api:calling; wiki~{0} api=~{1}", wiki, call);
+ byte[] rslt = Io_mgr._.DownloadFil_args("", null).Trg_engine_key_(trg_engine_key).Exec_as_bry(call);
+ if (rslt == null) {usr_dlg.Warn_many("", "", "wmf_api:wmf api returned nothing; api=~{0}", call); continue;}
+ wkr.Api_exec(wiki, rslt);
+ }
+ wkr.Api_term();
+ }
+ public static String[] Wikis = new String[]
+{ "commons.wikimedia.org"
+, "species.wikimedia.org"
+, "meta.wikimedia.org"
+, "incubator.wikimedia.org"
+, "www.wikidata.org"
+, "www.mediawiki.org"
+, "wikimediafoundation.org"
+, "en.wikipedia.org"
+, "en.wiktionary.org"
+, "en.wikisource.org"
+, "en.wikibooks.org"
+, "en.wikiversity.org"
+, "en.wikiquote.org"
+, "en.wikinews.org"
+, "en.wikivoyage.org"
+, "de.wikipedia.org"
+, "de.wiktionary.org"
+, "de.wikisource.org"
+, "de.wikibooks.org"
+, "de.wikiversity.org"
+, "de.wikiquote.org"
+, "de.wikinews.org"
+, "de.wikivoyage.org"
+, "es.wikipedia.org"
+, "es.wiktionary.org"
+, "es.wikisource.org"
+, "es.wikibooks.org"
+, "es.wikiversity.org"
+, "es.wikiquote.org"
+, "es.wikinews.org"
+, "es.wikivoyage.org"
+, "fr.wikipedia.org"
+, "fr.wiktionary.org"
+, "fr.wikisource.org"
+, "fr.wikibooks.org"
+, "fr.wikiversity.org"
+, "fr.wikiquote.org"
+, "fr.wikinews.org"
+, "fr.wikivoyage.org"
+, "it.wikipedia.org"
+, "it.wiktionary.org"
+, "it.wikisource.org"
+, "it.wikibooks.org"
+, "it.wikiversity.org"
+, "it.wikiquote.org"
+, "it.wikinews.org"
+, "it.wikivoyage.org"
+, "ja.wikipedia.org"
+, "ja.wiktionary.org"
+, "ja.wikisource.org"
+, "ja.wikibooks.org"
+, "ja.wikiversity.org"
+, "ja.wikiquote.org"
+, "ja.wikinews.org"
+, "nl.wikipedia.org"
+, "nl.wiktionary.org"
+, "nl.wikisource.org"
+, "nl.wikibooks.org"
+, "nl.wikiquote.org"
+, "nl.wikinews.org"
+, "nl.wikivoyage.org"
+, "nl.wikimedia.org"
+, "pl.wikipedia.org"
+, "pl.wiktionary.org"
+, "pl.wikisource.org"
+, "pl.wikibooks.org"
+, "pl.wikiquote.org"
+, "pl.wikinews.org"
+, "pl.wikivoyage.org"
+, "pl.wikimedia.org"
+, "pt.wikipedia.org"
+, "pt.wiktionary.org"
+, "pt.wikisource.org"
+, "pt.wikibooks.org"
+, "pt.wikiversity.org"
+, "pt.wikiquote.org"
+, "pt.wikinews.org"
+, "pt.wikivoyage.org"
+, "ru.wikipedia.org"
+, "ru.wiktionary.org"
+, "ru.wikisource.org"
+, "ru.wikibooks.org"
+, "ru.wikiversity.org"
+, "ru.wikiquote.org"
+, "ru.wikinews.org"
+, "ru.wikivoyage.org"
+, "ru.wikimedia.org"
+, "ar.wikipedia.org"
+, "ar.wiktionary.org"
+, "ar.wikisource.org"
+, "ar.wikibooks.org"
+, "ar.wikiversity.org"
+, "ar.wikiquote.org"
+, "ar.wikinews.org"
+, "ar.wikimedia.org"
+, "ca.wikipedia.org"
+, "ca.wiktionary.org"
+, "ca.wikisource.org"
+, "ca.wikibooks.org"
+, "ca.wikiquote.org"
+, "ca.wikinews.org"
+, "ca.wikimedia.org"
+, "cs.wikipedia.org"
+, "cs.wiktionary.org"
+, "cs.wikisource.org"
+, "cs.wikibooks.org"
+, "cs.wikiversity.org"
+, "cs.wikiquote.org"
+, "cs.wikinews.org"
+, "da.wikipedia.org"
+, "da.wiktionary.org"
+, "da.wikisource.org"
+, "da.wikibooks.org"
+, "da.wikiquote.org"
+, "eo.wikipedia.org"
+, "eo.wiktionary.org"
+, "eo.wikisource.org"
+, "eo.wikibooks.org"
+, "eo.wikiquote.org"
+, "eo.wikinews.org"
+, "fa.wikipedia.org"
+, "fa.wiktionary.org"
+, "fa.wikisource.org"
+, "fa.wikibooks.org"
+, "fa.wikiquote.org"
+, "fa.wikinews.org"
+, "fa.wikivoyage.org"
+, "fi.wikipedia.org"
+, "fi.wiktionary.org"
+, "fi.wikisource.org"
+, "fi.wikibooks.org"
+, "fi.wikiversity.org"
+, "fi.wikiquote.org"
+, "fi.wikinews.org"
+, "fi.wikimedia.org"
+, "hu.wikipedia.org"
+, "hu.wiktionary.org"
+, "hu.wikisource.org"
+, "hu.wikibooks.org"
+, "hu.wikiquote.org"
+, "hu.wikinews.org"
+, "id.wikipedia.org"
+, "id.wiktionary.org"
+, "id.wikisource.org"
+, "id.wikibooks.org"
+, "id.wikiquote.org"
+, "kk.wikipedia.org"
+, "kk.wiktionary.org"
+, "kk.wikibooks.org"
+, "kk.wikiquote.org"
+, "ko.wikipedia.org"
+, "ko.wiktionary.org"
+, "ko.wikisource.org"
+, "ko.wikibooks.org"
+, "ko.wikiversity.org"
+, "ko.wikiquote.org"
+, "ko.wikinews.org"
+, "lt.wikipedia.org"
+, "lt.wiktionary.org"
+, "lt.wikisource.org"
+, "lt.wikibooks.org"
+, "lt.wikiquote.org"
+, "no.wikipedia.org"
+, "no.wiktionary.org"
+, "no.wikisource.org"
+, "no.wikibooks.org"
+, "no.wikiquote.org"
+, "no.wikinews.org"
+, "no.wikimedia.org"
+, "ro.wikipedia.org"
+, "ro.wiktionary.org"
+, "ro.wikisource.org"
+, "ro.wikibooks.org"
+, "ro.wikiquote.org"
+, "ro.wikinews.org"
+, "ro.wikivoyage.org"
+, "sk.wikipedia.org"
+, "sk.wiktionary.org"
+, "sk.wikisource.org"
+, "sk.wikibooks.org"
+, "sk.wikiquote.org"
+, "sr.wikipedia.org"
+, "sr.wiktionary.org"
+, "sr.wikisource.org"
+, "sr.wikibooks.org"
+, "sr.wikiquote.org"
+, "sr.wikinews.org"
+, "sv.wikipedia.org"
+, "sv.wiktionary.org"
+, "sv.wikisource.org"
+, "sv.wikibooks.org"
+, "sv.wikiversity.org"
+, "sv.wikiquote.org"
+, "sv.wikinews.org"
+, "sv.wikivoyage.org"
+, "tr.wikipedia.org"
+, "tr.wiktionary.org"
+, "tr.wikisource.org"
+, "tr.wikibooks.org"
+, "tr.wikiquote.org"
+, "tr.wikinews.org"
+, "tr.wikimedia.org"
+, "uk.wikipedia.org"
+, "uk.wiktionary.org"
+, "uk.wikisource.org"
+, "uk.wikibooks.org"
+, "uk.wikiquote.org"
+, "uk.wikinews.org"
+, "uk.wikivoyage.org"
+, "uk.wikimedia.org"
+, "vi.wikipedia.org"
+, "vi.wiktionary.org"
+, "vi.wikisource.org"
+, "vi.wikibooks.org"
+, "vi.wikiquote.org"
+, "vi.wikivoyage.org"
+, "zh.wikipedia.org"
+, "zh.wiktionary.org"
+, "zh.wikisource.org"
+, "zh.wikibooks.org"
+, "zh.wikiquote.org"
+, "zh.wikinews.org"
+, "zh.wikivoyage.org"
+, "bg.wikipedia.org"
+, "bg.wiktionary.org"
+, "bg.wikisource.org"
+, "bg.wikibooks.org"
+, "bg.wikiquote.org"
+, "bg.wikinews.org"
+, "el.wikipedia.org"
+, "el.wiktionary.org"
+, "el.wikisource.org"
+, "el.wikibooks.org"
+, "el.wikiversity.org"
+, "el.wikiquote.org"
+, "el.wikinews.org"
+, "el.wikivoyage.org"
+, "et.wikipedia.org"
+, "et.wiktionary.org"
+, "et.wikisource.org"
+, "et.wikibooks.org"
+, "et.wikiquote.org"
+, "et.wikimedia.org"
+, "eu.wikipedia.org"
+, "eu.wiktionary.org"
+, "eu.wikibooks.org"
+, "eu.wikiquote.org"
+, "gl.wikipedia.org"
+, "gl.wiktionary.org"
+, "gl.wikisource.org"
+, "gl.wikibooks.org"
+, "gl.wikiquote.org"
+, "he.wikipedia.org"
+, "he.wiktionary.org"
+, "he.wikisource.org"
+, "he.wikibooks.org"
+, "he.wikiquote.org"
+, "he.wikinews.org"
+, "he.wikivoyage.org"
+, "hr.wikipedia.org"
+, "hr.wiktionary.org"
+, "hr.wikisource.org"
+, "hr.wikibooks.org"
+, "hr.wikiquote.org"
+, "ms.wikipedia.org"
+, "ms.wiktionary.org"
+, "ms.wikibooks.org"
+, "nn.wikipedia.org"
+, "nn.wiktionary.org"
+, "nn.wikiquote.org"
+, "sh.wikipedia.org"
+, "sh.wiktionary.org"
+, "simple.wikipedia.org"
+, "simple.wiktionary.org"
+, "simple.wikibooks.org"
+, "simple.wikiquote.org"
+, "sl.wikipedia.org"
+, "sl.wiktionary.org"
+, "sl.wikisource.org"
+, "sl.wikibooks.org"
+, "sl.wikiversity.org"
+, "sl.wikiquote.org"
+, "th.wikipedia.org"
+, "th.wiktionary.org"
+, "th.wikisource.org"
+, "th.wikibooks.org"
+, "th.wikiquote.org"
+, "th.wikinews.org"
+, "vo.wikipedia.org"
+, "vo.wiktionary.org"
+, "vo.wikibooks.org"
+, "vo.wikiquote.org"
+, "hi.wikipedia.org"
+, "hi.wiktionary.org"
+, "hi.wikibooks.org"
+, "hi.wikiquote.org"
+, "ia.wikipedia.org"
+, "ia.wiktionary.org"
+, "ia.wikibooks.org"
+, "la.wikipedia.org"
+, "la.wiktionary.org"
+, "la.wikisource.org"
+, "la.wikibooks.org"
+, "la.wikiquote.org"
+, "aa.wikipedia.org"
+, "aa.wiktionary.org"
+, "aa.wikibooks.org"
+, "ab.wikipedia.org"
+, "ab.wiktionary.org"
+, "ace.wikipedia.org"
+, "af.wikipedia.org"
+, "af.wiktionary.org"
+, "af.wikibooks.org"
+, "af.wikiquote.org"
+, "ak.wikipedia.org"
+, "ak.wiktionary.org"
+, "ak.wikibooks.org"
+, "als.wikipedia.org"
+, "als.wiktionary.org"
+, "als.wikibooks.org"
+, "als.wikiquote.org"
+, "am.wikipedia.org"
+, "am.wiktionary.org"
+, "am.wikiquote.org"
+, "an.wikipedia.org"
+, "an.wiktionary.org"
+, "ang.wikipedia.org"
+, "ang.wiktionary.org"
+, "ang.wikisource.org"
+, "ang.wikibooks.org"
+, "ang.wikiquote.org"
+, "arc.wikipedia.org"
+, "arz.wikipedia.org"
+, "as.wikipedia.org"
+, "as.wiktionary.org"
+, "as.wikisource.org"
+, "as.wikibooks.org"
+, "ast.wikipedia.org"
+, "ast.wiktionary.org"
+, "ast.wikibooks.org"
+, "ast.wikiquote.org"
+, "av.wikipedia.org"
+, "av.wiktionary.org"
+, "ay.wikipedia.org"
+, "ay.wiktionary.org"
+, "ay.wikibooks.org"
+, "az.wikipedia.org"
+, "az.wiktionary.org"
+, "az.wikisource.org"
+, "az.wikibooks.org"
+, "az.wikiquote.org"
+, "ba.wikipedia.org"
+, "ba.wikibooks.org"
+, "bar.wikipedia.org"
+, "bat-smg.wikipedia.org"
+, "bcl.wikipedia.org"
+, "be.wikipedia.org"
+, "be.wiktionary.org"
+, "be.wikisource.org"
+, "be.wikibooks.org"
+, "be.wikiquote.org"
+, "be.wikimedia.org"
+, "be-x-old.wikipedia.org"
+, "bh.wikipedia.org"
+, "bh.wiktionary.org"
+, "bi.wikipedia.org"
+, "bi.wiktionary.org"
+, "bi.wikibooks.org"
+, "bjn.wikipedia.org"
+, "bm.wikipedia.org"
+, "bm.wiktionary.org"
+, "bm.wikibooks.org"
+, "bm.wikiquote.org"
+, "bn.wikipedia.org"
+, "bn.wiktionary.org"
+, "bn.wikisource.org"
+, "bn.wikibooks.org"
+, "bo.wikipedia.org"
+, "bo.wiktionary.org"
+, "bo.wikibooks.org"
+, "bpy.wikipedia.org"
+, "br.wikipedia.org"
+, "br.wiktionary.org"
+, "br.wikisource.org"
+, "br.wikiquote.org"
+, "br.wikimedia.org"
+, "bs.wikipedia.org"
+, "bs.wiktionary.org"
+, "bs.wikisource.org"
+, "bs.wikibooks.org"
+, "bs.wikiquote.org"
+, "bs.wikinews.org"
+, "bug.wikipedia.org"
+, "bxr.wikipedia.org"
+, "cbk-zam.wikipedia.org"
+, "cdo.wikipedia.org"
+, "ce.wikipedia.org"
+, "ceb.wikipedia.org"
+, "ch.wikipedia.org"
+, "ch.wiktionary.org"
+, "ch.wikibooks.org"
+, "cho.wikipedia.org"
+, "chr.wikipedia.org"
+, "chr.wiktionary.org"
+, "chy.wikipedia.org"
+, "ckb.wikipedia.org"
+, "co.wikipedia.org"
+, "co.wiktionary.org"
+, "co.wikibooks.org"
+, "co.wikiquote.org"
+, "co.wikimedia.org"
+, "cr.wikipedia.org"
+, "cr.wiktionary.org"
+, "cr.wikiquote.org"
+, "crh.wikipedia.org"
+, "csb.wikipedia.org"
+, "csb.wiktionary.org"
+, "cu.wikipedia.org"
+, "cv.wikipedia.org"
+, "cv.wikibooks.org"
+, "cy.wikipedia.org"
+, "cy.wiktionary.org"
+, "cy.wikisource.org"
+, "cy.wikibooks.org"
+, "cy.wikiquote.org"
+, "diq.wikipedia.org"
+, "dsb.wikipedia.org"
+, "dv.wikipedia.org"
+, "dv.wiktionary.org"
+, "dz.wikipedia.org"
+, "dz.wiktionary.org"
+, "ee.wikipedia.org"
+, "eml.wikipedia.org"
+, "ext.wikipedia.org"
+, "ff.wikipedia.org"
+, "fiu-vro.wikipedia.org"
+, "fj.wikipedia.org"
+, "fj.wiktionary.org"
+, "fo.wikipedia.org"
+, "fo.wiktionary.org"
+, "fo.wikisource.org"
+, "frp.wikipedia.org"
+, "frr.wikipedia.org"
+, "fur.wikipedia.org"
+, "fy.wikipedia.org"
+, "fy.wiktionary.org"
+, "fy.wikibooks.org"
+, "ga.wikipedia.org"
+, "ga.wiktionary.org"
+, "ga.wikibooks.org"
+, "ga.wikiquote.org"
+, "gag.wikipedia.org"
+, "gan.wikipedia.org"
+, "gd.wikipedia.org"
+, "gd.wiktionary.org"
+, "glk.wikipedia.org"
+, "gn.wikipedia.org"
+, "gn.wiktionary.org"
+, "gn.wikibooks.org"
+, "got.wikipedia.org"
+, "got.wikibooks.org"
+, "gu.wikipedia.org"
+, "gu.wiktionary.org"
+, "gu.wikisource.org"
+, "gu.wikibooks.org"
+, "gu.wikiquote.org"
+, "gv.wikipedia.org"
+, "gv.wiktionary.org"
+, "ha.wikipedia.org"
+, "ha.wiktionary.org"
+, "hak.wikipedia.org"
+, "haw.wikipedia.org"
+, "hif.wikipedia.org"
+, "ho.wikipedia.org"
+, "hsb.wikipedia.org"
+, "hsb.wiktionary.org"
+, "ht.wikipedia.org"
+, "ht.wikisource.org"
+, "hy.wikipedia.org"
+, "hy.wiktionary.org"
+, "hy.wikisource.org"
+, "hy.wikibooks.org"
+, "hy.wikiquote.org"
+, "hz.wikipedia.org"
+, "ie.wikipedia.org"
+, "ie.wiktionary.org"
+, "ie.wikibooks.org"
+, "ig.wikipedia.org"
+, "ii.wikipedia.org"
+, "ik.wikipedia.org"
+, "ik.wiktionary.org"
+, "ilo.wikipedia.org"
+, "io.wikipedia.org"
+, "io.wiktionary.org"
+, "is.wikipedia.org"
+, "is.wiktionary.org"
+, "is.wikisource.org"
+, "is.wikibooks.org"
+, "is.wikiquote.org"
+, "iu.wikipedia.org"
+, "iu.wiktionary.org"
+, "jbo.wikipedia.org"
+, "jbo.wiktionary.org"
+, "jv.wikipedia.org"
+, "jv.wiktionary.org"
+, "ka.wikipedia.org"
+, "ka.wiktionary.org"
+, "ka.wikibooks.org"
+, "ka.wikiquote.org"
+, "kaa.wikipedia.org"
+, "kab.wikipedia.org"
+, "kbd.wikipedia.org"
+, "kg.wikipedia.org"
+, "ki.wikipedia.org"
+, "kj.wikipedia.org"
+, "kl.wikipedia.org"
+, "kl.wiktionary.org"
+, "km.wikipedia.org"
+, "km.wiktionary.org"
+, "km.wikibooks.org"
+, "kn.wikipedia.org"
+, "kn.wiktionary.org"
+, "kn.wikisource.org"
+, "kn.wikibooks.org"
+, "kn.wikiquote.org"
+, "koi.wikipedia.org"
+, "kr.wikipedia.org"
+, "kr.wikiquote.org"
+, "krc.wikipedia.org"
+, "ks.wikipedia.org"
+, "ks.wiktionary.org"
+, "ks.wikibooks.org"
+, "ks.wikiquote.org"
+, "ksh.wikipedia.org"
+, "ku.wikipedia.org"
+, "ku.wiktionary.org"
+, "ku.wikibooks.org"
+, "ku.wikiquote.org"
+, "kv.wikipedia.org"
+, "kw.wikipedia.org"
+, "kw.wiktionary.org"
+, "kw.wikiquote.org"
+, "ky.wikipedia.org"
+, "ky.wiktionary.org"
+, "ky.wikibooks.org"
+, "ky.wikiquote.org"
+, "lad.wikipedia.org"
+, "lb.wikipedia.org"
+, "lb.wiktionary.org"
+, "lb.wikibooks.org"
+, "lb.wikiquote.org"
+, "lbe.wikipedia.org"
+, "lez.wikipedia.org"
+, "lg.wikipedia.org"
+, "li.wikipedia.org"
+, "li.wiktionary.org"
+, "li.wikisource.org"
+, "li.wikibooks.org"
+, "li.wikiquote.org"
+, "lij.wikipedia.org"
+, "lmo.wikipedia.org"
+, "ln.wikipedia.org"
+, "ln.wiktionary.org"
+, "ln.wikibooks.org"
+, "lo.wikipedia.org"
+, "lo.wiktionary.org"
+, "ltg.wikipedia.org"
+, "lv.wikipedia.org"
+, "lv.wiktionary.org"
+, "lv.wikibooks.org"
+, "mai.wikipedia.org"
+, "map-bms.wikipedia.org"
+, "mdf.wikipedia.org"
+, "mg.wikipedia.org"
+, "mg.wiktionary.org"
+, "mg.wikibooks.org"
+, "mh.wikipedia.org"
+, "mh.wiktionary.org"
+, "mhr.wikipedia.org"
+, "mi.wikipedia.org"
+, "mi.wiktionary.org"
+, "mi.wikibooks.org"
+, "min.wikipedia.org"
+, "mk.wikipedia.org"
+, "mk.wiktionary.org"
+, "mk.wikisource.org"
+, "mk.wikibooks.org"
+, "mk.wikimedia.org"
+, "ml.wikipedia.org"
+, "ml.wiktionary.org"
+, "ml.wikisource.org"
+, "ml.wikibooks.org"
+, "ml.wikiquote.org"
+, "mn.wikipedia.org"
+, "mn.wiktionary.org"
+, "mn.wikibooks.org"
+, "mo.wikipedia.org"
+, "mo.wiktionary.org"
+, "mr.wikipedia.org"
+, "mr.wiktionary.org"
+, "mr.wikisource.org"
+, "mr.wikibooks.org"
+, "mr.wikiquote.org"
+, "mrj.wikipedia.org"
+, "mt.wikipedia.org"
+, "mt.wiktionary.org"
+, "mus.wikipedia.org"
+, "mwl.wikipedia.org"
+, "my.wikipedia.org"
+, "my.wiktionary.org"
+, "my.wikibooks.org"
+, "myv.wikipedia.org"
+, "mzn.wikipedia.org"
+, "na.wikipedia.org"
+, "na.wiktionary.org"
+, "na.wikibooks.org"
+, "na.wikiquote.org"
+, "nah.wikipedia.org"
+, "nah.wiktionary.org"
+, "nah.wikibooks.org"
+, "nap.wikipedia.org"
+, "nds.wikipedia.org"
+, "nds.wiktionary.org"
+, "nds.wikibooks.org"
+, "nds.wikiquote.org"
+, "nds-nl.wikipedia.org"
+, "ne.wikipedia.org"
+, "ne.wiktionary.org"
+, "ne.wikibooks.org"
+, "new.wikipedia.org"
+, "ng.wikipedia.org"
+, "nov.wikipedia.org"
+, "nrm.wikipedia.org"
+, "nso.wikipedia.org"
+, "nv.wikipedia.org"
+, "ny.wikipedia.org"
+, "oc.wikipedia.org"
+, "oc.wiktionary.org"
+, "oc.wikibooks.org"
+, "om.wikipedia.org"
+, "om.wiktionary.org"
+, "or.wikipedia.org"
+, "or.wiktionary.org"
+, "or.wikisource.org"
+, "os.wikipedia.org"
+, "pa.wikipedia.org"
+, "pa.wiktionary.org"
+, "pa.wikibooks.org"
+, "pag.wikipedia.org"
+, "pam.wikipedia.org"
+, "pap.wikipedia.org"
+, "pcd.wikipedia.org"
+, "pdc.wikipedia.org"
+, "pfl.wikipedia.org"
+, "pi.wikipedia.org"
+, "pi.wiktionary.org"
+, "pih.wikipedia.org"
+, "pms.wikipedia.org"
+, "pnb.wikipedia.org"
+, "pnb.wiktionary.org"
+, "pnt.wikipedia.org"
+, "ps.wikipedia.org"
+, "ps.wiktionary.org"
+, "ps.wikibooks.org"
+, "qu.wikipedia.org"
+, "qu.wiktionary.org"
+, "qu.wikibooks.org"
+, "qu.wikiquote.org"
+, "rm.wikipedia.org"
+, "rm.wiktionary.org"
+, "rm.wikibooks.org"
+, "rmy.wikipedia.org"
+, "rn.wikipedia.org"
+, "rn.wiktionary.org"
+, "roa-rup.wikipedia.org"
+, "roa-rup.wiktionary.org"
+, "roa-tara.wikipedia.org"
+, "rue.wikipedia.org"
+, "rw.wikipedia.org"
+, "rw.wiktionary.org"
+, "sa.wikipedia.org"
+, "sa.wiktionary.org"
+, "sa.wikisource.org"
+, "sa.wikibooks.org"
+, "sa.wikiquote.org"
+, "sah.wikipedia.org"
+, "sah.wikisource.org"
+, "sc.wikipedia.org"
+, "sc.wiktionary.org"
+, "scn.wikipedia.org"
+, "scn.wiktionary.org"
+, "sco.wikipedia.org"
+, "sd.wikipedia.org"
+, "sd.wiktionary.org"
+, "sd.wikinews.org"
+, "se.wikipedia.org"
+, "se.wikibooks.org"
+, "se.wikimedia.org"
+, "sg.wikipedia.org"
+, "sg.wiktionary.org"
+, "si.wikipedia.org"
+, "si.wiktionary.org"
+, "si.wikibooks.org"
+, "sm.wikipedia.org"
+, "sm.wiktionary.org"
+, "sn.wikipedia.org"
+, "sn.wiktionary.org"
+, "so.wikipedia.org"
+, "so.wiktionary.org"
+, "sq.wikipedia.org"
+, "sq.wiktionary.org"
+, "sq.wikibooks.org"
+, "sq.wikiquote.org"
+, "sq.wikinews.org"
+, "srn.wikipedia.org"
+, "ss.wikipedia.org"
+, "ss.wiktionary.org"
+, "st.wikipedia.org"
+, "st.wiktionary.org"
+, "stq.wikipedia.org"
+, "su.wikipedia.org"
+, "su.wiktionary.org"
+, "su.wikibooks.org"
+, "su.wikiquote.org"
+, "sw.wikipedia.org"
+, "sw.wiktionary.org"
+, "sw.wikibooks.org"
+, "szl.wikipedia.org"
+, "ta.wikipedia.org"
+, "ta.wiktionary.org"
+, "ta.wikisource.org"
+, "ta.wikibooks.org"
+, "ta.wikiquote.org"
+, "ta.wikinews.org"
+, "te.wikipedia.org"
+, "te.wiktionary.org"
+, "te.wikisource.org"
+, "te.wikibooks.org"
+, "te.wikiquote.org"
+, "tet.wikipedia.org"
+, "tg.wikipedia.org"
+, "tg.wiktionary.org"
+, "tg.wikibooks.org"
+, "ti.wikipedia.org"
+, "ti.wiktionary.org"
+, "tk.wikipedia.org"
+, "tk.wiktionary.org"
+, "tk.wikibooks.org"
+, "tk.wikiquote.org"
+, "tl.wikipedia.org"
+, "tl.wiktionary.org"
+, "tl.wikibooks.org"
+, "tn.wikipedia.org"
+, "tn.wiktionary.org"
+, "to.wikipedia.org"
+, "to.wiktionary.org"
+, "tpi.wikipedia.org"
+, "tpi.wiktionary.org"
+, "ts.wikipedia.org"
+, "ts.wiktionary.org"
+, "tt.wikipedia.org"
+, "tt.wiktionary.org"
+, "tt.wikibooks.org"
+, "tt.wikiquote.org"
+, "tum.wikipedia.org"
+, "tw.wikipedia.org"
+, "tw.wiktionary.org"
+, "ty.wikipedia.org"
+, "tyv.wikipedia.org"
+, "udm.wikipedia.org"
+, "ug.wikipedia.org"
+, "ug.wiktionary.org"
+, "ug.wikibooks.org"
+, "ug.wikiquote.org"
+, "ur.wikipedia.org"
+, "ur.wiktionary.org"
+, "ur.wikibooks.org"
+, "ur.wikiquote.org"
+, "uz.wikipedia.org"
+, "uz.wiktionary.org"
+, "uz.wikibooks.org"
+, "uz.wikiquote.org"
+, "ve.wikipedia.org"
+, "vec.wikipedia.org"
+, "vec.wiktionary.org"
+, "vec.wikisource.org"
+, "vep.wikipedia.org"
+, "vls.wikipedia.org"
+, "wa.wikipedia.org"
+, "wa.wiktionary.org"
+, "wa.wikibooks.org"
+, "war.wikipedia.org"
+, "wo.wikipedia.org"
+, "wo.wiktionary.org"
+, "wo.wikiquote.org"
+, "wuu.wikipedia.org"
+, "xal.wikipedia.org"
+, "xh.wikipedia.org"
+, "xh.wiktionary.org"
+, "xh.wikibooks.org"
+, "xmf.wikipedia.org"
+, "yi.wikipedia.org"
+, "yi.wiktionary.org"
+, "yi.wikisource.org"
+, "yo.wikipedia.org"
+, "yo.wiktionary.org"
+, "yo.wikibooks.org"
+, "za.wikipedia.org"
+, "za.wiktionary.org"
+, "za.wikibooks.org"
+, "za.wikiquote.org"
+, "zea.wikipedia.org"
+, "zh-classical.wikipedia.org"
+, "zh-min-nan.wikipedia.org"
+, "zh-min-nan.wiktionary.org"
+, "zh-min-nan.wikisource.org"
+, "zh-min-nan.wikibooks.org"
+, "zh-min-nan.wikiquote.org"
+, "zh-yue.wikipedia.org"
+, "zu.wikipedia.org"
+, "zu.wiktionary.org"
+, "zu.wikibooks.org"
+};
+//, "als.wikisource.org"
+//, "als.wikinews.org"
+//, "nds.wikinews.org"
+//, "ba.wiktionary.org"
+//, "tokipona.wikibooks.org"
+//, "ve.wikimedia.org" // NOTE: moved:DATE:2015-04-06
+}
diff --git a/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xow_wmf_api_wkr__ns.java b/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xow_wmf_api_wkr__ns.java
new file mode 100644
index 000000000..607faf291
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xow_wmf_api_wkr__ns.java
@@ -0,0 +1,74 @@
+/*
+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
.
+*/
+package gplx.xowa.xtns.wdatas.imports; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
+import gplx.json.*;
+class Xow_wmf_api_wkr__ns implements Xow_wmf_api_wkr {
+ private final Json_parser parser = new Json_parser();
+ private final Xowmf_site_tbl tbl_site; private final Xowmf_ns_tbl tbl_itm;
+ private int site_id_next = 1;
+ public Xow_wmf_api_wkr__ns(Xowmf_site_tbl tbl_site, Xowmf_ns_tbl tbl_itm) {
+ this.tbl_site = tbl_site; this.tbl_itm = tbl_itm;
+ }
+ public boolean Api_wiki_enabled(String wiki_domain) {return true;} // run against all wikis
+ public String Api_qargs() {return "action=query&meta=siteinfo&siprop=namespaces&format=json";}
+ public void Api_init() {
+ tbl_site.Conn().Txn_bgn();
+ tbl_site.Delete_all();
+ tbl_itm.Delete_all();
+ }
+ public boolean Api_exec(String wiki_domain, byte[] rslt) {
+ try {
+ int site_id = ++site_id_next;
+ tbl_site.Insert(site_id, wiki_domain);
+ Json_doc jdoc = parser.Parse(rslt);
+ Json_grp ns_grp = jdoc.Get_grp(Bry_jpath); if (ns_grp == null) throw Err_.new_("wmf_api_wkr.ns:invalid json; json={0}", rslt);
+ int ns_len = ns_grp.Subs_len();
+ for (int i = 0; i < ns_len; ++i) {
+ try {
+ Json_itm_kv kv = (Json_itm_kv)ns_grp.Subs_get_at(i);
+ Json_itm_nde nde = (Json_itm_nde)kv.Val();
+ int ns_id = Bry_.Xto_int_or(Get_val_or_null(nde, Bry_id), Int_.MinValue);
+ byte ns_case = Xow_ns_case_.parse_(String_.new_utf8_(Get_val_or_null(nde, Bry_case)));
+ byte[] ns_name = Get_val_or_null(nde, Bry_name);
+ byte[] ns_canonical = Get_val_or_null(nde, Bry_canonical);
+ if (ns_canonical == null) ns_canonical = Bry_.Empty; // main_ns has no canonical
+ tbl_itm.Insert(site_id, ns_id, ns_case, ns_name, ns_canonical);
+ } catch (Exception e) {
+ Xoa_app_.Usr_dlg().Warn_many("", "", "wmf_api_wkr.ns:unknown; wiki=~{0} rslt=~{1} i=~{2} err=~{3}", wiki_domain, rslt, i, Err_.Message_gplx(e));
+ continue;
+ }
+ }
+ tbl_site.Conn().Txn_sav();
+ return true;
+ } catch (Exception e) {
+ Xoa_app_.Usr_dlg().Warn_many("", "", "wmf_api_wkr.ns:unknown; wiki=~{0} rslt=~{1} err=~{2}", wiki_domain, rslt, Err_.Message_gplx(e));
+ return false;
+ }
+ }
+ public void Api_term() {
+ tbl_site.Conn().Txn_end();
+ }
+ private byte[] Get_val_or_null(Json_itm_nde nde, byte[] key) {
+ Json_itm sub = nde.Subs_get_by_key(key);
+ Json_itm_kv sub_as_kv = (Json_itm_kv)sub;
+ return sub_as_kv == null ? null : sub_as_kv.Val().Data_bry(); // sub_as_kv == null when key is not present; note that "canonical" does not exist for Main ns
+ }
+ private static final byte[] Bry_query = Bry_.new_ascii_("query"), Bry_namespaces = Bry_.new_ascii_("namespaces")
+ , Bry_id = Bry_.new_ascii_("id"), Bry_case = Bry_.new_ascii_("case"), Bry_name = Bry_.new_ascii_("*"), Bry_canonical = Bry_.new_ascii_("canonical");
+ private static final byte[][] Bry_jpath = new byte[][] {Bry_query, Bry_namespaces};
+}
diff --git a/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xowmf_site_tbl.java b/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xowmf_site_tbl.java
new file mode 100644
index 000000000..c4d3e79c0
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/xtns/wdatas/imports/Xowmf_site_tbl.java
@@ -0,0 +1,101 @@
+/*
+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
.
+*/
+package gplx.xowa.xtns.wdatas.imports; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wdatas.*;
+import gplx.dbs.*;
+class Xowmf_site_tbl implements RlsAble {
+ private static final String tbl_name = "wmf_site"; private final Db_meta_fld_list flds = new Db_meta_fld_list();
+ private final String fld_id, fld_name;
+ private final Db_conn conn;
+ private Db_stmt stmt_insert, stmt_select;
+ public Xowmf_site_tbl(Db_conn conn) {
+ this.conn = conn;
+ this.fld_id = flds.Add_int_pkey("site_id");
+ this.fld_name = flds.Add_str("site_name", 255);
+ conn.Rls_reg(this);
+ }
+ public Db_conn Conn() {return conn;}
+ public void Create_tbl() {conn.Ddl_create_tbl(Db_meta_tbl.new_(tbl_name, flds, Db_meta_idx.new_unique_by_name(tbl_name, "name", fld_name)));}
+ public void Rls() {
+ stmt_insert = Db_stmt_.Rls(stmt_insert);
+ stmt_select = Db_stmt_.Rls(stmt_select);
+ }
+ public void Delete_all() {conn.Stmt_delete(tbl_name, Db_meta_fld.Ary_empy).Exec_delete();}
+ public void Insert(int id, String name) {
+ if (stmt_insert == null) stmt_insert = conn.Stmt_insert(tbl_name, flds);
+ stmt_insert.Clear().Val_int(fld_id, id).Val_str(fld_name, name).Exec_insert();
+ }
+ public int Select_id(String name) {
+ if (stmt_select == null) stmt_select = conn.Stmt_select(tbl_name, flds, fld_name);
+ Db_rdr rdr = stmt_select.Clear().Crt_str(fld_name, name).Exec_select__rls_manual();
+ try {
+ return rdr.Move_next() ? rdr.Read_int(fld_id) : -1;
+ }
+ finally {rdr.Rls();}
+ }
+ public static Db_conn Get_conn_or_new(Io_url xowa_root) {
+ Io_url wmf_data_url = xowa_root.GenSubFil_nest("bin", "any", "xowa", "cfg", "wiki", "wmf_data.sqlite3");
+ Db_conn_bldr_data conn_data = Db_conn_bldr.I.Get_or_new(wmf_data_url);
+ Db_conn conn = conn_data.Conn();
+ if (conn_data.Created()) {
+ Xowmf_site_tbl site_tbl = new Xowmf_site_tbl(conn); site_tbl.Create_tbl();
+ Xowmf_ns_tbl itm_tbl = new Xowmf_ns_tbl(conn); itm_tbl.Create_tbl();
+ }
+ return conn;
+ }
+}
+class Xowmf_ns_tbl implements RlsAble {
+ private static final String tbl_name = "wmf_ns"; private final Db_meta_fld_list flds = new Db_meta_fld_list();
+ private final String fld_site_id, fld_id, fld_case, fld_name, fld_canonical;
+ private final Db_conn conn;
+ private Db_stmt stmt_insert, stmt_select;
+ public Xowmf_ns_tbl(Db_conn conn) {
+ this.conn = conn;
+ this.fld_site_id = flds.Add_int("site_id");
+ this.fld_id = flds.Add_int("ns_id");
+ this.fld_case = flds.Add_byte("ns_case");
+ this.fld_name = flds.Add_str("ns_name", 255);
+ this.fld_canonical = flds.Add_str("ns_canonical", 255);
+ 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_name(tbl_name, "main", fld_site_id, fld_id)));}
+ public void Delete_all() {conn.Stmt_delete(tbl_name, Db_meta_fld.Ary_empy).Exec_delete();}
+ public void Rls() {
+ stmt_insert = Db_stmt_.Rls(stmt_insert);
+ stmt_select = Db_stmt_.Rls(stmt_select);
+ }
+ public void Insert(int site_id, int id, byte case_match, byte[] name, byte[] canonical) {
+ if (stmt_insert == null) stmt_insert = conn.Stmt_insert(tbl_name, flds);
+ stmt_insert.Clear().Val_int(fld_site_id, site_id).Val_int(fld_id, id).Val_byte(fld_case, case_match).Val_bry_as_str(fld_name, name).Val_bry_as_str(fld_canonical, canonical).Exec_insert();
+ }
+ public void Select_all(Xow_ns_mgr rv, int site_id) {
+ if (stmt_select == null) stmt_select = conn.Stmt_select(tbl_name, flds, fld_site_id);
+ Db_rdr rdr = stmt_select.Clear().Crt_int(fld_site_id, site_id).Exec_select__rls_manual();
+ rv.Clear();
+ try {
+ while (rdr.Move_next()) {
+ rv.Add_new
+ ( rdr.Read_int (fld_id)
+ , rdr.Read_bry_by_str (fld_name)
+ , rdr.Read_byte (fld_case)
+ , Bool_.N);
+ }
+ }
+ finally {rdr.Rls();}
+ rv.Init();
+ }
+}
diff --git a/400_xowa/src/gplx/xowa/xtns/wdatas/specials/Wdata_itemByTitle_page.java b/400_xowa/src/gplx/xowa/xtns/wdatas/specials/Wdata_itemByTitle_page.java
index 2caac272b..2e71e6e6a 100644
--- a/400_xowa/src/gplx/xowa/xtns/wdatas/specials/Wdata_itemByTitle_page.java
+++ b/400_xowa/src/gplx/xowa/xtns/wdatas/specials/Wdata_itemByTitle_page.java
@@ -22,16 +22,16 @@ public class Wdata_itemByTitle_page implements Xows_page {
private static final byte[] Arg_site = Bry_.new_ascii_("site"), Arg_page = Bry_.new_ascii_("page");
public Bry_fmtr Html_fmtr() {return html_fmtr;}
private Wdata_itemByTitle_cfg cfg;
- public void Special_gen(Xoa_url calling_url, Xoae_page page, Xowe_wiki wiki, Xoa_ttl ttl) {
+ public void Special_gen(Xowe_wiki wiki, Xoae_page page, Xoa_url url, Xoa_ttl ttl) {
if (cfg == null) cfg = (Wdata_itemByTitle_cfg)wiki.Appe().Special_mgr().Get_or_null(Wdata_itemByTitle_cfg.Key);
// Special:ItemByTitle/enwiki/Earth -> www.wikidata.org/wiki/Q2
Gfo_usr_dlg usr_dlg = wiki.Appe().Usr_dlg();
byte[] site_bry = cfg.Site_default();
byte[] page_bry = Bry_.Empty;
byte[] raw_bry = ttl.Full_txt_wo_qarg(); // EX: enwiki/Earth
- int args_len = calling_url.Args().length;
+ int args_len = url.Args().length;
if (args_len > 0) {
- arg_hash.Load(calling_url);
+ arg_hash.Load(url);
site_bry = arg_hash.Get_val_bry_or(Arg_site, Bry_.Empty);
page_bry = arg_hash.Get_val_bry_or(Arg_page, Bry_.Empty);
}
diff --git a/400_xowa/src/gplx/xowa/xtns/wdatas/specials/Wdata_itemByTitle_page_tst.java b/400_xowa/src/gplx/xowa/xtns/wdatas/specials/Wdata_itemByTitle_page_tst.java
index 258bf5787..ca2f1be6f 100644
--- a/400_xowa/src/gplx/xowa/xtns/wdatas/specials/Wdata_itemByTitle_page_tst.java
+++ b/400_xowa/src/gplx/xowa/xtns/wdatas/specials/Wdata_itemByTitle_page_tst.java
@@ -65,7 +65,7 @@ class Wdata_itemByTitle_page_fxt {
page.Url_(url);
Xoa_ttl ttl = Xoa_ttl.parse_(wiki, Bry_.new_ascii_(link));
page.Ttl_(ttl);
- special_page.Special_gen(url, page, wiki, ttl);
+ special_page.Special_gen(wiki, page, url, ttl);
Tfds.Eq_str_lines(expd, String_.new_ascii_(page.Data_raw()));
}
public String Expd_html(String wmf_key, String ttl_str) {
diff --git a/400_xowa/src/gplx/xowa2/apps/Xoav_app.java b/400_xowa/src/gplx/xowa2/apps/Xoav_app.java
index cbdf99f58..75a8d4f0c 100644
--- a/400_xowa/src/gplx/xowa2/apps/Xoav_app.java
+++ b/400_xowa/src/gplx/xowa2/apps/Xoav_app.java
@@ -35,6 +35,7 @@ public class Xoav_app implements Xoa_app {
public Xowmf_mgr Wmf_mgr() {return wmf_mgr;} private final Xowmf_mgr wmf_mgr = new Xowmf_mgr();
public Bry_bfr_mkr Utl__bfr_mkr() {return Xoa_app_.Utl__bfr_mkr();}
public Url_encoder_mgr Utl__encoder_mgr() {return Xoa_app_.Utl__encoder_mgr();}
+ public boolean Xwiki_mgr__missing(byte[] domain) {return wiki_mgr.Get_by_domain(domain) == null;}
public Xoav_wiki_mgr Wiki_mgr() {return wiki_mgr;} private final Xoav_wiki_mgr wiki_mgr;
public Xoud_db_mgr User_data_mgr() {return user_data_mgr;} private Xoud_db_mgr user_data_mgr = new Xoud_db_mgr();
diff --git a/400_xowa/src/gplx/xowa2/apps/urls/Xoav_url_parser.java b/400_xowa/src/gplx/xowa2/apps/urls/Xoav_url_parser.java
index 94cc79de5..cf99bfa8c 100644
--- a/400_xowa/src/gplx/xowa2/apps/urls/Xoav_url_parser.java
+++ b/400_xowa/src/gplx/xowa2/apps/urls/Xoav_url_parser.java
@@ -17,10 +17,10 @@ along with this program. If not, see
.
*/
package gplx.xowa2.apps.urls; import gplx.*; import gplx.xowa2.*; import gplx.xowa2.apps.*;
public class Xoav_url_parser {
- private static final byte[] Bry_site = Bry_.new_ascii_("/site/"), Bry_wiki = Bry_.new_ascii_("/wiki/");
+ private static final byte[] Bry_site = Bry_.new_ascii_("/site/"), Bry_wiki = Bry_.new_ascii_("/wiki/"), Bry_http = Bry_.new_ascii_("http:");
public void Parse_xo_href(Xoav_url rv, byte[] src, byte[] cur_wiki_bry) {
rv.Clear();
- int pos = 5; // remove "http:"
+ int pos = Bry_.HasAtBgn(src, Bry_http) ? Bry_http.length : 0; // DRD: DRD:2.2 adds "http:" to all links
int src_len = src.length;
if (Bry_.HasAtBgn(src, Bry_site, pos, src_len))
pos = Parse_wiki(rv, src, src_len, pos);
diff --git a/400_xowa/src/gplx/xowa2/wikis/Xowv_wiki.java b/400_xowa/src/gplx/xowa2/wikis/Xowv_wiki.java
index 913334f2e..d5073f95e 100644
--- a/400_xowa/src/gplx/xowa2/wikis/Xowv_wiki.java
+++ b/400_xowa/src/gplx/xowa2/wikis/Xowv_wiki.java
@@ -17,10 +17,10 @@ along with this program. If not, see
.
*/
package gplx.xowa2.wikis; import gplx.*; import gplx.xowa2.*;
import gplx.core.primitives.*;
-import gplx.xowa.*; import gplx.xowa.wikis.xwikis.*; import gplx.xowa.langs.cases.*; import gplx.xowa.wikis.ttls.*; import gplx.xowa.html.hzips.*;
-import gplx.xowa.wikis.data.*;
+import gplx.xowa.*; import gplx.xowa.wikis.xwikis.*; import gplx.xowa.langs.cases.*; import gplx.xowa.wikis.ttls.*;
import gplx.xowa.files.*; import gplx.xowa.files.origs.*; import gplx.xowa.files.fsdb.*; import gplx.xowa.files.bins.*;
-import gplx.xowa.wikis.data.tbls.*; import gplx.dbs.*; import gplx.xowa.html.hdumps.*; import gplx.xowa.wikis.*; import gplx.xowa.files.repos.*;
+import gplx.xowa.wikis.*; import gplx.xowa.wikis.data.*; import gplx.xowa.files.repos.*; import gplx.xowa.wikis.data.tbls.*; import gplx.dbs.*;
+import gplx.xowa.html.wtrs.*; import gplx.xowa.html.hdumps.*; import gplx.xowa.html.hzips.*;
import gplx.xowa2.apps.*; import gplx.xowa2.wikis.specials.*; import gplx.xowa2.gui.*;
import gplx.fsdb.*; import gplx.fsdb.meta.*;
public class Xowv_wiki implements Xow_wiki, Xow_ttl_parser {
@@ -34,6 +34,7 @@ public class Xowv_wiki implements Xow_wiki, Xow_ttl_parser {
this.ns_mgr = Xow_ns_mgr_.default_(app.Utl_case_mgr());
this.html_mgr__hzip_mgr = new Xow_hzip_mgr(app.Usr_dlg(), this);
this.html_mgr__hdump_rdr = new Xohd_hdump_rdr(app, this);
+ this.html_mgr__lnki_wtr_utl = new Xoh_lnki_wtr_utl(this, new Xoh_href_parser(Xoa_app_.Utl__encoder_mgr().Url_ttl(), new Gfo_url_parser()));
this.xwiki_mgr = new Xow_xwiki_mgr();
this.special_mgr = new Xosp_special_mgr(this);
Io_url wiki_file_dir = domain_tid == Xow_domain_.Tid_int_home ? wiki_root_dir : wiki_root_dir.OwnerDir().OwnerDir().GenSubDir_nest("file", domain_str);
@@ -57,6 +58,7 @@ public class Xowv_wiki implements Xow_wiki, Xow_ttl_parser {
public boolean Html_mgr__hdump_enabled() {return Bool_.Y;}
public Xow_hzip_mgr Html_mgr__hzip_mgr() {return html_mgr__hzip_mgr;} private final Xow_hzip_mgr html_mgr__hzip_mgr;
public Xohd_hdump_rdr Html_mgr__hdump_rdr() {return html_mgr__hdump_rdr;} private final Xohd_hdump_rdr html_mgr__hdump_rdr;
+ public Xoh_lnki_wtr_utl Html_mgr__lnki_wtr_utl() {return html_mgr__lnki_wtr_utl;} private final Xoh_lnki_wtr_utl html_mgr__lnki_wtr_utl;
public Xol_lang Lang() {throw Err_.not_implemented_();}
public Xosp_special_mgr Special_mgr() {return special_mgr;} private Xosp_special_mgr special_mgr;
diff --git a/400_xowa/src_060_utl/gplx/Gfo_usr_dlg_ui_swt.java b/400_xowa/src_060_utl/gplx/Gfo_usr_dlg_ui_swt.java
index dd8eaee25..68db4f4ac 100644
--- a/400_xowa/src_060_utl/gplx/Gfo_usr_dlg_ui_swt.java
+++ b/400_xowa/src_060_utl/gplx/Gfo_usr_dlg_ui_swt.java
@@ -18,13 +18,12 @@ along with this program. If not, see
.
package gplx;
import gplx.core.strings.*; import gplx.gfui.*;
public class Gfo_usr_dlg_ui_swt implements Gfo_usr_dlg_ui, GfoInvkAble {
- Gfui_kit kit; GfuiInvkCmd cmd_sync; GfuiTextBox prog_box, info_box, warn_box;
+ private final GfuiInvkCmd cmd_sync; private final GfuiTextBox prog_box, info_box; private final Gfo_usr_dlg_ui_opt opt;
public Gfo_usr_dlg_ui_swt(Gfui_kit kit, GfuiTextBox prog_box, GfuiTextBox info_box, GfuiTextBox warn_box, Gfo_usr_dlg_ui_opt opt) {
- this.kit = kit;
- cmd_sync = kit.New_cmd_sync(this); // NOTE: cmd_sync needed else progress messages may be sent out of order
- this.prog_box = prog_box; this.info_box = info_box; this.warn_box = warn_box;
+ this.cmd_sync = kit.New_cmd_sync(this); // NOTE: cmd_sync needed else progress messages may be sent out of order
+ this.prog_box = prog_box; this.info_box = info_box;
this.opt = opt;
- } Gfo_usr_dlg_ui_opt opt;
+ }
public void Clear() {Write(Invk_write_prog, ""); info_box.Text_(""); info_box.ForeColor_(ColorAdp_.Black); info_box.BackColor_(ColorAdp_.White); info_box.Redraw(); info_box_is_warn = false;}
public String_ring Prog_msgs() {return prog_msgs;} String_ring prog_msgs = new String_ring().Max_(128);
public void Write_prog(String text) {Write(Invk_write_prog, text);}
diff --git a/400_xowa/src_120_wiki/gplx/xowa/Xow_ns_mgr.java b/400_xowa/src_120_wiki/gplx/xowa/Xow_ns_mgr.java
index 1f684c680..3dfba0b7b 100644
--- a/400_xowa/src_120_wiki/gplx/xowa/Xow_ns_mgr.java
+++ b/400_xowa/src_120_wiki/gplx/xowa/Xow_ns_mgr.java
@@ -224,6 +224,14 @@ public class Xow_ns_mgr implements GfoInvkAble, gplx.lists.ComparerAble {
private void Ords_sort_add(int ns_id) {
this.Add_new(ns_id, Bry_.XbyInt(ns_id), Xow_ns_case_.Id_1st, false); // NOTE: name and case_match are mostly useless defaults; note that in theory this proc should not be called (all siteInfos should be well-formed) but just in case, create items now so that Get_by_ord() does not fail
}
+ public byte[] Bld_ttl_w_ns(Bry_bfr bfr, boolean text_form, boolean literalize, int ns_id, byte[] ttl) {
+ if (ns_id == Xow_ns_.Id_main) return ttl;
+ Xow_ns ns = Ids_get_or_null(ns_id); if (ns == null) {Xoa_app_.Usr_dlg().Warn_many("", "", "ns_mgr:uknown ns_id; ns_id=~{0} ttl=~{1}", ns_id, ttl); return ttl;}
+ if (literalize) bfr.Add_byte(Byte_ascii.Colon); // NOTE: add : to literalize ns; EX: [[Category:A]] will get thrown into category list; [[:Category:A]] will print
+ bfr.Add(text_form ? ns.Name_txt_w_colon() : ns.Name_db_w_colon());
+ bfr.Add(ttl);
+ return bfr.Xto_bry_and_clear();
+ }
class Xow_ns_mgr_name_itm {
public Xow_ns_mgr_name_itm(byte[] name, Xow_ns ns) {this.name = name; this.name_len = name.length; this.ns = ns;}
public byte[] Name() {return name;} private byte[] name;
diff --git a/400_xowa/src_120_wiki/gplx/xowa/Xow_wiki.java b/400_xowa/src_120_wiki/gplx/xowa/Xow_wiki.java
index 416d5e58d..c07c6610c 100644
--- a/400_xowa/src_120_wiki/gplx/xowa/Xow_wiki.java
+++ b/400_xowa/src_120_wiki/gplx/xowa/Xow_wiki.java
@@ -17,10 +17,9 @@ along with this program. If not, see
.
*/
package gplx.xowa; import gplx.*;
import gplx.core.primitives.*;
-import gplx.xowa.wikis.*; import gplx.xowa.wikis.ttls.*;
-import gplx.xowa.wikis.data.*;
+import gplx.xowa.wikis.*; import gplx.xowa.wikis.ttls.*; import gplx.xowa.wikis.data.*;
import gplx.xowa.files.*; import gplx.xowa.files.repos.*; import gplx.xowa.files.origs.*; import gplx.xowa.files.bins.*; import gplx.fsdb.meta.*;
-import gplx.xowa.html.hzips.*; import gplx.xowa.html.hdumps.*;
+import gplx.xowa.html.wtrs.*; import gplx.xowa.html.hzips.*; import gplx.xowa.html.hdumps.*;
public interface Xow_wiki extends Xow_ttl_parser {
byte[] Domain_bry(); // EX: en.wikipedia.org
String Domain_str();
@@ -39,4 +38,5 @@ public interface Xow_wiki extends Xow_ttl_parser {
boolean Html_mgr__hdump_enabled();
Xow_hzip_mgr Html_mgr__hzip_mgr();
Xohd_hdump_rdr Html_mgr__hdump_rdr();
+ Xoh_lnki_wtr_utl Html_mgr__lnki_wtr_utl();
}
diff --git a/400_xowa/src_120_wiki/gplx/xowa/Xowe_wiki.java b/400_xowa/src_120_wiki/gplx/xowa/Xowe_wiki.java
index 4d1984122..93c094ded 100644
--- a/400_xowa/src_120_wiki/gplx/xowa/Xowe_wiki.java
+++ b/400_xowa/src_120_wiki/gplx/xowa/Xowe_wiki.java
@@ -22,7 +22,7 @@ import gplx.fsdb.*;
import gplx.xowa.wikis.data.*; import gplx.xowa.wikis.data.tbls.*;
import gplx.xowa.files.*; import gplx.xowa.files.repos.*; import gplx.xowa.files.origs.*; import gplx.xowa.files.bins.*; import gplx.fsdb.meta.*;
import gplx.xowa.langs.vnts.*; import gplx.xowa.gui.views.*; import gplx.xowa.wikis.xwikis.*;
-import gplx.xowa.html.hzips.*; import gplx.xowa.html.hdumps.*;
+import gplx.xowa.html.wtrs.*; import gplx.xowa.html.hzips.*; import gplx.xowa.html.hdumps.*;
import gplx.xowa.setup.maints.*; import gplx.xowa.wikis.caches.*;
import gplx.xowa.bldrs.xmls.*; import gplx.xowa.xtns.pfuncs.*;
import gplx.xowa.tdbs.*;
@@ -40,6 +40,7 @@ public class Xowe_wiki implements Xow_wiki, GfoInvkAble {
html_mgr = new Xow_html_mgr(this);
this.html_mgr__hdump_rdr = new Xohd_hdump_rdr(app, this);
this.html_mgr__hdump_wtr = new Xohd_hdump_wtr(app, this);
+ this.html_mgr__lnki_wtr_utl = new Xoh_lnki_wtr_utl(this, app.Href_parser());
tdb_fsys_mgr = new Xotdb_fsys_mgr(wiki_dir, ns_mgr);
xwiki_domain_tid = Xwiki_tid(domain_tid);
@@ -100,6 +101,7 @@ public class Xowe_wiki implements Xow_wiki, GfoInvkAble {
public Xow_hzip_mgr Html_mgr__hzip_mgr() {return html_mgr.Hzip_mgr();}
public Xohd_hdump_rdr Html_mgr__hdump_rdr() {return html_mgr__hdump_rdr;} private final Xohd_hdump_rdr html_mgr__hdump_rdr;
public Xohd_hdump_wtr Html_mgr__hdump_wtr() {return html_mgr__hdump_wtr;} private final Xohd_hdump_wtr html_mgr__hdump_wtr;
+ public Xoh_lnki_wtr_utl Html_mgr__lnki_wtr_utl() {return html_mgr__lnki_wtr_utl;} private final Xoh_lnki_wtr_utl html_mgr__lnki_wtr_utl;
public Xow_xwiki_mgr Xwiki_mgr() {return xwiki_mgr;} private final Xow_xwiki_mgr xwiki_mgr;
public int Xwiki_domain_tid() {return xwiki_domain_tid;} private int xwiki_domain_tid;
@@ -162,7 +164,8 @@ public class Xowe_wiki implements Xow_wiki, GfoInvkAble {
public Xoae_page GetPageByTtl(Xoa_url url, Xoa_ttl ttl, Xog_tab_itm tab) {return GetPageByTtl(url, ttl, lang, tab, true);}
public Xoae_page GetPageByTtl(Xoa_url url, Xoa_ttl ttl, Xol_lang lang, Xog_tab_itm tab, boolean parse_page) {
if (init_needed) Init_wiki(app.User());
- Xoae_page page = data_mgr.Get_page(url, ttl, false, false); // get page from data_mgr
+ Xoae_page page = Xoae_page.new_(this, ttl); page.Tab_data().Tab_(tab);
+ data_mgr.Get_page(page, url, ttl, false, false); // get page from data_mgr
if (page.Missing()) { // page doesn't exist
if (ttl.Ns().Id_file()) {
Xowe_wiki commons_wiki = app.Wiki_mgr().Get_by_key_or_null(commons_wiki_key);
@@ -174,7 +177,7 @@ public class Xowe_wiki implements Xow_wiki, GfoInvkAble {
return page.Missing_();
}
if (page.Missing()) return page; // NOTE: commons can return null page
- page.Tab_(tab);
+ page.Tab_data().Tab_(tab);
page.Lang_(lang);
if (parse_page)
ParsePage(page, false); // NOTE: do not clear page b/c reused for search
@@ -240,13 +243,7 @@ public class Xowe_wiki implements Xow_wiki, GfoInvkAble {
app.Wiki_mgr().Scripts().Exec(this);
Bry_fmtr.Null.Eval_mgr().Enabled_(true);
app.Css_installer().Install_assert(Bool_.Y, this, user.Fsys_mgr().Wiki_html_dir(domain_str));
- if (html_mgr__hdump_enabled) {
- // if (db_mgr.Tid() == Xodb_mgr_txt.Tid_txt) this.Db_mgr_create_as_sql();
- Xowd_html_tbl.Assert_col__page_html_db_id(Db_mgr_as_sql().Core_data_mgr()); // NOTE: must go above html_mgr.Init_by_wiki b/c Page_load will be done via messages
- this.Db_mgr_as_sql().Core_data_mgr().Tbl__page().Hdump_enabled_(html_mgr__hdump_enabled);
- html_mgr__hdump_rdr.Init_by_db(this.Data_mgr__core_mgr());
- html_mgr__hdump_wtr.Init_by_db(this.Data_mgr__core_mgr());
- }
+ Html_mgr__hdump_enabled_(html_mgr__hdump_enabled);
html_mgr.Init_by_wiki(this);
this.Copy_cfg(app.User().Wiki());
File_repos_assert(app, this);
@@ -255,6 +252,15 @@ public class Xowe_wiki implements Xow_wiki, GfoInvkAble {
app.Log_wtr().Log_msg_to_session_direct(log_bfr.Xto_str());
init_in_process = false;
}
+ private void Html_mgr__hdump_enabled_(boolean v) {
+ this.html_mgr__hdump_enabled = v;
+ if (html_mgr__hdump_enabled) {
+ // if (db_mgr.Tid() == Xodb_mgr_txt.Tid_txt) this.Db_mgr_create_as_sql();
+ Xowd_html_tbl.Assert_col__page_html_db_id(Db_mgr_as_sql().Core_data_mgr()); // NOTE: must go above html_mgr.Init_by_wiki b/c Page_load will be done via messages
+ html_mgr__hdump_rdr.Init_by_db(this.Data_mgr__core_mgr());
+ html_mgr__hdump_wtr.Init_by_db(this.Data_mgr__core_mgr());
+ }
+ }
public void Rls() {
if (rls_list == null) return;
int len = rls_list.Count();
@@ -291,7 +297,7 @@ public class Xowe_wiki implements Xow_wiki, GfoInvkAble {
else if (ctx.Match(k, Invk_maint)) return maint_mgr;
else if (ctx.Match(k, Invk_domain)) return domain_str;
else if (ctx.Match(k, Invk_xtns)) return xtn_mgr;
- else if (ctx.Match(k, Invk_hdump_enabled_)) html_mgr__hdump_enabled = m.ReadYn("v");
+ else if (ctx.Match(k, Invk_hdump_enabled_)) this.html_mgr__hdump_enabled = m.ReadYn("v");
else return GfoInvkAble_.Rv_unhandled;
return this;
}
diff --git a/400_xowa/src_121_wiki_data/gplx/xowa/Xow_data_mgr.java b/400_xowa/src_121_wiki_data/gplx/xowa/Xow_data_mgr.java
index 23cdf2156..6eff7e424 100644
--- a/400_xowa/src_121_wiki_data/gplx/xowa/Xow_data_mgr.java
+++ b/400_xowa/src_121_wiki_data/gplx/xowa/Xow_data_mgr.java
@@ -28,11 +28,15 @@ public class Xow_data_mgr implements GfoInvkAble {
public Xoae_page Get_page(Xoa_ttl ttl, boolean called_from_tmpl) {wiki.Appe().Url_parser().Parse(tmp_url, ttl.Raw()); return Get_page(tmp_url, ttl, called_from_tmpl, false);}
public Xoae_page Get_page_from_msg(Xoa_ttl ttl) {wiki.Appe().Url_parser().Parse(tmp_url, ttl.Raw()); return Get_page(tmp_url, ttl, false, true);}
public Xoae_page Get_page(Xoa_url url, Xoa_ttl ttl, boolean called_from_tmpl, boolean called_from_msg) {
+ Xoae_page rv = Xoae_page.new_(wiki, ttl);
+ return Get_page(rv, url, ttl, called_from_tmpl, called_from_msg);
+ }
+ public Xoae_page Get_page(Xoae_page rv, Xoa_url url, Xoa_ttl ttl, boolean called_from_tmpl, boolean called_from_msg) {
+ rv.Url_(url); // NOTE: must update page.Url(); should combine with Xoae_page.new_()
Xow_ns ns = ttl.Ns();
- Xoae_page rv = Xoae_page.new_(wiki, ttl); rv.Url_(url); // NOTE: must update page.Url(); should combine with Xoae_page.new_()
switch (ns.Id()) {
case Xow_ns_.Id_special:
- wiki.Special_mgr().Special_gen(url, rv, wiki, ttl);
+ wiki.Special_mgr().Special_gen(wiki, rv, url, ttl);
return rv;
case Xow_ns_.Id_mediawiki:
if ( !called_from_msg // if called from msg, fall through to actual data retrieval below, else infinite loop; DATE:2014-05-09
diff --git a/400_xowa/src_162_xfer/gplx/xowa/Xof_xfer_queue.java b/400_xowa/src_162_xfer/gplx/xowa/Xof_xfer_queue.java
index b86a2455d..280eb8981 100644
--- a/400_xowa/src_162_xfer/gplx/xowa/Xof_xfer_queue.java
+++ b/400_xowa/src_162_xfer/gplx/xowa/Xof_xfer_queue.java
@@ -63,7 +63,7 @@ public class Xof_xfer_queue {
}
private void Exec_v2(byte exec_tid, Gfo_usr_dlg wtr, Xowe_wiki wiki, Xoae_page page) {
wiki.File_mgr().Init_file_mgr_by_load(wiki);
- wiki.File_mgr().Fsdb_mgr().Fsdb_search_by_list(exec_tid, Xfer_itms_to_fsdb_itms(wiki, xfer_list, wiki.File_mgr().Patch_upright()), page, page.Tab().Html_itm());
+ wiki.File_mgr().Fsdb_mgr().Fsdb_search_by_list(exec_tid, Xfer_itms_to_fsdb_itms(wiki, xfer_list, wiki.File_mgr().Patch_upright()), page, page.Tab_data().Tab().Html_itm());
}
private ListAdp Xfer_itms_to_fsdb_itms(Xowe_wiki wiki, ListAdp xfer_list, int upright_patch) {
ListAdp rv = ListAdp_.new_();
@@ -77,8 +77,10 @@ public class Xof_xfer_queue {
fsdb.Ctor_by_orig(xfer.Orig_repo_id(), xfer.Orig_repo_name(), xfer.Orig_ttl(), xfer.Orig_ext(), xfer.Orig_w(), xfer.Orig_h(), xfer.Orig_redirect());
else { // NOTE: orig_ext doesn't exist; try to get again, b/c Xof_file_wkr won't get it; DATE:2015-04-05
Xof_orig_itm orig = wiki.File_mgr().Orig_mgr().Find_by_ttl_or_null(xfer.Lnki_ttl());
- gplx.xowa.files.repos.Xof_repo_pair repo_pair = wiki.File_mgr__repo_mgr().Repos_get_by_id(orig.Repo());
- fsdb.Ctor_by_orig(orig.Repo(), repo_pair.Trg().Wiki_key(), orig.Page(), orig.Ext(), orig.W(), orig.H(), orig.Redirect());
+ if (orig != null) {; // no orig;
+ gplx.xowa.files.repos.Xof_repo_pair repo_pair = wiki.File_mgr__repo_mgr().Repos_get_by_id(orig.Repo());
+ fsdb.Ctor_by_orig(orig.Repo(), repo_pair.Trg().Wiki_key(), orig.Page(), orig.Ext(), orig.W(), orig.H(), orig.Redirect());
+ }
}
fsdb.Html_uid_(xfer.Html_uid());
fsdb.Html_elem_tid_(xfer.Html_elem_tid());
diff --git a/400_xowa/src_240_install/gplx/xowa/Xoa_css_extractor.java b/400_xowa/src_240_install/gplx/xowa/Xoa_css_extractor.java
index 923d2b472..2034b909c 100644
--- a/400_xowa/src_240_install/gplx/xowa/Xoa_css_extractor.java
+++ b/400_xowa/src_240_install/gplx/xowa/Xoa_css_extractor.java
@@ -79,7 +79,7 @@ public class Xoa_css_extractor {
if ( core_db_mgr == null
|| core_db_mgr.Props() == null
|| core_db_mgr.Props().Schema_is_1()
- || !core_db_mgr.Tbl__cfg().Select_yn_or(Xow_cfg_consts.Grp__wiki_schema, Xow_cfg_consts.Key__schema__tbl_css_core, Bool_.N)
+ || !core_db_mgr.Tbl__cfg().Select_yn_or(Xow_cfg_consts.Grp__wiki_schema, Xowd_db_file_schema_props.Key__tbl_css_core, Bool_.N)
) return false;
Xowd_db_file core_db = core_db_mgr.Db__core();
gplx.xowa.html.css.Xowd_css_core_mgr.Get(core_db.Tbl__css_core(), core_db.Tbl__css_file(), wiki_html_dir);
diff --git a/400_xowa/src_240_install/gplx/xowa/Xoi_cmd_wiki_import.java b/400_xowa/src_240_install/gplx/xowa/Xoi_cmd_wiki_import.java
index ffda24dcf..88fa68588 100644
--- a/400_xowa/src_240_install/gplx/xowa/Xoi_cmd_wiki_import.java
+++ b/400_xowa/src_240_install/gplx/xowa/Xoi_cmd_wiki_import.java
@@ -63,7 +63,7 @@ class Xoi_cmd_wiki_import implements Gfo_thread_cmd {
bldr.Cmd_mgr().Add_cmd(wiki, Xob_cmd_keys.Key_text_cat_core);
bldr.Cmd_mgr().Add_cmd(wiki, Xob_cmd_keys.Key_text_cat_link);
}
- if (wiki.Appe().Setup_mgr().Dump_mgr().Search_version() == gplx.xowa.specials.search.Xosrh_core.Version_2)
+ if (wiki.Appe().Setup_mgr().Dump_mgr().Search_version() == gplx.xowa.specials.search.Xows_page__search.Version_2)
bldr.Cmd_mgr().Add_cmd(wiki, Xob_cmd_keys.Key_text_search_wkr);
bldr.Cmd_mgr().Add_cmd(wiki, Xob_cmd_keys.Key_text_term);
}
diff --git a/400_xowa/src_240_install/gplx/xowa/Xoi_cmd_wiki_tst.java b/400_xowa/src_240_install/gplx/xowa/Xoi_cmd_wiki_tst.java
index 9dea2c680..3ba24f0ce 100644
--- a/400_xowa/src_240_install/gplx/xowa/Xoi_cmd_wiki_tst.java
+++ b/400_xowa/src_240_install/gplx/xowa/Xoi_cmd_wiki_tst.java
@@ -124,836 +124,4 @@ public class Xoi_cmd_wiki_tst {
bfr.Add_str("app.bldr.wiki_cfg_bldr.run;").Add_byte_nl();
Io_mgr._.SaveFilStr("C:\\xowa_build_cfg.gfs", bfr.Xto_str());
}
- public static String[] Wikis = new String[]
-//{ "simple.wikipedia.org"
-//};
-{ "commons.wikimedia.org"
-, "species.wikimedia.org"
-, "meta.wikimedia.org"
-, "incubator.wikimedia.org"
-, "www.wikidata.org"
-, "www.mediawiki.org"
-, "wikimediafoundation.org"
-, "en.wikipedia.org"
-, "en.wiktionary.org"
-, "en.wikisource.org"
-, "en.wikibooks.org"
-, "en.wikiversity.org"
-, "en.wikiquote.org"
-, "en.wikinews.org"
-, "en.wikivoyage.org"
-, "de.wikipedia.org"
-, "de.wiktionary.org"
-, "de.wikisource.org"
-, "de.wikibooks.org"
-, "de.wikiversity.org"
-, "de.wikiquote.org"
-, "de.wikinews.org"
-, "de.wikivoyage.org"
-, "es.wikipedia.org"
-, "es.wiktionary.org"
-, "es.wikisource.org"
-, "es.wikibooks.org"
-, "es.wikiversity.org"
-, "es.wikiquote.org"
-, "es.wikinews.org"
-, "es.wikivoyage.org"
-, "fr.wikipedia.org"
-, "fr.wiktionary.org"
-, "fr.wikisource.org"
-, "fr.wikibooks.org"
-, "fr.wikiversity.org"
-, "fr.wikiquote.org"
-, "fr.wikinews.org"
-, "fr.wikivoyage.org"
-, "it.wikipedia.org"
-, "it.wiktionary.org"
-, "it.wikisource.org"
-, "it.wikibooks.org"
-, "it.wikiversity.org"
-, "it.wikiquote.org"
-, "it.wikinews.org"
-, "it.wikivoyage.org"
-, "ja.wikipedia.org"
-, "ja.wiktionary.org"
-, "ja.wikisource.org"
-, "ja.wikibooks.org"
-, "ja.wikiversity.org"
-, "ja.wikiquote.org"
-, "ja.wikinews.org"
-, "nl.wikipedia.org"
-, "nl.wiktionary.org"
-, "nl.wikisource.org"
-, "nl.wikibooks.org"
-, "nl.wikiquote.org"
-, "nl.wikinews.org"
-, "nl.wikivoyage.org"
-, "nl.wikimedia.org"
-, "pl.wikipedia.org"
-, "pl.wiktionary.org"
-, "pl.wikisource.org"
-, "pl.wikibooks.org"
-, "pl.wikiquote.org"
-, "pl.wikinews.org"
-, "pl.wikivoyage.org"
-, "pl.wikimedia.org"
-, "pt.wikipedia.org"
-, "pt.wiktionary.org"
-, "pt.wikisource.org"
-, "pt.wikibooks.org"
-, "pt.wikiversity.org"
-, "pt.wikiquote.org"
-, "pt.wikinews.org"
-, "pt.wikivoyage.org"
-, "ru.wikipedia.org"
-, "ru.wiktionary.org"
-, "ru.wikisource.org"
-, "ru.wikibooks.org"
-, "ru.wikiversity.org"
-, "ru.wikiquote.org"
-, "ru.wikinews.org"
-, "ru.wikivoyage.org"
-, "ru.wikimedia.org"
-, "ar.wikipedia.org"
-, "ar.wiktionary.org"
-, "ar.wikisource.org"
-, "ar.wikibooks.org"
-, "ar.wikiversity.org"
-, "ar.wikiquote.org"
-, "ar.wikinews.org"
-, "ar.wikimedia.org"
-, "ca.wikipedia.org"
-, "ca.wiktionary.org"
-, "ca.wikisource.org"
-, "ca.wikibooks.org"
-, "ca.wikiquote.org"
-, "ca.wikinews.org"
-, "ca.wikimedia.org"
-, "cs.wikipedia.org"
-, "cs.wiktionary.org"
-, "cs.wikisource.org"
-, "cs.wikibooks.org"
-, "cs.wikiversity.org"
-, "cs.wikiquote.org"
-, "cs.wikinews.org"
-, "da.wikipedia.org"
-, "da.wiktionary.org"
-, "da.wikisource.org"
-, "da.wikibooks.org"
-, "da.wikiquote.org"
-, "eo.wikipedia.org"
-, "eo.wiktionary.org"
-, "eo.wikisource.org"
-, "eo.wikibooks.org"
-, "eo.wikiquote.org"
-, "eo.wikinews.org"
-, "fa.wikipedia.org"
-, "fa.wiktionary.org"
-, "fa.wikisource.org"
-, "fa.wikibooks.org"
-, "fa.wikiquote.org"
-, "fa.wikinews.org"
-, "fa.wikivoyage.org"
-, "fi.wikipedia.org"
-, "fi.wiktionary.org"
-, "fi.wikisource.org"
-, "fi.wikibooks.org"
-, "fi.wikiversity.org"
-, "fi.wikiquote.org"
-, "fi.wikinews.org"
-, "fi.wikimedia.org"
-, "hu.wikipedia.org"
-, "hu.wiktionary.org"
-, "hu.wikisource.org"
-, "hu.wikibooks.org"
-, "hu.wikiquote.org"
-, "hu.wikinews.org"
-, "id.wikipedia.org"
-, "id.wiktionary.org"
-, "id.wikisource.org"
-, "id.wikibooks.org"
-, "id.wikiquote.org"
-, "kk.wikipedia.org"
-, "kk.wiktionary.org"
-, "kk.wikibooks.org"
-, "kk.wikiquote.org"
-, "ko.wikipedia.org"
-, "ko.wiktionary.org"
-, "ko.wikisource.org"
-, "ko.wikibooks.org"
-, "ko.wikiversity.org"
-, "ko.wikiquote.org"
-, "ko.wikinews.org"
-, "lt.wikipedia.org"
-, "lt.wiktionary.org"
-, "lt.wikisource.org"
-, "lt.wikibooks.org"
-, "lt.wikiquote.org"
-, "no.wikipedia.org"
-, "no.wiktionary.org"
-, "no.wikisource.org"
-, "no.wikibooks.org"
-, "no.wikiquote.org"
-, "no.wikinews.org"
-, "no.wikimedia.org"
-, "ro.wikipedia.org"
-, "ro.wiktionary.org"
-, "ro.wikisource.org"
-, "ro.wikibooks.org"
-, "ro.wikiquote.org"
-, "ro.wikinews.org"
-, "ro.wikivoyage.org"
-, "sk.wikipedia.org"
-, "sk.wiktionary.org"
-, "sk.wikisource.org"
-, "sk.wikibooks.org"
-, "sk.wikiquote.org"
-, "sr.wikipedia.org"
-, "sr.wiktionary.org"
-, "sr.wikisource.org"
-, "sr.wikibooks.org"
-, "sr.wikiquote.org"
-, "sr.wikinews.org"
-, "sv.wikipedia.org"
-, "sv.wiktionary.org"
-, "sv.wikisource.org"
-, "sv.wikibooks.org"
-, "sv.wikiversity.org"
-, "sv.wikiquote.org"
-, "sv.wikinews.org"
-, "sv.wikivoyage.org"
-, "tr.wikipedia.org"
-, "tr.wiktionary.org"
-, "tr.wikisource.org"
-, "tr.wikibooks.org"
-, "tr.wikiquote.org"
-, "tr.wikinews.org"
-, "tr.wikimedia.org"
-, "uk.wikipedia.org"
-, "uk.wiktionary.org"
-, "uk.wikisource.org"
-, "uk.wikibooks.org"
-, "uk.wikiquote.org"
-, "uk.wikinews.org"
-, "uk.wikivoyage.org"
-, "uk.wikimedia.org"
-, "vi.wikipedia.org"
-, "vi.wiktionary.org"
-, "vi.wikisource.org"
-, "vi.wikibooks.org"
-, "vi.wikiquote.org"
-, "vi.wikivoyage.org"
-, "zh.wikipedia.org"
-, "zh.wiktionary.org"
-, "zh.wikisource.org"
-, "zh.wikibooks.org"
-, "zh.wikiquote.org"
-, "zh.wikinews.org"
-, "zh.wikivoyage.org"
-, "bg.wikipedia.org"
-, "bg.wiktionary.org"
-, "bg.wikisource.org"
-, "bg.wikibooks.org"
-, "bg.wikiquote.org"
-, "bg.wikinews.org"
-, "el.wikipedia.org"
-, "el.wiktionary.org"
-, "el.wikisource.org"
-, "el.wikibooks.org"
-, "el.wikiversity.org"
-, "el.wikiquote.org"
-, "el.wikinews.org"
-, "el.wikivoyage.org"
-, "et.wikipedia.org"
-, "et.wiktionary.org"
-, "et.wikisource.org"
-, "et.wikibooks.org"
-, "et.wikiquote.org"
-, "et.wikimedia.org"
-, "eu.wikipedia.org"
-, "eu.wiktionary.org"
-, "eu.wikibooks.org"
-, "eu.wikiquote.org"
-, "gl.wikipedia.org"
-, "gl.wiktionary.org"
-, "gl.wikisource.org"
-, "gl.wikibooks.org"
-, "gl.wikiquote.org"
-, "he.wikipedia.org"
-, "he.wiktionary.org"
-, "he.wikisource.org"
-, "he.wikibooks.org"
-, "he.wikiquote.org"
-, "he.wikinews.org"
-, "he.wikivoyage.org"
-, "hr.wikipedia.org"
-, "hr.wiktionary.org"
-, "hr.wikisource.org"
-, "hr.wikibooks.org"
-, "hr.wikiquote.org"
-, "ms.wikipedia.org"
-, "ms.wiktionary.org"
-, "ms.wikibooks.org"
-, "nn.wikipedia.org"
-, "nn.wiktionary.org"
-, "nn.wikiquote.org"
-, "sh.wikipedia.org"
-, "sh.wiktionary.org"
-, "simple.wikipedia.org"
-, "simple.wiktionary.org"
-, "simple.wikibooks.org"
-, "simple.wikiquote.org"
-, "sl.wikipedia.org"
-, "sl.wiktionary.org"
-, "sl.wikisource.org"
-, "sl.wikibooks.org"
-, "sl.wikiversity.org"
-, "sl.wikiquote.org"
-, "th.wikipedia.org"
-, "th.wiktionary.org"
-, "th.wikisource.org"
-, "th.wikibooks.org"
-, "th.wikiquote.org"
-, "th.wikinews.org"
-, "vo.wikipedia.org"
-, "vo.wiktionary.org"
-, "vo.wikibooks.org"
-, "vo.wikiquote.org"
-, "hi.wikipedia.org"
-, "hi.wiktionary.org"
-, "hi.wikibooks.org"
-, "hi.wikiquote.org"
-, "ia.wikipedia.org"
-, "ia.wiktionary.org"
-, "ia.wikibooks.org"
-, "la.wikipedia.org"
-, "la.wiktionary.org"
-, "la.wikisource.org"
-, "la.wikibooks.org"
-, "la.wikiquote.org"
-, "aa.wikipedia.org"
-, "aa.wiktionary.org"
-, "aa.wikibooks.org"
-, "ab.wikipedia.org"
-, "ab.wiktionary.org"
-, "ace.wikipedia.org"
-, "af.wikipedia.org"
-, "af.wiktionary.org"
-, "af.wikibooks.org"
-, "af.wikiquote.org"
-, "ak.wikipedia.org"
-, "ak.wiktionary.org"
-, "ak.wikibooks.org"
-, "als.wikipedia.org"
-, "als.wiktionary.org"
-, "als.wikibooks.org"
-, "als.wikiquote.org"
-, "am.wikipedia.org"
-, "am.wiktionary.org"
-, "am.wikiquote.org"
-, "an.wikipedia.org"
-, "an.wiktionary.org"
-, "ang.wikipedia.org"
-, "ang.wiktionary.org"
-, "ang.wikisource.org"
-, "ang.wikibooks.org"
-, "ang.wikiquote.org"
-, "arc.wikipedia.org"
-, "arz.wikipedia.org"
-, "as.wikipedia.org"
-, "as.wiktionary.org"
-, "as.wikisource.org"
-, "as.wikibooks.org"
-, "ast.wikipedia.org"
-, "ast.wiktionary.org"
-, "ast.wikibooks.org"
-, "ast.wikiquote.org"
-, "av.wikipedia.org"
-, "av.wiktionary.org"
-, "ay.wikipedia.org"
-, "ay.wiktionary.org"
-, "ay.wikibooks.org"
-, "az.wikipedia.org"
-, "az.wiktionary.org"
-, "az.wikisource.org"
-, "az.wikibooks.org"
-, "az.wikiquote.org"
-, "ba.wikipedia.org"
-, "ba.wikibooks.org"
-, "bar.wikipedia.org"
-, "bat-smg.wikipedia.org"
-, "bcl.wikipedia.org"
-, "be.wikipedia.org"
-, "be.wiktionary.org"
-, "be.wikisource.org"
-, "be.wikibooks.org"
-, "be.wikiquote.org"
-, "be.wikimedia.org"
-, "be-x-old.wikipedia.org"
-, "bh.wikipedia.org"
-, "bh.wiktionary.org"
-, "bi.wikipedia.org"
-, "bi.wiktionary.org"
-, "bi.wikibooks.org"
-, "bjn.wikipedia.org"
-, "bm.wikipedia.org"
-, "bm.wiktionary.org"
-, "bm.wikibooks.org"
-, "bm.wikiquote.org"
-, "bn.wikipedia.org"
-, "bn.wiktionary.org"
-, "bn.wikisource.org"
-, "bn.wikibooks.org"
-, "bo.wikipedia.org"
-, "bo.wiktionary.org"
-, "bo.wikibooks.org"
-, "bpy.wikipedia.org"
-, "br.wikipedia.org"
-, "br.wiktionary.org"
-, "br.wikisource.org"
-, "br.wikiquote.org"
-, "br.wikimedia.org"
-, "bs.wikipedia.org"
-, "bs.wiktionary.org"
-, "bs.wikisource.org"
-, "bs.wikibooks.org"
-, "bs.wikiquote.org"
-, "bs.wikinews.org"
-, "bug.wikipedia.org"
-, "bxr.wikipedia.org"
-, "cbk-zam.wikipedia.org"
-, "cdo.wikipedia.org"
-, "ce.wikipedia.org"
-, "ceb.wikipedia.org"
-, "ch.wikipedia.org"
-, "ch.wiktionary.org"
-, "ch.wikibooks.org"
-, "cho.wikipedia.org"
-, "chr.wikipedia.org"
-, "chr.wiktionary.org"
-, "chy.wikipedia.org"
-, "ckb.wikipedia.org"
-, "co.wikipedia.org"
-, "co.wiktionary.org"
-, "co.wikibooks.org"
-, "co.wikiquote.org"
-, "co.wikimedia.org"
-, "cr.wikipedia.org"
-, "cr.wiktionary.org"
-, "cr.wikiquote.org"
-, "crh.wikipedia.org"
-, "csb.wikipedia.org"
-, "csb.wiktionary.org"
-, "cu.wikipedia.org"
-, "cv.wikipedia.org"
-, "cv.wikibooks.org"
-, "cy.wikipedia.org"
-, "cy.wiktionary.org"
-, "cy.wikisource.org"
-, "cy.wikibooks.org"
-, "cy.wikiquote.org"
-, "diq.wikipedia.org"
-, "dsb.wikipedia.org"
-, "dv.wikipedia.org"
-, "dv.wiktionary.org"
-, "dz.wikipedia.org"
-, "dz.wiktionary.org"
-, "ee.wikipedia.org"
-, "eml.wikipedia.org"
-, "ext.wikipedia.org"
-, "ff.wikipedia.org"
-, "fiu-vro.wikipedia.org"
-, "fj.wikipedia.org"
-, "fj.wiktionary.org"
-, "fo.wikipedia.org"
-, "fo.wiktionary.org"
-, "fo.wikisource.org"
-, "frp.wikipedia.org"
-, "frr.wikipedia.org"
-, "fur.wikipedia.org"
-, "fy.wikipedia.org"
-, "fy.wiktionary.org"
-, "fy.wikibooks.org"
-, "ga.wikipedia.org"
-, "ga.wiktionary.org"
-, "ga.wikibooks.org"
-, "ga.wikiquote.org"
-, "gag.wikipedia.org"
-, "gan.wikipedia.org"
-, "gd.wikipedia.org"
-, "gd.wiktionary.org"
-, "glk.wikipedia.org"
-, "gn.wikipedia.org"
-, "gn.wiktionary.org"
-, "gn.wikibooks.org"
-, "got.wikipedia.org"
-, "got.wikibooks.org"
-, "gu.wikipedia.org"
-, "gu.wiktionary.org"
-, "gu.wikisource.org"
-, "gu.wikibooks.org"
-, "gu.wikiquote.org"
-, "gv.wikipedia.org"
-, "gv.wiktionary.org"
-, "ha.wikipedia.org"
-, "ha.wiktionary.org"
-, "hak.wikipedia.org"
-, "haw.wikipedia.org"
-, "hif.wikipedia.org"
-, "ho.wikipedia.org"
-, "hsb.wikipedia.org"
-, "hsb.wiktionary.org"
-, "ht.wikipedia.org"
-, "ht.wikisource.org"
-, "hy.wikipedia.org"
-, "hy.wiktionary.org"
-, "hy.wikisource.org"
-, "hy.wikibooks.org"
-, "hy.wikiquote.org"
-, "hz.wikipedia.org"
-, "ie.wikipedia.org"
-, "ie.wiktionary.org"
-, "ie.wikibooks.org"
-, "ig.wikipedia.org"
-, "ii.wikipedia.org"
-, "ik.wikipedia.org"
-, "ik.wiktionary.org"
-, "ilo.wikipedia.org"
-, "io.wikipedia.org"
-, "io.wiktionary.org"
-, "is.wikipedia.org"
-, "is.wiktionary.org"
-, "is.wikisource.org"
-, "is.wikibooks.org"
-, "is.wikiquote.org"
-, "iu.wikipedia.org"
-, "iu.wiktionary.org"
-, "jbo.wikipedia.org"
-, "jbo.wiktionary.org"
-, "jv.wikipedia.org"
-, "jv.wiktionary.org"
-, "ka.wikipedia.org"
-, "ka.wiktionary.org"
-, "ka.wikibooks.org"
-, "ka.wikiquote.org"
-, "kaa.wikipedia.org"
-, "kab.wikipedia.org"
-, "kbd.wikipedia.org"
-, "kg.wikipedia.org"
-, "ki.wikipedia.org"
-, "kj.wikipedia.org"
-, "kl.wikipedia.org"
-, "kl.wiktionary.org"
-, "km.wikipedia.org"
-, "km.wiktionary.org"
-, "km.wikibooks.org"
-, "kn.wikipedia.org"
-, "kn.wiktionary.org"
-, "kn.wikisource.org"
-, "kn.wikibooks.org"
-, "kn.wikiquote.org"
-, "koi.wikipedia.org"
-, "kr.wikipedia.org"
-, "kr.wikiquote.org"
-, "krc.wikipedia.org"
-, "ks.wikipedia.org"
-, "ks.wiktionary.org"
-, "ks.wikibooks.org"
-, "ks.wikiquote.org"
-, "ksh.wikipedia.org"
-, "ku.wikipedia.org"
-, "ku.wiktionary.org"
-, "ku.wikibooks.org"
-, "ku.wikiquote.org"
-, "kv.wikipedia.org"
-, "kw.wikipedia.org"
-, "kw.wiktionary.org"
-, "kw.wikiquote.org"
-, "ky.wikipedia.org"
-, "ky.wiktionary.org"
-, "ky.wikibooks.org"
-, "ky.wikiquote.org"
-, "lad.wikipedia.org"
-, "lb.wikipedia.org"
-, "lb.wiktionary.org"
-, "lb.wikibooks.org"
-, "lb.wikiquote.org"
-, "lbe.wikipedia.org"
-, "lez.wikipedia.org"
-, "lg.wikipedia.org"
-, "li.wikipedia.org"
-, "li.wiktionary.org"
-, "li.wikisource.org"
-, "li.wikibooks.org"
-, "li.wikiquote.org"
-, "lij.wikipedia.org"
-, "lmo.wikipedia.org"
-, "ln.wikipedia.org"
-, "ln.wiktionary.org"
-, "ln.wikibooks.org"
-, "lo.wikipedia.org"
-, "lo.wiktionary.org"
-, "ltg.wikipedia.org"
-, "lv.wikipedia.org"
-, "lv.wiktionary.org"
-, "lv.wikibooks.org"
-, "mai.wikipedia.org"
-, "map-bms.wikipedia.org"
-, "mdf.wikipedia.org"
-, "mg.wikipedia.org"
-, "mg.wiktionary.org"
-, "mg.wikibooks.org"
-, "mh.wikipedia.org"
-, "mh.wiktionary.org"
-, "mhr.wikipedia.org"
-, "mi.wikipedia.org"
-, "mi.wiktionary.org"
-, "mi.wikibooks.org"
-, "min.wikipedia.org"
-, "mk.wikipedia.org"
-, "mk.wiktionary.org"
-, "mk.wikisource.org"
-, "mk.wikibooks.org"
-, "mk.wikimedia.org"
-, "ml.wikipedia.org"
-, "ml.wiktionary.org"
-, "ml.wikisource.org"
-, "ml.wikibooks.org"
-, "ml.wikiquote.org"
-, "mn.wikipedia.org"
-, "mn.wiktionary.org"
-, "mn.wikibooks.org"
-, "mo.wikipedia.org"
-, "mo.wiktionary.org"
-, "mr.wikipedia.org"
-, "mr.wiktionary.org"
-, "mr.wikisource.org"
-, "mr.wikibooks.org"
-, "mr.wikiquote.org"
-, "mrj.wikipedia.org"
-, "mt.wikipedia.org"
-, "mt.wiktionary.org"
-, "mus.wikipedia.org"
-, "mwl.wikipedia.org"
-, "my.wikipedia.org"
-, "my.wiktionary.org"
-, "my.wikibooks.org"
-, "myv.wikipedia.org"
-, "mzn.wikipedia.org"
-, "na.wikipedia.org"
-, "na.wiktionary.org"
-, "na.wikibooks.org"
-, "na.wikiquote.org"
-, "nah.wikipedia.org"
-, "nah.wiktionary.org"
-, "nah.wikibooks.org"
-, "nap.wikipedia.org"
-, "nds.wikipedia.org"
-, "nds.wiktionary.org"
-, "nds.wikibooks.org"
-, "nds.wikiquote.org"
-, "nds-nl.wikipedia.org"
-, "ne.wikipedia.org"
-, "ne.wiktionary.org"
-, "ne.wikibooks.org"
-, "new.wikipedia.org"
-, "ng.wikipedia.org"
-, "nov.wikipedia.org"
-, "nrm.wikipedia.org"
-, "nso.wikipedia.org"
-, "nv.wikipedia.org"
-, "ny.wikipedia.org"
-, "oc.wikipedia.org"
-, "oc.wiktionary.org"
-, "oc.wikibooks.org"
-, "om.wikipedia.org"
-, "om.wiktionary.org"
-, "or.wikipedia.org"
-, "or.wiktionary.org"
-, "or.wikisource.org"
-, "os.wikipedia.org"
-, "pa.wikipedia.org"
-, "pa.wiktionary.org"
-, "pa.wikibooks.org"
-, "pag.wikipedia.org"
-, "pam.wikipedia.org"
-, "pap.wikipedia.org"
-, "pcd.wikipedia.org"
-, "pdc.wikipedia.org"
-, "pfl.wikipedia.org"
-, "pi.wikipedia.org"
-, "pi.wiktionary.org"
-, "pih.wikipedia.org"
-, "pms.wikipedia.org"
-, "pnb.wikipedia.org"
-, "pnb.wiktionary.org"
-, "pnt.wikipedia.org"
-, "ps.wikipedia.org"
-, "ps.wiktionary.org"
-, "ps.wikibooks.org"
-, "qu.wikipedia.org"
-, "qu.wiktionary.org"
-, "qu.wikibooks.org"
-, "qu.wikiquote.org"
-, "rm.wikipedia.org"
-, "rm.wiktionary.org"
-, "rm.wikibooks.org"
-, "rmy.wikipedia.org"
-, "rn.wikipedia.org"
-, "rn.wiktionary.org"
-, "roa-rup.wikipedia.org"
-, "roa-rup.wiktionary.org"
-, "roa-tara.wikipedia.org"
-, "rue.wikipedia.org"
-, "rw.wikipedia.org"
-, "rw.wiktionary.org"
-, "sa.wikipedia.org"
-, "sa.wiktionary.org"
-, "sa.wikisource.org"
-, "sa.wikibooks.org"
-, "sa.wikiquote.org"
-, "sah.wikipedia.org"
-, "sah.wikisource.org"
-, "sc.wikipedia.org"
-, "sc.wiktionary.org"
-, "scn.wikipedia.org"
-, "scn.wiktionary.org"
-, "sco.wikipedia.org"
-, "sd.wikipedia.org"
-, "sd.wiktionary.org"
-, "sd.wikinews.org"
-, "se.wikipedia.org"
-, "se.wikibooks.org"
-, "se.wikimedia.org"
-, "sg.wikipedia.org"
-, "sg.wiktionary.org"
-, "si.wikipedia.org"
-, "si.wiktionary.org"
-, "si.wikibooks.org"
-, "sm.wikipedia.org"
-, "sm.wiktionary.org"
-, "sn.wikipedia.org"
-, "sn.wiktionary.org"
-, "so.wikipedia.org"
-, "so.wiktionary.org"
-, "sq.wikipedia.org"
-, "sq.wiktionary.org"
-, "sq.wikibooks.org"
-, "sq.wikiquote.org"
-, "sq.wikinews.org"
-, "srn.wikipedia.org"
-, "ss.wikipedia.org"
-, "ss.wiktionary.org"
-, "st.wikipedia.org"
-, "st.wiktionary.org"
-, "stq.wikipedia.org"
-, "su.wikipedia.org"
-, "su.wiktionary.org"
-, "su.wikibooks.org"
-, "su.wikiquote.org"
-, "sw.wikipedia.org"
-, "sw.wiktionary.org"
-, "sw.wikibooks.org"
-, "szl.wikipedia.org"
-, "ta.wikipedia.org"
-, "ta.wiktionary.org"
-, "ta.wikisource.org"
-, "ta.wikibooks.org"
-, "ta.wikiquote.org"
-, "ta.wikinews.org"
-, "te.wikipedia.org"
-, "te.wiktionary.org"
-, "te.wikisource.org"
-, "te.wikibooks.org"
-, "te.wikiquote.org"
-, "tet.wikipedia.org"
-, "tg.wikipedia.org"
-, "tg.wiktionary.org"
-, "tg.wikibooks.org"
-, "ti.wikipedia.org"
-, "ti.wiktionary.org"
-, "tk.wikipedia.org"
-, "tk.wiktionary.org"
-, "tk.wikibooks.org"
-, "tk.wikiquote.org"
-, "tl.wikipedia.org"
-, "tl.wiktionary.org"
-, "tl.wikibooks.org"
-, "tn.wikipedia.org"
-, "tn.wiktionary.org"
-, "to.wikipedia.org"
-, "to.wiktionary.org"
-, "tpi.wikipedia.org"
-, "tpi.wiktionary.org"
-, "ts.wikipedia.org"
-, "ts.wiktionary.org"
-, "tt.wikipedia.org"
-, "tt.wiktionary.org"
-, "tt.wikibooks.org"
-, "tt.wikiquote.org"
-, "tum.wikipedia.org"
-, "tw.wikipedia.org"
-, "tw.wiktionary.org"
-, "ty.wikipedia.org"
-, "tyv.wikipedia.org"
-, "udm.wikipedia.org"
-, "ug.wikipedia.org"
-, "ug.wiktionary.org"
-, "ug.wikibooks.org"
-, "ug.wikiquote.org"
-, "ur.wikipedia.org"
-, "ur.wiktionary.org"
-, "ur.wikibooks.org"
-, "ur.wikiquote.org"
-, "uz.wikipedia.org"
-, "uz.wiktionary.org"
-, "uz.wikibooks.org"
-, "uz.wikiquote.org"
-, "ve.wikipedia.org"
-, "ve.wikimedia.org"
-, "vec.wikipedia.org"
-, "vec.wiktionary.org"
-, "vec.wikisource.org"
-, "vep.wikipedia.org"
-, "vls.wikipedia.org"
-, "wa.wikipedia.org"
-, "wa.wiktionary.org"
-, "wa.wikibooks.org"
-, "war.wikipedia.org"
-, "wo.wikipedia.org"
-, "wo.wiktionary.org"
-, "wo.wikiquote.org"
-, "wuu.wikipedia.org"
-, "xal.wikipedia.org"
-, "xh.wikipedia.org"
-, "xh.wiktionary.org"
-, "xh.wikibooks.org"
-, "xmf.wikipedia.org"
-, "yi.wikipedia.org"
-, "yi.wiktionary.org"
-, "yi.wikisource.org"
-, "yo.wikipedia.org"
-, "yo.wiktionary.org"
-, "yo.wikibooks.org"
-, "za.wikipedia.org"
-, "za.wiktionary.org"
-, "za.wikibooks.org"
-, "za.wikiquote.org"
-, "zea.wikipedia.org"
-, "zh-classical.wikipedia.org"
-, "zh-min-nan.wikipedia.org"
-, "zh-min-nan.wiktionary.org"
-, "zh-min-nan.wikisource.org"
-, "zh-min-nan.wikibooks.org"
-, "zh-min-nan.wikiquote.org"
-, "zh-yue.wikipedia.org"
-, "zu.wikipedia.org"
-, "zu.wiktionary.org"
-, "zu.wikibooks.org"
-};
}
-//, "als.wikisource.org"
-//, "als.wikinews.org"
-//, "nds.wikinews.org"
-//, "ba.wiktionary.org"
-//, "tokipona.wikibooks.org"
diff --git a/400_xowa/src_240_install/gplx/xowa/Xoi_dump_mgr.java b/400_xowa/src_240_install/gplx/xowa/Xoi_dump_mgr.java
index b5834fa00..8df786116 100644
--- a/400_xowa/src_240_install/gplx/xowa/Xoi_dump_mgr.java
+++ b/400_xowa/src_240_install/gplx/xowa/Xoi_dump_mgr.java
@@ -30,7 +30,7 @@ public class Xoi_dump_mgr implements GfoInvkAble {
public boolean Css_wiki_update() {return css_wiki_update;} private boolean css_wiki_update = true;
public boolean Css_commons_download() {return css_commons_download;} private boolean css_commons_download = true; // changed from false to true; DATE:2014-10-19
public boolean Delete_xml_file() {return delete_xml_file;} private boolean delete_xml_file = true;
- public byte Search_version() {return search_version;} private byte search_version = gplx.xowa.specials.search.Xosrh_core.Version_2;
+ public byte Search_version() {return search_version;} private byte search_version = gplx.xowa.specials.search.Xows_page__search.Version_2;
public boolean Import_bz2_by_stdout() {return import_bz2_by_stdout;} private boolean import_bz2_by_stdout = true;
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk_server_urls)) return String_.Concat_with_str(",\n", server_urls);
diff --git a/400_xowa/src_300_html/gplx/xowa/Xoae_page.java b/400_xowa/src_300_html/gplx/xowa/Xoae_page.java
index 47130b869..ca27d0c82 100644
--- a/400_xowa/src_300_html/gplx/xowa/Xoae_page.java
+++ b/400_xowa/src_300_html/gplx/xowa/Xoae_page.java
@@ -30,7 +30,7 @@ public class Xoae_page implements Xoa_page {
public Xow_wiki Wiki() {return wiki;}
public Xoa_ttl Ttl() {return ttl;} public Xoae_page Ttl_(Xoa_ttl v) {ttl = v; url.Wiki_bry_(wiki.Domain_bry()).Page_bry_(v.Full_url()); return this;} private Xoa_ttl ttl;
public Xoa_url Url() {return url;} public Xoae_page Url_(Xoa_url v) {url = v; return this;} private Xoa_url url = Xoa_url.blank_();
- public void Xtn_gallery_packed_exists_y_() {html_data.Xtn_imap_exists_y_();}
+ public void Xtn_gallery_packed_exists_y_() {html_data.Xtn_gallery_packed_exists_y_();}
public boolean Exists() {return !Missing();}
public Xopg_revision_data Revision_data() {return revision_data;} private Xopg_revision_data revision_data = new Xopg_revision_data();
@@ -38,7 +38,7 @@ public class Xoae_page implements Xoa_page {
public Xopg_redlink_lnki_list Redlink_lnki_list() {return redlink_lnki_list;} private Xopg_redlink_lnki_list redlink_lnki_list;
public Xol_lang Lang() {return lang;} public Xoae_page Lang_(Xol_lang v) {lang = v; return this;} private Xol_lang lang;
public Xopg_html_data Html_data() {return html_data;} private Xopg_html_data html_data = new Xopg_html_data();
- public Xog_tab_itm Tab() {return tab;} public void Tab_(Xog_tab_itm v) {tab = v;} private Xog_tab_itm tab;
+ public Xopg_tab_data Tab_data() {return tab_data;} private final Xopg_tab_data tab_data = new Xopg_tab_data();
public Xopg_hdump_data Hdump_data() {return hdump_data;} private final Xopg_hdump_data hdump_data = new Xopg_hdump_data();
public boolean Missing() {return missing;} public Xoae_page Missing_() {return Missing_(true);} public Xoae_page Missing_(boolean v) {missing = v; return this;} private boolean missing;
public boolean Redirected() {return redirected;} public Xoae_page Redirected_(boolean v) {redirected = v; return this;} private boolean redirected;
@@ -89,6 +89,7 @@ public class Xoae_page implements Xoa_page {
slink_list.Clear();
html_data.Clear();
lnki_file_mgr.Clear();
+ tab_data.Clear();
pages_recursed = false;
tmpl_stack_ary = Bry_.Ary_empty;
tmpl_stack_ary_len = tmpl_stack_ary_max = 0;
diff --git a/400_xowa/src_300_html/gplx/xowa/Xop_link_parser.java b/400_xowa/src_300_html/gplx/xowa/Xop_link_parser.java
index b87b8f55b..11a60853c 100644
--- a/400_xowa/src_300_html/gplx/xowa/Xop_link_parser.java
+++ b/400_xowa/src_300_html/gplx/xowa/Xop_link_parser.java
@@ -29,7 +29,7 @@ public class Xop_link_parser {
case Xoo_protocol_itm.Tid_http: case Xoo_protocol_itm.Tid_https: // "http:" or "https:"; check if to offline wiki and redirect
byte[] wiki_bry = tmp_url.Wiki_bry(), page_bry = tmp_url.Page_bry();
if (Bry_.Eq(wiki_bry, wiki.Domain_bry()) // link is to this wiki; check if alias
- || app.Xwiki_exists(wiki_bry)) { // link is to an xwiki
+ || app.Xwiki_mgr__exists(wiki_bry)) { // link is to an xwiki
page_bry = tmp_url.Page_for_lnki();
Parse__ttl(tmp_bfr, wiki, wiki_bry, page_bry);
}
diff --git a/400_xowa/src_310_url/gplx/xowa/Xoh_href_parser.java b/400_xowa/src_310_url/gplx/xowa/Xoh_href_parser.java
index 44be7ecfa..41e2be900 100644
--- a/400_xowa/src_310_url/gplx/xowa/Xoh_href_parser.java
+++ b/400_xowa/src_310_url/gplx/xowa/Xoh_href_parser.java
@@ -72,10 +72,10 @@ public class Xoh_href_parser {
}
}
}
- public byte[] Build_to_bry(Xowe_wiki wiki, Xoa_ttl ttl) {Build_to_bfr(tmp_bfr, wiki, ttl, Bool_.N); return tmp_bfr.Xto_bry_and_clear();}
- public void Build_to_bfr(Bry_bfr bfr, Xowe_wiki wiki, byte[] raw) {Build_to_bfr(bfr, wiki, Xoa_ttl.parse_(wiki, raw), Bool_.N);}
- public void Build_to_bfr(Bry_bfr bfr, Xowe_wiki wiki, Xoa_ttl ttl) {Build_to_bfr(bfr, wiki, ttl, Bool_.N);}
- public void Build_to_bfr(Bry_bfr bfr, Xowe_wiki wiki, Xoa_ttl ttl, boolean force_site) {
+ public byte[] Build_to_bry(Xow_wiki wiki, Xoa_ttl ttl) {Build_to_bfr(tmp_bfr, wiki, ttl, Bool_.N); return tmp_bfr.Xto_bry_and_clear();}
+ public void Build_to_bfr(Bry_bfr bfr, Xow_wiki wiki, byte[] raw) {Build_to_bfr(bfr, wiki, wiki.Ttl_parse(raw), Bool_.N);}
+ public void Build_to_bfr(Bry_bfr bfr, Xow_wiki wiki, Xoa_ttl ttl) {Build_to_bfr(bfr, wiki, ttl, Bool_.N);}
+ public void Build_to_bfr(Bry_bfr bfr, Xow_wiki wiki, Xoa_ttl ttl, boolean force_site) {
byte[] page = ttl.Full_txt_raw();
Xow_xwiki_itm xwiki = ttl.Wik_itm();
if (xwiki == null) // not an xwiki; EX: [[wikt:Word]]
@@ -97,7 +97,7 @@ public class Xoh_href_parser {
else {} // anchor: noop
}
else { // xwiki
- if (wiki.Appe().Xwiki_missing(xwiki.Domain_bry())) { // xwiki is not offline; use http:
+ if (wiki.App().Xwiki_mgr__missing(xwiki.Domain_bry())) { // xwiki is not offline; use http:
bfr.Add(Href_http_bry); // add "http://"; EX: http://
bfr.Add(xwiki.Domain_bry()); // add xwiki; EX: en_dict
bfr.Add(Href_wiki_bry); // add "/wiki/"; EX: /wiki/
@@ -114,9 +114,9 @@ public class Xoh_href_parser {
int anch_bgn = Bry_finder.Find_fwd(ttl_full, Byte_ascii.Hash); // NOTE: cannot use Anch_bgn b/c Anch_bgn has bug with whitespace
if (anch_bgn == Bry_.NotFound) // no anchor; just add page
encoder.Encode(bfr_encoder, ttl_full, page_bgn, ttl_full.length);
- else { // anchor exists; check if anchor is preceded by ws; EX: [[A #b]] -> "/wiki/A#b"
+ else { // anchor exists; check if anchor is preceded by ws; EX: [[A #b]] -> "/wiki/A#b"
int page_end = Bry_finder.Find_bwd_last_ws(ttl_full, anch_bgn); // first 1st ws before #; handles multiple ws
- page_end = page_end == Bry_.NotFound ? anch_bgn : page_end; // if ws not found, use # pos; else use 1st ws pos
+ page_end = page_end == Bry_.NotFound ? anch_bgn : page_end; // if ws not found, use # pos; else use 1st ws pos
encoder.Encode(bfr_encoder, ttl_full, page_bgn, page_end); // add page
encoder.Encode(bfr_encoder, ttl_full, anch_bgn, ttl_full.length); // add anchor
}
@@ -130,9 +130,9 @@ public class Xoh_href_parser {
private static final byte[][] Seg__ary = new byte[][] {Seg_null_bry, Seg_wiki_bry, Seg_site_bry, Seg_xcmd_bry};
private static void Parse_wiki(Xoh_href rv, Url_encoder encoder, Xowe_wiki wiki, byte[] raw, int bgn, int len) {
byte[] ttl_raw = Bry_.Mid(raw, bgn, len);
- Xoa_ttl ttl = Xoa_ttl.parse_(wiki, ttl_raw);
+ Xoa_ttl ttl = wiki.Ttl_parse(ttl_raw);
if (ttl == null) {
- wiki.Appe().Usr_dlg().Warn_many("xowa.href.parser", "invalid_wiki", "wiki href does not have valid title: ~{0}", String_.new_utf8_(raw, bgn, len));
+ Xoa_app_.Usr_dlg().Warn_many("xowa.href.parser", "invalid_wiki", "wiki href does not have valid title: ~{0}", String_.new_utf8_(raw, bgn, len));
return;
}
if (ttl.Wik_itm() == null) { // standard href; EX: "/wiki/A"
@@ -174,12 +174,12 @@ public class Xoh_href_parser {
// rv.Qarg_(qarg_bry);
// page_bry = Bry_.Mid(page_bry, 0, qarg_pos);
// }
- Parse_ttl_and_resolve_xwiki(wiki.Appe().Usr_dlg(), rv, wiki, encoder, page_bry, raw, bgn, len);
+ Parse_ttl_and_resolve_xwiki(rv, wiki, encoder, page_bry, raw, bgn, len);
}
- private static void Parse_ttl_and_resolve_xwiki(Gfo_usr_dlg usr_dlg, Xoh_href rv, Xowe_wiki wiki, Url_encoder encoder, byte[] page_bry, byte[] raw, int bgn, int len) {
- Xoa_ttl ttl = Xoa_ttl.parse_(wiki, page_bry);
+ private static void Parse_ttl_and_resolve_xwiki(Xoh_href rv, Xowe_wiki wiki, Url_encoder encoder, byte[] page_bry, byte[] raw, int bgn, int len) {
+ Xoa_ttl ttl = wiki.Ttl_parse(page_bry);
if (ttl == null) {
- usr_dlg.Warn_many("xowa.href.parser", "invalid_wiki", "wiki href does not have valid title: ~{0}", String_.new_utf8_(raw, bgn, len));
+ Xoa_app_.Usr_dlg().Warn_many("xowa.href.parser", "invalid_wiki", "wiki href does not have valid title: ~{0}", String_.new_utf8_(raw, bgn, len));
rv.Page_(Bry_.Empty);
return;
}
@@ -198,7 +198,7 @@ public class Xoh_href_parser {
}
private static void Parse_xcmd(Xoh_href rv, Url_encoder encoder, Xowe_wiki wiki, byte[] raw, int bgn, int len) { // /xcmd/; note encoder is passed, but don't decode for now; most invk commands have an _ which will get changed to a " ";
rv.Tid_(Xoh_href.Tid_xcmd);
- rv.Wiki_(wiki.Domain_bry()); // wiki is always the current wiki
+ rv.Wiki_(wiki.Domain_bry()); // wiki is always the current wiki
rv.Page_(Bry_.Mid(raw, bgn, len)); // page is everything after "/xcmd/"; individual cmds will do further parsing; note that it should be decoded; EX: %20 -> " "; also note that anchor (#) or query params (?) are not parsed; the entire String will be reparsed later
}
private static final byte Protocol_xowa_tid = Xoo_protocol_itm.Tid_xowa;
diff --git a/tst/400_xowa/root/wiki/en.wikipedia.org/en.wikipedia.org-text.xowa b/tst/400_xowa/root/wiki/en.wikipedia.org/en.wikipedia.org-text.xowa
index f5cc044c2..3d493001e 100644
Binary files a/tst/400_xowa/root/wiki/en.wikipedia.org/en.wikipedia.org-text.xowa and b/tst/400_xowa/root/wiki/en.wikipedia.org/en.wikipedia.org-text.xowa differ