mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
Hdump: Serialize / deserialize top-icon [#721]
This commit is contained in:
@@ -1,24 +1,44 @@
|
||||
/*
|
||||
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; import gplx.*; import gplx.xowa.*;
|
||||
import gplx.xowa.wikis.pages.*; import gplx.xowa.wikis.pages.skins.*; import gplx.xowa.wikis.pages.lnkis.*; import gplx.xowa.wikis.pages.redirects.*;
|
||||
import gplx.xowa.files.*;
|
||||
import gplx.xowa.langs.*;
|
||||
import gplx.xowa.htmls.heads.*; import gplx.xowa.htmls.sections.*; import gplx.xowa.addons.htmls.tocs.*;
|
||||
import gplx.xowa.wikis.pages.dbs.*; import gplx.xowa.wikis.pages.hdumps.*; import gplx.xowa.wikis.pages.htmls.*; import gplx.xowa.wikis.pages.wtxts.*;
|
||||
/*
|
||||
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;
|
||||
|
||||
import gplx.Bry_;
|
||||
import gplx.Bry_bfr;
|
||||
import gplx.Guid_adp;
|
||||
import gplx.Guid_adp_;
|
||||
import gplx.Hash_adp;
|
||||
import gplx.Hash_adp_;
|
||||
import gplx.xowa.Xoa_page;
|
||||
import gplx.xowa.Xoa_page_;
|
||||
import gplx.xowa.Xoa_ttl;
|
||||
import gplx.xowa.Xoa_url;
|
||||
import gplx.xowa.Xoae_page;
|
||||
import gplx.xowa.Xow_wiki;
|
||||
import gplx.xowa.files.Xof_exec_tid;
|
||||
import gplx.xowa.htmls.heads.Xoh_head_mgr;
|
||||
import gplx.xowa.htmls.sections.Xoh_section_mgr;
|
||||
import gplx.xowa.langs.Xol_lang_itm;
|
||||
import gplx.xowa.wikis.pages.Xoa_page__commons_mgr;
|
||||
import gplx.xowa.wikis.pages.Xopg_module_mgr;
|
||||
import gplx.xowa.wikis.pages.dbs.Xopg_db_data;
|
||||
import gplx.xowa.wikis.pages.hdumps.Xopg_hdump_data;
|
||||
import gplx.xowa.wikis.pages.htmls.Xopg_html_data;
|
||||
import gplx.xowa.wikis.pages.redirects.Xopg_redirect_mgr;
|
||||
import gplx.xowa.wikis.pages.wtxts.Xopg_wtxt_data;
|
||||
|
||||
public class Xoh_page implements Xoa_page {
|
||||
// core
|
||||
public Xow_wiki Wiki() {return wiki;} private Xow_wiki wiki;
|
||||
@@ -49,6 +69,7 @@ public class Xoh_page implements Xoa_page {
|
||||
public Xoh_section_mgr Section_mgr() {return section_mgr;} private final Xoh_section_mgr section_mgr = new Xoh_section_mgr();
|
||||
public Xoh_img_mgr Img_mgr() {return img_mgr;} private Xoh_img_mgr img_mgr = new Xoh_img_mgr();
|
||||
public Xopg_module_mgr Head_mgr() {return head_mgr;} private Xopg_module_mgr head_mgr = new Xopg_module_mgr();
|
||||
public Hash_adp Props() {return props;} private final Hash_adp props = Hash_adp_.New();
|
||||
|
||||
// util
|
||||
public Xoa_page__commons_mgr Commons_mgr() {return commons_mgr;} private final Xoa_page__commons_mgr commons_mgr = new Xoa_page__commons_mgr();
|
||||
@@ -95,6 +116,7 @@ public class Xoh_page implements Xoa_page {
|
||||
display_ttl = content_sub = sidebar_div = Bry_.Empty;
|
||||
head_mgr.Clear(); commons_mgr.Clear();
|
||||
section_mgr.Clear(); img_mgr.Clear();
|
||||
props.Clear();
|
||||
}
|
||||
public static Xoh_page New_missing() {
|
||||
Xoh_page rv = new Xoh_page();
|
||||
|
||||
@@ -33,6 +33,8 @@ import gplx.xowa.apps.gfs.Gfs_php_converter;
|
||||
import gplx.xowa.htmls.core.Xow_hdump_mode;
|
||||
import gplx.xowa.htmls.core.htmls.Xoh_html_wtr_escaper;
|
||||
import gplx.xowa.htmls.core.htmls.Xoh_wtr_ctx;
|
||||
import gplx.xowa.htmls.hxtns.blobs.Hxtn_blob_tbl;
|
||||
import gplx.xowa.htmls.hxtns.pages.Hxtn_page_mgr;
|
||||
import gplx.xowa.htmls.portal.Xoh_page_body_cls;
|
||||
import gplx.xowa.htmls.portal.Xow_portal_mgr;
|
||||
import gplx.xowa.langs.vnts.Xol_vnt_mgr;
|
||||
@@ -166,6 +168,12 @@ public class Xoh_page_wtr_wkr {
|
||||
if (wpg.Html_data().Xtn_pgbnr() != null) {
|
||||
ctx.Wiki().Xtn_mgr().Xtn_pgbnr().Write_html(wpg, ctx, hctx).Bfr_arg__add(bfr); // if pgbnr exists, write to top of html
|
||||
}
|
||||
|
||||
int page_id = wpg.Db().Page().Id();
|
||||
Hxtn_page_mgr html_data_mgr = wpg.Wikie().Hxtn_mgr();
|
||||
|
||||
wpg.Html_data().Indicators().HxtnSave(wpg.Wikie(), html_data_mgr, wpg, page_id);
|
||||
|
||||
this.Write_body(bfr, ctx, hctx, wpg);
|
||||
}
|
||||
public void Write_body(Bry_bfr bfr, Xop_ctx ctx, Xoh_wtr_ctx hctx, Xoae_page page) {
|
||||
|
||||
@@ -42,6 +42,7 @@ 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;
|
||||
import gplx.xowa.xtns.indicators.Indicator_hxtn_page_wkr;
|
||||
|
||||
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;
|
||||
@@ -123,10 +124,12 @@ public class Xow_hdump_mgr__load implements Gfo_invk {
|
||||
}
|
||||
public void Fill_page(Xoae_page wpg, Xoh_page hpg) {
|
||||
Xopg_html_data html_data = wpg.Html_data();
|
||||
|
||||
html_data.Display_ttl_(tmp_hpg.Display_ttl());
|
||||
html_data.Content_sub_(tmp_hpg.Content_sub());
|
||||
html_data.Xtn_skin_mgr().Add(new Xopg_xtn_skin_itm_stub(tmp_hpg.Sidebar_div()));
|
||||
html_data.Custom_head_tags().Add(hpg.Html_data().Custom_head_tags().To_ary());
|
||||
html_data.Indicators().Deserialise(wiki, hpg, (byte[])tmp_hpg.Props().Get_by(Indicator_hxtn_page_wkr.KEY));
|
||||
|
||||
Xoh_head_mgr wpg_head = html_data.Head_mgr();
|
||||
Xopg_module_mgr hpg_head = hpg.Head_mgr();
|
||||
|
||||
@@ -1,23 +1,36 @@
|
||||
/*
|
||||
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.hxtns.pages; import gplx.*; import gplx.xowa.*; import gplx.xowa.htmls.*; import gplx.xowa.htmls.hxtns.*;
|
||||
import gplx.dbs.*;
|
||||
import gplx.core.lists.*; import gplx.core.lists.hashs.*;
|
||||
import gplx.xowa.htmls.hxtns.pages.*; import gplx.xowa.htmls.hxtns.blobs.*; import gplx.xowa.htmls.hxtns.wkrs.*; import gplx.xowa.htmls.hxtns.wikis.*;
|
||||
import gplx.xowa.wikis.*;
|
||||
/*
|
||||
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.hxtns.pages;
|
||||
|
||||
import gplx.Bry_bfr;
|
||||
import gplx.Bry_bfr_;
|
||||
import gplx.Gfo_usr_dlg_;
|
||||
import gplx.Hash_adp_bry;
|
||||
import gplx.Io_mgr;
|
||||
import gplx.Io_url;
|
||||
import gplx.List_adp;
|
||||
import gplx.core.lists.hashs.Hash_adp__int;
|
||||
import gplx.dbs.Db_conn;
|
||||
import gplx.dbs.Db_conn_bldr;
|
||||
import gplx.xowa.Xoa_ttl;
|
||||
import gplx.xowa.Xow_wiki;
|
||||
import gplx.xowa.htmls.Xoh_page;
|
||||
import gplx.xowa.htmls.hxtns.blobs.Hxtn_blob_tbl;
|
||||
import gplx.xowa.htmls.hxtns.wikis.Hxtn_wiki_mgr;
|
||||
import gplx.xowa.htmls.hxtns.wkrs.Hxtn_wkr_mgr;
|
||||
public class Hxtn_page_mgr {
|
||||
private Hxtn_page_tbl page_tbl;
|
||||
private Hxtn_blob_tbl blob_tbl;
|
||||
@@ -102,5 +115,8 @@ public class Hxtn_page_mgr {
|
||||
}
|
||||
}
|
||||
private static Io_url Make_url(Xow_wiki wiki, String file_name) {return wiki.Fsys_mgr().Root_dir().GenSubFil(wiki.Domain_str() + file_name);}
|
||||
public static final int Id__template_styles = 0;
|
||||
public static final int
|
||||
Id__template_styles = 0
|
||||
, Id__indicators = 2
|
||||
;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user