From e55e3971d98bbe1e889e5d59ec263460d8bc6596 Mon Sep 17 00:00:00 2001 From: gnosygnu Date: Wed, 19 Oct 2016 15:19:03 -0400 Subject: [PATCH] DownloadCentral: Add option to generate text packages (for wikidata) --- .../bldrs/centrals/dbs/datas/imports/Xobc_import_type.java | 1 + .../xowa/addons/bldrs/exports/packs/files/Pack_file_cfg.java | 4 +--- .../xowa/addons/bldrs/exports/packs/files/Pack_file_mgr.java | 2 ++ .../xowa/addons/bldrs/exports/packs/files/Pack_hash_bldr.java | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/400_xowa/src/gplx/xowa/addons/bldrs/centrals/dbs/datas/imports/Xobc_import_type.java b/400_xowa/src/gplx/xowa/addons/bldrs/centrals/dbs/datas/imports/Xobc_import_type.java index 0a10ecee1..3ffbc1942 100644 --- a/400_xowa/src/gplx/xowa/addons/bldrs/centrals/dbs/datas/imports/Xobc_import_type.java +++ b/400_xowa/src/gplx/xowa/addons/bldrs/centrals/dbs/datas/imports/Xobc_import_type.java @@ -29,5 +29,6 @@ public class Xobc_import_type { , Tid__fsdb__delete = 8 , Tid__wiki__ctg = 9 , Tid__misc = 10 + , Tid__wiki__wbase = 11 ; } diff --git a/400_xowa/src/gplx/xowa/addons/bldrs/exports/packs/files/Pack_file_cfg.java b/400_xowa/src/gplx/xowa/addons/bldrs/exports/packs/files/Pack_file_cfg.java index bc7e42155..56d736ecf 100644 --- a/400_xowa/src/gplx/xowa/addons/bldrs/exports/packs/files/Pack_file_cfg.java +++ b/400_xowa/src/gplx/xowa/addons/bldrs/exports/packs/files/Pack_file_cfg.java @@ -25,7 +25,6 @@ public class Pack_file_cfg implements Gfo_invk { public boolean Pack_fsdb_delete() {return pack_fsdb_delete;} private boolean pack_fsdb_delete; public boolean Pack_custom() {return pack_custom_files != null;} public String Pack_custom_files() {return pack_custom_files;} private String pack_custom_files; - public String Pack_custom_types() {return pack_custom_types;} private String pack_custom_types; 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; @@ -38,13 +37,12 @@ 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_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_types_)) pack_custom_types = m.ReadStr("v"); // pack_custom {types='core|srch|html';} else return Gfo_invk_.Rv_unhandled; return this; } private static final String Invk__deploy_dir_ = "deploy_dir_" , 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_custom_name_ = "pack_custom_name_", Invk__pack_custom_files_ = "pack_custom_files_", Invk__pack_custom_types_ = "pack_custom_types_" + , Invk__pack_custom_name_ = "pack_custom_name_", Invk__pack_custom_files_ = "pack_custom_files_" ; } diff --git a/400_xowa/src/gplx/xowa/addons/bldrs/exports/packs/files/Pack_file_mgr.java b/400_xowa/src/gplx/xowa/addons/bldrs/exports/packs/files/Pack_file_mgr.java index af0c4514a..c7ff1470a 100644 --- a/400_xowa/src/gplx/xowa/addons/bldrs/exports/packs/files/Pack_file_mgr.java +++ b/400_xowa/src/gplx/xowa/addons/bldrs/exports/packs/files/Pack_file_mgr.java @@ -51,6 +51,8 @@ public class Pack_file_mgr { } // build tasks + if (cfg.Pack_text()) // right now, only for wikidata + Make_task(tmp_bfr, wiki, wiki_date, bc_db, hash, "text", Xobc_import_type.Tid__file__core, Xobc_import_type.Tid__wiki__text, Xobc_import_type.Tid__wiki__ctg, Xobc_import_type.Tid__wiki__wbase); if (cfg.Pack_html()) Make_task(tmp_bfr, wiki, wiki_date, bc_db, hash, "html", Xobc_import_type.Tid__wiki__core, Xobc_import_type.Tid__wiki__srch, Xobc_import_type.Tid__wiki__html, Xobc_import_type.Tid__wiki__ctg); if (cfg.Pack_file()) diff --git a/400_xowa/src/gplx/xowa/addons/bldrs/exports/packs/files/Pack_hash_bldr.java b/400_xowa/src/gplx/xowa/addons/bldrs/exports/packs/files/Pack_hash_bldr.java index b49c8f127..513ffaa27 100644 --- a/400_xowa/src/gplx/xowa/addons/bldrs/exports/packs/files/Pack_hash_bldr.java +++ b/400_xowa/src/gplx/xowa/addons/bldrs/exports/packs/files/Pack_hash_bldr.java @@ -105,6 +105,7 @@ class Pack_hash_bldr { case Xow_db_file_.Tid__file_solo: case Xow_db_file_.Tid__file_data: return Xobc_import_type.Tid__file__data; case Xow_db_file_.Tid__text: return Xobc_import_type.Tid__wiki__text; + case Xow_db_file_.Tid__wbase: return Xobc_import_type.Tid__wiki__wbase; default: return Xobc_import_type.Tid__ignore; } }