mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.12.1.1
This commit is contained in:
@@ -32,11 +32,11 @@ public class Xow_data_mgr implements GfoInvkAble {
|
||||
public Xoae_page Get_page(Xoa_ttl ttl, boolean called_from_tmpl) {tmp_url = wiki.Utl__url_parser().Parse(ttl.Raw()); return Get_page(tmp_url, ttl, called_from_tmpl, false);}
|
||||
public Xoae_page Get_page_from_msg(Xoa_ttl ttl) {tmp_url = wiki.Utl__url_parser().Parse(ttl.Raw()); return Get_page(tmp_url, ttl, false, true);}
|
||||
public Xoae_page Get_page(Xoa_url url, Xoa_ttl ttl, boolean called_from_tmpl, boolean called_from_msg) {
|
||||
Xoae_page rv = Xoae_page.new_(wiki, ttl);
|
||||
Xoae_page rv = Xoae_page.New(wiki, ttl);
|
||||
return Get_page(rv, url, ttl, called_from_tmpl, called_from_msg);
|
||||
}
|
||||
public Xoae_page Get_page(Xoae_page rv, Xoa_url url, Xoa_ttl ttl, boolean called_from_tmpl, boolean called_from_msg) {
|
||||
rv.Url_(url); // NOTE: must update page.Url(); should combine with Xoae_page.new_()
|
||||
rv.Url_(url); // NOTE: must update page.Url(); should combine with Xoae_page.New()
|
||||
Xow_ns ns = ttl.Ns();
|
||||
switch (ns.Id()) {
|
||||
case Xow_ns_.Tid__special:
|
||||
@@ -87,7 +87,7 @@ public class Xow_data_mgr implements GfoInvkAble {
|
||||
public Xoae_page Load_page_by_ttl(Xoa_url url, Xoa_ttl ttl, Xog_tab_itm tab) {return Load_page_by_ttl(url, ttl, wiki.Lang(), tab, true);}
|
||||
public Xoae_page Load_page_by_ttl(Xoa_url url, Xoa_ttl ttl, Xol_lang_itm lang, Xog_tab_itm tab, boolean parse_page) {
|
||||
wiki.Init_assert();
|
||||
Xoae_page page = Xoae_page.new_(wiki, ttl); page.Tab_data().Tab_(tab);
|
||||
Xoae_page page = Xoae_page.New(wiki, ttl); page.Tab_data().Tab_(tab);
|
||||
this.Get_page(page, url, ttl, false, false); // get page from data_mgr
|
||||
if (page.Missing()) { // page doesn't exist
|
||||
boolean vnt_missing = true;
|
||||
|
||||
@@ -138,13 +138,13 @@ class Xow_data_mgr_fxt {
|
||||
}
|
||||
public Xow_data_mgr_fxt Update(String ttl_str, String data) {
|
||||
Xoa_ttl ttl = Xoa_ttl.parse(wiki, Bry_.new_u8(ttl_str));
|
||||
Xoae_page page = Xoae_page.test_(wiki, ttl);
|
||||
Xoae_page page = Xoae_page.New_test(wiki, ttl);
|
||||
wiki.Db_mgr().Save_mgr().Data_update(page, Bry_.new_u8(data));
|
||||
return this;
|
||||
}
|
||||
public Xow_data_mgr_fxt Rename(String old_ttl, String new_ttl) {
|
||||
Xoa_ttl ttl = Xoa_ttl.parse(wiki, Bry_.new_u8(old_ttl));
|
||||
Xoae_page page = Xoae_page.test_(wiki, ttl);
|
||||
Xoae_page page = Xoae_page.New_test(wiki, ttl);
|
||||
wiki.Db_mgr().Save_mgr().Data_rename(page, ttl.Ns().Id(), Bry_.new_u8(new_ttl));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -19,11 +19,12 @@ package gplx.xowa.wikis.data; import gplx.*; import gplx.xowa.*; import gplx.xow
|
||||
import gplx.core.ios.*; import gplx.dbs.*; import gplx.dbs.cfgs.*;
|
||||
import gplx.dbs.metas.*; import gplx.xowa.bldrs.cmds.*; import gplx.xowa.wikis.dbs.*;
|
||||
public class Xowd_core_db_props {
|
||||
public Xowd_core_db_props(int schema, Xowd_db_layout layout_text, Xowd_db_layout layout_html, Xowd_db_layout layout_file, byte zip_tid_text, byte zip_tid_html, boolean hzip_enabled) {
|
||||
public Xowd_core_db_props(int schema, Xowd_db_layout layout_text, Xowd_db_layout layout_html, Xowd_db_layout layout_file
|
||||
, byte zip_tid_text, byte zip_tid_html, boolean hzip_enabled, boolean hzip_mode_is_b256) {
|
||||
this.schema = schema;
|
||||
this.layout_text = layout_text; this.layout_html = layout_html; this.layout_file = layout_file;
|
||||
this.zip_tid_text = zip_tid_text; this.zip_tid_html = zip_tid_html;
|
||||
this.hzip_enabled = hzip_enabled;
|
||||
this.hzip_enabled = hzip_enabled; this.hzip_mode_is_b256 = hzip_mode_is_b256;
|
||||
}
|
||||
public int Schema() {return schema;} private final int schema;
|
||||
public boolean Schema_is_1() {return schema == 1;}
|
||||
@@ -33,6 +34,7 @@ public class Xowd_core_db_props {
|
||||
public byte Zip_tid_text() {return zip_tid_text;} private final byte zip_tid_text;
|
||||
public byte Zip_tid_html() {return zip_tid_html;} private final byte zip_tid_html;
|
||||
public boolean Hzip_enabled() {return hzip_enabled;} private final boolean hzip_enabled;
|
||||
public boolean Hzip_mode_is_b256() {return hzip_mode_is_b256;} private final boolean hzip_mode_is_b256;
|
||||
public void Cfg_save(Db_cfg_tbl tbl) {
|
||||
tbl.Conn().Txn_bgn("make__core__cfg__save");
|
||||
tbl.Insert_int (Cfg_grp, Cfg_key__schema_version , schema);
|
||||
@@ -42,12 +44,15 @@ public class Xowd_core_db_props {
|
||||
tbl.Insert_byte (Cfg_grp, Cfg_key__zip_tid_text , zip_tid_text);
|
||||
tbl.Insert_byte (Cfg_grp, Cfg_key__zip_tid_html , zip_tid_html);
|
||||
tbl.Insert_yn (Cfg_grp, Cfg_key__hzip_enabled , hzip_enabled);
|
||||
tbl.Insert_yn (Cfg_grp, Cfg_key__hzip_mode_is_b256 , hzip_mode_is_b256);
|
||||
tbl.Conn().Txn_end();
|
||||
}
|
||||
public static Xowd_core_db_props Cfg_load(Io_url url, Db_conn conn) {
|
||||
Db_cfg_tbl cfg_tbl = new Db_cfg_tbl(conn, "xowa_cfg");
|
||||
return cfg_tbl.Select_int_or(Cfg_grp, Cfg_key__schema_version, 1) == 1
|
||||
? new Xowd_core_db_props(1, Xowd_db_layout.Itm_lot, Xowd_db_layout.Itm_lot, Xowd_db_layout.Itm_lot, cfg_tbl.Select_byte_or(Xowe_wiki.Invk_db_mgr, Xodb_mgr_sql.Invk_data_storage_format, Io_stream_.Tid_gzip), Io_stream_.Tid_gzip, Bool_.Y)
|
||||
? new Xowd_core_db_props
|
||||
( 1, Xowd_db_layout.Itm_lot, Xowd_db_layout.Itm_lot, Xowd_db_layout.Itm_lot, cfg_tbl.Select_byte_or(Xowe_wiki.Invk_db_mgr, Xodb_mgr_sql.Invk_data_storage_format
|
||||
, Io_stream_.Tid_gzip), Io_stream_.Tid_gzip, Bool_.Y, Bool_.N)
|
||||
: Cfg_load(cfg_tbl);
|
||||
}
|
||||
private static Xowd_core_db_props Cfg_load(Db_cfg_tbl tbl) {
|
||||
@@ -60,6 +65,7 @@ public class Xowd_core_db_props {
|
||||
, cfg_hash.Get_by(Cfg_key__zip_tid_text).To_byte()
|
||||
, cfg_hash.Get_by(Cfg_key__zip_tid_html).To_byte()
|
||||
, cfg_hash.Get_by(Cfg_key__hzip_enabled).To_yn_or(Bool_.N)
|
||||
, cfg_hash.Get_by(Cfg_key__hzip_mode_is_b256).To_yn_or(Bool_.N)
|
||||
);
|
||||
}
|
||||
private static final String Cfg_grp = Xow_cfg_consts.Grp__wiki_core
|
||||
@@ -70,6 +76,7 @@ public class Xowd_core_db_props {
|
||||
, Cfg_key__zip_tid_text = "zip_tid_text"
|
||||
, Cfg_key__zip_tid_html = "zip_tid_html"
|
||||
, Cfg_key__hzip_enabled = "hzip_enabled"
|
||||
, Cfg_key__hzip_mode_is_b256 = "hzip_mode_is_b256"
|
||||
;
|
||||
public static final Xowd_core_db_props Test = new Xowd_core_db_props(2, Xowd_db_layout.Itm_few, Xowd_db_layout.Itm_few, Xowd_db_layout.Itm_few, Io_stream_.Tid_raw, Io_stream_.Tid_raw, Bool_.Y);
|
||||
public static final Xowd_core_db_props Test = new Xowd_core_db_props(2, Xowd_db_layout.Itm_few, Xowd_db_layout.Itm_few, Xowd_db_layout.Itm_few, Io_stream_.Tid_raw, Io_stream_.Tid_raw, Bool_.Y, Bool_.Y);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.wikis.data.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.data.*;
|
||||
import gplx.dbs.*;
|
||||
public class Xowd_cat_core_tbl implements RlsAble {
|
||||
public class Xowd_cat_core_tbl implements Rls_able {
|
||||
private final String tbl_name; private final Db_meta_fld_list flds = Db_meta_fld_list.new_();
|
||||
private final String fld_id, fld_pages, fld_subcats, fld_files, fld_hidden, fld_link_db_id;
|
||||
private final Db_conn conn; private Db_stmt stmt_insert, stmt_update, stmt_select;
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.wikis.data.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.data.*;
|
||||
import gplx.dbs.*; import gplx.dbs.qrys.*; import gplx.xowa.wikis.ctgs.*;
|
||||
public class Xowd_cat_link_tbl implements RlsAble {
|
||||
public class Xowd_cat_link_tbl implements Rls_able {
|
||||
private final String tbl_name; private final Db_meta_fld_list flds = Db_meta_fld_list.new_();
|
||||
private final String fld_from, fld_to_id, fld_sortkey, fld_timestamp, fld_type_id;
|
||||
private final Db_conn conn; private Db_stmt stmt_insert, stmt_select_in;
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.wikis.data.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.data.*;
|
||||
import gplx.dbs.*;
|
||||
public class Xowd_css_core_tbl implements RlsAble {
|
||||
public class Xowd_css_core_tbl implements Rls_able {
|
||||
private final String tbl_name = "css_core"; private final Db_meta_fld_list flds = Db_meta_fld_list.new_();
|
||||
private final String fld_id, fld_key, fld_updated_on;
|
||||
public Xowd_css_core_tbl(Db_conn conn) {
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.wikis.data.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.data.*;
|
||||
import gplx.dbs.*;
|
||||
public class Xowd_css_file_tbl implements RlsAble {
|
||||
public class Xowd_css_file_tbl implements Rls_able {
|
||||
private final String tbl_name = "css_file"; private final Db_meta_fld_list flds = Db_meta_fld_list.new_();
|
||||
private final String fld_css_id, fld_path, fld_data;
|
||||
private final Db_conn conn; private Db_stmt stmt_insert;
|
||||
|
||||
@@ -19,7 +19,7 @@ package gplx.xowa.wikis.data.tbls; import gplx.*; import gplx.xowa.*; import gpl
|
||||
import gplx.core.primitives.*; import gplx.core.criterias.*;
|
||||
import gplx.dbs.*; import gplx.xowa.*; import gplx.xowa.wikis.dbs.*; import gplx.dbs.qrys.*;
|
||||
import gplx.xowa.wikis.nss.*;
|
||||
public class Xowd_page_tbl implements RlsAble {
|
||||
public class Xowd_page_tbl implements Rls_able {
|
||||
private final String tbl_name = "page";
|
||||
private String fld_id, fld_ns, fld_title, fld_is_redirect, fld_touched, fld_len, fld_random_int, fld_text_db_id, fld_html_db_id, fld_redirect_id;
|
||||
private final Db_meta_fld_list flds = Db_meta_fld_list.new_();
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.wikis.data.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.data.*;
|
||||
import gplx.core.ios.*; import gplx.dbs.*; import gplx.dbs.qrys.*; import gplx.xowa.wikis.dbs.*; import gplx.dbs.cfgs.*;
|
||||
public class Xowd_pagelinks_tbl implements RlsAble {
|
||||
public class Xowd_pagelinks_tbl implements Rls_able {
|
||||
private final String tbl_name = "pagelink"; private final Db_meta_fld_list flds = Db_meta_fld_list.new_();
|
||||
private final String fld_src_id, fld_trg_id;
|
||||
private final Db_conn conn;
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.wikis.data.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.data.*;
|
||||
import gplx.core.ios.*; import gplx.dbs.*; import gplx.dbs.qrys.*; import gplx.xowa.wikis.dbs.*; import gplx.dbs.cfgs.*;
|
||||
public class Xowd_pagelinks_temp_tbl implements RlsAble {
|
||||
public class Xowd_pagelinks_temp_tbl implements Rls_able {
|
||||
private final String tbl_name = "pagelinks_temp"; private final Db_meta_fld_list flds = Db_meta_fld_list.new_();
|
||||
private final String fld_src_id, fld_trg_ns, fld_trg_ttl;
|
||||
private final Db_conn conn; private Db_stmt stmt_insert;
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.wikis.data.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.data.*;
|
||||
import gplx.core.primitives.*; import gplx.dbs.*; import gplx.dbs.cfgs.*; import gplx.dbs.qrys.*;
|
||||
public class Xowd_search_word_tbl implements RlsAble {
|
||||
public class Xowd_search_word_tbl implements Rls_able {
|
||||
private final String tbl_name; private final Db_meta_fld_list flds = Db_meta_fld_list.new_();
|
||||
private final String fld_id, fld_text; private String fld_page_count; private boolean page_count_exists;
|
||||
private final Db_conn conn; private Db_stmt stmt_insert, stmt_select_by, stmt_select_in;
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.wikis.data.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.data.*;
|
||||
import gplx.core.ios.*; import gplx.dbs.*; import gplx.dbs.utls.*;
|
||||
public class Xowd_text_tbl implements RlsAble {
|
||||
public class Xowd_text_tbl implements Rls_able {
|
||||
private final String tbl_name = "text"; private final Db_meta_fld_list flds = Db_meta_fld_list.new_();
|
||||
private final String fld_page_id, fld_text_data;
|
||||
private final Db_conn conn; private Db_stmt stmt_select, stmt_insert;
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.wikis.data.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.data.*;
|
||||
import gplx.dbs.*; import gplx.xowa.xtns.wdatas.*;
|
||||
public class Xowd_wbase_pid_tbl implements RlsAble {
|
||||
public class Xowd_wbase_pid_tbl implements Rls_able {
|
||||
private final String tbl_name; private final Db_meta_fld_list flds = Db_meta_fld_list.new_();
|
||||
private final String fld_src_lang, fld_src_ttl, fld_trg_ttl;
|
||||
private final Db_conn conn; private Db_stmt stmt_select, stmt_insert;
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.wikis.data.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.data.*;
|
||||
import gplx.dbs.*;
|
||||
public class Xowd_wbase_qid_tbl implements RlsAble {
|
||||
public class Xowd_wbase_qid_tbl implements Rls_able {
|
||||
private final String tbl_name; private final Db_meta_fld_list flds = Db_meta_fld_list.new_();
|
||||
private final String fld_src_wiki, fld_src_ns, fld_src_ttl, fld_trg_ttl;
|
||||
private final Db_conn conn; private Db_stmt stmt_select, stmt_insert;
|
||||
|
||||
Reference in New Issue
Block a user