mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.7.2.1'
This commit is contained in:
@@ -29,7 +29,7 @@ public class Xofw_wiki_wkr_base implements Xofw_wiki_finder {
|
||||
byte[] wiki_key = repo_pair.Src().Wiki_domain();
|
||||
if (repo_pair.Src().Wmf_api()) continue;
|
||||
Xowe_wiki repo_wiki = (Xowe_wiki)wiki_mgr.Get_by_or_null(wiki_key); if (repo_wiki == null) {continue;}
|
||||
Xoa_ttl ttl = Xoa_ttl.parse(repo_wiki, ttl_bry);
|
||||
Xoa_ttl ttl = Xoa_ttl.Parse(repo_wiki, ttl_bry);
|
||||
Xow_ns file_ns = repo_wiki.Ns_mgr().Ns_file();
|
||||
boolean found = repo_wiki.Db_mgr().Load_mgr().Load_by_ttl(tmp_db_page, file_ns, ttl.Page_db());
|
||||
if (!found) {continue;}
|
||||
@@ -41,7 +41,7 @@ public class Xofw_wiki_wkr_base implements Xofw_wiki_finder {
|
||||
file.Orig_repo_id_(-1);
|
||||
}
|
||||
public boolean Locate(Xofw_file_finder_rslt rv, List_adp repo_pairs, byte[] ttl_bry) {
|
||||
Xoa_ttl ttl = Xoa_ttl.parse(wiki, ttl_bry); // NOTE: parse(ttl_bry) should be the same across all wikis; i.e.: there should be no aliases/namespaces
|
||||
Xoa_ttl ttl = Xoa_ttl.Parse(wiki, ttl_bry); // NOTE: parse(ttl_bry) should be the same across all wikis; i.e.: there should be no aliases/namespaces
|
||||
Xow_ns file_ns = wiki.Ns_mgr().Ns_file(); // NOTE: file_ns should also be the same across all wikis; being used for data_mgr.Parse below
|
||||
byte[] ttl_db_key = ttl.Page_db();
|
||||
rv.Init(ttl_db_key);
|
||||
|
||||
@@ -20,23 +20,35 @@ import gplx.xowa.apps.fsys.*; import gplx.xowa.files.exts.*;
|
||||
import gplx.xowa.wikis.domains.*;
|
||||
public class Xow_repo_mgr_ {
|
||||
public static void Assert_repos(Xoae_app app, Xowe_wiki wiki) {
|
||||
Xoa_repo_mgr repo_mgr = app.File_mgr().Repo_mgr();
|
||||
Xoa_fsys_mgr app_fsys_mgr = app.Fsys_mgr();
|
||||
Xof_rule_mgr ext_rule_mgr = app.File_mgr().Ext_rules();
|
||||
byte[] domain_bry = wiki.Domain_bry();
|
||||
Xof_repo_itm repo_itm = repo_mgr.Get_by(domain_bry);
|
||||
if (repo_itm == null) { // no repo for wiki exists; create it;
|
||||
repo_itm = new Xof_repo_itm(domain_bry, app_fsys_mgr, ext_rule_mgr, domain_bry);
|
||||
repo_mgr.Add(repo_itm);
|
||||
}
|
||||
Xowe_repo_mgr pair_mgr = wiki.File_mgr().Repo_mgr();
|
||||
if (pair_mgr.Repos_len() == 0) { // no pairs defined; add at least 1
|
||||
Xof_repo_itm repo_src = repo_mgr.Get_by(File_repo_xowa_null);
|
||||
if (repo_src == null) {
|
||||
repo_itm = new Xof_repo_itm(File_repo_xowa_null, app_fsys_mgr, ext_rule_mgr, Xow_domain_tid_.Bry__home);
|
||||
synchronized (app) { // LOCK:app-level; DATE:2016-07-07
|
||||
Xoa_repo_mgr repo_mgr = app.File_mgr().Repo_mgr();
|
||||
Xoa_fsys_mgr app_fsys_mgr = app.Fsys_mgr();
|
||||
Xof_rule_mgr ext_rule_mgr = app.File_mgr().Ext_rules();
|
||||
byte[] domain_bry = wiki.Domain_bry();
|
||||
Xof_repo_itm repo_itm = repo_mgr.Get_by(domain_bry);
|
||||
if (repo_itm == null) { // no repo for wiki exists; create it;
|
||||
repo_itm = new Xof_repo_itm(domain_bry, app_fsys_mgr, ext_rule_mgr, domain_bry);
|
||||
repo_itm.Root_str_(wiki.Fsys_mgr().Root_dir().Raw()); // NOTE: needed for mass_parse; ordinarily called by xowa.gfs; DATE:2016-07-07
|
||||
repo_mgr.Add(repo_itm);
|
||||
}
|
||||
pair_mgr.Add_repo(File_repo_xowa_null, domain_bry);
|
||||
Xowe_repo_mgr pair_mgr = wiki.File_mgr().Repo_mgr();
|
||||
if (pair_mgr.Repos_len() == 0) { // no pairs defined; add at least 1
|
||||
Xof_repo_itm repo_src = repo_mgr.Get_by(File_repo_xowa_null);
|
||||
if (repo_src == null) {
|
||||
repo_itm = new Xof_repo_itm(File_repo_xowa_null, app_fsys_mgr, ext_rule_mgr, Xow_domain_tid_.Bry__home);
|
||||
repo_mgr.Add(repo_itm);
|
||||
}
|
||||
pair_mgr.Add_repo(File_repo_xowa_null, domain_bry);
|
||||
|
||||
// add commons; needed for mass_parse, else multiple "repo_mgr.invalid_repo" when common files exist in user_cache; DATE:2016-07-07
|
||||
Xof_repo_itm commons_repo = repo_mgr.Get_by(Xow_domain_itm_.Bry__commons);
|
||||
if (commons_repo == null) {
|
||||
commons_repo = new Xof_repo_itm(Xow_domain_itm_.Bry__commons, app_fsys_mgr, ext_rule_mgr, domain_bry);
|
||||
commons_repo.Root_str_(app.Fsys_mgr().Wiki_dir().GenSubDir(Xow_domain_itm_.Str__commons).Raw()); // NOTE: needed for mass_parse; ordinarily called by xowa.gfs; DATE:2016-07-07
|
||||
repo_mgr.Add(commons_repo);
|
||||
}
|
||||
pair_mgr.Add_repo(Xow_domain_itm_.Bry__commons, Xow_domain_itm_.Bry__commons);
|
||||
}
|
||||
}
|
||||
}
|
||||
private static byte[] File_repo_xowa_null = Bry_.new_a7("xowa_repo_null");
|
||||
|
||||
Reference in New Issue
Block a user