mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.4.2.1'
This commit is contained in:
@@ -23,7 +23,7 @@ public class Xou_db_file {
|
||||
private final Db_conn conn;
|
||||
public Xou_db_file(Db_conn conn) {
|
||||
this.conn = conn;
|
||||
this.tbl__cfg = new Db_cfg_tbl(conn, "xowa_cfg");
|
||||
this.tbl__cfg = gplx.xowa.wikis.data.Xowd_cfg_tbl_.New(conn);
|
||||
this.tbl__site = new Xoud_site_tbl(conn);
|
||||
this.tbl__history = new Xoud_history_tbl(conn);
|
||||
this.tbl__cache = new Xou_cache_tbl(conn);
|
||||
|
||||
@@ -20,32 +20,38 @@ import gplx.core.threads.*; import gplx.dbs.*; import gplx.dbs.metas.updates.*;
|
||||
import gplx.xowa.files.caches.*;
|
||||
import gplx.xowa.users.bmks.*; import gplx.xowa.users.history.*;
|
||||
public class Xou_db_mgr {
|
||||
private final Xoa_app app;
|
||||
private final Xoud_id_mgr id_mgr;
|
||||
private final Xoa_app app;
|
||||
private final Xoud_id_mgr id_mgr;
|
||||
private Db_conn conn;
|
||||
public Xou_db_mgr(Xoa_app app) {
|
||||
this.app = app;
|
||||
this.id_mgr = new Xoud_id_mgr(cfg_mgr);
|
||||
this.site_mgr = new Xoud_site_mgr(id_mgr);
|
||||
}
|
||||
public Xou_db_file Db_file() {return db_file;} private Xou_db_file db_file;
|
||||
public Xoud_cfg_mgr Cfg_mgr() {return cfg_mgr;} private final Xoud_cfg_mgr cfg_mgr = new Xoud_cfg_mgr();
|
||||
public Xoud_site_mgr Site_mgr() {return site_mgr;} private final Xoud_site_mgr site_mgr;
|
||||
public Xoud_history_mgr History_mgr() {return history_mgr;} private final Xoud_history_mgr history_mgr = new Xoud_history_mgr();
|
||||
public Xoud_bmk_mgr Bmk_mgr() {return bmk_mgr;} private final Xoud_bmk_mgr bmk_mgr = new Xoud_bmk_mgr();
|
||||
public Xoud_cfg_mgr Cfg_mgr() {return cfg_mgr;} private final Xoud_cfg_mgr cfg_mgr = new Xoud_cfg_mgr();
|
||||
public Xoud_site_mgr Site_mgr() {return site_mgr;} private final Xoud_site_mgr site_mgr;
|
||||
public Xoud_history_mgr History_mgr() {return history_mgr;} private final Xoud_history_mgr history_mgr = new Xoud_history_mgr();
|
||||
public Xoud_bmk_mgr Bmk_mgr() {return bmk_mgr;} private final Xoud_bmk_mgr bmk_mgr = new Xoud_bmk_mgr();
|
||||
public Xou_cache_mgr Cache_mgr() {return cache_mgr;} private Xou_cache_mgr cache_mgr;
|
||||
public Xou_file_itm_finder File__xfer_itm_finder() {return xfer_itm_finder;} private Xou_file_itm_finder xfer_itm_finder;
|
||||
public void Init_by_app(boolean drd, Io_url db_url) {
|
||||
Db_conn_bldr_data db_conn_bldr = Db_conn_bldr.Instance.Get_or_new(db_url);
|
||||
Db_conn conn = db_conn_bldr.Conn(); boolean created = db_conn_bldr.Created();
|
||||
this.conn = db_conn_bldr.Conn(); boolean created = db_conn_bldr.Created();
|
||||
this.db_file = new Xou_db_file(conn); db_file.Init_assert();
|
||||
this.cache_mgr = new Xou_cache_mgr(app.Wiki_mgri(), app.Fsys_mgr().File_dir(), db_file);
|
||||
this.xfer_itm_finder = new Xou_file_itm_finder(cache_mgr);
|
||||
this.bmk_mgr.Conn_(conn, created);
|
||||
// this.history_mgr.Conn_(conn, created);
|
||||
if (drd) {
|
||||
cfg_mgr.Conn_(conn, created);
|
||||
site_mgr.Conn_(conn, created);
|
||||
this.Init_site_mgr();
|
||||
// history_mgr.Conn_(user_conn, created);
|
||||
}
|
||||
}
|
||||
private boolean init_site_mgr;
|
||||
public void Init_site_mgr() {
|
||||
if (init_site_mgr) return; init_site_mgr = true;
|
||||
cfg_mgr.Conn_ (conn, !conn.Meta_tbl_exists(Xoud_cfg_mgr.Tbl_name));
|
||||
site_mgr.Conn_(conn, !conn.Meta_tbl_exists(Xoud_site_tbl.Tbl_name));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,10 +17,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.users.data; import gplx.*; import gplx.xowa.*; import gplx.xowa.users.*;
|
||||
import gplx.dbs.*; import gplx.dbs.cfgs.*;
|
||||
public class Xoud_cfg_mgr {
|
||||
public class Xoud_cfg_mgr {
|
||||
public Db_cfg_tbl Tbl() {return tbl;} private Db_cfg_tbl tbl;
|
||||
public static final String Tbl_name = "user_opt";
|
||||
public void Conn_(Db_conn new_conn, boolean created) {
|
||||
tbl = new Db_cfg_tbl(new_conn, "user_opt");
|
||||
tbl = new Db_cfg_tbl(new_conn, Tbl_name);
|
||||
if (created) tbl.Create_tbl();
|
||||
}
|
||||
public int Select_int_or(String grp, String key, int or) {
|
||||
|
||||
@@ -19,7 +19,7 @@ package gplx.xowa.users.data; import gplx.*; import gplx.xowa.*; import gplx.xow
|
||||
import gplx.dbs.*; import gplx.xowa.users.data.*;
|
||||
public class Xoud_site_mgr {
|
||||
private Xoud_site_tbl tbl;
|
||||
private final Xoud_id_mgr id_mgr;
|
||||
private final Xoud_id_mgr id_mgr;
|
||||
public Xoud_site_mgr(Xoud_id_mgr id_mgr) {this.id_mgr = id_mgr;}
|
||||
public void Conn_(Db_conn conn, boolean created) {
|
||||
tbl = new Xoud_site_tbl(conn);
|
||||
|
||||
@@ -18,9 +18,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.users.data; import gplx.*; import gplx.xowa.*; import gplx.xowa.users.*;
|
||||
import gplx.dbs.*;
|
||||
public class Xoud_site_tbl implements Rls_able {
|
||||
private final String tbl_name = "user_site"; private final Dbmeta_fld_list flds = Dbmeta_fld_list.new_();
|
||||
private final String fld_site_id, fld_site_priority, fld_site_domain, fld_site_name, fld_site_path, fld_site_xtn;
|
||||
private final Db_conn conn;
|
||||
public static final String Tbl_name = "user_site";
|
||||
private final String tbl_name = Tbl_name; private final Dbmeta_fld_list flds = Dbmeta_fld_list.new_();
|
||||
private final String fld_site_id, fld_site_priority, fld_site_domain, fld_site_name, fld_site_path, fld_site_xtn;
|
||||
private final Db_conn conn;
|
||||
public Xoud_site_tbl(Db_conn conn) {
|
||||
this.conn = conn;
|
||||
fld_site_id = flds.Add_int_pkey("site_id");
|
||||
|
||||
Reference in New Issue
Block a user