mirror of
https://github.com/gnosygnu/xowa.git
synced 2024-10-27 20:34:16 +00:00
Hdump: Show category at bottom of Category pages [#722]
This commit is contained in:
parent
94b757682a
commit
8c7c9f88ff
@ -1,25 +1,37 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.xowa.addons.parsers.mediawikis; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.parsers.*;
|
||||
import gplx.xowa.wikis.*; import gplx.xowa.parsers.*; import gplx.xowa.wikis.pages.*; import gplx.xowa.htmls.core.htmls.*;
|
||||
import gplx.xowa.wikis.caches.*;
|
||||
import gplx.xowa.addons.wikis.ctgs.htmls.pageboxs.*;
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2020 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.xowa.addons.parsers.mediawikis;
|
||||
|
||||
import gplx.Bry_;
|
||||
import gplx.Bry_bfr;
|
||||
import gplx.Bry_bfr_;
|
||||
import gplx.String_;
|
||||
import gplx.xowa.Xoa_ttl;
|
||||
import gplx.xowa.Xoae_page;
|
||||
import gplx.xowa.Xowe_wiki;
|
||||
import gplx.xowa.addons.wikis.ctgs.htmls.pageboxs.Xoctg_pagebox_itm;
|
||||
import gplx.xowa.htmls.core.htmls.Xoh_wtr_ctx;
|
||||
import gplx.xowa.parsers.Xop_ctx;
|
||||
import gplx.xowa.parsers.Xow_parser_mgr;
|
||||
import gplx.xowa.wikis.Xow_page_tid;
|
||||
import gplx.xowa.wikis.pages.Xopg_view_mode_;
|
||||
|
||||
public class Xop_mediawiki_wkr {
|
||||
private final Xowe_wiki wiki;
|
||||
private final Bry_bfr tmp_bfr = Bry_bfr_.New();
|
||||
private final Xowe_wiki wiki;
|
||||
private final Bry_bfr tmp_bfr = Bry_bfr_.New();
|
||||
public Xop_mediawiki_wkr(Xowe_wiki wiki, Xop_mediawiki_loader loader) {
|
||||
this.wiki = wiki;
|
||||
if (loader != null)
|
||||
@ -59,7 +71,7 @@ public class Xop_mediawiki_wkr {
|
||||
for (int i = 0; i < ctgs_len; i++) {
|
||||
pagebox_itms[i] = new Xoctg_pagebox_itm(wpg.Wtxt().Ctgs__get_at(i));
|
||||
}
|
||||
wiki.Ctg__pagebox_wtr().Write_pagebox(tmp_bfr, wiki, wpg, pagebox_itms);
|
||||
wiki.Ctg__pagebox_wtr().Write_pagebox(tmp_bfr, wpg, pagebox_itms);
|
||||
}
|
||||
|
||||
orig_bry = tmp_bfr.To_bry_and_clear();
|
||||
|
@ -1,34 +1,58 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.xowa.addons.wikis.ctgs.htmls.pageboxs; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.ctgs.*; import gplx.xowa.addons.wikis.ctgs.htmls.*;
|
||||
import gplx.xowa.htmls.core.htmls.*;
|
||||
import gplx.xowa.addons.wikis.ctgs.htmls.pageboxs.singles.*; import gplx.xowa.addons.wikis.ctgs.htmls.pageboxs.doubles.*;
|
||||
import gplx.xowa.wikis.data.*; import gplx.xowa.wikis.data.tbls.*; import gplx.xowa.addons.wikis.ctgs.dbs.*;
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2020 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.xowa.addons.wikis.ctgs.htmls.pageboxs;
|
||||
|
||||
import gplx.Bry_bfr;
|
||||
import gplx.Err_;
|
||||
import gplx.GfoMsg;
|
||||
import gplx.Gfo_invk;
|
||||
import gplx.Gfo_invk_;
|
||||
import gplx.Gfo_usr_dlg_;
|
||||
import gplx.GfsCtx;
|
||||
import gplx.Io_mgr;
|
||||
import gplx.xowa.Xoa_page;
|
||||
import gplx.xowa.Xow_wiki;
|
||||
import gplx.xowa.addons.wikis.ctgs.dbs.Xodb_cat_db_;
|
||||
import gplx.xowa.addons.wikis.ctgs.htmls.pageboxs.doubles.Xoctg_double_box;
|
||||
import gplx.xowa.addons.wikis.ctgs.htmls.pageboxs.singles.Xoctg_single_box;
|
||||
import gplx.xowa.wikis.data.Xow_db_file;
|
||||
import gplx.xowa.wikis.data.tbls.Xowd_cat_core_tbl;
|
||||
import gplx.xowa.wikis.data.tbls.Xowd_page_itm;
|
||||
|
||||
public class Xoctg_pagebox_wtr implements Gfo_invk {
|
||||
private final Xoctg_single_box single_box = new Xoctg_single_box();
|
||||
private final Xoctg_double_box double_box = new Xoctg_double_box();
|
||||
private final Xoctg_pagebox_hash hash = new Xoctg_pagebox_hash();
|
||||
private final Xowd_page_itm tmp_page_itm = new Xowd_page_itm();
|
||||
public boolean Grouping_enabled() {return grouping_enabled;} private boolean grouping_enabled;
|
||||
private final Xoctg_single_box single_box = new Xoctg_single_box();
|
||||
private final Xoctg_double_box double_box = new Xoctg_double_box();
|
||||
private Xow_wiki wiki;
|
||||
private boolean grouping_enabled;
|
||||
|
||||
public void Init_by_wiki(Xow_wiki wiki) {
|
||||
this.wiki = wiki;
|
||||
single_box.Init_by_wiki(wiki);
|
||||
double_box.Init_by_wiki(wiki);
|
||||
wiki.App().Cfg().Bind_many_wiki(this, wiki, Cfg__grouping_enabled);
|
||||
}
|
||||
public void Write_pagebox(Bry_bfr bfr, Xow_wiki wiki, Xoa_page page, Xoctg_pagebox_itm[] pagebox_itms) {
|
||||
|
||||
public void Write_pagebox(Bry_bfr bfr, Xoa_page page) {
|
||||
Xoctg_pagebox_itm[] itms = Get_catlinks_by_page(page);
|
||||
if (itms.length > 0) {
|
||||
this.Write_pagebox(bfr, page, itms);
|
||||
}
|
||||
}
|
||||
|
||||
public void Write_pagebox(Bry_bfr bfr, Xoa_page page, Xoctg_pagebox_itm[] pagebox_itms) {
|
||||
try {
|
||||
if (grouping_enabled)
|
||||
double_box.Write_pagebox(bfr, pagebox_itms);
|
||||
@ -38,20 +62,22 @@ public class Xoctg_pagebox_wtr implements Gfo_invk {
|
||||
Gfo_usr_dlg_.Instance.Warn_many("", "", "failed to write pagebox categories; page=~{0} err=~{1}", page.Url_bry_safe(), Err_.Message_gplx_log(e));
|
||||
}
|
||||
}
|
||||
public Xoctg_pagebox_itm[] Get_catlinks_by_page(Xow_wiki wiki, Xoa_page page) {
|
||||
|
||||
private Xoctg_pagebox_itm[] Get_catlinks_by_page(Xoa_page page) {
|
||||
// NOTE: db load is necessary b/c page.Wtxt().Ctgs__len() is insufficient
|
||||
// html_dbs will always be 0 since they do not parse ctgs;
|
||||
// wtxt_dbs may have page.Wtxt().Ctgs__len() > 0 but these items don't have Id / Hidden
|
||||
Xoctg_pagebox_hash hash = new Xoctg_pagebox_hash();
|
||||
Xoctg_pagebox_loader select_cbk = new Xoctg_pagebox_loader(hash, page.Url_bry_safe());
|
||||
|
||||
// get cat_db_id from page
|
||||
tmp_page_itm.Clear();
|
||||
boolean exists = wiki.Data__core_mgr().Tbl__page().Select_by_ttl(tmp_page_itm, page.Ttl().Ns(), page.Ttl().Page_db());
|
||||
int cat_db_id = tmp_page_itm.Cat_db_id();
|
||||
Xowd_page_itm pageRow = new Xowd_page_itm();
|
||||
boolean exists = wiki.Data__core_mgr().Tbl__page().Select_by_ttl(pageRow, page.Ttl().Ns(), page.Ttl().Page_db());
|
||||
int cat_db_id = pageRow.Cat_db_id();
|
||||
if (exists && cat_db_id != -1) {// note that wtxt_dbs can have 0 ctgs but will have cat_db_id == -1
|
||||
Xow_db_file cat_link_db = wiki.Data__core_mgr().Dbs__get_by_id_or_null(cat_db_id);
|
||||
if (cat_link_db != null && Io_mgr.Instance.ExistsFil(cat_link_db.Url())) { // make sure cat_db_id exists
|
||||
select_cbk.Select_catlinks_by_page(wiki, cat_link_db.Conn(), hash, tmp_page_itm.Id());
|
||||
select_cbk.Select_catlinks_by_page(wiki, cat_link_db.Conn(), hash, pageRow.Id());
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,6 +89,7 @@ public class Xoctg_pagebox_wtr implements Gfo_invk {
|
||||
}
|
||||
return hash.To_ary_and_clear();
|
||||
}
|
||||
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Cfg__grouping_enabled)) this.grouping_enabled = m.ReadYn("v");
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
|
@ -255,8 +255,7 @@ public class Xoh_page_wtr_wkr {
|
||||
&& !hctx.Mode_is_hdump() // do not dump categories during hdump; DATE:2016-10-12
|
||||
) {
|
||||
if (app.Mode().Tid_is_gui()) app.Usr_dlg().Prog_many("", "", "loading categories: count=~{0}", ctgs_len);
|
||||
Xoctg_pagebox_itm[] pagebox_itms = wiki.Ctg__pagebox_wtr().Get_catlinks_by_page(wiki, page);
|
||||
wiki.Ctg__pagebox_wtr().Write_pagebox(bfr, wiki, page, pagebox_itms);
|
||||
wiki.Ctg__pagebox_wtr().Write_pagebox(bfr, page);
|
||||
}
|
||||
|
||||
// translate if variants are enabled
|
||||
|
@ -1,24 +1,48 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.xowa.htmls.core; import gplx.*; import gplx.xowa.*; import gplx.xowa.htmls.*;
|
||||
import gplx.core.ios.*;
|
||||
import gplx.xowa.htmls.heads.*; import gplx.xowa.htmls.core.makes.*; import gplx.xowa.htmls.core.hzips.*;
|
||||
import gplx.xowa.wikis.*; import gplx.xowa.wikis.data.*; import gplx.xowa.wikis.data.tbls.*;
|
||||
import gplx.xowa.wikis.pages.*; import gplx.xowa.wikis.pages.skins.*; import gplx.xowa.wikis.pages.lnkis.*; import gplx.xowa.wikis.pages.htmls.*;
|
||||
import gplx.xowa.addons.wikis.ctgs.htmls.pageboxs.*;
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2020 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.xowa.htmls.core;
|
||||
|
||||
import gplx.Bool_;
|
||||
import gplx.Bry_;
|
||||
import gplx.Bry_bfr;
|
||||
import gplx.Bry_find_;
|
||||
import gplx.Byte_ascii;
|
||||
import gplx.GfoMsg;
|
||||
import gplx.Gfo_invk;
|
||||
import gplx.GfsCtx;
|
||||
import gplx.Hash_adp_bry;
|
||||
import gplx.Io_mgr;
|
||||
import gplx.Io_url;
|
||||
import gplx.core.ios.Io_stream_zip_mgr;
|
||||
import gplx.xowa.Xoa_ttl;
|
||||
import gplx.xowa.Xoae_page;
|
||||
import gplx.xowa.Xow_wiki;
|
||||
import gplx.xowa.htmls.Xoh_img_mgr;
|
||||
import gplx.xowa.htmls.Xoh_page;
|
||||
import gplx.xowa.htmls.core.hzips.Xoh_hzip_dict_;
|
||||
import gplx.xowa.htmls.core.hzips.Xoh_hzip_mgr;
|
||||
import gplx.xowa.htmls.core.makes.Xoh_make_mgr;
|
||||
import gplx.xowa.htmls.heads.Xoh_head_mgr;
|
||||
import gplx.xowa.wikis.data.Xow_db_file;
|
||||
import gplx.xowa.wikis.data.tbls.Xowd_page_itm;
|
||||
import gplx.xowa.wikis.pages.Xopg_module_mgr;
|
||||
import gplx.xowa.wikis.pages.htmls.Xopg_html_data;
|
||||
import gplx.xowa.wikis.pages.lnkis.Xopg_lnki_list;
|
||||
import gplx.xowa.wikis.pages.skins.Xopg_xtn_skin_itm_stub;
|
||||
|
||||
public class Xow_hdump_mgr__load implements Gfo_invk {
|
||||
private final Xow_wiki wiki; private final Xoh_hzip_mgr hzip_mgr; private final Io_stream_zip_mgr zip_mgr;
|
||||
private final Xoh_page tmp_hpg; private final Bry_bfr tmp_bfr; private final Xowd_page_itm tmp_dbpg = new Xowd_page_itm();
|
||||
@ -37,9 +61,9 @@ public class Xow_hdump_mgr__load implements Gfo_invk {
|
||||
wiki.Hxtn_mgr().Init_by_wiki(wiki, Bool_.N);
|
||||
make_mgr.Init_by_wiki(wiki);
|
||||
}
|
||||
public void Load_by_xowe(Xoae_page wpg) {
|
||||
public void Load_by_xowe(Xoae_page wpg, boolean load_ctg) {
|
||||
tmp_hpg.Ctor_by_hview(wpg.Wiki(), wpg.Url(), wpg.Ttl(), wpg.Db().Page().Id());
|
||||
Load_by_xowh(tmp_hpg, wpg.Ttl(), Bool_.Y);
|
||||
Load_by_xowh(tmp_hpg, wpg.Ttl(), load_ctg);
|
||||
wpg.Db().Html().Html_bry_(tmp_hpg.Db().Html().Html_bry());
|
||||
wpg.Root_(new gplx.xowa.parsers.Xop_root_tkn()); // HACK: set root, else load page will fail
|
||||
Fill_page(wpg, tmp_hpg);
|
||||
@ -65,12 +89,9 @@ public class Xow_hdump_mgr__load implements Gfo_invk {
|
||||
|
||||
// write ctgs
|
||||
if (load_ctg) {
|
||||
Xoctg_pagebox_itm[] pagebox_itms = wiki.Ctg__pagebox_wtr().Get_catlinks_by_page(wiki, hpg);
|
||||
if (pagebox_itms.length > 0) {
|
||||
tmp_bfr.Add(src);
|
||||
wiki.Ctg__pagebox_wtr().Write_pagebox(tmp_bfr, wiki, hpg, pagebox_itms);
|
||||
src = tmp_bfr.To_bry_and_clear();
|
||||
}
|
||||
tmp_bfr.Add(src);
|
||||
wiki.Ctg__pagebox_wtr().Write_pagebox(tmp_bfr, hpg);
|
||||
src = tmp_bfr.To_bry_and_clear();
|
||||
}
|
||||
|
||||
hpg.Db().Html().Html_bry_(src);
|
||||
|
@ -1,32 +1,49 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.xowa.wikis.pages; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*;
|
||||
import gplx.core.net.qargs.*;
|
||||
import gplx.xowa.guis.views.*;
|
||||
import gplx.xowa.addons.wikis.pages.syncs.core.*;
|
||||
import gplx.xowa.wikis.data.tbls.*;
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2020 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.xowa.wikis.pages;
|
||||
|
||||
import gplx.Bry_;
|
||||
import gplx.Bry_bfr;
|
||||
import gplx.Bry_bfr_;
|
||||
import gplx.Err_;
|
||||
import gplx.Gfo_usr_dlg_;
|
||||
import gplx.core.net.qargs.Gfo_qarg_itm;
|
||||
import gplx.core.net.qargs.Gfo_qarg_mgr;
|
||||
import gplx.xowa.Xoa_app;
|
||||
import gplx.xowa.Xoa_app_;
|
||||
import gplx.xowa.Xoa_ttl;
|
||||
import gplx.xowa.Xoa_url;
|
||||
import gplx.xowa.Xoa_url_;
|
||||
import gplx.xowa.Xoae_page;
|
||||
import gplx.xowa.Xowe_wiki;
|
||||
import gplx.xowa.Xowe_wiki_;
|
||||
import gplx.xowa.addons.wikis.pages.syncs.core.Xosync_read_mgr;
|
||||
import gplx.xowa.guis.views.Xog_tab_itm;
|
||||
import gplx.xowa.wikis.data.tbls.Xowd_page_itm;
|
||||
|
||||
public class Xowe_page_mgr {
|
||||
private final Xowe_wiki wiki;
|
||||
private final Bry_bfr tmp_bfr = Bry_bfr_.New();
|
||||
private final Gfo_qarg_mgr tmp_qarg_mgr = new Gfo_qarg_mgr();
|
||||
private final Xowe_wiki wiki;
|
||||
private final Bry_bfr tmp_bfr = Bry_bfr_.New();
|
||||
private final Gfo_qarg_mgr tmp_qarg_mgr = new Gfo_qarg_mgr();
|
||||
public Xowe_page_mgr(Xowe_wiki wiki) {this.wiki = wiki;}
|
||||
public Xosync_read_mgr Sync_mgr() {return read_mgr;} private final Xosync_read_mgr read_mgr = new Xosync_read_mgr();
|
||||
public Xosync_read_mgr Sync_mgr() {return read_mgr;} private final Xosync_read_mgr read_mgr = new Xosync_read_mgr();
|
||||
public void Init_by_wiki(Xowe_wiki wiki) {
|
||||
read_mgr.Init_by_wiki(wiki);
|
||||
}
|
||||
|
||||
public Xoae_page Load_page(Xoa_url url, Xoa_ttl ttl, Xog_tab_itm tab) { // NOTE: called by GUI and HTTP_SERVER; not called by MASS_PARSE
|
||||
Xoa_app_.Usr_dlg().Log_many("", "", "page.load: url=~{0}", url.To_str());
|
||||
Wait_for_popups(wiki.App());
|
||||
@ -75,9 +92,10 @@ public class Xowe_page_mgr {
|
||||
// load from html_db
|
||||
boolean from_html_db = page.Db().Page().Html_db_id() != -1;
|
||||
boolean read_from_html_db_preferred = wiki.Html__hdump_mgr().Load_mgr().Read_preferred();
|
||||
boolean isCategoryPage = ttl.Ns().Id_is_ctg();
|
||||
if (from_html_db) {
|
||||
if (read_from_html_db_preferred) {
|
||||
wiki.Html__hdump_mgr().Load_mgr().Load_by_xowe(page);
|
||||
wiki.Html__hdump_mgr().Load_mgr().Load_by_xowe(page, !isCategoryPage); // NOTE: if loading for html_db, do not build page_box; will be built below; ISSUE#:722; DATE:2020-05-17
|
||||
int html_len = Bry_.Len(page.Db().Html().Html_bry());
|
||||
from_html_db = html_len > 0; // NOTE: archive.org has some wtxt_dbs which included page|html_db_id without actual html_dbs; DATE:2016-06-22
|
||||
Gfo_usr_dlg_.Instance.Log_many("", "", "page_load: loaded html; page=~{0} html_len=~{1}", ttl.Full_db(), html_len);
|
||||
@ -95,7 +113,7 @@ public class Xowe_page_mgr {
|
||||
&& !ttl.Ns().Id_is_special() // skip special
|
||||
&& !read_from_html_db_preferred // read preferred not marked
|
||||
) {
|
||||
wiki.Html__hdump_mgr().Load_mgr().Load_by_xowe(page);
|
||||
wiki.Html__hdump_mgr().Load_mgr().Load_by_xowe(page, true);
|
||||
from_html_db = Bry_.Len_gt_0(page.Db().Html().Html_bry());
|
||||
}
|
||||
else {
|
||||
@ -105,12 +123,15 @@ public class Xowe_page_mgr {
|
||||
page.Html_data().Hdump_exists_(from_html_db);
|
||||
|
||||
// if [[Category]], generate catlinks (subc; page; file)
|
||||
if (ttl.Ns().Id_is_ctg()) {
|
||||
if (isCategoryPage) {
|
||||
wiki.Ctg__catpage_mgr().Write_catpage(tmp_bfr, page);
|
||||
if (from_html_db)
|
||||
if (from_html_db) {
|
||||
wiki.Ctg__pagebox_wtr().Write_pagebox(tmp_bfr, page);
|
||||
page.Db().Html().Html_bry_(Bry_.Add(page.Db().Html().Html_bry(), tmp_bfr.To_bry_and_clear()));
|
||||
else
|
||||
}
|
||||
else {
|
||||
page.Html_data().Catpage_data_(tmp_bfr.To_bry_and_clear());
|
||||
}
|
||||
}
|
||||
|
||||
return page;
|
||||
|
Loading…
Reference in New Issue
Block a user