mirror of
https://github.com/gnosygnu/xowa.git
synced 2025-06-06 09:24:20 +00:00
Switch img_src and img_trg when loading from imglnk_reg
This commit is contained in:
parent
d983a32397
commit
8fc07752e9
@ -32,7 +32,7 @@ public class Xoa_app_ {
|
||||
}
|
||||
}
|
||||
public static final String Name = "xowa";
|
||||
public static final String Version = "3.10.3.2";
|
||||
public static final String Version = "3.10.3.3";
|
||||
public static String Build_date = "2012-12-30 00:00:00";
|
||||
public static String Op_sys_str;
|
||||
public static String User_agent = "";
|
||||
|
@ -19,6 +19,7 @@ package gplx.xowa.addons.bldrs.exports.packs.files; import gplx.*; import gplx.x
|
||||
import gplx.xowa.bldrs.*; import gplx.xowa.bldrs.wkrs.*;
|
||||
public class Pack_file_bldr_cfg implements Gfo_invk {
|
||||
public Io_url Deploy_dir() {return deploy_dir;} private Io_url deploy_dir;
|
||||
public boolean Pack_text() {return pack_text;} private boolean pack_text = false;
|
||||
public boolean Pack_html() {return pack_html;} private boolean pack_html = true;
|
||||
public boolean Pack_file() {return pack_file;} private boolean pack_file = true;
|
||||
public boolean Pack_fsdb_delete() {return pack_fsdb_delete;} private boolean pack_fsdb_delete;
|
||||
@ -26,6 +27,7 @@ public class Pack_file_bldr_cfg implements Gfo_invk {
|
||||
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk__deploy_dir_)) deploy_dir = m.ReadIoUrl("v");
|
||||
else if (ctx.Match(k, Invk__pack_text_)) pack_text = m.ReadYn("v");
|
||||
else if (ctx.Match(k, Invk__pack_html_)) pack_html = m.ReadYn("v");
|
||||
else if (ctx.Match(k, Invk__pack_file_)) pack_file = m.ReadYn("v");
|
||||
else if (ctx.Match(k, Invk__pack_file_cutoff_)) pack_file_cutoff = m.ReadDate("v");
|
||||
@ -34,7 +36,7 @@ public class Pack_file_bldr_cfg implements Gfo_invk {
|
||||
return this;
|
||||
}
|
||||
private static final String Invk__deploy_dir_ = "deploy_dir_"
|
||||
, Invk__pack_html_ = "pack_html_", Invk__pack_file_ = "pack_file_", Invk__pack_file_cutoff_ = "pack_file_cutoff_"
|
||||
, Invk__pack_text_ = "pack_text_", Invk__pack_html_ = "pack_html_", Invk__pack_file_ = "pack_file_", Invk__pack_file_cutoff_ = "pack_file_cutoff_"
|
||||
, Invk__pack_fsdb_delete_ = "pack_fsdb_delete_"
|
||||
;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public class Pack_file_mgr {
|
||||
Io_url pack_dir = wiki_dir.GenSubDir_nest("tmp", "pack");
|
||||
Io_mgr.Instance.DeleteDirDeep(pack_dir); Io_mgr.Instance.CreateDirIfAbsent(pack_dir);
|
||||
String wiki_date = wiki.Props().Modified_latest().XtoStr_fmt("yyyy.MM");
|
||||
Pack_hash hash = Pack_hash_bldr.Bld(wiki, wiki_dir, pack_dir, wiki_date, cfg.Pack_html(), cfg.Pack_file(), cfg.Pack_file_cutoff(), cfg.Pack_fsdb_delete());
|
||||
Pack_hash hash = Pack_hash_bldr.Bld(wiki, wiki_dir, pack_dir, wiki_date, cfg.Pack_text(), cfg.Pack_html(), cfg.Pack_file(), cfg.Pack_file_cutoff(), cfg.Pack_fsdb_delete());
|
||||
|
||||
// get import_tbl
|
||||
byte[] wiki_abrv = wiki.Domain_itm().Abrv_xo();
|
||||
@ -169,7 +169,7 @@ public class Pack_file_mgr {
|
||||
}
|
||||
}
|
||||
class Pack_hash_bldr {
|
||||
public static Pack_hash Bld(Xow_wiki wiki, Io_url wiki_dir, Io_url pack_dir, String wiki_date, boolean pack_html, boolean pack_file, DateAdp pack_file_cutoff, boolean pack_fsdb_delete) {
|
||||
public static Pack_hash Bld(Xow_wiki wiki, Io_url wiki_dir, Io_url pack_dir, String wiki_date, boolean pack_text, boolean pack_html, boolean pack_file, DateAdp pack_file_cutoff, boolean pack_fsdb_delete) {
|
||||
Pack_hash rv = new Pack_hash();
|
||||
Pack_zip_name_bldr zip_name_bldr = new Pack_zip_name_bldr(pack_dir, wiki.Domain_str(), String_.new_a7(wiki.Domain_itm().Abrv_wm()), wiki_date);
|
||||
Xow_db_mgr db_mgr = wiki.Data__core_mgr();
|
||||
@ -186,6 +186,17 @@ class Pack_hash_bldr {
|
||||
rv.Consolidate(Xobc_import_type.Tid__wiki__srch);
|
||||
}
|
||||
|
||||
// bld text pack
|
||||
if (pack_text) {
|
||||
int len = db_mgr.Dbs__len();
|
||||
for (int i = 0; i < len; ++i) {
|
||||
Xow_db_file file = db_mgr.Dbs__get_at(i);
|
||||
int pack_tid = Get_pack_tid(file.Tid());
|
||||
if (pack_tid == Xobc_import_type.Tid__ignore) continue;
|
||||
rv.Add(zip_name_bldr, pack_tid, file.Url());
|
||||
}
|
||||
}
|
||||
|
||||
// bld file pack
|
||||
if (pack_file) {
|
||||
Fsm_mnt_itm mnt_itm = wiki.File__mnt_mgr().Mnts__get_at(Fsm_mnt_mgr.Mnt_idx_main);
|
||||
@ -228,6 +239,7 @@ class Pack_hash_bldr {
|
||||
case Xow_db_file_.Tid__file_core: return Xobc_import_type.Tid__file__core;
|
||||
case Xow_db_file_.Tid__file_solo:
|
||||
case Xow_db_file_.Tid__file_data: return Xobc_import_type.Tid__file__data;
|
||||
case Xow_db_file_.Tid__text: return Xobc_import_type.Tid__wiki__text;
|
||||
default: return Xobc_import_type.Tid__ignore;
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ class Xomp_html_db_wtr {
|
||||
private int prv_ns_id = -1;
|
||||
private Xow_db_file html_db; private Xowd_html_tbl html_tbl;
|
||||
private Xob_ns_file_itm ns_itm;
|
||||
public Xomp_html_db_wtr(Xowe_wiki wiki) {
|
||||
public Xomp_html_db_wtr(Xowe_wiki wiki, boolean reset_html_dbs) {
|
||||
this.wiki = wiki; this.db_mgr = wiki.Data__core_mgr();
|
||||
this.len_max = wiki.Appe().Api_root().Bldr().Wiki().Import().Html_db_max();
|
||||
|
||||
|
@ -34,7 +34,7 @@ class Xomp_make_html {
|
||||
|
||||
// init more
|
||||
Xomp_html_db_rdr html_db_rdr = new Xomp_html_db_rdr(wiki);
|
||||
Xomp_html_db_wtr html_db_wtr = new Xomp_html_db_wtr(wiki);
|
||||
Xomp_html_db_wtr html_db_wtr = new Xomp_html_db_wtr(wiki, true);
|
||||
Xowd_html_row src_row = new Xowd_html_row();
|
||||
|
||||
// loop xomp|page and generate html dbs
|
||||
|
@ -89,7 +89,7 @@ CREATE TABLE fsdb_regy
|
||||
);
|
||||
|
||||
--export fsdb_regy from file.make
|
||||
ATTACH 'simple.wikipedia.org-file-page_map.xowa' AS pfm_db;
|
||||
ATTACH 'en.wikipedia.org-file-page_map.xowa' AS pfm_db;
|
||||
INSERT INTO pfm_db.fsdb_regy SELECT * FROM fsdb_regy;
|
||||
CREATE INDEX fsdb_regy__main ON fsdb_regy (fsdb_fil_id, fsdb_thm_id);
|
||||
*/
|
||||
|
@ -49,11 +49,11 @@ public class Xof_orig_wkr__img_links_ {
|
||||
return rdr.Move_next()
|
||||
? new Xof_orig_itm
|
||||
( repo_id
|
||||
, img_trg
|
||||
, img_src // NOTE: was originally (incorrectly) img_trg; PAGE:en.v:Ani; DATE:2016-10-18
|
||||
, rdr.Read_int("img_ext_id")
|
||||
, rdr.Read_int("img_width")
|
||||
, rdr.Read_int("img_height")
|
||||
, img_src
|
||||
, img_trg // NOTE: was originally (incorrectly) img_src; PAGE:en.v:Ani; DATE:2016-10-18
|
||||
)
|
||||
: Xof_orig_itm.Null;
|
||||
} finally {rdr.Rls();}
|
||||
|
@ -60,8 +60,10 @@ public class Xob_page_delete_cmd extends Xob_cmd_base {
|
||||
Xow_db_file db_file = db_file_ary[i];
|
||||
switch (db_file.Tid()) {
|
||||
case Xow_db_file_.Tid__core: case Xow_db_file_.Tid__wiki_solo: case Xow_db_file_.Tid__text_solo:
|
||||
if (wiki.Data__core_mgr().Props().Layout_text().Tid_is_lot()) continue; // if mode is lot, then "core" db does not have text, cat, search; skip; DATE:2016-01-31
|
||||
db_file_is_text = db_file_is_cat = db_file_is_search = Bool_.Y; break;
|
||||
// if mode is lot, then "core" db does not have cat, search; skip; DATE:2016-01-31
|
||||
if (wiki.Data__core_mgr().Props().Layout_text().Tid_is_lot()) continue;
|
||||
db_file_is_cat = db_file_is_search = Bool_.Y; // do not set db_file_is_text to true; DATE:2016-10-18
|
||||
break;
|
||||
case Xow_db_file_.Tid__text: db_file_is_text = Bool_.Y; break;
|
||||
case Xow_db_file_.Tid__cat: db_file_is_cat = Bool_.Y; break;
|
||||
case Xow_db_file_.Tid__search_core: db_file_is_search = Bool_.Y; break;
|
||||
|
@ -27,7 +27,7 @@ public class Wdata_wiki_mgr implements Gfo_evt_itm, Gfo_invk {
|
||||
private final Xoae_app app;
|
||||
private final Wdata_prop_val_visitor prop_val_visitor;
|
||||
private final Wdata_doc_parser wdoc_parser_v1 = new Wdata_doc_parser_v1(), wdoc_parser_v2 = new Wdata_doc_parser_v2();
|
||||
private final Object thread_lock =new Object();
|
||||
private final Object thread_lock = new Object();
|
||||
private Wdata_hwtr_mgr hwtr_mgr;
|
||||
private final Bry_bfr tmp_bfr = Bry_bfr_.New_w_size(32);
|
||||
public Wdata_wiki_mgr(Xoae_app app) {
|
||||
|
Loading…
Reference in New Issue
Block a user