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

Cfg: Convert 'Wiki - HTML databases'

This commit is contained in:
gnosygnu
2016-12-13 12:49:05 -05:00
parent c73c917c48
commit 200707b1c6
14 changed files with 64 additions and 95 deletions

View File

@@ -50,7 +50,6 @@ public class Xoapi_root implements Gfo_invk {
public Xoapi_usr Usr() {return usr_api;} private final Xoapi_usr usr_api = new Xoapi_usr();
public Xoapi_special Special() {return special_api;} private final Xoapi_special special_api = new Xoapi_special();
public Xoapi_xtns Xtns() {return xtns_api;} private final Xoapi_xtns xtns_api = new Xoapi_xtns();
public Xoapi_wiki Wiki() {return wiki;} private final Xoapi_wiki wiki = new Xoapi_wiki();
public Xoapi_app_wikis Wikis() {return app_wikis;} private final Xoapi_app_wikis app_wikis = new Xoapi_app_wikis();
public String Test_str() {return test_str;} public void Test_str_(String v) {test_str = v;} private String test_str; // TEST
private void Exec(String key) {
@@ -70,7 +69,6 @@ public class Xoapi_root implements Gfo_invk {
else if (ctx.Match(k, Invk_special)) return special_api;
else if (ctx.Match(k, Invk_xtns)) return xtns_api;
else if (ctx.Match(k, Invk_exec)) Exec(m.ReadStr("v"));
else if (ctx.Match(k, Invk_wiki)) return wiki;
else if (ctx.Match(k, Invk_wikis)) return app_wikis;
else if (ctx.Match(k, Invk_test_str)) return test_str;
else if (ctx.Match(k, Invk_test_str_)) test_str = m.ReadStr("v");
@@ -81,6 +79,6 @@ public class Xoapi_root implements Gfo_invk {
, Invk_app = "app", Invk_addon = "addon"
, Invk_bldr = "bldr", Invk_nav = "nav", Invk_gui = "gui", Invk_html = "html", Invk_net = "net", Invk_usr = "usr", Invk_special = "special", Invk_xtns = "xtns"
, Invk_test_str = "test_str", Invk_test_str_ = "test_str_"
, Invk_wiki = "wiki", Invk_wikis = "wikis"
, Invk_wikis = "wikis"
;
}

View File

@@ -19,13 +19,11 @@ package gplx.xowa.apps.apis.xowa; import gplx.*; import gplx.xowa.*; import gplx
import gplx.xowa.apps.apis.xowa.wikis.*;
public class Xoapi_app_wiki implements Gfo_invk {
public Xoapi_wiki_lang Lang() {return lang;} private final Xoapi_wiki_lang lang = new Xoapi_wiki_lang();
public Xoapi_hdump Hdump() {return hdump;} private final Xoapi_hdump hdump = new Xoapi_hdump();
public void Subscribe(Gfo_evt_itm sub) {lang.Subscribe(sub);}
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk_lang)) return lang;
else if (ctx.Match(k, Invk_hdump)) return hdump;
else return Gfo_invk_.Rv_unhandled;
}
private static final String Invk_lang = "lang", Invk_hdump = "hdump";
private static final String Invk_lang = "lang";
public static final Xoapi_app_wiki Dflt = new Xoapi_app_wiki();
}

View File

@@ -1,27 +0,0 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.apis.xowa; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*;
import gplx.xowa.apps.apis.xowa.wikis.*;
public class Xoapi_wiki implements Gfo_invk {
public Xoapi_hdump Hdump() {return hdump;} private final Xoapi_hdump hdump = new Xoapi_hdump();
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk_hdump)) return hdump;
else return Gfo_invk_.Rv_unhandled;
}
private static final String Invk_hdump = "hdump";
}

View File

@@ -1,41 +0,0 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.apis.xowa.wikis; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
public class Hdump_html_mode {
public Hdump_html_mode(int tid, String key, String gui) {
this.tid = (byte)tid; this.key = key; this.gui = gui;
}
public byte Tid() {return tid;} private final byte tid;
public String Key() {return key;} private final String key;
public String Gui() {return gui;} private final String gui;
public Keyval Opt() {return Keyval_.new_(key, gui);}
public boolean Tid_is_hdump_save() {return tid == Hdump_save.tid;}
public static final Hdump_html_mode
Shown = new Hdump_html_mode(0, "shown" , "Shown")
, Hdump_save = new Hdump_html_mode(1, "hdump_save" , "Saved for HTML DB")
, Hdump_load = new Hdump_html_mode(2, "hdump_load" , "Loaded by HTML DB")
;
public static Hdump_html_mode Parse(String v) {
if (String_.Eq(v, Shown.key)) return Shown;
else if (String_.Eq(v, Hdump_save.key)) return Hdump_save;
else if (String_.Eq(v, Hdump_load.key)) return Hdump_load;
else throw Err_.new_unhandled(v);
}
public static Keyval[] Opt_list() {return new Keyval[] {Shown.Opt(), Hdump_save.Opt()};}
}

View File

@@ -1,34 +0,0 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.apis.xowa.wikis; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
public class Xoapi_hdump implements Gfo_invk {
public boolean Read_preferred() {return read_preferred;} private boolean read_preferred = true;
public Hdump_html_mode Html_mode() {return html_mode;} private Hdump_html_mode html_mode = Hdump_html_mode.Shown;
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk__read_preferred)) return Yn.To_str(read_preferred);
else if (ctx.Match(k, Invk__read_preferred_)) read_preferred = m.ReadYn("v");
else if (ctx.Match(k, Invk__html_mode)) return html_mode.Key();
else if (ctx.Match(k, Invk__html_mode_)) html_mode = Hdump_html_mode.Parse(m.ReadStr("v"));
else if (ctx.Match(k, Invk__html_mode_list)) return Hdump_html_mode.Opt_list();
return this;
}
private static final String
Invk__read_preferred = "read_preferred" , Invk__read_preferred_ = "read_preferred_"
, Invk__html_mode = "html_mode" , Invk__html_mode_ = "html_mode_", Invk__html_mode_list = "html_mode_list"
;
}