1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

Wiki.Dom: Refactor Wiki.Props

This commit is contained in:
gnosygnu
2017-02-17 17:57:17 -05:00
parent 22b6d4dbde
commit c9e22b69f7
39 changed files with 216 additions and 635 deletions

View File

@@ -45,9 +45,9 @@ public class Pfunc_urlfunc extends Pf_func_base { // EX: {{lc:A}} -> a
Bry_bfr tmp_bfr = ctx.Wiki().Utl__bfr_mkr().Get_b512();
try {
switch (tid) {
case Tid_local: tmp_bfr.Add(ctx.Wiki().Props().ArticlePath());break;
case Tid_full: tmp_bfr.Add(Bry_relative_url).Add(ctx.Wiki().Props().Server_name()).Add(ctx.Wiki().Props().ArticlePath()); break;
case Tid_canonical: tmp_bfr.Add(ctx.Wiki().Props().Server()).Add(ctx.Wiki().Props().ArticlePath()); break;
case Tid_local: tmp_bfr.Add(ctx.Wiki().Props().Article_path());break;
case Tid_full: tmp_bfr.Add(Bry_relative_url).Add(ctx.Wiki().Props().Server_name()).Add(ctx.Wiki().Props().Article_path()); break;
case Tid_canonical: tmp_bfr.Add(ctx.Wiki().Props().Server()).Add(ctx.Wiki().Props().Article_path()); break;
default: throw Err_.new_unhandled(tid);
}
tmp_bfr.Add(ttl_ary);

View File

@@ -28,10 +28,10 @@ public class Pfunc_wiki_props extends Pf_func_base {
case Xol_kwd_grp_.Id_site_sitename: bfr.Add(props.Site_name()); break;
case Xol_kwd_grp_.Id_site_server: bfr.Add(props.Server()); break;
case Xol_kwd_grp_.Id_site_servername: bfr.Add(props.Server_name()); break;
case Xol_kwd_grp_.Id_site_articlepath: bfr.Add(props.ArticlePath()); break;
case Xol_kwd_grp_.Id_site_scriptpath: bfr.Add(props.ScriptPath()); break;
case Xol_kwd_grp_.Id_site_stylepath: bfr.Add(props.StylePath()); break;
case Xol_kwd_grp_.Id_site_directionmark: bfr.Add(props.DirectionMark()); break;
case Xol_kwd_grp_.Id_site_articlepath: bfr.Add(props.Article_path()); break;
case Xol_kwd_grp_.Id_site_scriptpath: bfr.Add(props.Script_path()); break;
case Xol_kwd_grp_.Id_site_stylepath: bfr.Add(props.Style_path()); break;
case Xol_kwd_grp_.Id_site_directionmark: bfr.Add(props.Direction_mark()); break;
case Xol_kwd_grp_.Id_site_currentversion: bfr.Add(props.Current_version()); break;
case Xol_kwd_grp_.Id_site_contentlanguage: bfr.Add(ctx.Page().Lang().Key_bry()); break;
default: throw Err_.new_unhandled(id);

View File

@@ -152,8 +152,8 @@ public class Scrib_lib_site implements Scrib_lib {
Xow_wiki_props props = core.Wiki().Props();
rv[0] = Keyval_.new_("siteName" , props.Site_name());
rv[1] = Keyval_.new_("server" , Bry_.Add(gplx.core.net.Gfo_protocol_itm.Bry_relative, props.Server_name())); // NOTE: should generate "//en.wikipedia.org", not "de.wikipedia.org"; PAGE:de.w:Giro_d<5F>Italia_1996 DATE:2016-04-17
rv[2] = Keyval_.new_("scriptPath" , props.ScriptPath());
rv[3] = Keyval_.new_("stylePath" , props.StylePath());
rv[2] = Keyval_.new_("scriptPath" , props.Script_path());
rv[3] = Keyval_.new_("stylePath" , props.Style_path());
rv[4] = Keyval_.new_("currentVersion" , props.Current_version());
}
private Keyval[] Bld_ns_ary(Xowe_wiki wiki) {

View File

@@ -96,7 +96,7 @@ class Xowb_json_dump_db {
Xow_db_file db_core = db_mgr.Db__core();
db_core.Tbl__site_stats().Update(page_count_main, page_id, 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, Xow_cfg_consts.Key__init__modified_latest, page_modified_on.XtoStr_fmt(DateAdp_.Fmt_iso8561_date_time));
db_mgr.Tbl__cfg().Insert_str(Xowd_cfg_key_.Grp__wiki_init, Xowd_cfg_key_.Key__init__modified_latest, page_modified_on.XtoStr_fmt(DateAdp_.Fmt_iso8561_date_time));
}
private static final byte[] Bry__id_key = Bry_.new_a7("id");
}