mirror of
https://github.com/gnosygnu/xowa.git
synced 2024-10-27 20:34:16 +00:00
Cfg: Add more implementation for cfg_cache and pub / sub
This commit is contained in:
parent
f7558a6761
commit
585ef1c2ce
@ -40,6 +40,17 @@ public class Bool_ {
|
||||
return false;
|
||||
throw Err_.new_parse_type(boolean.class, raw);
|
||||
}
|
||||
public static boolean Parse_or(String raw, boolean or) {
|
||||
if ( String_.Eq(raw, True_str)
|
||||
|| String_.Eq(raw, "True") // needed for Store_Wtr(){boolVal.toString();}
|
||||
)
|
||||
return true;
|
||||
else if ( String_.Eq(raw, False_str)
|
||||
|| String_.Eq(raw, "False")
|
||||
)
|
||||
return false;
|
||||
return or;
|
||||
}
|
||||
public static int Compare(boolean lhs, boolean rhs) {
|
||||
if ( lhs == rhs) return CompareAble_.Same;
|
||||
else if (!lhs && rhs) return CompareAble_.Less;
|
||||
|
@ -17,7 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx;
|
||||
public class Char_ {
|
||||
public static final Class<?> Cls_ref_type = Character.class;
|
||||
public static final String Cls_val_name = "char";
|
||||
public static final Class<?> Cls_ref_type = Character.class;
|
||||
public static final char Null = '\0', NewLine = '\n';
|
||||
public static boolean IsCaseLower(char c) {return Character.isLowerCase(c);}
|
||||
public static boolean IsLetterOrDigit(char c) {return Character.isLetterOrDigit(c);}
|
||||
|
@ -21,6 +21,7 @@ import java.text.NumberFormat;
|
||||
import java.text.ParseException;
|
||||
import java.util.Locale;
|
||||
public class Decimal_adp_ {
|
||||
public static final String Cls_val_name = "decimal";
|
||||
public static final Class<?> Cls_ref_type = Decimal_adp.class;
|
||||
public static Decimal_adp as_(Object obj) {return obj instanceof Decimal_adp ? (Decimal_adp)obj : null;}
|
||||
public static final Decimal_adp Zero = new Decimal_adp(0);
|
||||
|
@ -18,13 +18,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx;
|
||||
public class Double_ {
|
||||
public static final String Cls_val_name = "double";
|
||||
public static final Class<?> Cls_ref_type = Double.class;
|
||||
public static final Class<?> Cls_ref_type = Double.class;
|
||||
public static final double
|
||||
MinValue = Double.MIN_VALUE
|
||||
, NaN = Double.NaN
|
||||
, Inf_pos = Double.POSITIVE_INFINITY
|
||||
;
|
||||
public static final byte[]
|
||||
public static final byte[]
|
||||
NaN_bry = Bry_.new_a7("NaN")
|
||||
, Inf_pos_bry = Bry_.new_a7("INF")
|
||||
;
|
||||
|
@ -17,7 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx;
|
||||
public class Short_ {
|
||||
public static final Class<?> Cls_ref_type = Short.class;
|
||||
public static final String Cls_val_name = "short";
|
||||
public static final Class<?> Cls_ref_type = Short.class;
|
||||
public static short cast(Object obj) {try {return (Short)obj;} catch(Exception exc) {throw Err_.new_type_mismatch_w_exc(exc, short.class, obj);}}
|
||||
public static short By_int(int v) {return (short)v;}
|
||||
}
|
||||
|
@ -62,20 +62,35 @@ public class Type_adp_ {
|
||||
else if (Type_adp_.Eq(type, Char_.Cls_ref_type)) return Tid__char;
|
||||
else return Tid__obj;
|
||||
}
|
||||
public static int To_tid(String name) {
|
||||
if (String_.Eq(name, Int_.Cls_val_name)) return Tid__int;
|
||||
else if (String_.Eq(name, String_.Cls_val_name)) return Tid__str;
|
||||
else if (String_.Eq(name, Bry_.Cls_val_name)) return Tid__bry;
|
||||
else if (String_.Eq(name, Bool_.Cls_val_name)) return Tid__bool;
|
||||
else if (String_.Eq(name, Byte_.Cls_val_name)) return Tid__byte;
|
||||
else if (String_.Eq(name, Long_.Cls_val_name)) return Tid__long;
|
||||
else if (String_.Eq(name, Double_.Cls_val_name)) return Tid__double;
|
||||
else if (String_.Eq(name, Decimal_adp_.Cls_val_name)) return Tid__decimal;
|
||||
else if (String_.Eq(name, DateAdp_.Cls_ref_name)) return Tid__date;
|
||||
else if (String_.Eq(name, Float_.Cls_val_name)) return Tid__float;
|
||||
else if (String_.Eq(name, Short_.Cls_val_name)) return Tid__short;
|
||||
else if (String_.Eq(name, Char_.Cls_val_name)) return Tid__char;
|
||||
else return Tid__obj;
|
||||
}
|
||||
public static final int
|
||||
Tid__obj = 0
|
||||
, Tid__null = 1
|
||||
, Tid__bool = 2
|
||||
, Tid__byte = 3
|
||||
, Tid__short = 4
|
||||
, Tid__int = 5
|
||||
, Tid__long = 6
|
||||
, Tid__float = 7
|
||||
, Tid__double = 8
|
||||
, Tid__char = 9
|
||||
, Tid__str = 10
|
||||
, Tid__bry = 11
|
||||
, Tid__date = 12
|
||||
, Tid__decimal = 13
|
||||
Tid__obj = 0
|
||||
, Tid__null = 1
|
||||
, Tid__bool = 2
|
||||
, Tid__byte = 3
|
||||
, Tid__short = 4
|
||||
, Tid__int = 5
|
||||
, Tid__long = 6
|
||||
, Tid__float = 7
|
||||
, Tid__double = 8
|
||||
, Tid__char = 9
|
||||
, Tid__str = 10
|
||||
, Tid__bry = 11
|
||||
, Tid__date = 12
|
||||
, Tid__decimal = 13
|
||||
;
|
||||
}
|
||||
|
@ -150,6 +150,7 @@ public class Db_conn {
|
||||
}
|
||||
public Db_stmt Stmt_select_max(String tbl, String col, String... where) {
|
||||
Db_qry__select_in_tbl qry = new Db_qry__select_in_tbl(tbl, String_.Ary(String_.Format("Max({0}) AS {0}", col)), where, null, null, null, null);
|
||||
qry.Where_(where.length == 0 ? Db_crt_.Wildcard : Db_crt_.eq_many_(where));
|
||||
return engine.Stmt_by_qry(qry);
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@ public class Db_qry__select_in_tbl implements Db_qry {
|
||||
public boolean Exec_is_rdr() {return true;}
|
||||
public String Base_table() {return base_table;} private final String base_table;
|
||||
public Criteria Where() {return where;} private Criteria where;
|
||||
public void Where_(Criteria v) {this.where = v;}
|
||||
public String[] Select_flds() {return select_flds;} private final String[] select_flds;
|
||||
private final String[] where_flds;
|
||||
public void Where_sql(String_bldr sb) {
|
||||
|
@ -31,6 +31,7 @@ import gplx.xowa.users.*;
|
||||
import gplx.xowa.bldrs.*;
|
||||
import gplx.xowa.addons.*; import gplx.xowa.specials.mgrs.*;
|
||||
import gplx.xowa.parsers.amps.*;
|
||||
import gplx.xowa.addons.apps.cfgs.*;
|
||||
public interface Xoa_app extends Gfo_invk {
|
||||
boolean Tid_is_edit();
|
||||
Xoa_app_mode Mode();
|
||||
@ -49,6 +50,7 @@ public interface Xoa_app extends Gfo_invk {
|
||||
Xog_tab_mgr Gui__tab_mgr();
|
||||
Xou_user User();
|
||||
Xowmf_mgr Wmf_mgr();
|
||||
Xocfg_mgr Cfg();
|
||||
boolean Xwiki_mgr__missing(byte[] domain);
|
||||
Xoa_sitelink_mgr Xwiki_mgr__sitelink_mgr();
|
||||
Xow_xwiki_itm_parser Xwiki_mgr__itm_parser();
|
||||
|
@ -30,6 +30,7 @@ import gplx.xowa.parsers.utils.*; import gplx.xowa.parsers.logs.*; import gplx.x
|
||||
import gplx.xowa.bldrs.wms.*;
|
||||
import gplx.xowa.wikis.tdbs.*; import gplx.xowa.wikis.tdbs.hives.*; import gplx.xowa.wikis.xwikis.*;
|
||||
import gplx.xowa.addons.*; import gplx.xowa.specials.mgrs.*;
|
||||
import gplx.xowa.addons.apps.cfgs.*;
|
||||
public class Xoae_app implements Xoa_app, Gfo_invk {
|
||||
public Xoae_app(Gfo_usr_dlg usr_dlg, Xoa_app_mode mode, Io_url root_dir, Io_url wiki_dir, Io_url file_dir, Io_url user_dir, Io_url css_dir, String bin_dir_name) {
|
||||
Xoa_app_.Usr_dlg_(usr_dlg);
|
||||
@ -94,7 +95,7 @@ public class Xoae_app implements Xoa_app, Gfo_invk {
|
||||
public Xog_cbk_mgr Gui__cbk_mgr() {return gui__cbk_mgr;} private final Xog_cbk_mgr gui__cbk_mgr = new Xog_cbk_mgr();
|
||||
public Xog_tab_mgr Gui__tab_mgr() {return gui__tab_mgr;} private final Xog_tab_mgr gui__tab_mgr;
|
||||
public Gfo_thread_mgr Thread_mgr() {return thread_mgr;} private final Gfo_thread_mgr thread_mgr = new Gfo_thread_mgr();
|
||||
|
||||
public Xocfg_mgr Cfg() {return cfg;} private final Xocfg_mgr cfg = new Xocfg_mgr();
|
||||
|
||||
public Xoae_wiki_mgr Wiki_mgr() {return wiki_mgr;} private Xoae_wiki_mgr wiki_mgr;
|
||||
public Xoa_wiki_mgr Wiki_mgri() {return wiki_mgr;}
|
||||
@ -146,6 +147,7 @@ public class Xoae_app implements Xoa_app, Gfo_invk {
|
||||
public void Init_by_app() {
|
||||
stage = Xoa_stage_.Tid_init;
|
||||
user.Init_by_app(this);
|
||||
cfg.Init_by_app(user.User_db_mgr().Conn());
|
||||
prog_mgr.Init_by_app(url_cmd_eval);
|
||||
xtn_mgr.Init_by_app(this);
|
||||
gui_mgr.Init_by_app();
|
||||
@ -195,6 +197,7 @@ public class Xoae_app implements Xoa_app, Gfo_invk {
|
||||
this.Utl__bfr_mkr().Clear();
|
||||
msg_log.Clear();
|
||||
wiki_mgr.Free_mem(clear_ctx);
|
||||
if (cfg != null) cfg.Clear(); // TEST:cfg is null b/c tests do not call Init_by_app
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_gui)) return gui_mgr;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ import gplx.xowa.bldrs.wms.*;
|
||||
import gplx.langs.htmls.encoders.*;
|
||||
import gplx.xowa.bldrs.*;
|
||||
import gplx.xowa.addons.*; import gplx.xowa.specials.mgrs.*;
|
||||
import gplx.xowa.addons.apps.cfgs.*;
|
||||
public class Xoav_app implements Xoa_app, Gfo_invk {
|
||||
public Xoav_app(Gfo_usr_dlg usr_dlg, Xoa_app_mode mode, Xog_tab_mgr tab_mgr, String plat_name, Io_url root_dir, Io_url file_dir, Io_url css_dir, Io_url http_root) {
|
||||
Xoa_app_.Usr_dlg_(usr_dlg); this.usr_dlg = usr_dlg; this.mode = mode;
|
||||
@ -79,6 +80,7 @@ public class Xoav_app implements Xoa_app, Gfo_invk {
|
||||
public Xog_tab_mgr Gui__tab_mgr() {return gui__tab_mgr;} private final Xog_tab_mgr gui__tab_mgr;
|
||||
public Gfo_thread_mgr Thread_mgr() {return thread_mgr;} private final Gfo_thread_mgr thread_mgr = new Gfo_thread_mgr();
|
||||
public Xop_amp_mgr Parser_amp_mgr() {return parser_amp_mgr;} private final Xop_amp_mgr parser_amp_mgr = Xop_amp_mgr.Instance;
|
||||
public Xocfg_mgr Cfg() {return cfg;} private final Xocfg_mgr cfg = new Xocfg_mgr();
|
||||
|
||||
public Xowmf_mgr Wmf_mgr() {return wmf_mgr;} private final Xowmf_mgr wmf_mgr = new Xowmf_mgr();
|
||||
public Gfo_usr_dlg Usr_dlg() {return usr_dlg;} public void Usr_dlg_(Gfo_usr_dlg v) {usr_dlg = v; Xoa_app_.Usr_dlg_(usr_dlg);} private Gfo_usr_dlg usr_dlg = Gfo_usr_dlg_.Noop;
|
||||
@ -95,6 +97,10 @@ public class Xoav_app implements Xoa_app, Gfo_invk {
|
||||
public void Init_by_app(Io_url user_db_url) {
|
||||
user.Init_db(this, wiki_mgr, user_db_url);
|
||||
this.Addon_mgr().Add_dflts_by_app(this).Run_by_app(this);
|
||||
cfg.Init_by_app(user.User_db_mgr().Conn());
|
||||
}
|
||||
public void Free_mem() { // NOTE:not yet called in drd; DATE:2016-12-04
|
||||
cfg.Clear();
|
||||
}
|
||||
public static Xoav_app New_by_drd(gplx.xowa.drds.files.Xod_fsys_mgr fsys_mgr, Xog_tab_mgr tab_mgr) {
|
||||
// create log
|
||||
|
@ -25,7 +25,6 @@ public class Xoapi_addon implements Gfo_invk {
|
||||
public boolean App__scripting__enabled() {return app__scripting__enabled;} private boolean app__scripting__enabled = false;
|
||||
public String App__update__restart_cmd() {return app__update__restart_cmd;} private String app__update__restart_cmd = "";
|
||||
public String App__update__update_db_src() {return app__update__update_db_src;} private String app__update__update_db_src = "http://xowa.org";
|
||||
public boolean Parser__hdr__section_editable() {return parser__hdr__section_editable;} private boolean parser__hdr__section_editable = false;
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk__search)) return search;
|
||||
else if (ctx.Match(k, Invk__bldr)) return bldr;
|
||||
@ -39,8 +38,6 @@ public class Xoapi_addon implements Gfo_invk {
|
||||
else if (ctx.Match(k, Invk__app__update__restart_cmd_)) app__update__restart_cmd = m.ReadStr("v");
|
||||
else if (ctx.Match(k, Invk__app__update__update_db_src)) return app__update__update_db_src;
|
||||
else if (ctx.Match(k, Invk__app__update__update_db_src_)) app__update__update_db_src = m.ReadStr("v");
|
||||
else if (ctx.Match(k, Invk__parser__hdr__section_editable)) return Yn.To_str(parser__hdr__section_editable);
|
||||
else if (ctx.Match(k, Invk__parser__hdr__section_editable_)) parser__hdr__section_editable = m.ReadBool("v");
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
@ -55,8 +52,6 @@ public class Xoapi_addon implements Gfo_invk {
|
||||
, Invk__app__update__restart_cmd_ = "app__update__restart_cmd_"
|
||||
, Invk__app__update__update_db_src = "app__update__update_db_src"
|
||||
, Invk__app__update__update_db_src_ = "app__update__update_db_src_"
|
||||
, Invk__parser__hdr__section_editable = "parser__hdr__section_editable"
|
||||
, Invk__parser__hdr__section_editable_ = "parser__hdr__section_editable_"
|
||||
;
|
||||
public static boolean app__page_history__log_all;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public class Xog_tab_itm implements Gfo_invk {
|
||||
private Xog_win_itm win; private Xocfg_tab_mgr cfg_tab_mgr;
|
||||
public Xog_tab_itm(Xog_tab_mgr tab_mgr, Gfui_tab_itm_data tab_data, Xowe_wiki wiki, Xoae_page page) {
|
||||
this.tab_mgr = tab_mgr; this.tab_data = tab_data; this.wiki = wiki; this.page = page;
|
||||
this.win = tab_mgr.Win(); this.cfg_tab_mgr = win.App().Cfg_regy ().App().Gui_mgr().Tab_mgr();
|
||||
this.win = tab_mgr.Win(); this.cfg_tab_mgr = win.App().Cfg_regy().App().Gui_mgr().Tab_mgr();
|
||||
this.html_itm = new Xog_html_itm(this);
|
||||
cmd_sync = win.Kit().New_cmd_sync(this);
|
||||
}
|
||||
|
@ -41,7 +41,8 @@ public class Xoh_html_wtr {
|
||||
|
||||
public void Init_by_wiki(Xowe_wiki wiki) {
|
||||
cfg.Toc__show_(Bool_.Y).Lnki__title_(true).Lnki__visited_y_().Lnki__id_(Bool_.Y); // NOTE: set during Init_by_wiki, b/c all tests assume these are false
|
||||
cfg.Section_editable_(wiki.Appe().Api_root().Addon().Parser__hdr__section_editable());
|
||||
|
||||
cfg.Section_editable_(wiki.App().Cfg().Bind_bool(wiki, gplx.xowa.htmls.core.wkrs.hdrs.Xoh_section_editable_.Cfg__section_editing__enabled, cfg));
|
||||
ref_wtr.Init_by_wiki(wiki);
|
||||
}
|
||||
public void Init_by_page(Xop_ctx ctx, Xoh_wtr_ctx hctx, byte[] src, Xoae_page page) {
|
||||
|
@ -16,10 +16,16 @@ 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.htmls.core.htmls; import gplx.*; import gplx.xowa.*; import gplx.xowa.htmls.*; import gplx.xowa.htmls.core.*;
|
||||
public class Xoh_html_wtr_cfg {
|
||||
public class Xoh_html_wtr_cfg implements Gfo_invk {
|
||||
public boolean Toc__show() {return toc__show;} public Xoh_html_wtr_cfg Toc__show_(boolean v) {toc__show = v; return this;} private boolean toc__show;
|
||||
public boolean Lnki__id() {return lnki__id;} public Xoh_html_wtr_cfg Lnki__id_(boolean v) {lnki__id = v; return this;} private boolean lnki__id;
|
||||
public boolean Lnki__title() {return lnki__title;} public Xoh_html_wtr_cfg Lnki__title_(boolean v) {lnki__title = v; return this;} private boolean lnki__title;
|
||||
public boolean Lnki__visited() {return lnki__visited;} public Xoh_html_wtr_cfg Lnki__visited_y_() {lnki__visited = true; return this;} private boolean lnki__visited;
|
||||
public boolean Section_editable() {return section_editable;} public Xoh_html_wtr_cfg Section_editable_(boolean v) {section_editable = v; return this;} private boolean section_editable;
|
||||
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, gplx.xowa.htmls.core.wkrs.hdrs.Xoh_section_editable_.Cfg__section_editing__enabled)) section_editable = m.ReadBool("v");
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@ -18,8 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.htmls.core.wkrs.hdrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.htmls.*; import gplx.xowa.htmls.core.*; import gplx.xowa.htmls.core.wkrs.*;
|
||||
import gplx.xowa.parsers.*; import gplx.xowa.parsers.tmpls.*; import gplx.xowa.parsers.hdrs.*;
|
||||
public class Xoh_section_editable_ {
|
||||
public static void Write_imt1(Bry_bfr bfr, Xop_ctx ctx, Xop_tkn_itm tkn) {
|
||||
public static void Write_imt(Bry_bfr bfr, Xop_ctx ctx, Xop_tkn_itm tkn) {
|
||||
Xop_hdr_tkn hdr_tkn = (Xop_hdr_tkn)tkn;
|
||||
ctx.Wiki().Parser_mgr().Hdr__section_editable__imt_fmt().Bld_many_to_bry(bfr, hdr_tkn.Section_editable_page(), hdr_tkn.Section_editable_idx());
|
||||
}
|
||||
public static final String Cfg__section_editing__enabled = "section_editing.enabled";
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ import gplx.xowa.wikis.*; import gplx.core.envs.*;
|
||||
import gplx.xowa.files.*;
|
||||
import gplx.xowa.xtns.scribunto.*; import gplx.xowa.xtns.wbases.hwtrs.*; import gplx.xowa.xtns.pfuncs.ifs.*; import gplx.xowa.xtns.pfuncs.times.*; import gplx.xowa.xtns.pfuncs.ttls.*;
|
||||
import gplx.xowa.parsers.uniqs.*; import gplx.xowa.parsers.hdrs.sections.*;
|
||||
public class Xow_parser_mgr {
|
||||
public class Xow_parser_mgr implements Gfo_invk {
|
||||
private final Xowe_wiki wiki; private final Xop_tkn_mkr tkn_mkr;
|
||||
public Xow_parser_mgr(Xowe_wiki wiki) {
|
||||
this.wiki = wiki; this.tkn_mkr = wiki.Appe().Parser_mgr().Tkn_mkr();
|
||||
@ -84,7 +84,8 @@ public class Xow_parser_mgr {
|
||||
tmpl_stack_ary = Bry_.Ary_empty;
|
||||
tmpl_stack_ary_len = tmpl_stack_ary_max = 0;
|
||||
uniq_mgr.Clear();
|
||||
hdr__section_editable__enabled = page.Wikie().Appe().Api_root().Addon().Parser__hdr__section_editable();
|
||||
|
||||
hdr__section_editable__enabled = page.Wiki().App().Cfg().Bind_bool(wiki, gplx.xowa.htmls.core.wkrs.hdrs.Xoh_section_editable_.Cfg__section_editing__enabled, this);
|
||||
|
||||
scrib.When_page_changed(page); // notify scribunto about page changed
|
||||
ctx.Page_(page);
|
||||
@ -98,4 +99,9 @@ public class Xow_parser_mgr {
|
||||
page.Root_(root);
|
||||
root.Data_htm_(root.Root_src());
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, gplx.xowa.htmls.core.wkrs.hdrs.Xoh_section_editable_.Cfg__section_editing__enabled)) hdr__section_editable__enabled = m.ReadBool("v");
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@ -23,17 +23,19 @@ public class Xow_domain_itm {
|
||||
this.domain_str = String_.new_u8(domain_bry);
|
||||
this.abrv_wm = Xow_abrv_wm_.To_abrv(this);
|
||||
this.abrv_xo = Xow_abrv_xo_.To_bry(domain_bry, lang_orig_key, domain_type);
|
||||
this.abrv_xo_str = String_.new_u8(abrv_xo);
|
||||
}
|
||||
public byte[] Domain_bry() {return domain_bry;} private final byte[] domain_bry;
|
||||
public String Domain_str() {return domain_str;} private final String domain_str;
|
||||
public Xow_domain_tid Domain_type() {return domain_type;} private final Xow_domain_tid domain_type;
|
||||
public byte[] Domain_bry() {return domain_bry;} private final byte[] domain_bry;
|
||||
public String Domain_str() {return domain_str;} private final String domain_str;
|
||||
public Xow_domain_tid Domain_type() {return domain_type;} private final Xow_domain_tid domain_type;
|
||||
public int Domain_type_id() {return domain_type.Tid();}
|
||||
public byte[] Abrv_wm() {return abrv_wm;} private final byte[] abrv_wm; // EX: enwiki
|
||||
public byte[] Abrv_xo() {return abrv_xo;} private final byte[] abrv_xo; // EX: en.w
|
||||
public Xol_lang_stub Lang_actl_itm() {return lang_actl_itm;} private final Xol_lang_stub lang_actl_itm; // EX: zh
|
||||
public byte[] Abrv_wm() {return abrv_wm;} private final byte[] abrv_wm; // EX: enwiki
|
||||
public byte[] Abrv_xo() {return abrv_xo;} private final byte[] abrv_xo; // EX: en.w
|
||||
public String Abrv_xo_str() {return abrv_xo_str;} private final String abrv_xo_str; // EX: en.w
|
||||
public Xol_lang_stub Lang_actl_itm() {return lang_actl_itm;} private final Xol_lang_stub lang_actl_itm; // EX: zh
|
||||
public int Lang_actl_uid() {return lang_actl_itm.Id();}
|
||||
public byte[] Lang_actl_key() {return lang_actl_itm.Key();}
|
||||
public byte[] Lang_orig_key() {return lang_orig_key;} private final byte[] lang_orig_key; // EX: lzh
|
||||
public byte[] Lang_orig_key() {return lang_orig_key;} private final byte[] lang_orig_key; // EX: lzh
|
||||
public int Sort_idx() {return sort_idx;} public void Sort_idx_(int v) {sort_idx = v;} private int sort_idx = -1; // used for Search
|
||||
public static Xow_domain_itm new_(byte[] domain_bry, int domain_tid, byte[] lang_key) {
|
||||
Xol_lang_stub lang_actl_itm = Xol_lang_stub_.Get_by_key_or_intl(lang_key);
|
||||
|
Loading…
Reference in New Issue
Block a user