mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.8.1.1'
This commit is contained in:
@@ -55,7 +55,7 @@ class Xou_user_ {
|
||||
rv = rv.Add_new(-2, "Media").Add_new(-1, "Special").Add_new(0, "").Add_new(1, "Talk").Add_new(2, "User").Add_new(3, "User talk").Add_new(4, "Wikipedia").Add_new(5, "Wikipedia talk")
|
||||
.Add_new(6, "File").Add_new(7, "File talk").Add_new(8, "MediaWiki").Add_new(9, "MediaWiki talk").Add_new(10, "Template").Add_new(11, "Template talk")
|
||||
.Add_new(12, "Help").Add_new(13, "Help talk").Add_new(14, "Category").Add_new(15, "Category talk").Add_new(100, "Portal").Add_new(101, "Portal talk")
|
||||
.Add_new(gplx.xowa.xtns.wdatas.Wdata_wiki_mgr.Ns_property, gplx.xowa.xtns.wdatas.Wdata_wiki_mgr.Ns_property_name)
|
||||
.Add_new(gplx.xowa.xtns.wbases.Wdata_wiki_mgr.Ns_property, gplx.xowa.xtns.wbases.Wdata_wiki_mgr.Ns_property_name)
|
||||
.Add_new(730, "Data").Add_new(731, "Data talk")
|
||||
.Add_new(Xow_ns_.Tid__module, Xow_ns_.Key__module).Add_new(Xow_ns_.Tid__module_talk, Xow_ns_.Key__module_talk)
|
||||
.Add_defaults()
|
||||
|
||||
@@ -32,7 +32,7 @@ public class Xoud_opt_scope_tst {
|
||||
class Xoud_opt_scope_fxt {
|
||||
private final Xoud_opt_scope_parser parser = new Xoud_opt_scope_parser();
|
||||
public void Clear() {
|
||||
// Gfo_usr_dlg_.I = Xoa_app_.usr_dlg_console_();
|
||||
// Gfo_usr_dlg_.I = Xoa_app_.New__usr_dlg__console();
|
||||
}
|
||||
public Xoud_opt_scope Make(int lang_id, int type_id) {return new Xoud_opt_scope(lang_id, type_id);}
|
||||
public void Test_parse(String raw, Xoud_opt_scope... expd) {
|
||||
|
||||
@@ -23,7 +23,7 @@ public class Xou_history_itm {
|
||||
this.wiki = wiki;
|
||||
this.page = page;
|
||||
this.key = key_(wiki, page);
|
||||
this.view_bgn = DateAdp_.Now();
|
||||
this.view_bgn = Datetime_now.Get();
|
||||
}
|
||||
public byte[] Key() {return key;} private byte[] key;
|
||||
public byte[] Wiki() {return wiki;} private byte[] wiki;
|
||||
@@ -43,7 +43,7 @@ public class Xou_history_itm {
|
||||
}
|
||||
}
|
||||
public void Tally() {
|
||||
view_end = view_count == 0 ? view_bgn : DateAdp_.Now();
|
||||
view_end = view_count == 0 ? view_bgn : Datetime_now.Get();
|
||||
view_count++;
|
||||
}
|
||||
public void Merge(Xou_history_itm merge) {
|
||||
@@ -68,6 +68,6 @@ public class Xou_history_itm {
|
||||
.Add(wiki) .Add_byte(Bry_.Dlm_fld)
|
||||
.Add(page) .Add_byte(Bry_.Dlm_row);
|
||||
}
|
||||
public static byte[] key_(byte[] wiki, byte[] page) {return Bry_.Add(wiki, Key_dlm, page);} private static final byte[] Key_dlm = Byte_ascii.Pipe_bry;
|
||||
public static byte[] key_(byte[] wiki, byte[] page) {return Bry_.Add(wiki, Key_dlm, page);} private static final byte[] Key_dlm = Byte_ascii.Pipe_bry;
|
||||
public static final byte Fld_key = 0, Fld_wiki = 1, Fld_page = 2, Fld_view_count = 3, Fld_view_bgn = 4, Fld_view_end = 5;
|
||||
}
|
||||
|
||||
@@ -47,8 +47,8 @@ public class Xou_history_mgr implements Gfo_invk {
|
||||
Xoa_url url = page.Url();
|
||||
Xoa_ttl ttl = page.Ttl();
|
||||
byte[] page_ttl = null;
|
||||
if (page.Redirect().Itms__len() > 0) // page was redirected; add src ttl to history, not trg; EX: UK -> United Kingdom; add "UK"; DATE:2014-02-28
|
||||
page_ttl = page.Redirect().Itms__get_at(0).Ttl().Full_db();
|
||||
if (page.Redirect_trail().Itms__len() > 0) // page was redirected; add src ttl to history, not trg; EX: UK -> United Kingdom; add "UK"; DATE:2014-02-28
|
||||
page_ttl = page.Redirect_trail().Itms__get_at_0th_or_null().Ttl().Page_db();
|
||||
else {
|
||||
page_ttl = Bry_.Add(ttl.Ns().Name_db_w_colon(), ttl.Page_txt()); // use ttl.Page_txt() b/c it normalizes space/casing (url.Page_txt does not)
|
||||
if (url.Qargs_ary().length > 0)
|
||||
@@ -107,7 +107,7 @@ public class Xou_history_mgr implements Gfo_invk {
|
||||
|
||||
// save archive
|
||||
byte[] ary = Xou_history_itm_srl.Save(archive_itms);
|
||||
Io_url url = app.Usere().Fsys_mgr().App_data_history_fil().GenNewNameOnly(DateAdp_.Now().XtoStr_fmt_yyyyMMdd_HHmmss_fff());
|
||||
Io_url url = app.Usere().Fsys_mgr().App_data_history_fil().GenNewNameOnly(Datetime_now.Get().XtoStr_fmt_yyyyMMdd_HHmmss_fff());
|
||||
Io_mgr.Instance.SaveFilBry(url, ary);
|
||||
return current_itms;
|
||||
} private int current_itms_max = 512, current_itms_reset = 256;
|
||||
|
||||
@@ -21,7 +21,7 @@ public class Xou_history_mgr_tst {
|
||||
private Xou_history_mgr_fxt fxt = new Xou_history_mgr_fxt();
|
||||
@Before public void init() {fxt.Clear();}
|
||||
@Test public void Archive() {
|
||||
Tfds.Now_enabled_y_(); // NOTE: each DateTime_.Now() advances clock by 1 min; adding a new DateAdp_.Now() anywhere will throw off times on this test; DATE:2014-04-01
|
||||
Datetime_now.Manual_y_(); // NOTE: each DateTime_.Now() advances clock by 1 min; adding a new Datetime_now.Get() anywhere will throw off times on this test; DATE:2014-04-01
|
||||
fxt.Invk(Xou_history_mgr.Invk_current_itms_max_, 4).Invk(Xou_history_mgr.Invk_current_itms_reset_, 2);
|
||||
fxt.Add_many("A", "B", "C", "D", "E");
|
||||
fxt.Save();
|
||||
@@ -67,7 +67,7 @@ class Xou_history_mgr_fxt {
|
||||
byte[] ttl_bry = Bry_.new_u8(ttl_str);
|
||||
Xoa_ttl ttl = Xoa_ttl.Parse(wiki, ttl_bry);
|
||||
Xoae_page page = Xoae_page.New_test(wiki, ttl);
|
||||
page.Db().Page().Modified_on_(DateAdp_.Now());
|
||||
page.Db().Page().Modified_on_(Datetime_now.Get());
|
||||
byte[] url_bry = ttl_bry;
|
||||
if (arg_str != null) url_bry = Bry_.Add(url_bry, Bry_.new_u8(arg_str));
|
||||
Xoa_url url = wiki.Utl__url_parser().Parse(url_bry);
|
||||
|
||||
@@ -30,7 +30,7 @@ public class Xoud_history_mgr implements Gfo_invk {
|
||||
}
|
||||
private void Update(String wiki, String page, String qarg) {
|
||||
// Xoud_history_row row = history_tbl.Select_by_page(wiki, page, qarg);
|
||||
// DateAdp time = DateAdp_.Now();
|
||||
// DateAdp time = Datetime_now.Get();
|
||||
// if (row == null)
|
||||
// history_tbl.Insert(wiki, page, qarg, time, 1);
|
||||
// else
|
||||
|
||||
Reference in New Issue
Block a user