1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2015-02-01 15:11:16 -05:00
parent 5efed51da9
commit 3df6db4b7b
410 changed files with 1577 additions and 1150 deletions

View File

@@ -16,6 +16,7 @@ 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.core.btries; import gplx.*; import gplx.core.*;
import gplx.core.primitives.*;
public class Btrie_bwd_mgr {
public int Match_pos() {return match_pos;} private int match_pos;
public Object Match_exact(byte[] src, int bgn_pos, int end_pos) {

View File

@@ -16,6 +16,7 @@ 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.core.btries; import gplx.*; import gplx.core.*;
import gplx.core.primitives.*;
public class Btrie_fast_mgr {
private ByteTrieItm_fast root;
public boolean CaseAny() {return root.CaseAny();} public Btrie_fast_mgr CaseAny_(boolean v) {root.CaseAny_(v); return this;}

View File

@@ -16,6 +16,7 @@ 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.core.btries; import gplx.*; import gplx.core.*;
import gplx.core.primitives.*;
public class Btrie_slim_mgr implements Btrie_mgr {
Btrie_slim_mgr(boolean case_match) {root = new Btrie_slim_itm(Byte_.Zero, null, !case_match);} private Btrie_slim_itm root;
public int Count() {return count;} private int count;

View File

@@ -16,6 +16,7 @@ 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.core.regxs; import gplx.*; import gplx.core.*;
import gplx.core.strings.*;
public interface Gfo_pattern_itm {
byte Tid();
void Compile(byte[] src, int bgn, int end);

View File

@@ -16,7 +16,7 @@ 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.core.regxs; import gplx.*; import gplx.core.*;
import org.junit.*;
import org.junit.*; import gplx.core.strings.*;
public class Gfo_pattern_tst {
@Before public void init() {fxt.Clear();} private Gfo_pattern_itm_fxt fxt = new Gfo_pattern_itm_fxt();
@Test public void Compile() {

View File

@@ -27,7 +27,7 @@ class Schema_loader_mgr__sqlite implements Schema_loader_mgr {
public void Load(Schema_db_mgr db_mgr, Db_conn conn) {
Gfo_usr_dlg_._.Log_many("", "", "db.schema.load.bgn: conn=~{0}", conn.Url().Xto_api());
Schema_tbl_mgr tbl_mgr = db_mgr.Tbl_mgr();
Db_qry__select_in_tbl qry = Db_qry__select_in_tbl.new_("sqlite_master", null, String_.Ary("type", "name", "sql"));
Db_qry__select_in_tbl qry = Db_qry__select_in_tbl.new_("sqlite_master", String_.Ary_empty, String_.Ary("type", "name", "sql"));
Db_stmt stmt = Db_stmt_.new_select_as_rdr(conn, qry);
Db_rdr rdr = stmt.Exec_select_as_rdr();
while (rdr.Move_next()) {

View File

@@ -16,7 +16,7 @@ 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.fsdb; import gplx.*;
import org.junit.*;
import org.junit.*; import gplx.core.primitives.*;
public class Binary_search__tst {
private Binary_search__fxt fxt = new Binary_search__fxt();
@Test public void Basic() {

View File

@@ -96,7 +96,7 @@ class Fsdb_cfg_tbl_sql extends Fsdb_cfg_tbl_base implements Fsdb_cfg_tbl {
.Exec_update();
}
private Db_stmt Select_stmt() {
Db_qry_select qry = Db_qry_.select_val_(Tbl_name, Fld_cfg_val, gplx.criterias.Criteria_.And_many(Db_crt_.eq_(Fld_cfg_grp, ""), Db_crt_.eq_(Fld_cfg_key, "")));
Db_qry_select qry = Db_qry_.select_val_(Tbl_name, Fld_cfg_val, gplx.core.criterias.Criteria_.And_many(Db_crt_.eq_(Fld_cfg_grp, ""), Db_crt_.eq_(Fld_cfg_key, "")));
return conn.New_stmt(qry);
}
@Override public int Select_as_int_or(String grp, String key, int or) {return Int_.parse_or_(Select_as_str_or(grp, key, null), or);}
@@ -110,7 +110,7 @@ class Fsdb_cfg_tbl_sql extends Fsdb_cfg_tbl_base implements Fsdb_cfg_tbl {
}
public Fsdb_cfg_grp Select_as_grp(String grp) {
Fsdb_cfg_grp rv = null;
Db_qry_select qry = Db_qry_.select_cols_(Tbl_name, gplx.criterias.Criteria_.And_many(Db_crt_.eq_(Fld_cfg_grp, "")), Fld_cfg_key, Fld_cfg_val);
Db_qry_select qry = Db_qry_.select_cols_(Tbl_name, gplx.core.criterias.Criteria_.And_many(Db_crt_.eq_(Fld_cfg_grp, "")), Fld_cfg_key, Fld_cfg_val);
DataRdr rdr = DataRdr_.Null;
try {
rdr = conn.New_stmt(qry).Clear().Val_str(grp).Exec_select();

View File

@@ -16,7 +16,7 @@ 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.fsdb; import gplx.*;
import gplx.dbs.*;
import gplx.dbs.*; import gplx.dbs.engines.sqlite.*;
public class Fsdb_db_abc_mgr implements RlsAble {
private Db_conn boot_provider;
public int Next_id() {return cfg_mgr.Next_id();}

View File

@@ -16,7 +16,8 @@ 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.fsdb; import gplx.*;
import gplx.dbs.*; import gplx.cache.*;
import gplx.core.primitives.*; import gplx.cache.*;
import gplx.dbs.*; import gplx.dbs.engines.sqlite.*;
public class Fsdb_db_atr_fil implements RlsAble {
private Gfo_cache_mgr_bry dir_cache = new Gfo_cache_mgr_bry();
private Fsdb_dir_tbl tbl_dir; private Fsdb_fil_tbl tbl_fil; private Fsdb_xtn_thm_tbl tbl_thm;

View File

@@ -62,3 +62,20 @@ public class Fsdb_db_atr_tbl {
);
private static Db_stmt_bldr stmt_bldr = new Db_stmt_bldr(Tbl_name, String_.Ary(Fld_uid), Fld_url, Fld_path_bgn);
}
// class tmptbl {
// private String Tbl_name = "file_url_atr";
// private String Fld_wiki_id
// , Fld_uid, Fld_url, Fld_path_bgn
// ;
// private Db_meta_tbl meta;
// private Db_meta_fld_list Flds = Db_meta_fld_list.new_();
// private void Conn_() {
// Fld_wiki_id = Flds.Add_int("wiki_id");
// Fld_uid = Flds.Add_int("uid");
// Fld_url = Flds.Add_str("url", 255);
// Fld_path_bgn = Flds.Add_str("path_bgn", 255);
// meta = Db_meta_tbl.new_(Tbl_name, Flds
// , Db_meta_idx.new_unique(Tbl_name, "pkey", Fld_wiki_id, Fld_uid)
// );
// }
// }

View File

@@ -16,7 +16,7 @@ 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.fsdb; import gplx.*;
import gplx.dbs.*; import gplx.ios.*;
import gplx.ios.*; import gplx.dbs.*; import gplx.dbs.engines.sqlite.*;
public class Fsdb_db_bin_fil implements RlsAble {
public int Id() {return id;} private int id;
public Io_url Url() {return url;} private Io_url url;

View File

@@ -61,5 +61,30 @@ public class Fsdb_db_bin_tbl {
, ", bin_max bigint NOT NULL"
, ");"
);
// public void Conn_(boolean version_is_1) {
// this.version_is_1 = version_is_1;
// if (version_is_1) {
// where_cols = String_.Ary(Fld_ns_id);
// }
// else {
// where_cols = String_.Ary(Fld_wiki_id, Fld_ns_id);
// Tbl_name = "wiki_ns_regy";
// Fld_wiki_id = Flds.Add_int("wiki_id");
// }
// Fld_ns_id = Flds.Add_int("ns_id");
// Fld_ns_name = Flds.Add_str("ns_name", 255);
// Fld_ns_case = Flds.Add_byte("ns_case");
// Fld_ns_is_alias = Flds.Add_bool("ns_is_alias");
// Fld_ns_count = Flds.Add_int("ns_count");
// }
private static Db_stmt_bldr stmt_bldr = new Db_stmt_bldr(Tbl_name, String_.Ary(Fld_uid), Fld_url, Fld_bin_len, Fld_bin_max);
// private String tbl_name = "file_fsdb_bin";
// private static final Db_meta_fld_list Flds = Db_meta_fld_list.new_();
// private static final String
// Fld_wiki_id = Flds.Add_int("wiki_id")
// , Fld_uid = Flds.Add_int("uid")
// , Fld_url = Flds.Add_str("url", 255)
// , Fld_bin_len = Flds.Add_long("bin_len")
// , Fld_bin_max = Flds.Add_long("bin_max")
// ;
}

View File

@@ -71,7 +71,7 @@ public class Fsdb_fil_tbl {
private Db_stmt Select_by_name_stmt() {
Db_qry qry = Sqlite_engine_.Supports_indexed_by
? (Db_qry)Db_qry_sql.rdr_("SELECT * FROM fsdb_fil INDEXED BY fsdb_fil__owner WHERE fil_owner_id = ? AND fil_name = ?;")
: Db_qry_.select_().From_(Tbl_name).Cols_all_().Where_(gplx.criterias.Criteria_.And_many(Db_crt_.eq_(Fld_fil_owner_id, Int_.MinValue), Db_crt_.eq_(Fld_fil_name, "")))
: Db_qry_.select_().From_(Tbl_name).Cols_all_().Where_(gplx.core.criterias.Criteria_.And_many(Db_crt_.eq_(Fld_fil_owner_id, Int_.MinValue), Db_crt_.eq_(Fld_fil_name, "")))
;
return conn.New_stmt(qry);
}
@@ -132,3 +132,27 @@ public class Fsdb_fil_tbl {
Idx_owner = Db_idx_itm.sql_ ("CREATE INDEX IF NOT EXISTS fsdb_fil__owner ON fsdb_fil (fil_owner_id, fil_name, fil_id);")
;
}
// class tmptbl {
// private String Tbl_name = "file_fsdb_fil";
// private String Fld_wiki_id, Fld_fil_id, Fld_fil_owner_id, Fld_fil_name, Fld_fil_xtn_id, Fld_fil_ext_id
// , Fld_fil_size, Fld_fil_modified, Fld_fil_hash, Fld_fil_bin_db_id
// ;
// private Db_meta_tbl meta;
// private Db_meta_fld_list Flds = Db_meta_fld_list.new_();
// private void Conn_() {
// Fld_wiki_id = Flds.Add_int("wiki_id");
// Fld_fil_id = Flds.Add_int("fil_id");
// Fld_fil_owner_id = Flds.Add_int("fil_owner_id");
// Fld_fil_xtn_id = Flds.Add_int("fil_xtn_id");
// Fld_fil_ext_id = Flds.Add_int("fil_ext_id");
// Fld_fil_bin_db_id = Flds.Add_int("fil_bin_db_id"); // group ints at beginning of table
// Fld_fil_name = Flds.Add_str("fil_name", 255);
// Fld_fil_size = Flds.Add_long("fil_size");
// Fld_fil_modified = Flds.Add_str("fil_modified", 14); // stored as yyyyMMddHHmmss
// Fld_fil_hash = Flds.Add_str("fil_hash", 40);
// meta = Db_meta_tbl.new_(Tbl_name, Flds
// , Db_meta_idx.new_unique(Tbl_name, "pkey", Fld_wiki_id, Fld_fil_id)
// , Db_meta_idx.new_unique(Tbl_name, "fil_owner", Fld_wiki_id, Fld_fil_owner_id, Fld_fil_name, Fld_fil_id)
// );
// }
// }

View File

@@ -16,6 +16,7 @@ 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.fsdb; import gplx.*;
import gplx.core.primitives.*;
import gplx.dbs.*; import gplx.xowa.files.fsdb.*;
public class Fsdb_mnt_mgr implements GfoInvkAble {
private Db_conn conn;

View File

@@ -65,3 +65,20 @@ public class Fsdb_mnt_tbl {
, ");"
);
}
// class tmptbl {
// private String Tbl_name = "file_url_mnt";
// private String Fld_wiki_id
// , Fld_id, Fld_name, Fld_url
// ;
// private Db_meta_tbl meta;
// private Db_meta_fld_list Flds = Db_meta_fld_list.new_();
// private void Conn_() {
// Fld_wiki_id = Flds.Add_int("wiki_id");
// Fld_id = Flds.Add_int("id");
// Fld_name = Flds.Add_str("name", 255);
// Fld_url = Flds.Add_str("url", 255);
// meta = Db_meta_tbl.new_(Tbl_name, Flds
// , Db_meta_idx.new_unique(Tbl_name, "pkey", Fld_wiki_id, Fld_id)
// );
// }
// }

View File

@@ -68,10 +68,10 @@ public class Fsdb_xtn_thm_tbl {
}
private Db_stmt Select_by_fil_w_stmt() {
Db_qry_select qry = Db_qry_.select_().From_(Tbl_name).Cols_all_();
gplx.criterias.Criteria crt
gplx.core.criterias.Criteria crt
= this.Schema_thm_page()
? gplx.criterias.Criteria_.And_many(Db_crt_.eq_(Fld_thm_owner_id, Int_.MinValue), Db_crt_.eq_(Fld_thm_w, Int_.MinValue), Db_crt_.eq_(Fld_thm_time, Int_.MinValue), Db_crt_.eq_(Fld_thm_page, Int_.MinValue))
: gplx.criterias.Criteria_.And_many(Db_crt_.eq_(Fld_thm_owner_id, Int_.MinValue), Db_crt_.eq_(Fld_thm_w, Int_.MinValue), Db_crt_.eq_(Fld_thm_thumbtime, Int_.MinValue))
? gplx.core.criterias.Criteria_.And_many(Db_crt_.eq_(Fld_thm_owner_id, Int_.MinValue), Db_crt_.eq_(Fld_thm_w, Int_.MinValue), Db_crt_.eq_(Fld_thm_time, Int_.MinValue), Db_crt_.eq_(Fld_thm_page, Int_.MinValue))
: gplx.core.criterias.Criteria_.And_many(Db_crt_.eq_(Fld_thm_owner_id, Int_.MinValue), Db_crt_.eq_(Fld_thm_w, Int_.MinValue), Db_crt_.eq_(Fld_thm_thumbtime, Int_.MinValue))
;
qry.Where_(crt);
return conn.New_stmt(qry);
@@ -126,3 +126,30 @@ public class Fsdb_xtn_thm_tbl {
public static final DateAdp Modified_null = null;
public static final String Hash_null = "";
}
// class tmptbl {
// private String Tbl_name = "file_data_thm";
// private String Fld_wiki_id
// , Fld_id, Fld_owner_id, Fld_w, Fld_h
// , Fld_time, Fld_page
// , Fld_bin_db_id, Fld_size, Fld_modified, Fld_hash
// ;
// private Db_meta_tbl meta;
// private Db_meta_fld_list Flds = Db_meta_fld_list.new_();
// private void Conn_() {
// Fld_wiki_id = Flds.Add_int("wiki_id");
// Fld_id = Flds.Add_int("id");
// Fld_owner_id = Flds.Add_int("owner_id");
// Fld_w = Flds.Add_int("w");
// Fld_h = Flds.Add_int("h");
// Fld_time = Flds.Add_double("time");
// Fld_page = Flds.Add_int("page");
// Fld_bin_db_id = Flds.Add_int("bin_db_id");
// Fld_size = Flds.Add_long("size");
// Fld_modified = Flds.Add_str("modified", 14); // stored as yyyyMMddHHmmss
// Fld_hash = Flds.Add_str("hash", 40);
// meta = Db_meta_tbl.new_(Tbl_name, Flds
// , Db_meta_idx.new_unique(Tbl_name, "pkey", Fld_wiki_id, Fld_id)
// , Db_meta_idx.new_unique(Tbl_name, "owner", Fld_wiki_id, Fld_owner_id, Fld_id, Fld_w, Fld_time, Fld_page)
// );
// }
// }

View File

@@ -16,7 +16,7 @@ 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.gfs; import gplx.*;
import org.junit.*;
import org.junit.*; import gplx.core.strings.*;
public class Gfs_msg_bldr_tst {
@Before public void init() {fxt.Clear();} Gfs_msg_bldr_fxt fxt = new Gfs_msg_bldr_fxt();
@Test public void Basic() {

View File

@@ -16,7 +16,7 @@ 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.html; import gplx.*;
import gplx.core.btries.*;
import gplx.core.primitives.*; import gplx.core.btries.*;
public class Html_utl {
public static byte[] Escape_for_atr_val_as_bry(Bry_bfr tmp_bfr, byte quote_byte, String s) {
if (s == null) return null;

View File

@@ -16,6 +16,7 @@ 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.php; import gplx.*;
import gplx.core.primitives.*;
public class Php_text_itm_parser {
public static final byte Rslt_orig = 0, Rslt_dirty = 1, Rslt_fmt = 2;
public boolean Quote_is_single() {return quote_is_single;} public Php_text_itm_parser Quote_is_single_(boolean v) {quote_is_single = v; return this;} private boolean quote_is_single;

View File

@@ -16,6 +16,7 @@ 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.threads; import gplx.*;
import gplx.core.primitives.*;
public class Gfo_async_mgr implements GfoInvkAble {
private ListAdp queue = ListAdp_.new_();
private Bool_obj_ref running = Bool_obj_ref.n_();

View File

@@ -24,7 +24,7 @@ public class Xoa_app_ {
boot_mgr.Run(args);
}
public static final String Name = "xowa";
public static final String Version = "2.1.4.1";
public static final String Version = "2.2.1.1";
public static String Build_date = "2012-12-30 00:00:00";
public static String Op_sys;
public static String User_agent = "";

View File

@@ -16,6 +16,7 @@ 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.fsys; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*;
import gplx.core.primitives.*;
public class Xoa_fsys_eval implements Bry_fmtr_eval_mgr {
public Xoa_fsys_eval(Xoa_app app) {this.app = app;} private Xoa_app app;
public boolean Enabled() {return enabled;} public void Enabled_(boolean v) {enabled = v;} private boolean enabled = true;

View File

@@ -16,6 +16,7 @@ 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.bldrs; import gplx.*; import gplx.xowa.*;
import gplx.core.primitives.*; import gplx.core.strings.*;
import gplx.dbs.*; import gplx.xowa.dbs.*; import gplx.xowa.specials.search.*; import gplx.xowa.ctgs.*; import gplx.xowa.dbs.tbls.*;
public class Db_mgr_fxt {
public Db_mgr_fxt Ctor_fsys() {bldr_fxt = new Xob_fxt().Ctor(Xoa_test_.Url_root().GenSubDir("root")); return this;}

View File

@@ -16,6 +16,7 @@ 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.bldrs; import gplx.*; import gplx.xowa.*;
import gplx.core.primitives.*;
import gplx.xowa.wikis.*; import gplx.xowa.xtns.wdatas.imports.*; import gplx.xowa.bldrs.imports.ctgs.*; import gplx.xowa.bldrs.imports.*; import gplx.xowa.bldrs.oimgs.*;
import gplx.xowa.bldrs.wikis.redirects.*; import gplx.xowa.bldrs.wikis.images.*; import gplx.xowa.files.wiki_orig.*;
import gplx.xowa.bldrs.files.*;

View File

@@ -16,6 +16,7 @@ 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.bldrs.cfgs; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*;
import gplx.core.strings.*;
public class Xob_wiki_cfg_bldr implements GfoInvkAble {
public Xob_wiki_cfg_bldr(Xob_bldr bldr) {this.app = bldr.App();} private Xoa_app app;
public void Exec() {

View File

@@ -16,7 +16,7 @@ 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.bldrs.cfgs; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*;
import org.junit.*;
import org.junit.*; import gplx.core.strings.*;
public class Xob_wiki_cfg_bldr_tst {
Xob_wiki_cfg_bldr_fxt fxt = new Xob_wiki_cfg_bldr_fxt();
@Before public void init() {fxt.Clear();}

View File

@@ -27,7 +27,7 @@ public class Xob_xfer_regy_tbl {
public static DataRdr Select(Db_conn p, byte repo_id, byte[] ttl, int limit) {
Db_qry qry = Db_qry_.select_().Cols_all_()
.From_(Tbl_name)
.Where_(gplx.criterias.Criteria_.And_many(Db_crt_.mte_(Fld_orig_repo, repo_id), Db_crt_.mt_(Fld_lnki_ttl, String_.new_utf8_(ttl)), Db_crt_.eq_(Fld_xfer_status, 0)))
.Where_(gplx.core.criterias.Criteria_.And_many(Db_crt_.mte_(Fld_orig_repo, repo_id), Db_crt_.mt_(Fld_lnki_ttl, String_.new_utf8_(ttl)), Db_crt_.eq_(Fld_xfer_status, 0)))
.OrderBy_many_(Fld_xfer_status, Fld_orig_repo, Fld_lnki_ttl, Fld_file_w)
.Limit_(limit)
;
@@ -53,7 +53,7 @@ public class Xob_xfer_regy_tbl {
public static DataRdr Select_by_lnki_page_id(Db_conn p, int lnki_page_id, int select_interval) {
Db_qry qry = Db_qry_.select_().Cols_all_()
.From_(Tbl_name)
.Where_(gplx.criterias.Criteria_.And_many(Db_crt_.eq_(Fld_xfer_status, 0), Db_crt_.mte_(Fld_lnki_page_id, lnki_page_id)))
.Where_(gplx.core.criterias.Criteria_.And_many(Db_crt_.eq_(Fld_xfer_status, 0), Db_crt_.mte_(Fld_lnki_page_id, lnki_page_id)))
.OrderBy_many_(Fld_lnki_page_id, Fld_lnki_id)
.Limit_(select_interval)
;

View File

@@ -16,6 +16,7 @@ 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.bldrs.imports; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*;
import gplx.core.primitives.*;
import gplx.ios.*;
import gplx.xowa.dbs.*;
public abstract class Xob_search_base extends Xob_itm_dump_base implements Xobd_wkr, GfoInvkAble {

View File

@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.bldrs.imports; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*;
import gplx.xowa.bldrs.*;
import gplx.criterias.*;
import gplx.core.criterias.*;
public class Xobc_core_cleanup extends Xob_itm_basic_base implements Xob_cmd {
private String bz2_cmd;
private boolean delete_all, delete_tmp;

View File

@@ -16,7 +16,7 @@ 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.bldrs.imports.ctgs; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*; import gplx.xowa.bldrs.imports.*;
import org.junit.*;
import org.junit.*; import gplx.core.primitives.*;
public class Xob_category_registry_sql_tst {
@Before public void init() {if (Xoa_test_.Db_skip()) return; fxt.Clear();} private Xob_category_registry_sql_fxt fxt = new Xob_category_registry_sql_fxt();
@Test public void Basic() {

View File

@@ -16,7 +16,7 @@ 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.bldrs.imports.ctgs; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*; import gplx.xowa.bldrs.imports.*;
import org.junit.*; import gplx.dbs.*; import gplx.xowa.dbs.tbls.*; import gplx.xowa.ctgs.*;
import org.junit.*; import gplx.core.primitives.*; import gplx.dbs.*; import gplx.xowa.dbs.tbls.*; import gplx.xowa.ctgs.*;
public class Xob_categorylinks_sql_tst {
@Before public void init() {if (Xoa_test_.Db_skip()) return; fxt.Ctor_fsys();} Db_mgr_fxt fxt = new Db_mgr_fxt();
@After public void term() {if (Xoa_test_.Db_skip()) return; fxt.Rls();}

View File

@@ -16,7 +16,7 @@ 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.bldrs.imports.ctgs; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*; import gplx.xowa.bldrs.imports.*;
import gplx.core.btries.*; import gplx.core.flds.*; import gplx.ios.*;
import gplx.core.primitives.*; import gplx.core.btries.*; import gplx.core.flds.*; import gplx.ios.*;
public abstract class Xob_ctg_v1_base extends Xob_itm_dump_base implements Xobd_parser_wkr, GfoInvkAble {
protected Xob_ctg_v1_base() {} // TEST:needed for fxt
public Xob_ctg_v1_base Ctor(Xob_bldr bldr, Xow_wiki wiki) {this.Cmd_ctor(bldr, wiki); return this;}

View File

@@ -16,7 +16,7 @@ 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.bldrs.langs; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*;
import gplx.json.*; import gplx.php.*; import gplx.gfs.*;
import gplx.core.primitives.*; import gplx.json.*; import gplx.php.*; import gplx.gfs.*;
interface Json_itm_wkr {
void Read_kv_sub(byte[] key, byte[] val);
}

View File

@@ -16,7 +16,7 @@ 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.bldrs.langs; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*;
import org.junit.*;
import org.junit.*; import gplx.core.strings.*;
public class Xobc_utl_make_lang_tst {
@Before public void init() {fxt.Clear();} private Xobc_utl_make_lang_fxt fxt = new Xobc_utl_make_lang_fxt();
@Test public void Parse() {

View File

@@ -16,7 +16,7 @@ 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.bldrs.langs; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*;
import gplx.core.btries.*; import gplx.intl.*; import gplx.php.*;
import gplx.core.primitives.*; import gplx.core.btries.*; import gplx.intl.*; import gplx.php.*;
import gplx.xowa.langs.*; import gplx.xowa.langs.numbers.*;
public class Xol_mw_lang_parser {
private Php_parser parser = new Php_parser(); private Php_evaluator evaluator;

View File

@@ -16,6 +16,7 @@ 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.bldrs.oimgs; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*;
import gplx.core.primitives.*;
import gplx.dbs.*; import gplx.xowa.dbs.*; import gplx.xowa.dbs.tbls.*;
public class Xodb_db_file {
Xodb_db_file(Io_url url, Db_conn conn, boolean created) {this.url = url; this.conn = conn; this.created = created;}

View File

@@ -16,7 +16,7 @@ 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.bldrs.wiki_cfgs; import gplx.*; import gplx.xowa.*; import gplx.xowa.bldrs.*;
import org.junit.*;
import org.junit.*; import gplx.core.strings.*;
import gplx.xmls.*;
import gplx.xowa.bldrs.cfgs.*;
public class Xoi_wiki_props_api_tst {

View File

@@ -16,7 +16,7 @@ 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.ctgs; import gplx.*; import gplx.xowa.*;
import gplx.core.flds.*;
import gplx.core.primitives.*; import gplx.core.flds.*;
public class Xoctg_idx_mgr implements GfoInvkAble {
ListAdp itms = ListAdp_.new_();
public int Block_len() {return block_len;} public Xoctg_idx_mgr Block_len_(int v) {this.block_len = v; return this;} private int block_len = Io_mgr.Len_mb;

View File

@@ -16,7 +16,7 @@ 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.ctgs; import gplx.*; import gplx.xowa.*;
import org.junit.*;
import org.junit.*; import gplx.core.primitives.*;
public class Xoctg_idx_mgr_tst {
@Before public void init() {fxt.Clear();} private Xoctg_idx_mgr_fxt fxt = new Xoctg_idx_mgr_fxt();
@Test public void Index() {

View File

@@ -16,6 +16,7 @@ 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.ctgs; import gplx.*; import gplx.xowa.*;
import gplx.core.primitives.*;
public class Xoctg_url {
public byte[][] Grp_idxs() {return grp_idxs;} private byte[][] grp_idxs = new byte[3][];
public byte[] Grp_fwds() {return grp_fwds;} private byte[] grp_fwds = new byte[3];

View File

@@ -18,4 +18,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.xowa.dbs; import gplx.*; import gplx.xowa.*;
public class Xodb_ctx {
public boolean Html_db_enabled() {return html_db_enabled;} public void Html_db_enabled_(boolean v) {html_db_enabled = v;} private boolean html_db_enabled;
public static final Xodb_ctx Null = null;
}

View File

@@ -16,7 +16,7 @@ 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.dbs; import gplx.*; import gplx.xowa.*;
import gplx.xowa.bldrs.imports.ctgs.*; import gplx.xowa.ctgs.*; import gplx.xowa.specials.search.*;
import gplx.core.primitives.*; import gplx.xowa.bldrs.imports.ctgs.*; import gplx.xowa.ctgs.*; import gplx.xowa.specials.search.*;
public interface Xodb_load_mgr {
void Load_init (Xow_wiki wiki);
void Load_page (Xodb_page rv, Xow_ns ns, boolean timestamp_enabled);

View File

@@ -16,7 +16,7 @@ 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.dbs; import gplx.*; import gplx.xowa.*;
import gplx.dbs.*;
import gplx.core.primitives.*; import gplx.dbs.*;
import gplx.xowa.apps.*; import gplx.xowa.bldrs.imports.ctgs.*; import gplx.xowa.ctgs.*; import gplx.xowa.specials.search.*; import gplx.xowa.dbs.tbls.*;
public class Xodb_load_mgr_sql implements Xodb_load_mgr {
public Xodb_load_mgr_sql(Xodb_mgr_sql db_mgr, Xodb_fsys_mgr fsys_mgr) {this.db_mgr = db_mgr; this.fsys_mgr = fsys_mgr;} private Xodb_mgr_sql db_mgr; Xodb_fsys_mgr fsys_mgr;

View File

@@ -16,7 +16,7 @@ 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.dbs; import gplx.*; import gplx.xowa.*;
import org.junit.*; import gplx.xowa.bldrs.*; import gplx.xowa.ctgs.*; import gplx.dbs.*; import gplx.xowa.dbs.tbls.*;
import org.junit.*; import gplx.core.primitives.*; import gplx.xowa.bldrs.*; import gplx.xowa.ctgs.*; import gplx.dbs.*; import gplx.xowa.dbs.tbls.*;
public class Xodb_load_mgr_sql_tst {
@Before public void init() {if (Xoa_test_.Db_skip()) return; fxt.Clear();} private Xodb_load_mgr_sql_fxt fxt = new Xodb_load_mgr_sql_fxt();
@Test public void Load_ctg_ttls() {

View File

@@ -16,7 +16,7 @@ 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.dbs; import gplx.*; import gplx.xowa.*;
import gplx.core.brys.*; import gplx.core.flds.*; import gplx.xowa.bldrs.imports.ctgs.*; import gplx.xowa.ctgs.*; import gplx.xowa.dbs.tbls.*; import gplx.xowa.specials.search.*;
import gplx.core.primitives.*; import gplx.core.brys.*; import gplx.core.flds.*; import gplx.xowa.bldrs.imports.ctgs.*; import gplx.xowa.ctgs.*; import gplx.xowa.dbs.tbls.*; import gplx.xowa.specials.search.*;
public class Xodb_load_mgr_txt implements Xodb_load_mgr {
public Xodb_load_mgr_txt(Xow_wiki wiki) {
this.wiki = wiki;

View File

@@ -16,9 +16,9 @@ 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.dbs; import gplx.*; import gplx.xowa.*;
import gplx.dbs.*;
import gplx.dbs.*; import gplx.dbs.engines.sqlite.*;
import gplx.xowa.apps.*; import gplx.xowa.dbs.tbls.*; import gplx.xowa.ctgs.*; import gplx.xowa.hdumps.*;
import gplx.xowa2.wikis.data.tbls.*;
import gplx.xowa2.wikis.data.*;
public class Xodb_mgr_sql implements Xodb_mgr, GfoInvkAble {
private boolean html_db_enabled;
public Xodb_mgr_sql(Xow_wiki wiki) {
@@ -50,7 +50,7 @@ public class Xodb_mgr_sql implements Xodb_mgr, GfoInvkAble {
public Xodb_save_mgr Save_mgr() {return save_mgr;} private Xodb_save_mgr_sql save_mgr;
public Xodb_hdump_mgr Hdump_mgr() {return hdump_mgr;} private Xodb_hdump_mgr hdump_mgr;
public Xodb_xowa_cfg_tbl Tbl_xowa_cfg() {return tbl_cfg;} private Xodb_xowa_cfg_tbl tbl_cfg = new Xodb_xowa_cfg_tbl();
public Xodata_ns_regy_tbl Tbl_xowa_ns() {return tbl_ns;} private Xodata_ns_regy_tbl tbl_ns = new Xodata_ns_regy_tbl();
public Xodb_xowa_ns_tbl Tbl_xowa_ns() {return tbl_ns;} private Xodb_xowa_ns_tbl tbl_ns = new Xodb_xowa_ns_tbl();
public Xodb_xowa_db_tbl Tbl_xowa_db() {return tbl_db;} private Xodb_xowa_db_tbl tbl_db = new Xodb_xowa_db_tbl();
public Xodb_page_tbl Tbl_page() {return tbl_page;} private Xodb_page_tbl tbl_page;
public Xodb_text_tbl Tbl_text() {return tbl_text;} private Xodb_text_tbl tbl_text;
@@ -168,7 +168,7 @@ public class Xodb_mgr_sql implements Xodb_mgr, GfoInvkAble {
Xodb_file file = ary[i] ;
if (file.Tid() != tid) continue;
file.Rls();
gplx.dbs.Db_url__sqlite sqlite = (gplx.dbs.Db_url__sqlite)file.Connect();
Db_url__sqlite sqlite = (Db_url__sqlite)file.Connect();
Io_mgr._.DeleteFil_args(sqlite.Url()).MissingFails_off().Exec();
file.Cmd_mode_(Db_cmd_mode.Delete);
}

View File

@@ -16,7 +16,7 @@ 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.dbs.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.dbs.*;
import gplx.xowa.ctgs.*;
import gplx.core.primitives.*; import gplx.xowa.ctgs.*;
public class Xodb_category_itm {
public int Id() {return id;} private int id;
public Int_obj_val Id_val() {if (id_val == null) id_val = Int_obj_val.new_(id); return id_val;} Int_obj_val id_val;

View File

@@ -40,11 +40,11 @@ public class Xodb_categorylinks_tbl {
}
public int Select_by_type(Db_conn p, ListAdp list, int cat_page_id, byte arg_tid, byte[] arg_sortkey, boolean arg_is_from, int limit) {
String arg_sortkey_str = arg_sortkey == null ? "" : String_.new_utf8_(arg_sortkey);
gplx.criterias.Criteria comp_crt = !arg_is_from
gplx.core.criterias.Criteria comp_crt = !arg_is_from
? Db_crt_.mte_(Fld_cl_sortkey, arg_sortkey_str) // from: sortkey >= 'val'
: Db_crt_.lte_(Fld_cl_sortkey, arg_sortkey_str); // until: sortkey <= 'val'
Db_qry_select qry = Db_qry_.select_().Cols_(Fld_cl_from, Fld_cl_sortkey).From_(Tbl_name)
.Where_(gplx.criterias.Criteria_.And_many(Db_crt_.eq_(Fld_cl_to_id, -1), Db_crt_.eq_(Fld_cl_type_id, arg_tid), comp_crt))
.Where_(gplx.core.criterias.Criteria_.And_many(Db_crt_.eq_(Fld_cl_to_id, -1), Db_crt_.eq_(Fld_cl_type_id, arg_tid), comp_crt))
.OrderBy_(Fld_cl_sortkey, !arg_is_from)
.Limit_(limit + 1); // + 1 to get last_plus_one for next page / previous page
Db_stmt stmt = Db_stmt_.Null;

View File

@@ -16,7 +16,7 @@ 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.dbs.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.dbs.*;
import gplx.dbs.*; import gplx.criterias.*;
import gplx.dbs.*; import gplx.core.criterias.*;
class Xodb_in_wkr_page_id extends Xodb_in_wkr_page_base {
private ListAdp list; // list is original list of ids which may have dupes; needed to fill statement (which takes range of bgn - end); DATE:2013-12-08
private OrderedHash hash; // hash is unique list of ids; needed for fetch from rdr (which indexes by id)

View File

@@ -16,7 +16,7 @@ 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.dbs.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.dbs.*;
import gplx.dbs.*; import gplx.criterias.*;
import gplx.core.primitives.*; import gplx.dbs.*; import gplx.core.criterias.*;
public class Xodb_page_tbl {
public static final String Tbl_name = "page"
, Fld_page_id = "page_id", Fld_page_ns = "page_namespace", Fld_page_title = "page_title"
@@ -226,7 +226,7 @@ public class Xodb_page_tbl {
}
public void Select_by_search(Cancelable cancelable, ListAdp rv, byte[] search, int results_max) {
if (Bry_.Len_eq_0(search)) return; // do not allow empty search
Criteria crt = gplx.criterias.Criteria_.And_many(Db_crt_.eq_(Fld_page_ns, Xow_ns_.Id_main), Db_crt_.like_(Fld_page_title, ""));
Criteria crt = gplx.core.criterias.Criteria_.And_many(Db_crt_.eq_(Fld_page_ns, Xow_ns_.Id_main), Db_crt_.like_(Fld_page_title, ""));
Db_qry_select qry = Db_qry_.select_().From_(Tbl_name).Cols_(Fld_page_id, Fld_page_len, Fld_page_ns, Fld_page_title).Where_(crt); // NOTE: use fields from main index only
DataRdr rdr = DataRdr_.Null;
Db_stmt stmt = Db_stmt_.Null;
@@ -252,9 +252,9 @@ public class Xodb_page_tbl {
return Bry_.Increment_last(rv, increment_pos);
}
public Db_stmt Select_for_parse_all_stmt(Db_conn p, int limit, byte redirect) {
Criteria crt = gplx.criterias.Criteria_.And_many(Db_crt_.eq_(Fld_page_ns, -1), Db_crt_.mt_(Fld_page_title, ""));
Criteria crt = gplx.core.criterias.Criteria_.And_many(Db_crt_.eq_(Fld_page_ns, -1), Db_crt_.mt_(Fld_page_title, ""));
if (redirect != Bool_.__byte)
crt = gplx.criterias.Criteria_.And(crt, Db_crt_.eq_(Fld_page_is_redirect, redirect));
crt = gplx.core.criterias.Criteria_.And(crt, Db_crt_.eq_(Fld_page_is_redirect, redirect));
Db_qry_select qry = Db_qry_.select_().From_(Tbl_name).Cols_(html_db_enabled ? Flds_select_all__html_y : Flds_select_all__html_n)
.Where_(crt)
.Limit_(limit);

View File

@@ -16,7 +16,7 @@ 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.dbs.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.dbs.*;
import gplx.dbs.*;
import gplx.core.primitives.*; import gplx.dbs.*;
public class Xodb_search_title_word_tbl {
public static void Create_table(Db_conn p) {Sqlite_engine_.Tbl_create(p, Tbl_name, Tbl_sql);}
public static void Create_index(Gfo_usr_dlg usr_dlg, Db_conn p) {Sqlite_engine_.Idx_create(usr_dlg, p, "search", Indexes_main);}
@@ -32,7 +32,7 @@ public class Xodb_search_title_word_tbl {
.Cols_(Xodb_search_title_word_tbl.Fld_stw_word_id)
.From_(Xodb_search_title_word_tbl.Tbl_name, "w")
;
gplx.criterias.Criteria crt = null;
gplx.core.criterias.Criteria crt = null;
if (Bry_.Has(search, Byte_ascii.Asterisk)) {
search = Bry_.Replace(search, Byte_ascii.Asterisk, Byte_ascii.Percent);
crt = Db_crt_.like_ (Xodb_search_title_word_tbl.Fld_stw_word, String_.new_utf8_(search));

View File

@@ -16,7 +16,7 @@ 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.dbs.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.dbs.*;
import gplx.dbs.*; import gplx.ios.*;
import gplx.core.primitives.*; import gplx.dbs.*; import gplx.ios.*;
public class Xodb_text_tbl {
public Xodb_text_tbl(Xodb_mgr_sql db_mgr) {this.db_mgr = db_mgr; zip_mgr = db_mgr.Wiki().App().Zip_mgr();} private Xodb_mgr_sql db_mgr; private Io_stream_zip_mgr zip_mgr;
public void Delete_all(Db_conn conn) {conn.Exec_qry(Db_qry_.delete_tbl_(Tbl_name));}

View File

@@ -16,7 +16,7 @@ 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.dbs.tbls; import gplx.*; import gplx.xowa.*; import gplx.xowa.dbs.*;
import gplx.dbs.*;
import gplx.dbs.*; import gplx.core.primitives.*;
public class Xodb_xowa_cfg_tbl {
public Db_conn Conn() {return conn;} public Xodb_xowa_cfg_tbl Conn_(Db_conn conn) {this.conn = conn; return this;} Db_conn conn;
private DataRdr Select(String grp) {
@@ -88,7 +88,7 @@ public class Xodb_xowa_cfg_tbl {
Db_qry qry = Db_qry_.update_common_(Tbl_name, Where_grp_key(grp, key), KeyVal_.new_(Fld_cfg_val, val));
conn.Exec_qry(qry);
}
private gplx.criterias.Criteria Where_grp_key(String grp, String key) {return Db_crt_.eqMany_(KeyVal_.new_(Fld_cfg_grp, grp), KeyVal_.new_(Fld_cfg_key, key));}
private gplx.core.criterias.Criteria Where_grp_key(String grp, String key) {return Db_crt_.eq_many_(KeyVal_.new_(Fld_cfg_grp, grp), KeyVal_.new_(Fld_cfg_key, key));}
public static final String Tbl_name = "xowa_cfg", Fld_cfg_grp = "cfg_grp", Fld_cfg_key = "cfg_key", Fld_cfg_val = "cfg_val";
public static void Create_table(Db_conn p) {Sqlite_engine_.Tbl_create(p, Tbl_name, Tbl_sql);}
public static void Create_index(Db_conn p) {Sqlite_engine_.Idx_create(p, Idx_select);}

View File

@@ -37,7 +37,7 @@ public class Xof_lnki_file_mgr {
page_init_needed = false;
wiki.File_mgr().Fsdb_mgr().Init_by_wiki__add_bin_wkrs(wiki); // NOTE: fsdb_mgr may not be init'd for wiki; assert that that it is
Create_xfer_itms(page.Lnki_list(), wiki.File_mgr().Fsdb_mgr().Patch_upright()); // NOTE: Patch_upright check must occur after Init_by_wiki; DATE:2014-05-31
wiki.File_mgr().Fsdb_mgr().Reg_select_only(page, exec_tid, fsdb_list, orig_regy);
wiki.File_mgr().Fsdb_mgr().Orig_select_by_list(page, exec_tid, fsdb_list, orig_regy);
Hash_xfer_itms();
}
Xof_fsdb_itm fsdb_itm = (Xof_fsdb_itm)xfer_list.Fetch(xfer_itm.Lnki_ttl());

View File

@@ -104,7 +104,7 @@ public class Xow_file_mgr implements GfoInvkAble {
return meta.Orig_exists() == Bool_.Y_byte || meta.Thumbs().length != 0;
}
else
return fsdb_mgr.Reg_select_itm_exists(ttl_bry);
return fsdb_mgr.Orig_exists_by_ttl(ttl_bry);
}
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {

View File

@@ -16,6 +16,7 @@ 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.files.bins; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.core.primitives.*;
interface Bin_fetcher {
boolean Save_as_url(Io_url trg);
boolean Save_as_bry(Bry_obj_ref bry);

View File

@@ -16,6 +16,7 @@ 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.files.bins; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.core.primitives.*;
import gplx.xowa.files.fsdb.*; import gplx.xowa.files.cnvs.*; import gplx.ios.*;
public class Xof_bin_mgr implements GfoInvkAble {
private Xof_bin_wkr[] wkrs; private int wkrs_len;

View File

@@ -16,7 +16,7 @@ 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.files.bins; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.dbs.*; import gplx.ios.*; import gplx.cache.*; import gplx.fsdb.*; import gplx.xowa.files.fsdb.*;
import gplx.core.primitives.*; import gplx.dbs.*; import gplx.ios.*; import gplx.cache.*; import gplx.fsdb.*; import gplx.xowa.files.fsdb.*;
public class Xof_bin_wkr_fsdb_sql implements Xof_bin_wkr, GfoInvkAble {
private byte[] bin_bfr; private int bin_flush_when = Io_mgr.Len_mb;
private Int_obj_ref tmp_itm_id = Int_obj_ref.neg1_(), tmp_bin_db_id = Int_obj_ref.neg1_(), tmp_mnt_id = Int_obj_ref.neg1_();

View File

@@ -16,6 +16,7 @@ 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.files.cnvs; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.core.primitives.*;
public interface Xof_img_wkr_resize_img {
boolean Exec(Io_url src, Io_url trg, int trg_w, int trg_h, int ext_id, String_obj_ref rslt_val);
}

View File

@@ -16,6 +16,7 @@ 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.files.cnvs; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.core.primitives.*;
public class Xof_img_wkr_resize_img_imageMagick implements Xof_img_wkr_resize_img {
boolean init_needed = true;
public Xof_img_wkr_resize_img_imageMagick(Xoa_app app, ProcessAdp cmd_convert, ProcessAdp cmd_convert_svg_to_png) {this.app = app; this.cmd_convert = cmd_convert; this.cmd_convert_svg_to_png = cmd_convert_svg_to_png;} ProcessAdp cmd_convert, cmd_convert_svg_to_png; Xoa_app app;

View File

@@ -16,7 +16,7 @@ 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.files.cnvs; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.gfui.*; import gplx.xowa.files.cnvs.*;
import gplx.core.primitives.*; import gplx.gfui.*; import gplx.xowa.files.cnvs.*;
public class Xof_img_wkr_resize_img_mok implements Xof_img_wkr_resize_img {
public boolean Exec(Io_url src, Io_url trg, int trg_w, int trg_h, int ext_id, String_obj_ref rslt_val) {
SizeAdp src_size = ImageAdp_.txt_fil_(src).Size();

View File

@@ -26,18 +26,19 @@ public interface Xof_fsdb_mgr extends RlsAble {
Xof_qry_mgr Qry_mgr();
Xof_bin_mgr Bin_mgr();
Xof_bin_wkr Bin_wkr_fsdb();
Gfo_usr_dlg Usr_dlg();
Fsdb_mnt_mgr Mnt_mgr();
Cache_mgr Cache_mgr();
void Db_bin_max_(long v);
void Init_by_wiki(Xow_wiki wiki, Io_url db_dir, Io_url fs_dir, Xow_repo_mgr repo_mgr);
boolean Init_by_wiki(Xow_wiki wiki);
boolean Init_by_wiki__add_bin_wkrs(Xow_wiki wiki);
boolean Orig_exists_by_ttl(byte[] ttl);
void Orig_select_by_list(Xoa_page page, byte exec_tid, ListAdp itms, OrderedHash hash);
void Fsdb_search_by_list(Xoa_page page, byte exec_tid, ListAdp itms);
void Img_insert(Fsdb_xtn_img_itm rv, byte[] dir, byte[] fil, int ext_id, int img_w, int img_h, DateAdp modified, String hash, long bin_len, gplx.ios.Io_stream_rdr bin_rdr);
void Thm_insert(Fsdb_xtn_thm_itm rv, byte[] dir, byte[] fil, int ext_id, int thm_w, int thm_h, double thumbtime, int page, DateAdp modified, String hash, long bin_len, gplx.ios.Io_stream_rdr bin_rdr);
void Fil_insert(Fsdb_fil_itm rv , byte[] dir, byte[] fil, int ext_id, DateAdp modified, String hash, long bin_len, gplx.ios.Io_stream_rdr bin_rdr);
void Reg_insert(Xof_fsdb_itm itm, byte repo_id, byte status);
void Reg_select(Xoa_page page, byte exec_tid, ListAdp itms);
void Reg_select_only(Xoa_page page, byte exec_tid, ListAdp itms, OrderedHash hash);
boolean Reg_select_itm_exists(byte[] ttl);
void Orig_insert(Xof_fsdb_itm itm, byte repo_id, byte status);
}

View File

@@ -53,32 +53,32 @@ public class Xof_fsdb_mgr_ {
if (fsdb_mgr.Qry_mgr().Find(exec_tid, itm)) {
Xof_repo_pair repo_pair = repo_mgr.Repos_get_by_wiki(itm.Orig_wiki());
if (repo_pair == null) {
fsdb_mgr.Reg_insert(itm, Xof_repo_itm.Repo_unknown, Xof_wiki_orig_wkr_.Tid_missing_qry);
fsdb_mgr.Orig_insert(itm, Xof_repo_itm.Repo_unknown, Xof_wiki_orig_wkr_.Tid_missing_qry);
return;
}
byte orig_wiki = repo_pair.Repo_id(); // NOTE: should be itm.Orig_repo, but throws null refs
if (Is_not_viewable(exec_tid, itm.Lnki_ext())) {
itm.Rslt_qry_(Xof_qry_wkr_.Tid_mock);
itm.Rslt_bin_(Xof_bin_wkr_.Tid_noop);
fsdb_mgr.Reg_insert(itm, orig_wiki, Xof_wiki_orig_wkr_.Tid_noop);
fsdb_mgr.Orig_insert(itm, orig_wiki, Xof_wiki_orig_wkr_.Tid_noop);
return;
}
if (fsdb_mgr.Bin_mgr().Find_to_url_as_bool(ListAdp_.Null, exec_tid, itm)) {
fsdb_mgr.Reg_insert(itm, orig_wiki, Xof_wiki_orig_wkr_.Tid_found_orig);
fsdb_mgr.Orig_insert(itm, orig_wiki, Xof_wiki_orig_wkr_.Tid_found_orig);
// TODO: this "breaks" tests b/c mock bin_wkr is fsdb;
if (itm.Rslt_bin() != Xof_bin_wkr_.Tid_fsdb_wiki) // if bin is from fsdb, don't save it; occurs when page has new file listed twice; 1st file inserts into fsdb; 2nd file should find in fsdb and not save again
Fsdb_save(fsdb_mgr, itm);
Fsdb_save(usr_dlg, fsdb_mgr, itm);
Js_img_mgr.Update_img(page, itm);
}
else {
usr_dlg.Warn_many("", "", "file not found: page=~{0} file=~{1} width=~{2}", page.Url().Xto_full_str_safe(), String_.new_utf8_(itm.Lnki_ttl()), itm.Lnki_w());
itm.Rslt_bin_(Xof_bin_wkr_.Tid_not_found);
fsdb_mgr.Reg_insert(itm, orig_wiki, Xof_wiki_orig_wkr_.Tid_missing_bin);
fsdb_mgr.Orig_insert(itm, orig_wiki, Xof_wiki_orig_wkr_.Tid_missing_bin);
// gplx.xowa.files.gui.Js_img_mgr.Update_img_missing(usr_dlg, itm.Html_uid()); // TODO: update caption with "" if image is missing
}
}
else {
fsdb_mgr.Reg_insert(itm, Xof_repo_itm.Repo_unknown, Xof_wiki_orig_wkr_.Tid_missing_qry);
fsdb_mgr.Orig_insert(itm, Xof_repo_itm.Repo_unknown, Xof_wiki_orig_wkr_.Tid_missing_qry);
// gplx.xowa.files.gui.Js_img_mgr.Update_img_missing(usr_dlg, itm.Html_uid()); // TODO: update caption with "" if image is missing
}
}
@@ -110,7 +110,7 @@ public class Xof_fsdb_mgr_ {
default: throw Err_.unhandled(itm.Rslt_reg());
}
}
private void Fsdb_save(Xof_fsdb_mgr fsdb_mgr, Xof_fsdb_itm itm) {
private void Fsdb_save(Gfo_usr_dlg usr_dlg, Xof_fsdb_mgr fsdb_mgr, Xof_fsdb_itm itm) {
Io_url html_url = itm.Html_url();
long bin_len = Io_mgr._.QueryFil(html_url).Size();
gplx.ios.Io_stream_rdr bin_rdr = gplx.ios.Io_stream_rdr_.file_(html_url);
@@ -140,7 +140,7 @@ public class Xof_fsdb_mgr_ {
fsdb_mgr.Cache_mgr().Reg(fsdb_mgr.Wiki(), itm, bin_len);
}
catch (Exception e) {
fsdb_mgr.Usr_dlg().Warn_many("", "", "failed to save file: ttl=~{0} url=~{1} err=~{2}", String_.new_utf8_(itm.Lnki_ttl()), html_url.Raw(), Err_.Message_gplx(e));
usr_dlg.Warn_many("", "", "failed to save file: ttl=~{0} url=~{1} err=~{2}", String_.new_utf8_(itm.Lnki_ttl()), html_url.Raw(), Err_.Message_gplx(e));
}
finally {bin_rdr.Rls();}
}

View File

@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.xowa.files.fsdb; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.fsdb.*; import gplx.xowa.files.wiki_orig.*; import gplx.xowa.files.qrys.*; import gplx.xowa.files.bins.*;
import gplx.xowa.files.fsdb.caches.*;
import gplx.xowa2.files.orig_regy.*;
public class Xof_fsdb_mgr_mem implements Xof_fsdb_mgr, Xof_bin_wkr {
private Hash_adp_bry bin_hash = Hash_adp_bry.cs_(); private Bry_bfr bin_key_bfr = Bry_bfr.new_();
private Hash_adp_bry reg_hash = Hash_adp_bry.cs_();
@@ -28,7 +29,6 @@ public class Xof_fsdb_mgr_mem implements Xof_fsdb_mgr, Xof_bin_wkr {
public Xof_bin_wkr Bin_wkr_fsdb() {return this;}
public boolean Bin_wkr_resize() {return bin_wkr_resize;} public void Bin_wkr_resize_(boolean v) {bin_wkr_resize = v;} private boolean bin_wkr_resize = false;
public void Db_bin_max_(long v) {}
public Gfo_usr_dlg Usr_dlg() {return usr_dlg;} Gfo_usr_dlg usr_dlg = Gfo_usr_dlg_.Null;
private Io_url fs_dir;
private Xof_url_bldr url_bldr = new Xof_url_bldr();
public Cache_mgr Cache_mgr() {return cache_mgr;} private Cache_mgr cache_mgr = new Cache_mgr(null);
@@ -36,7 +36,7 @@ public class Xof_fsdb_mgr_mem implements Xof_fsdb_mgr, Xof_bin_wkr {
public Fsdb_mnt_mgr Mnt_mgr() {throw Err_.not_implemented_();}
public boolean Init_by_wiki(Xow_wiki wiki) {throw Err_.not_implemented_();}
public boolean Init_by_wiki__add_bin_wkrs(Xow_wiki wiki) {throw Err_.not_implemented_();}
public void Reg_select_only(Xoa_page page, byte exec_tid, ListAdp itms, OrderedHash hash) {throw Err_.not_implemented_();}
public void Orig_select_by_list(Xoa_page page, byte exec_tid, ListAdp itms, OrderedHash hash) {throw Err_.not_implemented_();}
public void Init_by_wiki(Xow_wiki wiki, Io_url db_dir, Io_url fs_dir, Xow_repo_mgr repo_mgr) {
this.fs_dir = fs_dir;
this.wiki = wiki;
@@ -64,13 +64,13 @@ public class Xof_fsdb_mgr_mem implements Xof_fsdb_mgr, Xof_bin_wkr {
itm.Init(key, dir, fil, img_w, img_h, bin);
bin_hash.Add(key, itm);
}
public void Reg_insert(Xof_fsdb_itm fsdb_itm, byte repo_id, byte status) {
public void Orig_insert(Xof_fsdb_itm fsdb_itm, byte repo_id, byte status) {
byte[] fsdb_itm_ttl = fsdb_itm.Orig_ttl();
if (reg_hash.Has(fsdb_itm_ttl)) return;
Xof_orig_regy_itm regy_itm = new Xof_orig_regy_itm(fsdb_itm_ttl, status, repo_id, fsdb_itm.Orig_w(), fsdb_itm.Orig_h(), fsdb_itm.Lnki_ext().Id(), fsdb_itm.Orig_redirect());
reg_hash.Add(fsdb_itm_ttl, regy_itm);
}
public void Reg_select(Xoa_page page, byte exec_tid, ListAdp itms) {
public void Fsdb_search_by_list(Xoa_page page, byte exec_tid, ListAdp itms) {
int itms_len = itms.Count();
for (int i = 0; i < itms_len; i++) {
Xof_fsdb_itm itm = (Xof_fsdb_itm)itms.FetchAt(i);
@@ -92,7 +92,7 @@ public class Xof_fsdb_mgr_mem implements Xof_fsdb_mgr, Xof_bin_wkr {
}
Xof_fsdb_mgr_._.Fsdb_search(this, fs_dir, page, exec_tid, itms, bin_mgr.Repo_mgr(), url_bldr);
}
public boolean Reg_select_itm_exists(byte[] ttl) {return reg_hash.Has(ttl);}
public boolean Orig_exists_by_ttl(byte[] ttl) {return reg_hash.Has(ttl);}
public byte Bin_wkr_tid() {return Xof_bin_wkr_.Tid_fsdb_wiki;}
public gplx.ios.Io_stream_rdr Bin_wkr_get_as_rdr(ListAdp temp_files, Xof_fsdb_itm itm, boolean is_thumb, int w) {
byte[] wiki = itm.Orig_wiki();

View File

@@ -16,11 +16,13 @@ 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.files.fsdb; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.core.primitives.*;
import gplx.dbs.*; import gplx.fsdb.*; import gplx.xowa.files.wiki_orig.*; import gplx.xowa.files.bins.*; import gplx.xowa.files.qrys.*; import gplx.xowa.files.fsdb.caches.*;
import gplx.xowa.files.fsdb.fs_roots.*;
import gplx.xowa2.files.*;
public class Xof_fsdb_mgr_sql implements Xof_fsdb_mgr, GfoInvkAble {
private Db_conn img_regy_provider = null;
private Gfo_usr_dlg usr_dlg = Gfo_usr_dlg_.Null;
private Db_conn orig_regy_conn = null;
private Io_url app_file_dir;
private Xof_url_bldr url_bldr = Xof_url_bldr.new_v2_();
public boolean Tid_is_mem() {return false;}
@@ -44,7 +46,6 @@ public class Xof_fsdb_mgr_sql implements Xof_fsdb_mgr, GfoInvkAble {
return patch_upright_tid;
} private boolean patch_upright_null = true; private int patch_upright_tid;
public Io_url Db_dir() {return db_dir;} public Xof_fsdb_mgr_sql Db_dir_(Io_url v) {db_dir = v; mnt_mgr.Init(db_dir); return this;} private Io_url db_dir;
public Gfo_usr_dlg Usr_dlg() {return usr_dlg;} Gfo_usr_dlg usr_dlg = Gfo_usr_dlg_.Null;
public Cache_mgr Cache_mgr() {return cache_mgr;} private Cache_mgr cache_mgr;
public Xow_wiki Wiki() {return wiki;} private Xow_wiki wiki;
public Xof_fsdb_mgr_sql(Xow_wiki wiki) {this.wiki = wiki;}
@@ -68,7 +69,7 @@ public class Xof_fsdb_mgr_sql implements Xof_fsdb_mgr, GfoInvkAble {
init = true;
Xow_repo_mgr repo_mgr = wiki.File_mgr().Repo_mgr();
Init_by_wiki(wiki, wiki.App().Fsys_mgr().File_dir().GenSubDir(wiki.Domain_str()), wiki.App().Fsys_mgr().File_dir(), repo_mgr);
Xof_qry_wkr_xowa_reg qry_xowa = new Xof_qry_wkr_xowa_reg(img_regy_provider);
Xof_qry_wkr_xowa_reg qry_xowa = new Xof_qry_wkr_xowa_reg(orig_regy_conn);
// Xof_qry_wkr_xowa qry_xowa = new Xof_qry_wkr_xowa(new Xof_wiki_finder(wiki.App().Wiki_mgr().Get_by_key_or_make(Xow_wiki_.Domain_commons_bry), wiki), new gplx.xowa.files.qrys.Xof_img_meta_wkr_xowa());
Xof_qry_wkr_wmf_api qry_wmf_api = new Xof_qry_wkr_wmf_api(wiki, new Xof_img_wkr_api_size_base_wmf());
qry_mgr.Add_many(qry_xowa, qry_wmf_api);
@@ -80,19 +81,19 @@ public class Xof_fsdb_mgr_sql implements Xof_fsdb_mgr, GfoInvkAble {
public void Init_by_wiki(Xow_wiki wiki, Io_url db_dir, Io_url app_file_dir, Xow_repo_mgr repo_mgr) {
this.app_file_dir = app_file_dir;
this.db_dir = db_dir;
img_regy_provider = Wiki_orig_provider(db_dir);
orig_regy_conn = Wiki_orig_provider(db_dir);
mnt_mgr.Init(db_dir);
bin_mgr = new Xof_bin_mgr(wiki, this, repo_mgr);
bin_wkr_fsdb = new Xof_bin_wkr_fsdb_sql(this).Bin_bfr_len_(64 * Io_mgr.Len_kb); // most thumbs are 40 kb
cache_mgr = wiki.App().File_mgr().Cache_mgr();
} private boolean init = false;
public boolean Reg_select_itm_exists(byte[] ttl) {return Xof_wiki_orig_tbl.Select_itm_exists(img_regy_provider, ttl);}
public void Reg_select_only(Xoa_page page, byte exec_tid, ListAdp itms, OrderedHash hash) {
Xof_wiki_orig_tbl.Select_list(wiki.App().Usr_dlg(), img_regy_provider, wiki.Db_mgr().Db_ctx(), exec_tid, itms, hash, url_bldr, bin_mgr.Repo_mgr());
public boolean Orig_exists_by_ttl(byte[] ttl) {return Xof_wiki_orig_tbl.Select_itm_exists(orig_regy_conn, ttl);}
public void Orig_select_by_list(Xoa_page page, byte exec_tid, ListAdp itms, OrderedHash hash) {
Xof_wiki_orig_tbl.Select_list(wiki.App().Usr_dlg(), orig_regy_conn, wiki.Db_mgr().Db_ctx(), exec_tid, itms, hash, url_bldr, bin_mgr.Repo_mgr());
}
public void Reg_select(Xoa_page page, byte exec_tid, ListAdp itms) {
public void Fsdb_search_by_list(Xoa_page page, byte exec_tid, ListAdp itms) {
OrderedHash hash = OrderedHash_.new_bry_();
Reg_select_only(page, exec_tid, itms, hash);
Orig_select_by_list(page, exec_tid, itms, hash);
Xof_fsdb_mgr_._.Fsdb_search(this, app_file_dir, page, exec_tid, itms, bin_mgr.Repo_mgr(), url_bldr);
}
public boolean Download(Xofv_file_itm itm) {
@@ -105,10 +106,10 @@ public class Xof_fsdb_mgr_sql implements Xof_fsdb_mgr, GfoInvkAble {
}
public Fsdb_fil_itm Fil_select_bin(byte[] dir, byte[] fil, boolean is_thumb, int width, double thumbtime) {return mnt_mgr.Fil_select_bin(dir, fil, is_thumb, width, thumbtime);}
public boolean Thm_select_bin(byte[] dir, byte[] fil, Fsdb_xtn_thm_itm thm) {return mnt_mgr.Thm_select_bin(dir, fil, thm);}
public void Reg_insert(Xof_fsdb_itm itm, byte repo_id, byte status) {
public void Orig_insert(Xof_fsdb_itm itm, byte repo_id, byte status) {
byte[] orig_page = itm.Orig_ttl();
if (!Xof_wiki_orig_tbl.Select_itm_exists(img_regy_provider, orig_page))
Xof_wiki_orig_tbl.Insert(img_regy_provider, orig_page, status, repo_id, itm.Orig_redirect(), itm.Lnki_ext().Id(), itm.Orig_w(), itm.Orig_h());
if (!Xof_wiki_orig_tbl.Select_itm_exists(orig_regy_conn, orig_page))
Xof_wiki_orig_tbl.Insert(orig_regy_conn, orig_page, status, repo_id, itm.Orig_redirect(), itm.Lnki_ext().Id(), itm.Orig_w(), itm.Orig_h());
}
public void Fil_insert(Fsdb_fil_itm rv , byte[] dir, byte[] fil, int ext_id, DateAdp modified, String hash, long bin_len, gplx.ios.Io_stream_rdr bin_rdr) {
mnt_mgr.Fil_insert(rv, dir, fil, ext_id, modified, hash, bin_len, bin_rdr);
@@ -121,16 +122,16 @@ public class Xof_fsdb_mgr_sql implements Xof_fsdb_mgr, GfoInvkAble {
}
public void Txn_open() {
mnt_mgr.Txn_open();
img_regy_provider.Txn_mgr().Txn_bgn_if_none();
orig_regy_conn.Txn_mgr().Txn_bgn_if_none();
}
public void Txn_save() {
mnt_mgr.Txn_save();
img_regy_provider.Txn_mgr().Txn_end_all();
orig_regy_conn.Txn_mgr().Txn_end_all();
}
public void Rls() {
this.Txn_save(); // NOTE: must call save, else user db will not update next id; DATE:2014-02-11
mnt_mgr.Rls();
img_regy_provider.Conn_term();
orig_regy_conn.Conn_term();
}
public static Io_url Wiki_orig_url(Io_url root_dir) {return root_dir.GenSubFil("wiki.orig#00.sqlite3");}
public static Db_conn Wiki_orig_provider(Io_url root_dir) {

View File

@@ -16,6 +16,7 @@ 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.files.fsdb.caches; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*; import gplx.xowa.files.fsdb.*;
import gplx.core.primitives.*;
import gplx.dbs.*;
import gplx.fsdb.*;
class Cache_fil_mgr {

View File

@@ -16,6 +16,7 @@ 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.files.fsdb.caches; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*; import gplx.xowa.files.fsdb.*;
import gplx.core.primitives.*;
import gplx.dbs.*; import gplx.xowa.users.dbs.*;
import gplx.xowa2.files.*;
public class Cache_mgr implements Xou_db_wkr, GfoInvkAble {

View File

@@ -16,6 +16,7 @@ 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.files.fsdb.fs_roots; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*; import gplx.xowa.files.fsdb.*;
import gplx.core.primitives.*;
import gplx.dbs.*; import gplx.gfui.*; import gplx.fsdb.*;
import gplx.xowa.files.wiki_orig.*;
class Fs_root_dir {

View File

@@ -20,13 +20,12 @@ import gplx.ios.*; import gplx.fsdb.*;
import gplx.xowa.files.qrys.*; import gplx.xowa.files.bins.*;
import gplx.xowa.files.fsdb.caches.*;
import gplx.xowa.files.gui.*;
public class Fs_root_fsdb_mgr implements Xof_fsdb_mgr, GfoInvkAble {
public class Fs_root_fsdb_mgr implements Xof_fsdb_mgr, GfoInvkAble { // read images from file-system dir
public boolean Tid_is_mem() {return false;}
public Xow_wiki Wiki() {return wiki;} private Xow_wiki wiki;
public Xof_qry_mgr Qry_mgr() {throw Err_.not_implemented_();}
public Xof_bin_mgr Bin_mgr() {throw Err_.not_implemented_();}
public Xof_bin_wkr Bin_wkr_fsdb() {throw Err_.not_implemented_();}
public Gfo_usr_dlg Usr_dlg() {return usr_dlg;} private Gfo_usr_dlg usr_dlg;
public Cache_mgr Cache_mgr() {throw Err_.not_implemented_();}
public void Db_bin_max_(long v) {throw Err_.not_implemented_();}
public int Patch_upright() {return Xof_patch_upright_tid_.Tid_all;}
@@ -34,17 +33,16 @@ public class Fs_root_fsdb_mgr implements Xof_fsdb_mgr, GfoInvkAble {
public void Img_insert(Fsdb_xtn_img_itm rv, byte[] dir, byte[] fil, int ext_id, int img_w, int img_h, DateAdp modified, String hash, long bin_len, gplx.ios.Io_stream_rdr bin_rdr) {throw Err_.not_implemented_();}
public void Thm_insert(Fsdb_xtn_thm_itm rv, byte[] dir, byte[] fil, int ext_id, int thm_w, int thm_h, double thumbtime, int page, DateAdp modified, String hash, long bin_len, gplx.ios.Io_stream_rdr bin_rdr) {throw Err_.not_implemented_();}
public void Fil_insert(Fsdb_fil_itm rv , byte[] dir, byte[] fil, int ext_id, DateAdp modified, String hash, long bin_len, gplx.ios.Io_stream_rdr bin_rdr) {throw Err_.not_implemented_();}
public void Reg_insert(Xof_fsdb_itm itm, byte repo_id, byte status) {throw Err_.not_implemented_();}
public void Orig_insert(Xof_fsdb_itm itm, byte repo_id, byte status) {throw Err_.not_implemented_();}
private Fs_root_wkr_fsdb fsdb_wkr;
public Fs_root_fsdb_mgr(Xow_wiki wiki) {this.Init_by_wiki(wiki); fsdb_wkr = new Fs_root_wkr_fsdb(wiki);}
public boolean Init_by_wiki(Xow_wiki wiki) {
this.wiki = wiki;
this.usr_dlg = wiki.App().Usr_dlg();
return true;
}
public boolean Init_by_wiki__add_bin_wkrs(Xow_wiki wiki) {return this.Init_by_wiki(wiki);}
public void Init_by_wiki(Xow_wiki wiki, Io_url db_dir, Io_url fs_dir, Xow_repo_mgr repo_mgr) {this.Init_by_wiki(wiki);}
public void Reg_select(Xoa_page page, byte exec_tid, ListAdp itms) {
public void Fsdb_search_by_list(Xoa_page page, byte exec_tid, ListAdp itms) {
int itms_len = itms.Count();
for (int i = 0; i < itms_len; i++) {
Xof_fsdb_itm itm = (Xof_fsdb_itm)itms.FetchAt(i);
@@ -52,8 +50,8 @@ public class Fs_root_fsdb_mgr implements Xof_fsdb_mgr, GfoInvkAble {
Js_img_mgr.Update_img(page, itm);
}
}
public void Reg_select_only(Xoa_page page, byte exec_tid, ListAdp itms, OrderedHash hash) {}
public boolean Reg_select_itm_exists(byte[] ttl) {throw Err_.not_implemented_();}
public void Orig_select_by_list(Xoa_page page, byte exec_tid, ListAdp itms, OrderedHash hash) {}
public boolean Orig_exists_by_ttl(byte[] ttl) {throw Err_.not_implemented_();}
public void Rls() {}
private Io_url Xto_url(byte[] v) {
if (Op_sys.Cur().Tid_is_wnt())

View File

@@ -16,7 +16,7 @@ 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.files.fsdb.fs_roots; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*; import gplx.xowa.files.fsdb.*;
import gplx.dbs.*;
import gplx.core.primitives.*; import gplx.dbs.*;
import gplx.fsdb.*;
public class Fs_root_wkr_fsdb {
private Xow_wiki wiki;

View File

@@ -68,7 +68,7 @@ class Xof_file_fxt {
Xof_fsdb_itm itm = itm_(String_.new_utf8_(arg.Ttl()), arg.Lnki_type(), arg.Lnki_w(), arg.Lnki_h(), arg.Lnki_upright(), arg.Lnki_thumbtime());
ListAdp itms_list = ListAdp_.new_();
itms_list.Add(itm);
fsdb_mgr.Reg_select(Xoa_page.Empty, arg.Exec_tid(), itms_list);
fsdb_mgr.Fsdb_search_by_list(Xoa_page.Empty, arg.Exec_tid(), itms_list);
if (arg.Rslt_reg() != Xof_wiki_orig_wkr_.Tid_null) Tfds.Eq(arg.Rslt_reg(), itm.Rslt_reg(), "rslt_reg");
if (arg.Rslt_qry() != Xof_qry_wkr_.Tid_null) Tfds.Eq(arg.Rslt_qry(), itm.Rslt_qry(), "rslt_qry");
if (arg.Rslt_bin() != Xof_bin_wkr_.Tid_null) Tfds.Eq(arg.Rslt_bin(), itm.Rslt_bin(), "rslt_bin");
@@ -104,7 +104,7 @@ class Xof_file_fxt {
Xof_fsdb_itm itm = itm_(ttl, Xop_lnki_type.Id_null, Xop_lnki_tkn.Width_null, Xop_lnki_tkn.Height_null, Xop_lnki_tkn.Upright_null, Xof_doc_thumb.Null_as_int);
ListAdp list = ListAdp_.new_();
list.Add(itm);
fsdb_mgr.Reg_select(Xoa_page.Empty, Xof_exec_tid.Tid_wiki_page, list);
fsdb_mgr.Fsdb_search_by_list(Xoa_page.Empty, Xof_exec_tid.Tid_wiki_page, list);
return itm;
}
public static String file_img_(int w, int h) {return String_.Format("{0},{1}", w, h);}

View File

@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.files.qrys; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.dbs.*; import gplx.xowa.dbs.tbls.*; import gplx.xowa.files.fsdb.*; import gplx.xowa.files.wiki_orig.*;
import gplx.xowa2.files.orig_regy.*;
public class Xof_qry_wkr_xowa_reg implements Xof_qry_wkr {
private Db_conn conn;
public Xof_qry_wkr_xowa_reg(Db_conn p) {this.conn = p;}

View File

@@ -1,114 +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.files.wiki_orig; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.dbs.*; import gplx.xowa.dbs.*; import gplx.xowa.files.fsdb.*;
public class Xof_orig_regy_tbl implements Db_conn_itm {
public void Conn_term() {}
public Xof_orig_regy_tbl() {
Ctor_for_meta();
}
public Db_conn Conn() {return conn;} public Xof_orig_regy_tbl Conn_(Db_conn v) {conn = v; conn.Itms_add(this); return this;} private Db_conn conn;
// public void Select_list(Cancelable cancelable, Xodb_ctx db_ctx, byte exec_tid, ListAdp itms, OrderedHash hash, Xof_url_bldr url_bldr, Xow_repo_mgr repo_mgr) {
// Xof_wiki_orig_tbl_in_wkr in_wkr = new Xof_wiki_orig_tbl_in_wkr();
// in_wkr.Init(itms, hash);
// in_wkr.Select_in(p, cancelable, db_ctx, 0, itms.Count());
// Xof_wiki_orig_tbl_evaluator.Rdr_done(exec_tid, itms, hash, url_bldr, repo_mgr);
// }
public boolean Select_itm_exists(byte[] ttl) {return Select_itm(ttl) != Xof_orig_regy_itm.Null;}
public Xof_orig_regy_itm Select_itm(byte[] ttl) {
Xof_orig_regy_itm rv = Xof_orig_regy_itm.Null;
Db_rdr rdr = Db_rdr_.Null;
try {
Db_stmt stmt = conn.New_stmt_select_all_where(tbl_name, Flds.Xto_str_ary(), Fld_orig_ttl);
rdr = stmt.Clear().Val_bry_as_str(ttl).Exec_select_as_rdr();
if (rdr.Move_next())
rv = Make_itm(rdr);
}
catch (Exception e) {
Tfds.WriteText(Err_.Message_gplx(e));
}
finally {rdr.Rls();}
return rv;
}
public void Insert(byte repo, byte[] ttl, int ext, int w, int h, byte[] redirect) {
Db_stmt stmt = Db_stmt_.Null;
try {
stmt = conn.New_stmt_insert(tbl_name, Flds.Xto_str_ary());
stmt.Clear()
.Val_byte(repo).Val_bry_as_str(ttl).Val_int(ext).Val_int(w).Val_int(h).Val_bry_as_str(redirect)
.Exec_insert();
} finally {stmt.Rls();}
}
private String tbl_name = "file_orig_regy";
private String Fld_orig_repo, Fld_orig_ttl, Fld_orig_ext, Fld_orig_w, Fld_orig_h, Fld_orig_redirect;
private final Db_meta_fld_list Flds = Db_meta_fld_list.new_();
private void Ctor_for_meta() {
tbl_name = "wiki_orig";
Fld_orig_repo = Flds.Add_byte("orig_repo");
Fld_orig_ttl = Flds.Add_str("orig_ttl", 1024);
Fld_orig_ext = Flds.Add_int("orig_ext");
Fld_orig_w = Flds.Add_int("orig_w");
Fld_orig_h = Flds.Add_int("orig_h");
Fld_orig_redirect = Flds.Add_str("orig_redirect", 1024);
}
public Db_meta_tbl new_meta() {
return Db_meta_tbl.new_(tbl_name, Flds.Xto_fld_ary()
, Db_meta_idx.new_unique(tbl_name, "key" , Fld_orig_ttl)
);
}
private Xof_orig_regy_itm Make_itm(Db_rdr rdr) {
Xof_orig_regy_itm rv = new Xof_orig_regy_itm
( rdr.Read_bry_by_str(Fld_orig_ttl)
, Xof_wiki_orig_wkr_.Tid_found_orig
, rdr.Read_byte(Fld_orig_repo)
, rdr.Read_int(Fld_orig_w)
, rdr.Read_int(Fld_orig_h)
, rdr.Read_int(Fld_orig_ext)
, rdr.Read_bry_by_str(Fld_orig_redirect)
);
return rv;
}
}
abstract class Db_in_wkr__base {
public abstract int Interval();
public abstract Db_qry Make_qry (Object db_ctx, int bgn, int end);
public abstract void Fill_stmt (Db_stmt stmt, int bgn, int end);
public abstract void Read_data (Cancelable cancelable, Object db_ctx, Db_rdr rdr);
public void Select_in(Cancelable cancelable, Object db_ctx, Db_conn conn, int full_bgn, int full_end) {
Db_rdr rdr = Db_rdr_.Null;
Db_stmt stmt = Db_stmt_.Null;
int part_len = Interval();
for (int part_bgn = full_bgn; part_bgn < full_end; part_bgn += part_len) {
int part_end = part_bgn + part_len;
if (part_end > full_end) part_end = full_end;
try {
stmt = conn.New_stmt(Make_qry(db_ctx, part_bgn, part_end));
Fill_stmt(stmt, part_bgn, part_end);
rdr = stmt.Exec_select_as_rdr();
Read_data(cancelable, db_ctx, rdr);
}
finally {rdr.Rls(); stmt.Rls();}
}
}
public static Object[] In_ary(int len) {
Object[] rv = new Object[len];
for (int i = 0; i < len; i++)
rv[i] = "";
return rv;
}
}

View File

@@ -16,7 +16,7 @@ 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.files.wiki_orig; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.dbs.*; import gplx.xowa.dbs.*; import gplx.xowa.files.fsdb.*;
import gplx.dbs.*; import gplx.xowa.dbs.*; import gplx.xowa.files.fsdb.*; import gplx.xowa2.files.orig_regy.*;
public class Xof_wiki_orig_tbl {
public static void Create_table(Db_conn p) {
Sqlite_engine_.Tbl_create(p, Tbl_name, Tbl_sql);

View File

@@ -16,7 +16,9 @@ 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.files.wiki_orig; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.core.primitives.*;
import gplx.dbs.*; import gplx.xowa.dbs.*; import gplx.xowa.files.fsdb.*;
import gplx.xowa2.files.orig_regy.*;
class Xof_wiki_orig_tbl_in_wkr extends gplx.xowa.dbs.tbls.Xodb_in_wkr_base {
private ListAdp itms_all;
@Override public int Interval() {return Sqlite_engine_.Stmt_arg_max;}

View File

@@ -16,7 +16,7 @@ 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.gui.bnds; import gplx.*; import gplx.xowa.*; import gplx.xowa.gui.*;
import gplx.srls.dsvs.*; import gplx.gfui.*; import gplx.xowa.cfgs2.*;
import gplx.core.primitives.*; import gplx.srls.dsvs.*; import gplx.gfui.*; import gplx.xowa.cfgs2.*;
public class Xog_bnd_mgr_srl extends Dsv_wkr_base {
private Xoa_app app;
private Xog_bnd_mgr bnd_mgr;

View File

@@ -16,7 +16,7 @@ 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.gui.views; import gplx.*; import gplx.xowa.*; import gplx.xowa.gui.*;
import gplx.core.btries.*; import gplx.gfui.*; import gplx.html.*; import gplx.xowa.gui.menus.*; import gplx.xowa.gui.menus.dom.*; import gplx.xowa.html.modules.*; import gplx.xowa.pages.*;
import gplx.core.primitives.*; import gplx.core.btries.*; import gplx.gfui.*; import gplx.html.*; import gplx.xowa.gui.menus.*; import gplx.xowa.gui.menus.dom.*; import gplx.xowa.html.modules.*; import gplx.xowa.pages.*;
public class Xog_html_itm implements GfoInvkAble, GfoEvObj {
private Xoa_app app;
public Xog_html_itm(Xog_tab_itm owner_tab) {

View File

@@ -20,7 +20,7 @@ import gplx.intl.*; import gplx.dbs.*; import gplx.xowa.html.hzips.*;
import gplx.xowa.hdumps.core.*; import gplx.xowa.hdumps.loads.*; import gplx.xowa.hdumps.htmls.*; import gplx.xowa.apps.fsys.*;
import gplx.xowa2.apps.*; import gplx.xowa2.wikis.*; import gplx.xowa2.wikis.data.*; import gplx.xowa2.gui.*;
public class Xowd_hdump_mgr {
private final Xoav_app app; private final Xowv_wiki wiki; private final Xodata_db_mgr wiki_db_mgr;
private final Xoav_app app; private final Xowv_wiki wiki; private final Xowd_data_mgr wiki_db_mgr;
private Xodb_page dbpg = new Xodb_page();
private Hdump_load_mgr load_mgr = new Hdump_load_mgr();
private Hdump_html_body html_body = new Hdump_html_body();
@@ -29,10 +29,10 @@ public class Xowd_hdump_mgr {
html_body.Init_by_app(app.Usr_dlg(), app.Fsys_mgr(), app.Utl_encoder_fsys());
}
public void Get_by_ttl(Xog_page rv, Gfo_url url, Xoa_ttl ttl) {
wiki_db_mgr.Tbl_page_regy().Select_by_ttl(dbpg, ttl.Ns(), ttl.Page_db());
wiki_db_mgr.Tbl__page().Select_by_ttl(dbpg, ttl.Ns(), ttl.Page_db());
if (dbpg.Redirect_id() != -1) Select_by_id(rv, dbpg);
if (dbpg.Html_db_id() == -1) return; // should return "not found" message
load_mgr.Load2(rv, Db_conn_pool.I.Get_or_new(wiki_db_mgr.Key_by_idx(dbpg.Html_db_id())), dbpg.Id(), ttl);
load_mgr.Load2(rv, Db_conn_pool.I.Get_or_new(wiki_db_mgr.Url_by_idx(dbpg.Html_db_id())), dbpg.Id(), ttl);
Bry_bfr bfr = app.Utl_bfr_mkr().Get_m001();
html_body.Init_by_page(wiki.Domain_bry(), rv).Write(bfr);
wiki.Hzip_mgr().Load(bfr, ttl.Page_db(), bfr.Xto_bry_and_clear());
@@ -42,7 +42,7 @@ public class Xowd_hdump_mgr {
int redirect_count = 0;
while (redirect_count < 5) {
int redirect_id = dbpg.Redirect_id();
wiki_db_mgr.Tbl_page_regy().Select_by_id(dbpg, redirect_id);
wiki_db_mgr.Tbl__page().Select_by_id(dbpg, redirect_id);
if (redirect_id == -1) break;
}
}

View File

@@ -16,7 +16,7 @@ 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.hdumps.srls; import gplx.*; import gplx.xowa.*; import gplx.xowa.hdumps.*;
import gplx.xowa.hdumps.core.*;
import gplx.core.primitives.*; import gplx.xowa.hdumps.core.*;
import gplx.xowa2.gui.*;
public interface Hpg_srl_itm {
byte Tid();

View File

@@ -16,7 +16,7 @@ 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.hdumps.srls; import gplx.*; import gplx.xowa.*; import gplx.xowa.hdumps.*;
import gplx.xowa.hdumps.core.*;
import gplx.core.primitives.*; import gplx.xowa.hdumps.core.*;
import gplx.xowa2.gui.*;
public class Hpg_srl_itm_ {
public static final byte // SERIALIZED

View File

@@ -16,7 +16,7 @@ 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.hdumps.srls; import gplx.*; import gplx.xowa.*; import gplx.xowa.hdumps.*;
import org.junit.*;
import org.junit.*; import gplx.core.primitives.*;
public class Hpg_srl_itm__tst {
@Before public void init() {fxt.Clear();} private Hpg_srl_itm__fxt fxt = new Hpg_srl_itm__fxt();
@Test public void Srl() {

View File

@@ -16,7 +16,7 @@ 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.hdumps.srls; import gplx.*; import gplx.xowa.*; import gplx.xowa.hdumps.*;
import gplx.xowa.hdumps.core.*;
import gplx.core.primitives.*; import gplx.xowa.hdumps.core.*;
import gplx.xowa2.gui.*;
public class Hpg_srl_mgr {
private Int_obj_ref count_ref = Int_obj_ref.zero_();

View File

@@ -16,6 +16,7 @@ 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.html; import gplx.*; import gplx.xowa.*;
import gplx.core.primitives.*;
import gplx.core.btries.*; import gplx.html.*; import gplx.xowa.wikis.*; import gplx.xowa.net.*;
import gplx.xowa.parsers.apos.*; import gplx.xowa.parsers.amps.*; import gplx.xowa.parsers.lnkes.*; import gplx.xowa.parsers.hdrs.*; import gplx.xowa.parsers.lists.*; import gplx.xowa.html.lnkis.*; import gplx.xowa.parsers.tblws.*; import gplx.xowa.parsers.paras.*;
import gplx.xowa.xtns.*; import gplx.xowa.xtns.dynamicPageList.*; import gplx.xowa.xtns.math.*; import gplx.xowa.langs.vnts.*; import gplx.xowa.xtns.cite.*; import gplx.xowa.html.hzips.*;

View File

@@ -16,6 +16,7 @@ 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.html; import gplx.*; import gplx.xowa.*;
import gplx.core.primitives.*;
import gplx.xowa.wikis.*;
public class Xoh_imgs_mgr implements GfoInvkAble {
public Xoh_imgs_mgr(Xow_html_mgr html_mgr) {wiki_is_default = html_mgr.Wiki().Domain_tid() == Xow_wiki_domain_.Tid_home;} private boolean wiki_is_default;

View File

@@ -16,7 +16,7 @@ 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.html.hzips; import gplx.*; import gplx.xowa.*; import gplx.xowa.html.*;
import gplx.core.brys.*; import gplx.html.*; import gplx.xowa.apps.ttls.*; import gplx.xowa.hdumps.srls.*;
import gplx.core.primitives.*; import gplx.core.brys.*; import gplx.html.*; import gplx.xowa.apps.ttls.*; import gplx.xowa.hdumps.srls.*;
public class Xow_hzip_itm__anchor {
private Xow_hzip_mgr hzip_mgr; private Xoa_ttl_parser ttl_parser; private Byte_obj_ref xtid_ref = Byte_obj_ref.zero_();
private Bry_rdr bry_rdr = new Bry_rdr();

View File

@@ -16,7 +16,7 @@ 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.html.hzips; import gplx.*; import gplx.xowa.*; import gplx.xowa.html.*;
import gplx.core.btries.*; import gplx.xowa.apps.ttls.*;
import gplx.core.primitives.*; import gplx.core.btries.*; import gplx.xowa.apps.ttls.*;
public class Xow_hzip_mgr {
private Gfo_usr_dlg usr_dlg;
private byte[] page_url; private byte[] src; private int src_len;

View File

@@ -16,6 +16,7 @@ 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.html.hzips; import gplx.*; import gplx.xowa.*; import gplx.xowa.html.*;
import gplx.core.primitives.*;
class Xow_hzip_xtid {
public static int Find_xtid(Xow_hzip_mgr hzip_mgr, byte[] src, int src_len, int bgn, int pos, Byte_obj_ref xtid_ref) {
int xtid_bgn = pos + Len_xtid; if (!Bry_.Match(src, pos, xtid_bgn, Bry_xtid)) return Xow_hzip_mgr.Unhandled; // next atr should be "xtid='"

View File

@@ -16,6 +16,7 @@ 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.html.lnkis; import gplx.*; import gplx.xowa.*; import gplx.xowa.html.*;
import gplx.core.primitives.*;
import gplx.xowa.files.*; import gplx.xowa.parsers.lnkis.*;
public class Xoh_file_mgr {
private final Xow_wiki wiki; private final Bool_obj_ref queue_add_ref = Bool_obj_ref.n_();

View File

@@ -16,7 +16,7 @@ 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.html.modules.popups; import gplx.*; import gplx.xowa.*; import gplx.xowa.html.*; import gplx.xowa.html.modules.*;
import gplx.threads.*;
import gplx.core.primitives.*; import gplx.threads.*;
import gplx.xowa.gui.views.*;
import gplx.xowa.specials.search.*;
import gplx.xowa.apis.xowa.html.modules.*;

View File

@@ -16,7 +16,7 @@ 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.html.modules.popups; import gplx.*; import gplx.xowa.*; import gplx.xowa.html.*; import gplx.xowa.html.modules.*;
import org.junit.*;
import org.junit.*; import gplx.core.primitives.*;
import gplx.xowa.apis.xowa.html.modules.*;
import gplx.xowa.gui.views.*;
public class Xow_popup_parser_tst {

View File

@@ -16,7 +16,7 @@ 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.html.sidebar; import gplx.*; import gplx.xowa.*; import gplx.xowa.html.*;
import org.junit.*;
import org.junit.*; import gplx.core.strings.*;
public class Xowh_sidebar_mgr_tst {
@Before public void init() {fxt.Clear();} private Xowh_sidebar_mgr_fxt fxt = new Xowh_sidebar_mgr_fxt();
@Test public void Grp() {

View File

@@ -16,6 +16,7 @@ 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.html.tocs; import gplx.*; import gplx.xowa.*; import gplx.xowa.html.*;
import gplx.core.primitives.*;
import gplx.xowa.parsers.amps.*; import gplx.xowa.parsers.hdrs.*;
public class Xow_hdr_mgr {
private Xow_wiki wiki; private Xoa_page page;

View File

@@ -16,6 +16,7 @@ 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.langs.cases; import gplx.*; import gplx.xowa.*; import gplx.xowa.langs.*;
import gplx.core.primitives.*;
import gplx.intl.*;
public interface Xol_case_itm extends Gfo_case_itm {
byte Tid();

View File

@@ -16,7 +16,7 @@ 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.langs.cases; import gplx.*; import gplx.xowa.*; import gplx.xowa.langs.*;
import org.junit.*;
import org.junit.*; import gplx.core.strings.*;
public class Xol_case_mgr_tst {
@Before public void init() {fxt.Clear();} private Xol_case_mgr_fxt fxt = new Xol_case_mgr_fxt();
@Test public void Mw_parse() {

View File

@@ -16,7 +16,7 @@ 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.langs.grammars; import gplx.*; import gplx.xowa.*; import gplx.xowa.langs.*;
import gplx.core.btries.*;
import gplx.core.primitives.*; import gplx.core.btries.*;
public class Xol_grammar_ {
public static final byte Tid__max = 9;
public static final byte Tid_genitive = 0, Tid_elative = 1, Tid_partitive = 2, Tid_illative = 3, Tid_inessive = 4, Tid_accusative = 5, Tid_instrumental = 6, Tid_prepositional = 7, Tid_dative = 8, Tid_unknown = Byte_.Max_value_127;

View File

@@ -16,7 +16,7 @@ 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.langs.grammars; import gplx.*; import gplx.xowa.*; import gplx.xowa.langs.*;
import gplx.core.btries.*;
import gplx.core.primitives.*; import gplx.core.btries.*;
public class Xol_grammar_fi implements Xol_grammar {
public boolean Vowel_harmony(byte[] word, int word_len) {
// $aou = preg_match( '/[aou][^äöy]*$/i', $word );

View File

@@ -16,7 +16,7 @@ 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.langs.numbers; import gplx.*; import gplx.xowa.*; import gplx.xowa.langs.*;
import gplx.core.btries.*;
import gplx.core.primitives.*; import gplx.core.btries.*;
public class Xol_num_fmtr_base implements GfoInvkAble {
private Btrie_fast_mgr dlm_trie = Btrie_fast_mgr.cs_();
private Xol_num_grp[] grp_ary = Xol_num_grp.Ary_empty; int grp_ary_len;

View File

@@ -16,7 +16,7 @@ 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.servers; import gplx.*; import gplx.xowa.*;
import gplx.gfui.*;
import gplx.core.primitives.*; import gplx.gfui.*;
import gplx.xowa.servers.tcp.*;
import gplx.xowa.servers.http.*;
public class Gxw_html_server implements Gxw_html {

View File

@@ -16,6 +16,7 @@ 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.servers.tcp; import gplx.*; import gplx.xowa.*; import gplx.xowa.servers.*;
import gplx.core.primitives.*;
import gplx.ios.*; import gplx.texts.*;
public class Xosrv_msg_rdr {
public Xosrv_msg_rdr(byte[] default_body_bry, IoStream rdr) {this.default_body_bry = default_body_bry; default_body_bry_len = default_body_bry.length; this.rdr = rdr;} private byte[] header_bry = new byte[24], default_body_bry; int default_body_bry_len;

Some files were not shown because too many files have changed in this diff Show More