mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.4.2.1'
This commit is contained in:
@@ -59,7 +59,7 @@ public class Xob_bldr implements GfoInvkAble {
|
||||
if (prime == null) throw Err_.new_("bldr", "bldr.cmd does not exists: cmd={0}", key);
|
||||
byte[] wiki_key = cmd.Get_bry_or_null("wiki");
|
||||
Xowe_wiki wiki = wiki_key == null ? app.Usere().Wiki() : app.Wiki_mgr().Get_by_or_make(wiki_key);
|
||||
Xob_cmd clone = prime.Cmd_new(this, wiki);
|
||||
Xob_cmd clone = prime.Cmd_clone(this, wiki);
|
||||
int atrs_len = cmd.Len();
|
||||
for (int j = 0; j < atrs_len; ++j) {
|
||||
Json_kv atr_kv = cmd.Get_at_as_kv(j);
|
||||
|
||||
@@ -31,9 +31,9 @@ public class Xob_cmd_mgr implements GfoInvkAble {
|
||||
public Xob_cmd Get_at(int i) {return (Xob_cmd)list.Get_at(i);}
|
||||
public Xob_cmd Add(Xob_cmd cmd) {list.Add(cmd); return cmd;}
|
||||
public GfoInvkAble Add_cmd(Xowe_wiki wiki, String cmd_key) {
|
||||
Xob_cmd prototype = cmd_regy.Get_or_null(cmd_key);
|
||||
if (prototype != null) {
|
||||
Xob_cmd clone = prototype.Cmd_new(bldr, wiki);
|
||||
Xob_cmd prime = cmd_regy.Get_or_null(cmd_key);
|
||||
if (prime != null) {
|
||||
Xob_cmd clone = prime.Cmd_clone(bldr, wiki);
|
||||
Add(clone);
|
||||
return clone;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import gplx.dbs.*; import gplx.dbs.cfgs.*;
|
||||
public class Xob_db_file {
|
||||
Xob_db_file(Io_url url, Db_conn conn) {
|
||||
this.url = url; this.conn = conn;
|
||||
this.tbl__cfg = new Db_cfg_tbl(conn, "xowa_cfg");
|
||||
this.tbl__cfg = gplx.xowa.wikis.data.Xowd_cfg_tbl_.New(conn);
|
||||
}
|
||||
public Io_url Url() {return url;} private final Io_url url;
|
||||
public Db_conn Conn() {return conn;} private final Db_conn conn;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class Xob_page_wkr_cmd implements Xob_cmd {
|
||||
private final Xob_bldr bldr; private final Xowe_wiki wiki;
|
||||
public Xob_page_wkr_cmd(Xob_bldr bldr, Xowe_wiki wiki) {this.bldr = bldr; this.wiki = wiki;}
|
||||
public String Cmd_key() {return KEY;} public static final String KEY = "dump_mgr";
|
||||
public Xob_cmd Cmd_new(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
public Xob_cmd Cmd_clone(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
public void Cmd_run() {
|
||||
Xob_page_wkr[] wkr_ary = (Xob_page_wkr[])wkrs.To_ary(Xob_page_wkr.class); int wkr_ary_len = wkr_ary.length;
|
||||
for (int i = 0; i < wkr_ary_len; i++)
|
||||
|
||||
@@ -23,7 +23,7 @@ import gplx.xowa.bldrs.wtrs.*;
|
||||
public class Xob_category_registry_sql implements Xob_cmd {
|
||||
public Xob_category_registry_sql(Xob_bldr bldr, Xowe_wiki wiki) {this.wiki = wiki;} private Xowe_wiki wiki;
|
||||
public String Cmd_key() {return Xob_cmd_keys.Key_text_cat_core;}
|
||||
public Xob_cmd Cmd_new(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
public Xob_cmd Cmd_clone(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
public void Cmd_end() { // NOTE: placing in end, b/c must run *after* page_sql
|
||||
// setup
|
||||
wiki.Html_mgr().Importing_ctgs_(Bool_.Y);
|
||||
|
||||
@@ -23,7 +23,7 @@ public class Xob_diff_build_cmd implements Xob_cmd {
|
||||
private int[] db_ids = Int_.Ary_empty; private String bld_name = "all";
|
||||
public Xob_diff_build_cmd(Xob_bldr bldr, Xowe_wiki wiki) {this.bldr = bldr; this.wiki = wiki;}
|
||||
public String Cmd_key() {return Xob_cmd_keys.Key_diff_build;}
|
||||
public Xob_cmd Cmd_new(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
public Xob_cmd Cmd_clone(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
public void Cmd_run() {
|
||||
new Xob_diff_build_wkr(bldr, wiki, prev_url, curr_url, diff_url, commit_interval, new Xowd_tbl_mapr(bld_name, db_ids)).Exec();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ public abstract class Xob_init_base implements Xob_cmd, GfoInvkAble {
|
||||
private byte wbase_enabled = Bool_.__byte;
|
||||
public Xob_init_base Ctor(Xob_bldr bldr, Xowe_wiki wiki) {this.bldr = bldr; this.wiki = wiki; this.usr_dlg = wiki.Appe().Usr_dlg(); return this;}
|
||||
public abstract String Cmd_key();
|
||||
public Xob_cmd Cmd_new(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
public Xob_cmd Cmd_clone(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
public abstract void Cmd_ini_wdata(Xob_bldr bldr, Xowe_wiki wiki);
|
||||
public abstract void Cmd_run_end(Xowe_wiki wiki);
|
||||
@gplx.Virtual public void Cmd_init(Xob_bldr bldr) { // add other cmds; EX: wikidata
|
||||
|
||||
@@ -20,7 +20,7 @@ import gplx.xowa.bldrs.wkrs.*; import gplx.xowa.bldrs.xmls.*; import gplx.xowa.x
|
||||
public abstract class Xob_term_base implements Xob_cmd, GfoInvkAble {
|
||||
public Xob_term_base Ctor(Xob_bldr bldr, Xowe_wiki wiki) {this.wiki = wiki; return this;} private Xowe_wiki wiki;
|
||||
public abstract String Cmd_key();
|
||||
public Xob_cmd Cmd_new(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
public Xob_cmd Cmd_clone(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
public void Cmd_init(Xob_bldr bldr) {}
|
||||
public void Cmd_bgn(Xob_bldr bldr) {}
|
||||
public void Cmd_run() {}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class Xob_css_cmd implements Xob_cmd {
|
||||
private Io_url css_dir; private String css_key;
|
||||
public Xob_css_cmd(Xob_bldr bldr, Xowe_wiki wiki) {this.bldr = bldr; this.wiki = wiki; this.usr_dlg = wiki.Appe().Usr_dlg();}
|
||||
public String Cmd_key() {return Xob_cmd_keys.Key_text_css;}
|
||||
public Xob_cmd Cmd_new(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
public Xob_cmd Cmd_clone(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
public void Cmd_init(Xob_bldr bldr) {
|
||||
if (css_dir == null) css_dir = wiki.App().Fsys_mgr().Wiki_css_dir(wiki.Domain_str()); // EX: /xowa/user/anonymous/wiki/en.wikipedia.org
|
||||
if (css_key == null) css_key = Xowd_css_core_mgr.Key_default;
|
||||
|
||||
@@ -86,7 +86,7 @@ public class Xob_page_cmd extends Xob_itm_basic_base implements Xob_page_wkr, Gf
|
||||
Xowd_db_file db_core = db_mgr.Db__core();
|
||||
db_core.Tbl__site_stats().Update(page_count_main, page_count_all, ns_mgr.Ns_file().Count()); // save page stats
|
||||
db_core.Tbl__ns().Insert(ns_mgr); // save ns
|
||||
db_mgr.Tbl__cfg().Insert_str(Xow_cfg_consts.Grp__wiki_init, "props.modified_latest", modified_latest.XtoStr_fmt(DateAdp_.Fmt_iso8561_date_time));
|
||||
db_mgr.Tbl__cfg().Insert_str(Xow_cfg_consts.Grp__wiki_init, Xow_cfg_consts.Key__init__modified_latest, modified_latest.XtoStr_fmt(DateAdp_.Fmt_iso8561_date_time));
|
||||
if (idx_mode.Tid_is_end()) page_core_tbl.Create_index();
|
||||
if (redirect_id_enabled) {
|
||||
redirect_tbl.Conn().Txn_end();
|
||||
|
||||
@@ -36,5 +36,5 @@ public class Xob_alert_cmd extends Xob_cmd__base implements Xob_cmd {
|
||||
public static final String BLDR_CMD_KEY = "ui.alert";
|
||||
@Override public String Cmd_key() {return BLDR_CMD_KEY;}
|
||||
public static final Xob_cmd Prototype = new Xob_alert_cmd(null, null);
|
||||
@Override public Xob_cmd Cmd_new(Xob_bldr bldr, Xowe_wiki wiki) {return new Xob_alert_cmd(bldr, wiki);}
|
||||
@Override public Xob_cmd Cmd_clone(Xob_bldr bldr, Xowe_wiki wiki) {return new Xob_alert_cmd(bldr, wiki);}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import gplx.xowa.wikis.data.*; import gplx.xowa.wikis.dbs.*;
|
||||
public class Xob_exec_sql_cmd implements Xob_cmd {
|
||||
private Xowe_wiki wiki; private int file_idx = -1; private String sql;
|
||||
public Xob_exec_sql_cmd(Xob_bldr bldr, Xowe_wiki wiki) {this.wiki = wiki;}
|
||||
public Xob_cmd Cmd_new(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
public Xob_cmd Cmd_clone(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
public String Cmd_key() {return Xob_cmd_keys.Key_exec_sql;}
|
||||
public void Cmd_run() {
|
||||
Xoae_app app = wiki.Appe();
|
||||
|
||||
@@ -24,7 +24,7 @@ public class Xob_site_meta_cmd implements Xob_cmd {
|
||||
private final Xob_bldr bldr;
|
||||
private String[] wikis; private Io_url db_url; private DateAdp cutoff_time;
|
||||
public Xob_site_meta_cmd(Xob_bldr bldr, Xow_wiki wiki) {this.bldr = bldr;}
|
||||
public Xob_cmd Cmd_new(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
public Xob_cmd Cmd_clone(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
public String Cmd_key() {return Xob_cmd_keys.Key_site_meta;}
|
||||
public void Cmd_run() {
|
||||
Xoa_app app = bldr.App();
|
||||
|
||||
@@ -23,7 +23,7 @@ public class Xob_xml_dumper_cmd implements Xob_cmd {
|
||||
private final Xob_xml_dumper xml_dumper = new Xob_xml_dumper(); private int commit_interval = 1000;
|
||||
private Io_url dump_url;
|
||||
public Xob_xml_dumper_cmd(Xob_bldr bldr, Xowe_wiki wiki) {this.wiki = wiki; this.usr_dlg = wiki.Appe().Usr_dlg();}
|
||||
public Xob_cmd Cmd_new(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
public Xob_cmd Cmd_clone(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
public String Cmd_key() {return Xob_cmd_keys.Key_util_xml_dump;}
|
||||
public void Cmd_init(Xob_bldr bldr) {
|
||||
dump_url = wiki.Fsys_mgr().Root_dir().GenSubFil(wiki.Domain_str() + "-dump.xml");
|
||||
|
||||
@@ -119,8 +119,8 @@ public class Xoi_cmd_mgr implements GfoInvkAble {
|
||||
}
|
||||
public static final String[] Wiki_cmds_valid = new String[] {Xoi_cmd_wiki_download.Key_wiki_download, Xoi_cmd_wiki_unzip.KEY_dump, Xoi_cmd_wiki_import.KEY, Xoi_cmd_wiki_zip.KEY, Xoi_cmd_category2_build.KEY, Xoi_cmd_category2_page_props.KEY_category2, Xoi_cmd_category2_categorylinks.KEY_category2};
|
||||
public static final String Wiki_cmd_custom = "wiki.custom", Wiki_cmd_dump_file = "wiki.dump_file";
|
||||
public Gfo_thread_cmd Cmd_add(GfoMsg m) {Gfo_thread_cmd rv = Cmd_new(m); cmds.Add(rv); return rv;}
|
||||
Gfo_thread_cmd Cmd_new(GfoMsg m) {
|
||||
public Gfo_thread_cmd Cmd_add(GfoMsg m) {Gfo_thread_cmd rv = Cmd_clone(m); cmds.Add(rv); return rv;}
|
||||
Gfo_thread_cmd Cmd_clone(GfoMsg m) {
|
||||
String cmd_key = m.ReadStr("v");
|
||||
if (String_.Eq(cmd_key, Gfo_thread_cmd_download.KEY)) return new Gfo_thread_cmd_download().Init("downloading", m.ReadStr("src"), Bry_fmtr_eval_mgr_.Eval_url(app.Url_cmd_eval(), m.ReadBry("trg"))).Url_eval_mgr_(app.Url_cmd_eval()).Owner_(this).Ctor(app.Usr_dlg(), app.Gui_mgr().Kit());
|
||||
else if (String_.Eq(cmd_key, Gfo_thread_cmd_unzip.KEY)) return new Gfo_thread_cmd_unzip().Url_eval_mgr_(app.Url_cmd_eval()).Owner_(this).Init(app.Usr_dlg(), app.Gui_mgr().Kit(), app.Prog_mgr().App_decompress_bz2(), app.Prog_mgr().App_decompress_zip(), app.Prog_mgr().App_decompress_gz(), Bry_fmtr_eval_mgr_.Eval_url(app.Url_cmd_eval(), m.ReadBry("src")), Bry_fmtr_eval_mgr_.Eval_url(app.Url_cmd_eval(), m.ReadBry("trg")));
|
||||
|
||||
@@ -17,11 +17,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.bldrs.wkrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*;
|
||||
public interface Xob_cmd extends GfoInvkAble {
|
||||
String Cmd_key();
|
||||
Xob_cmd Cmd_new(Xob_bldr bldr, Xowe_wiki wiki);
|
||||
void Cmd_init(Xob_bldr bldr);
|
||||
void Cmd_bgn(Xob_bldr bldr);
|
||||
void Cmd_run();
|
||||
void Cmd_end();
|
||||
void Cmd_term();
|
||||
String Cmd_key();
|
||||
Xob_cmd Cmd_clone(Xob_bldr bldr, Xowe_wiki wiki);
|
||||
void Cmd_init(Xob_bldr bldr);
|
||||
void Cmd_bgn(Xob_bldr bldr);
|
||||
void Cmd_run();
|
||||
void Cmd_end();
|
||||
void Cmd_term();
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public abstract class Xob_cmd__base implements Xob_cmd, GfoInvkAble {
|
||||
this.usr_dlg = bldr == null ? null : bldr.Usr_dlg();
|
||||
}
|
||||
public abstract String Cmd_key();
|
||||
@gplx.Virtual public Xob_cmd Cmd_new(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
@gplx.Virtual public Xob_cmd Cmd_clone(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
public abstract void Cmd_run();
|
||||
@gplx.Virtual public void Cmd_init(Xob_bldr bldr) {}
|
||||
@gplx.Virtual public void Cmd_bgn(Xob_bldr bldr) {}
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.bldrs.wkrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*;
|
||||
public abstract class Xob_cmd_base implements Xob_cmd {
|
||||
public abstract String Cmd_key();
|
||||
@gplx.Virtual public Xob_cmd Cmd_new(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
@gplx.Virtual public Xob_cmd Cmd_clone(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
@gplx.Virtual public void Cmd_init(Xob_bldr bldr) {}
|
||||
@gplx.Virtual public void Cmd_bgn(Xob_bldr bldr) {}
|
||||
@gplx.Virtual public void Cmd_run() {}
|
||||
|
||||
@@ -26,7 +26,7 @@ public abstract class Xob_itm_basic_base implements GfoInvkAble {
|
||||
if (bldr != null && wiki != null)
|
||||
this.Cmd_ctor_end(bldr, wiki);
|
||||
}
|
||||
@gplx.Virtual public Xob_cmd Cmd_new(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
@gplx.Virtual public Xob_cmd Cmd_clone(Xob_bldr bldr, Xowe_wiki wiki) {return null;}
|
||||
@gplx.Virtual protected void Cmd_ctor_end(Xob_bldr bldr, Xowe_wiki wiki) {}
|
||||
@gplx.Virtual public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_owner)) return bldr.Cmd_mgr();
|
||||
|
||||
Reference in New Issue
Block a user