mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
Cfg: Add more implementation for cfg_cache and pub / sub
This commit is contained in:
@@ -18,20 +18,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.addons.apps.cfgs; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.apps.*;
|
||||
import gplx.dbs.*; import gplx.xowa.addons.apps.cfgs.mgrs.*;
|
||||
public class Xocfg_mgr {
|
||||
private final Xocfg_cache_mgr cache_mgr;
|
||||
public Xocfg_mgr(Db_conn conn) {
|
||||
this.cache_mgr = new Xocfg_cache_mgr(conn);
|
||||
private final Xocfg_cache_mgr cache_mgr = new Xocfg_cache_mgr();
|
||||
public void Init_by_app(Db_conn conn) {
|
||||
cache_mgr.Init_by_app(conn);
|
||||
}
|
||||
public void Clear() {
|
||||
cache_mgr.Clear();
|
||||
}
|
||||
public void Sub_many(Gfo_evt_itm sub, String ctx, String... keys) {
|
||||
cache_mgr.Sub_many(sub, ctx, keys);
|
||||
public boolean Bind_bool(Xow_wiki wiki, String key, Gfo_invk sub) {return Bool_.Parse_or(Bind_str(wiki, key, sub), false);}
|
||||
public String Bind_str(Xow_wiki wiki, String key, Gfo_invk sub) {
|
||||
String ctx = wiki.Domain_itm().Abrv_xo_str();
|
||||
cache_mgr.Sub(sub, ctx, key, key);
|
||||
return cache_mgr.Get(ctx, key);
|
||||
}
|
||||
public String Get_str(String ctx, String key) {return cache_mgr.Get(ctx, key);}
|
||||
public void Set_str(String ctx, String key, String val) {cache_mgr.Set(ctx, key, val);}
|
||||
|
||||
public static Xocfg_mgr New(Db_conn conn) {
|
||||
return new Xocfg_mgr(conn);
|
||||
public String Get_str(String ctx, String key) {
|
||||
return cache_mgr.Get(ctx, key);
|
||||
}
|
||||
public void Set_str(String ctx, String key, String val) {
|
||||
cache_mgr.Set(ctx, key, val);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,11 +43,6 @@ public class Xocfg_db_mgr {
|
||||
public void Set_str(String ctx, String key, String val) {
|
||||
Xoitm_meta_itm meta_itm = tbl__itm_meta.Select_by_key_or_null(key);
|
||||
if (meta_itm == null) throw Err_.new_wo_type("cfg not defined", "ctx", ctx, "key", key);
|
||||
|
||||
// parse val
|
||||
if (meta_itm.Gui_type() == Xoitm_gui_tid.Tid__checkbox) {
|
||||
val = String_.Eq(val, "on") ? "true" : "false";
|
||||
}
|
||||
tbl__itm_data.Upsert(meta_itm.Id(), ctx, val, Datetime_now.Get().XtoUtc().XtoStr_fmt_iso_8561());
|
||||
}
|
||||
public void Del(String ctx, String key) {
|
||||
|
||||
@@ -35,13 +35,13 @@ public class Xocfg_itm_bldr {
|
||||
// insert nde_i18n
|
||||
db_mgr.Tbl__nde_i18n().Upsert(grp_id, Lang__dflt, grp_name, grp_help);
|
||||
}
|
||||
public void Create_itm(String grp_key, String itm_key, String scope_id_str, String gui_type, String gui_args, String itm_dflt, String itm_name, String help) {
|
||||
public void Create_itm(String grp_key, String itm_key, String scope_id_str, int db_type_id, String gui_type, String gui_args, String itm_dflt, String itm_name, String help) {
|
||||
// insert itm_meta
|
||||
int grp_id = db_mgr.Tbl__grp_meta().Select_id_by_key_or_fail(grp_key);
|
||||
int itm_id = db_mgr.Conn().Sys_mgr().Autonum_next("cfg_itm_meta.itm_id");
|
||||
int scope_id = Xoitm_scope_tid.To_int(scope_id_str);
|
||||
int gui_type_id = Xoitm_gui_tid.To_tid(gui_type);
|
||||
db_mgr.Tbl__itm_meta().Upsert(itm_id, scope_id, gui_type_id, gui_args, itm_key, itm_dflt);
|
||||
db_mgr.Tbl__itm_meta().Upsert(itm_id, scope_id, db_type_id, gui_type_id, gui_args, itm_key, itm_dflt);
|
||||
|
||||
// insert grp_map
|
||||
int itm_sort = db_mgr.Tbl__grp_map().Select_next_sort(grp_id);
|
||||
|
||||
@@ -35,7 +35,7 @@ public class Xogrp_map_tbl implements Db_tbl {
|
||||
Db_tbl__crud_.Upsert(conn, tbl_name, flds, String_.Ary(fld__map_src, fld__map_trg), map_src, map_trg, map_sort);
|
||||
}
|
||||
public int Select_next_sort(int owner_id) {
|
||||
Db_rdr rdr = conn.Stmt_sql("SELECT Max(map_sort) AS map_sort FROM cfg_grp_map WHERE map_src = ?").Crt_int(fld__map_src, owner_id).Exec_select__rls_auto();
|
||||
Db_rdr rdr = conn.Stmt_select_max(tbl_name, fld__map_sort, fld__map_src).Crt_int(fld__map_src, owner_id).Exec_select__rls_auto();
|
||||
try {
|
||||
if (!rdr.Move_next()) return 0;
|
||||
Object max = rdr.Read_obj(fld__map_sort);
|
||||
|
||||
@@ -17,9 +17,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.addons.apps.cfgs.dbs; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.apps.*; import gplx.xowa.addons.apps.cfgs.*;
|
||||
public class Xoitm_meta_itm {
|
||||
public Xoitm_meta_itm(int id, int scope_id, int gui_type, String gui_args, String key, String dflt) {
|
||||
public Xoitm_meta_itm(int id, int scope_id, int db_type, int gui_type, String gui_args, String key, String dflt) {
|
||||
this.id = id;
|
||||
this.scope_id = scope_id;
|
||||
this.db_type = db_type;
|
||||
this.gui_type = gui_type;
|
||||
this.gui_args = gui_args;
|
||||
this.key = key;
|
||||
@@ -27,6 +28,7 @@ public class Xoitm_meta_itm {
|
||||
}
|
||||
public int Id() {return id;} private final int id;
|
||||
public int Scope_id() {return scope_id;} private final int scope_id;
|
||||
public int Db_type() {return db_type;} private final int db_type;
|
||||
public int Gui_type() {return gui_type;} private final int gui_type;
|
||||
public String Gui_args() {return gui_args;} private final String gui_args;
|
||||
public String Key() {return key;} private final String key;
|
||||
|
||||
@@ -19,7 +19,7 @@ package gplx.xowa.addons.apps.cfgs.dbs; import gplx.*; import gplx.xowa.*; impor
|
||||
import gplx.dbs.*; import gplx.dbs.utls.*;
|
||||
public class Xoitm_meta_tbl implements Db_tbl {
|
||||
private final Dbmeta_fld_list flds = new Dbmeta_fld_list();
|
||||
private final String fld__itm_id, fld__itm_key, fld__itm_scope_id, fld__itm_gui_type, fld__itm_gui_args, fld__itm_dflt;
|
||||
private final String fld__itm_id, fld__itm_key, fld__itm_scope_id, fld__itm_db_type, fld__itm_gui_type, fld__itm_gui_args, fld__itm_dflt;
|
||||
private final Db_conn conn;
|
||||
public Xoitm_meta_tbl(Db_conn conn) {
|
||||
this.conn = conn;
|
||||
@@ -27,6 +27,7 @@ public class Xoitm_meta_tbl implements Db_tbl {
|
||||
this.fld__itm_id = flds.Add_int("itm_id"); // EX: '2'
|
||||
this.fld__itm_key = flds.Add_str("itm_key", 255); // EX: 'cfg_1'
|
||||
this.fld__itm_scope_id = flds.Add_int("itm_scope_id"); // EX: '1'; ENUM: Xoitm_scope_tid
|
||||
this.fld__itm_db_type = flds.Add_int("itm_db_type"); // EX: '1'; ENUM: Type_adp_
|
||||
this.fld__itm_gui_type = flds.Add_int("itm_gui_type"); // EX: '1'; ENUM: Xoitm_gui_tid
|
||||
this.fld__itm_gui_args = flds.Add_str("itm_gui_args", 255); // EX: '1,40' (numeric); '255' (textbox); 'enum_name' (combo); etc..
|
||||
this.fld__itm_dflt = flds.Add_str("itm_dflt", 4096); // EX: 'abc'
|
||||
@@ -34,8 +35,8 @@ public class Xoitm_meta_tbl implements Db_tbl {
|
||||
}
|
||||
public String Tbl_name() {return tbl_name;} private final String tbl_name;
|
||||
public void Create_tbl() {conn.Meta_tbl_create(Dbmeta_tbl_itm.New(tbl_name, flds));}
|
||||
public void Upsert(int itm_id, int scope_id, int gui_type, String gui_args, String itm_key, String itm_dflt) {
|
||||
Db_tbl__crud_.Upsert(conn, tbl_name, flds, String_.Ary(fld__itm_id), itm_id, itm_key, scope_id, gui_type, gui_args, itm_dflt);
|
||||
public void Upsert(int itm_id, int scope_id, int db_type, int gui_type, String gui_args, String itm_key, String itm_dflt) {
|
||||
Db_tbl__crud_.Upsert(conn, tbl_name, flds, String_.Ary(fld__itm_id), itm_id, itm_key, scope_id, db_type, gui_type, gui_args, itm_dflt);
|
||||
}
|
||||
public Xoitm_meta_itm Select_by_key_or_null(String key) {
|
||||
Db_rdr rdr = conn.Stmt_select(tbl_name, flds, fld__itm_key).Crt_str(fld__itm_key, key).Exec_select__rls_auto();
|
||||
@@ -46,6 +47,7 @@ public class Xoitm_meta_tbl implements Db_tbl {
|
||||
return new Xoitm_meta_itm
|
||||
( rdr.Read_int(fld__itm_id)
|
||||
, rdr.Read_int(fld__itm_scope_id)
|
||||
, rdr.Read_int(fld__itm_db_type)
|
||||
, rdr.Read_int(fld__itm_gui_type)
|
||||
, rdr.Read_str(fld__itm_gui_args)
|
||||
, rdr.Read_str(fld__itm_key)
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.addons.apps.cfgs.mgrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.apps.*; import gplx.xowa.addons.apps.cfgs.*;
|
||||
class Xocfg_cache_grp {
|
||||
private final Hash_adp vals = Hash_adp_.New();
|
||||
private final Hash_adp subs = Hash_adp_.New();
|
||||
private final Ordered_hash subs = Ordered_hash_.New();
|
||||
private final String dflt;
|
||||
public Xocfg_cache_grp(String key, String dflt) {
|
||||
this.key = key;
|
||||
@@ -50,7 +50,7 @@ class Xocfg_cache_grp {
|
||||
public void Add(String ctx, Xocfg_cache_itm itm) {
|
||||
vals.Add(ctx, itm);
|
||||
}
|
||||
public void Sub(Gfo_evt_itm sub, String ctx, String evt) {
|
||||
public void Sub(Gfo_invk sub, String ctx, String evt) {
|
||||
List_adp list = (List_adp)subs.Get_by(ctx);
|
||||
if (list == null) {
|
||||
list = List_adp_.New();
|
||||
@@ -62,8 +62,11 @@ class Xocfg_cache_grp {
|
||||
// exact match; EX: "en.w|key_1"
|
||||
List_adp list = (List_adp)subs.Get_by(ctx);
|
||||
if (list == null) {// global match; EX: "app|key_1"
|
||||
list = (List_adp)subs.Get_by(ctx);
|
||||
if (list == null) return;
|
||||
int len = subs.Len();
|
||||
for (int i = 0; i < len; i++) {
|
||||
list = (List_adp)subs.Get_at(i);
|
||||
Pub(list, val);
|
||||
}
|
||||
}
|
||||
Pub(list, val);
|
||||
}
|
||||
@@ -71,7 +74,7 @@ class Xocfg_cache_grp {
|
||||
int len = list.Len();
|
||||
for (int i = 0; i < len; i++) {
|
||||
Xocfg_cache_sub sub = (Xocfg_cache_sub)list.Get_at(i);
|
||||
Gfo_evt_mgr_.Pub_val(sub.Sub(), sub.Evt(), val);
|
||||
Gfo_invk_.Invk_by_msg(sub.Sub(), sub.Evt(), GfoMsg_.new_parse_(sub.Evt()).Add("v", val));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,10 +19,13 @@ package gplx.xowa.addons.apps.cfgs.mgrs; import gplx.*; import gplx.xowa.*; impo
|
||||
import gplx.dbs.*; import gplx.xowa.addons.apps.cfgs.dbs.*;
|
||||
public class Xocfg_cache_mgr {
|
||||
private final Hash_adp grps = Hash_adp_.New();
|
||||
public Xocfg_cache_mgr(Db_conn conn) {
|
||||
public Xocfg_cache_mgr() {
|
||||
this.db_mgr = new Xocfg_db_mgr(Db_conn_.Noop);
|
||||
}
|
||||
public void Init_by_app(Db_conn conn) {
|
||||
this.db_mgr = new Xocfg_db_mgr(conn);
|
||||
}
|
||||
public Xocfg_db_mgr Db_mgr() {return db_mgr;} private final Xocfg_db_mgr db_mgr;
|
||||
public Xocfg_db_mgr Db_mgr() {return db_mgr;} private Xocfg_db_mgr db_mgr;
|
||||
public void Clear() {grps.Clear();}
|
||||
public String Get(String ctx, String key) {
|
||||
Xocfg_cache_grp grp = Grps__get_or_load(key);
|
||||
@@ -33,26 +36,25 @@ public class Xocfg_cache_mgr {
|
||||
grp.Set(ctx, val);
|
||||
grp.Pub(ctx, val);
|
||||
}
|
||||
public void Sub_many(Gfo_evt_itm sub, String ctx, String... evts) {
|
||||
int len = evts.length;
|
||||
for (int i = 0; i < len; i++) {
|
||||
String evt = evts[i];
|
||||
if (!String_.Has_at_bgn(evt, "Evt__")) throw Err_.new_wo_type("cfg:event must start with Evt__", "evt", evt);
|
||||
Sub(sub, ctx, String_.Mid(evt, 5), evt);
|
||||
}
|
||||
}
|
||||
public void Sub(Gfo_evt_itm sub, String ctx, String key, String evt) {
|
||||
public void Sub(Gfo_invk sub, String ctx, String key, String evt) {
|
||||
Xocfg_cache_grp grp = Grps__get_or_load(key);
|
||||
grp.Sub(sub, ctx, evt);
|
||||
}
|
||||
private Xocfg_cache_grp Grps__get_or_load(String key) {
|
||||
Xocfg_cache_grp grp = (Xocfg_cache_grp)grps.Get_by(key);
|
||||
return grp == null ? Load_grp(key) : grp;
|
||||
if (grp == null) {
|
||||
grp = Load_grp(key);
|
||||
grps.Add(key, grp);
|
||||
}
|
||||
return grp;
|
||||
}
|
||||
private Xocfg_cache_grp Load_grp(String key) {
|
||||
// get data from db
|
||||
Xoitm_meta_itm meta_itm = db_mgr.Tbl__itm_meta().Select_by_key_or_null(key);
|
||||
if (meta_itm == null) throw Err_.new_wo_type("cfg:grp not found;", "key", key);
|
||||
if (meta_itm == null) {
|
||||
Gfo_usr_dlg_.Instance.Warn_many("", "", "cfg:grp not found; key=~{0}", key);
|
||||
return new Xocfg_cache_grp(key, "");
|
||||
}
|
||||
Xoitm_data_itm[] itms = db_mgr.Tbl__itm_data().Select_all_by_id(meta_itm.Id());
|
||||
|
||||
// make
|
||||
|
||||
@@ -18,27 +18,64 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.addons.apps.cfgs.mgrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.apps.*; import gplx.xowa.addons.apps.cfgs.*;
|
||||
import org.junit.*; import gplx.core.tests.*; import gplx.dbs.*; import gplx.xowa.addons.apps.cfgs.dbs.*;
|
||||
public class Xocfg_cache_mgr__tst {
|
||||
// private final Xocfg_cache_mgr__fxt fxt = new Xocfg_cache_mgr__fxt();
|
||||
@Test public void Basic() {
|
||||
// fxt.Init__db_add("en.w", "key_1", "val_1");
|
||||
// fxt.Test__get("en.w", "key_1", "val_1");
|
||||
private final Xocfg_cache_mgr__fxt fxt = new Xocfg_cache_mgr__fxt();
|
||||
@Before public void init() {fxt.Clear();}
|
||||
@Test public void Get__wiki() {
|
||||
fxt.Init__db_add("en.w", "key_1", "val_1");
|
||||
fxt.Test__get("en.w", "key_1", "val_1");
|
||||
fxt.Test__get("en.d", "key_1", "dflt");
|
||||
}
|
||||
@Test public void Get__app() {
|
||||
String ctx = gplx.xowa.addons.apps.cfgs.gui.Xogui_itm.Ctx__app;
|
||||
fxt.Init__db_add(ctx, "key_1", "val_1");
|
||||
fxt.Test__get(ctx, "key_1", "val_1");
|
||||
fxt.Test__get("en.w", "key_1", "val_1");
|
||||
fxt.Test__get("en.d", "key_1", "val_1");
|
||||
}
|
||||
@Test public void Set__app() {
|
||||
String ctx = gplx.xowa.addons.apps.cfgs.gui.Xogui_itm.Ctx__app;
|
||||
fxt.Init__db_add(ctx, "key_1", "123");
|
||||
fxt.Init__sub(ctx, "key_1", "key_1");
|
||||
fxt.Exec__set(ctx, "key_1", "234");
|
||||
fxt.Test__get(ctx, "key_1", "234");
|
||||
fxt.Sub().Test__key_1(234);
|
||||
}
|
||||
}
|
||||
class Xocfg_cache_mgr__fxt {
|
||||
private final Xocfg_cache_mgr mgr;
|
||||
private final Xocfg_itm_bldr cfg_bldr;
|
||||
public Xocfg_cache_mgr__fxt() {
|
||||
private Xocfg_cache_mgr mgr = new Xocfg_cache_mgr();
|
||||
private Xocfg_itm_bldr cfg_bldr;
|
||||
public void Clear() {
|
||||
gplx.dbs.Db_conn_bldr.Instance.Reg_default_mem();
|
||||
Db_conn conn = Db_conn_bldr.Instance.Get_or_autocreate(true, Io_url_.new_any_("mem/xowa/wiki/en.wikipedia.org/"));
|
||||
this.mgr = new Xocfg_cache_mgr(conn);
|
||||
mgr.Init_by_app(conn);
|
||||
cfg_bldr = new Xocfg_itm_bldr(mgr.Db_mgr());
|
||||
}
|
||||
public void Init__db_add(String ctx, String key, String val) {
|
||||
public Xocfg_cache_sub_mock Sub() {return sub;} private Xocfg_cache_sub_mock sub = new Xocfg_cache_sub_mock();
|
||||
public void Init__db_add(String ctx, String key, Object val) {
|
||||
cfg_bldr.Create_grp("", "test_grp", "", "");
|
||||
cfg_bldr.Create_itm("test_grp", key, "wiki", "textbox", "", "dflt", "", "");
|
||||
mgr.Db_mgr().Set_str(ctx, key, val);
|
||||
int type_id = Type_adp_.To_tid_obj(val);
|
||||
cfg_bldr.Create_itm("test_grp", key, "wiki", type_id, "textbox", "", "dflt", "", "");
|
||||
mgr.Db_mgr().Set_str(ctx, key, Object_.Xto_str_strict_or_null(val));
|
||||
}
|
||||
public void Init__sub(String ctx, String key, String evt) {
|
||||
mgr.Sub(sub, ctx, key, evt);
|
||||
}
|
||||
public void Test__get(String ctx, String key, String expd) {
|
||||
Gftest.Eq__str(expd, mgr.Get(ctx, key));
|
||||
Gftest.Eq__str(expd, mgr.Get(ctx, key), "ctx={0} key={1}", ctx, key);
|
||||
}
|
||||
public void Exec__set(String ctx, String key, String val) {
|
||||
mgr.Set(ctx, key, val);
|
||||
}
|
||||
}
|
||||
class Xocfg_cache_sub_mock implements Gfo_invk {
|
||||
private int key_1;
|
||||
public void Test__key_1(int expd) {
|
||||
Gftest.Eq__int(expd, key_1);
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Evt__key_1)) {key_1 = m.ReadInt("v");}
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
public static final String Evt__key_1 = "key_1";
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.addons.apps.cfgs.mgrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.apps.*; import gplx.xowa.addons.apps.cfgs.*;
|
||||
class Xocfg_cache_sub {
|
||||
public Xocfg_cache_sub(Gfo_evt_itm sub, String ctx, String evt, String key) {
|
||||
public Xocfg_cache_sub(Gfo_invk sub, String ctx, String evt, String key) {
|
||||
this.ctx = ctx;
|
||||
this.key = key;
|
||||
this.evt = evt;
|
||||
@@ -26,5 +26,5 @@ class Xocfg_cache_sub {
|
||||
public String Ctx() {return ctx;} private final String ctx;
|
||||
public String Key() {return key;} private final String key;
|
||||
public String Evt() {return evt;} private final String evt;
|
||||
public Gfo_evt_itm Sub() {return sub;} private final Gfo_evt_itm sub;
|
||||
public Gfo_invk Sub() {return sub;} private final Gfo_invk sub;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class Xocfg_item_bridge implements Bridge_cmd_itm {
|
||||
itm_bldr.Create_grp(ary[1], ary[2], ary[3], ary[4]);
|
||||
}
|
||||
else {
|
||||
itm_bldr.Create_itm(ary[1], ary[2], ary[3], ary[4], ary[5], ary[6], ary[7], ary[8]);
|
||||
itm_bldr.Create_itm(ary[1], ary[2], ary[3], Type_adp_.To_tid(ary[4]), ary[5], ary[6], ary[7], ary[8], ary[9]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,19 +19,19 @@ package gplx.xowa.addons.apps.cfgs.specials.lists; import gplx.*; import gplx.xo
|
||||
import gplx.langs.jsons.*;
|
||||
import gplx.xowa.addons.apps.cfgs.dbs.*;
|
||||
public class Xocfg_list_bridge_mgr {
|
||||
private final Xocfg_db_mgr db_mgr;
|
||||
private final Xoa_app app;
|
||||
public Xocfg_list_bridge_mgr(Xoa_app app) {
|
||||
this.db_mgr = new Xocfg_db_mgr(app.User().User_db_mgr().Conn());
|
||||
this.app = app;
|
||||
}
|
||||
public void Upsert(Json_nde args) {
|
||||
String ctx = args.Get_as_str("ctx");
|
||||
String key = args.Get_as_str("key");
|
||||
String val = args.Get_as_str("val");
|
||||
db_mgr.Set_str(ctx, key, val);
|
||||
app.Cfg().Set_str(ctx, key, val);
|
||||
}
|
||||
public void Revert(Json_nde args) {
|
||||
String ctx = args.Get_as_str("ctx");
|
||||
String key = args.Get_as_str("key");
|
||||
db_mgr.Del(ctx, key);
|
||||
// String ctx = args.Get_as_str("ctx");
|
||||
// String key = args.Get_as_str("key");
|
||||
// app.Cfg().d.Del(ctx, key);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user