mirror of
https://github.com/gnosygnu/xowa.git
synced 2024-10-27 20:34:16 +00:00
Embeddable: Download interwiki map
This commit is contained in:
parent
ecc27daec8
commit
dc22c15895
@ -31,7 +31,7 @@ public class Xoa_app_ {
|
||||
}
|
||||
public static final String Name = "xowa";
|
||||
public static final int Version_id = 538;
|
||||
public static final String Version = "4.5.16.1709";
|
||||
public static final String Version = "4.5.17.1710";
|
||||
public static String Build_date = "2012-12-30 00:00:00";
|
||||
public static String Build_date_fmt = "yyyy-MM-dd HH:mm:ss";
|
||||
public static String Op_sys_str;
|
||||
|
@ -59,6 +59,7 @@ public interface Xow_wiki extends Xow_ttl_parser, Gfo_invk {
|
||||
Io_stream_zip_mgr Utl__zip_mgr();
|
||||
Xow_url_parser Utl__url_parser();
|
||||
Xoax_addon_mgr Addon_mgr();
|
||||
boolean Embeddable_enabled(); void Embeddable_enabled_(boolean v);
|
||||
void Init_needed_y_();
|
||||
void Rls();
|
||||
}
|
||||
|
@ -124,6 +124,7 @@ public class Xowe_wiki implements Xow_wiki, Gfo_invk, Gfo_evt_itm {
|
||||
public Xowe_page_mgr Page_mgr() {return page_mgr;} private final Xowe_page_mgr page_mgr;
|
||||
public Xop_sanitizer Sanitizer() {return sanitizer;} private final Xop_sanitizer sanitizer;
|
||||
public byte[] Wtxt__expand_tmpl(byte[] src) {return parser_mgr.Main().Expand_tmpl(src);}
|
||||
public boolean Embeddable_enabled() {return embeddable_enabled;} public void Embeddable_enabled_(boolean v) {this.embeddable_enabled = v;} private boolean embeddable_enabled;
|
||||
|
||||
|
||||
public Xow_hdump_mgr Html__hdump_mgr() {return html__hdump_mgr;} private final Xow_hdump_mgr html__hdump_mgr;
|
||||
|
@ -44,7 +44,16 @@ public class Xop_mediawiki_mgr {
|
||||
public Xop_mediawiki_wkr Make(String domain_str, Xop_mediawiki_loader loader) {
|
||||
Xowe_wiki wiki = (Xowe_wiki)app.Wiki_mgr().Make(Bry_.new_u8(domain_str), app.Fsys_mgr().Wiki_dir());
|
||||
if (mode_is_prod) {
|
||||
wiki.Embeddable_enabled_(true); // must mark wiki as embeddable, else orig_mgr will load wkrs which will download images DATE:2017-10-23
|
||||
wiki.Init_by_wiki();
|
||||
|
||||
// init setup data; xowa_cfg|interwikimap and ns_msg; DATE:2017-10-23
|
||||
if (gplx.xowa.wikis.data.Xow_db_file__core_.Find_core_fil_or_null(wiki) == null) { // only run if file does not exist
|
||||
Xowe_wiki_.Create(wiki, 0, "embeddeable_parser");
|
||||
wiki.App().Site_cfg_mgr().Load(wiki); // load interwikimap et al from WM API
|
||||
wiki.Db_mgr_as_sql().Core_data_mgr().Db__core().Tbl__ns().Insert(wiki.Ns_mgr()); // save ns to xowa_ns
|
||||
}
|
||||
|
||||
wiki.File_mgr().Version_2_y_(); // must set to version_2 else video files will use old v1 Meta_code; DATE:2017-01-26
|
||||
wiki.File_mgr().Fsdb_mode().Tid__v2__mp__y_(); // must set to mass_parse mode, else will use old v1 Meta_code for xfer_itm and url_bldr; DATE:2017-01-26
|
||||
}
|
||||
|
@ -17,15 +17,15 @@ package gplx.xowa.files; import gplx.*; import gplx.xowa.*;
|
||||
public class Xof_fsdb_mode {
|
||||
private int tid;
|
||||
Xof_fsdb_mode(int tid) {this.tid = tid;}
|
||||
public boolean Tid__v2__bld() {return tid == TID__v2__bld;}
|
||||
public void Tid__v2__bld__y_() {tid = TID__v2__bld;}
|
||||
public void Tid__v2__mp__y_() {tid = TID__v2__mp;}
|
||||
public boolean Tid__bld() {return tid > TID__v2__gui;}
|
||||
public boolean Tid__v2__bld() {return tid == TID__v2__bld;}
|
||||
public void Tid__v2__bld__y_() {tid = TID__v2__bld;}
|
||||
public void Tid__v2__mp__y_() {tid = TID__v2__mp;}
|
||||
public boolean Tid__bld() {return tid > TID__v2__gui;}
|
||||
private static final int
|
||||
TID__v0 = 1
|
||||
, TID__v2__gui = 2
|
||||
, TID__v2__bld = 3
|
||||
, TID__v2__mp = 4
|
||||
TID__v0 = 1
|
||||
, TID__v2__gui = 2
|
||||
, TID__v2__bld = 3
|
||||
, TID__v2__mp = 4
|
||||
;
|
||||
public static Xof_fsdb_mode New__v0() {return new Xof_fsdb_mode(TID__v0);}
|
||||
public static Xof_fsdb_mode New__v2__gui() {return new Xof_fsdb_mode(TID__v2__gui);}
|
||||
|
@ -53,6 +53,7 @@ public class Xow_file_mgr implements Gfo_invk {
|
||||
public boolean Version_2_y() {return this.Version() == Version_2;}
|
||||
public void Version_1_y_() {version = Version_1;} // TEST:
|
||||
public void Version_2_y_() {version = Version_2; fsdb_mode = Xof_fsdb_mode.New__v2__gui();} // TEST:
|
||||
|
||||
public void Fsdb_mgr_(Xof_fsdb_mgr fsdb_mgr) {
|
||||
this.fsdb_mgr = fsdb_mgr;
|
||||
version = Version_2;
|
||||
|
@ -23,6 +23,11 @@ public class Xof_orig_mgr {
|
||||
public Xof_orig_mgr() {this.Wkrs__clear();}
|
||||
public void Init_by_wiki(Xow_wiki wiki, Xof_fsdb_mode fsdb_mode, Xof_orig_tbl[] orig_tbls, Xof_url_bldr url_bldr) {
|
||||
this.repo_mgr = wiki.File__repo_mgr(); this.url_bldr = url_bldr;
|
||||
|
||||
// if embeddable, do not load orig wkrs which will download images DATE:2017-10-23
|
||||
if (wiki.Embeddable_enabled())
|
||||
return;
|
||||
|
||||
// if (!fsdb_mode.Tid_v0()) { // add view,make; don't add if wmf
|
||||
int orig_tbls_len = orig_tbls.length;
|
||||
for (int i = 0; i < orig_tbls_len; ++i) {
|
||||
|
@ -93,6 +93,7 @@ public class Xowv_wiki implements Xow_wiki, Xow_ttl_parser, Gfo_invk {
|
||||
public Xosp_special_mgr Special_mgr() {return special_mgr;} private Xosp_special_mgr special_mgr;
|
||||
public Xow_xwiki_mgr Xwiki_mgr() {return xwiki_mgr;} private final Xow_xwiki_mgr xwiki_mgr;
|
||||
public Xoav_app Appv() {return app;} private final Xoav_app app;
|
||||
public boolean Embeddable_enabled() {return embeddable_enabled;} public void Embeddable_enabled_(boolean v) {this.embeddable_enabled = v;} private boolean embeddable_enabled;
|
||||
public void Init_by_wiki() {
|
||||
if (!init_needed) return;
|
||||
init_needed = false;
|
||||
|
Loading…
Reference in New Issue
Block a user