mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.8.2.1'
This commit is contained in:
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.xtns.pfuncs.ifs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.pfuncs.*;
|
||||
import gplx.core.envs.*; import gplx.core.caches.*;
|
||||
import gplx.xowa.bldrs.wms.apis.*; import gplx.xowa.wikis.data.tbls.*;
|
||||
import gplx.xowa.apps.wms.apis.*; import gplx.xowa.wikis.data.tbls.*;
|
||||
import gplx.xowa.wikis.nss.*;
|
||||
public class Pfunc_ifexist_mgr {
|
||||
private final Xowd_page_itm db_page = Xowd_page_itm.new_tmp();
|
||||
|
||||
@@ -26,6 +26,6 @@ public class Pfunc_rev_props_tst {
|
||||
@Test public void Page_size() {fxt.Test_parse_tmpl_str_test("{{PAGESIZE:Test page}}" , "{{test}}", "0");}
|
||||
@Test public void Revision_size() {fxt.Test_parse_tmpl_str_test("{{REVISIONSIZE}}" , "{{test}}", "8");}
|
||||
@Test public void Protection_level() {fxt.Test_parse_tmpl_str_test("{{PROTECTIONLEVEL}}" , "{{test}}", "normal");}
|
||||
@Test public void Protection_expiry() {fxt.Test_parse_tmpl_str_test("{{PROTECTIONEXPIRY}}" , "{{test}}", "infinite");}
|
||||
@Test public void Protection_expiry() {fxt.Test_parse_tmpl_str_test("{{PROTECTIONEXPIRY}}" , "{{test}}", "infinity");}
|
||||
@Test public void PageSize_invalid_ttl() {fxt.Test_parse_tmpl_str_test("{{PAGESIZE:{{{100}}}|R}}" , "{{test}}", "0");}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class Pfunc_filepath extends Pf_func_base {
|
||||
byte[] url = wiki.Parser_mgr().Url_bldr().Init_for_trg_html(Xof_repo_itm_.Mode_orig, trg_repo, ttl_bry, xfer_itm.Orig_ttl_md5(), xfer_itm.Orig_ext(), Xof_img_size.Size__neg1, Xof_lnki_time.Null, Xof_lnki_page.Null).Xto_bry();
|
||||
bfr.Add(url);
|
||||
}
|
||||
private static Pfunc_filepath_itm Load_page(Xowe_wiki wiki, Xoa_ttl ttl) {
|
||||
public static Pfunc_filepath_itm Load_page(Xowe_wiki wiki, Xoa_ttl ttl) {
|
||||
// try to get from cache
|
||||
Gfo_cache_mgr cache_mgr = wiki.Cache_mgr().Commons_cache();
|
||||
byte[] cache_key = ttl.Page_url();
|
||||
@@ -69,9 +69,3 @@ public class Pfunc_filepath extends Pf_func_base {
|
||||
return cache_itm;
|
||||
}
|
||||
}
|
||||
class Pfunc_filepath_itm implements Rls_able {
|
||||
public Pfunc_filepath_itm(boolean exists, byte[] page_url) {this.exists = exists; this.page_url = page_url;}
|
||||
public boolean Exists() {return exists;} private final boolean exists;
|
||||
public byte[] Page_url() {return page_url;} private final byte[] page_url;
|
||||
public void Rls() {}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
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.xtns.pfuncs.ttls; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.pfuncs.*;
|
||||
public class Pfunc_filepath_itm implements Rls_able {
|
||||
public Pfunc_filepath_itm(boolean exists, byte[] page_url) {this.exists = exists; this.page_url = page_url;}
|
||||
public boolean Exists() {return exists;} private final boolean exists;
|
||||
public byte[] Page_url() {return page_url;} private final byte[] page_url;
|
||||
public void Rls() {}
|
||||
}
|
||||
@@ -61,6 +61,6 @@ public class Pfunc_filepath_tst {
|
||||
}
|
||||
// private static void Init_orig_mgr(Xow_wiki wiki) {
|
||||
// Xof_orig_tbl orig_tbl = null;
|
||||
// wiki.File__orig_mgr().Init_by_wiki(wiki, Xof_fsdb_mode.new_v2_gui(), new Xof_orig_tbl[] {orig_tbl}, Xof_url_bldr.new_v2());
|
||||
// wiki.File__orig_mgr().Init_by_wiki(wiki, Xof_fsdb_mode.New__v2__gui(), new Xof_orig_tbl[] {orig_tbl}, Xof_url_bldr.new_v2());
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user