DownloadCentral.Package: Add option to manually specify wiki date for new packages

v3.3.4
gnosygnu 8 years ago
parent 6ad12f4df9
commit 03a428ec4b

@ -32,7 +32,7 @@ public class Xoa_app_ {
} }
} }
public static final String Name = "xowa"; public static final String Name = "xowa";
public static final String Version = "3.10.4.1"; public static final String Version = "3.10.4.2";
public static String Build_date = "2012-12-30 00:00:00"; public static String Build_date = "2012-12-30 00:00:00";
public static String Op_sys_str; public static String Op_sys_str;
public static String User_agent = ""; public static String User_agent = "";

@ -27,6 +27,9 @@ public class Pack_file_cfg implements Gfo_invk {
public String Pack_custom_files() {return pack_custom_files;} private String pack_custom_files; public String Pack_custom_files() {return pack_custom_files;} private String pack_custom_files;
public String Pack_custom_name() {return pack_custom_name;} private String pack_custom_name; public String Pack_custom_name() {return pack_custom_name;} private String pack_custom_name;
public DateAdp Pack_file_cutoff() {return pack_file_cutoff;} private DateAdp pack_file_cutoff = null; public DateAdp Pack_file_cutoff() {return pack_file_cutoff;} private DateAdp pack_file_cutoff = null;
public String Wiki_date(DateAdp wiki_last_modified) {
return wiki_date == null ? wiki_last_modified.XtoStr_fmt("yyyy.MM") : wiki_date;
} private String wiki_date = null;
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) { public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk__deploy_dir_)) deploy_dir = m.ReadIoUrl("v"); if (ctx.Match(k, Invk__deploy_dir_)) deploy_dir = m.ReadIoUrl("v");
@ -37,6 +40,7 @@ public class Pack_file_cfg implements Gfo_invk {
else if (ctx.Match(k, Invk__pack_fsdb_delete_)) pack_fsdb_delete = m.ReadYn("v"); else if (ctx.Match(k, Invk__pack_fsdb_delete_)) pack_fsdb_delete = m.ReadYn("v");
else if (ctx.Match(k, Invk__pack_custom_name_)) pack_custom_name = m.ReadStr("v"); else if (ctx.Match(k, Invk__pack_custom_name_)) pack_custom_name = m.ReadStr("v");
else if (ctx.Match(k, Invk__pack_custom_files_)) pack_custom_files = m.ReadStr("v"); // pack_custom {files='en.wikipedia.org-core.xowa|en.wikipedia.org-html-ns.008.xowa'}} else if (ctx.Match(k, Invk__pack_custom_files_)) pack_custom_files = m.ReadStr("v"); // pack_custom {files='en.wikipedia.org-core.xowa|en.wikipedia.org-html-ns.008.xowa'}}
else if (ctx.Match(k, Invk__wiki_date_)) wiki_date = m.ReadStr("v");
else return Gfo_invk_.Rv_unhandled; else return Gfo_invk_.Rv_unhandled;
return this; return this;
} }
@ -44,5 +48,6 @@ public class Pack_file_cfg implements Gfo_invk {
, Invk__pack_text_ = "pack_text_", Invk__pack_html_ = "pack_html_", Invk__pack_file_ = "pack_file_", Invk__pack_file_cutoff_ = "pack_file_cutoff_" , Invk__pack_text_ = "pack_text_", Invk__pack_html_ = "pack_html_", Invk__pack_file_ = "pack_file_", Invk__pack_file_cutoff_ = "pack_file_cutoff_"
, Invk__pack_fsdb_delete_ = "pack_fsdb_delete_" , Invk__pack_fsdb_delete_ = "pack_fsdb_delete_"
, Invk__pack_custom_name_ = "pack_custom_name_", Invk__pack_custom_files_ = "pack_custom_files_" , Invk__pack_custom_name_ = "pack_custom_name_", Invk__pack_custom_files_ = "pack_custom_files_"
, Invk__wiki_date_ = "wiki_date_"
; ;
} }

@ -26,7 +26,7 @@ public class Pack_file_mgr {
Io_url wiki_dir = wiki.Fsys_mgr().Root_dir(); Io_url wiki_dir = wiki.Fsys_mgr().Root_dir();
Io_url pack_dir = wiki_dir.GenSubDir_nest("tmp", "pack"); Io_url pack_dir = wiki_dir.GenSubDir_nest("tmp", "pack");
Io_mgr.Instance.DeleteDirDeep(pack_dir); Io_mgr.Instance.CreateDirIfAbsent(pack_dir); Io_mgr.Instance.DeleteDirDeep(pack_dir); Io_mgr.Instance.CreateDirIfAbsent(pack_dir);
String wiki_date = wiki.Props().Modified_latest().XtoStr_fmt("yyyy.MM"); String wiki_date = cfg.Wiki_date(wiki.Props().Modified_latest());
Pack_hash hash = Pack_hash_bldr.Bld(wiki, wiki_dir, pack_dir, wiki_date, cfg); Pack_hash hash = Pack_hash_bldr.Bld(wiki, wiki_dir, pack_dir, wiki_date, cfg);
// get import_tbl // get import_tbl

@ -82,7 +82,6 @@ public class Xof_fsdb_itm implements Xof_file_itm {
this.lnki_w = file_w; this.lnki_h = Xof_img_size.Size__neg1; this.lnki_w = file_w; this.lnki_h = Xof_img_size.Size__neg1;
} }
public void Init_at_html(int exec_tid, Xof_img_size img_size, Xof_repo_itm repo, Xof_url_bldr url_bldr) { public void Init_at_html(int exec_tid, Xof_img_size img_size, Xof_repo_itm repo, Xof_url_bldr url_bldr) {
int j = 1;
Calc_html_size(exec_tid, img_size); Calc_html_size(exec_tid, img_size);
this.html_view_url = url_bldr.To_url_trg(repo, this, file_is_orig); this.html_view_url = url_bldr.To_url_trg(repo, this, file_is_orig);
this.html_orig_url = url_bldr.To_url_trg(repo, this, Bool_.Y); this.html_orig_url = url_bldr.To_url_trg(repo, this, Bool_.Y);
@ -149,9 +148,7 @@ public class Xof_fsdb_itm implements Xof_file_itm {
public void Change_repo(byte orig_repo_id, byte[] orig_repo_name) { public void Change_repo(byte orig_repo_id, byte[] orig_repo_name) {
this.orig_repo_id = orig_repo_id; this.orig_repo_name = orig_repo_name; this.orig_repo_id = orig_repo_id; this.orig_repo_name = orig_repo_name;
} }
public void File_is_orig_(boolean v) { public void File_is_orig_(boolean v) {this.file_is_orig = v;}
this.file_is_orig = v;
}
public void Orig_repo_name_(byte[] v) {orig_repo_name = v;} public void Orig_repo_name_(byte[] v) {orig_repo_name = v;}
public void Html_elem_tid_(byte v) {this.html_elem_tid = v;} public void Html_elem_tid_(byte v) {this.html_elem_tid = v;}
public void Html_size_(int w, int h) {html_w = w; html_h = h;} public void Html_size_(int w, int h) {html_w = w; html_h = h;}

Loading…
Cancel
Save