コード例 #1
0
 private void Download_itm(Xodb_tbl_oimg_xfer_itm fsdb) {
   try {
     tier_id_val = fsdb.Lnki_tier_id();
     page_id_val = fsdb.Lnki_page_id();
     lnki_id_val = fsdb.Lnki_id();
     fsdb.Orig_repo_name_(
         fsdb.Orig_repo_id() == Xof_repo_tid_.Tid__local
             ? wiki.Domain_bry()
             : Xow_domain_itm_.Bry__commons);
     Download_exec(fsdb);
     ++exec_count;
     if (exec_count % progress_interval == 0) Print_progress(fsdb);
     if (exec_count % poll_interval == 0) poll_mgr.Poll();
     if (exec_count % commit_interval == 0) Txn_sav();
     if (exec_count % delete_interval == 0) Delete_files();
   } catch (Exception exc) {
     ++exec_fail;
     usr_dlg.Warn_many(
         "",
         "",
         "download error; ttl=~{0} w=~{1} err=~{2}",
         fsdb.Orig_ttl(),
         fsdb.Lnki_w(),
         Err_.Message_gplx_full(exc));
   }
 }
コード例 #2
0
 public static Fsdb_db_mgr new_src_bin_db_mgr(Xow_wiki wiki, String version) {
   String domain_str = wiki.Domain_str();
   Fsdb_db_mgr rv = null;
   Io_url url = null;
   if (String_.Eq(version, "v1")) {
     url =
         wiki.Fsys_mgr()
             .File_dir()
             .OwnerDir()
             .GenSubDir(domain_str + "-prv"); // v1: EX: /xowa/file/en.wikipedia.org-prv/
     rv = new Fsdb_db_mgr__v1(url);
   } else if (String_.Eq(version, "v2")) {
     url = wiki.Fsys_mgr().Root_dir().GenSubDir("prv"); // v2: EX: /xowa/wiki/en.wikipedia.org/prv/
     rv = Fsdb_db_mgr_.new_detect(wiki, url, url); // note that v2 is prioritized over v1
   } else throw Err_.new_wo_type("fsdb.make:unknown fsdb_type", "version", version);
   if (rv == null)
     throw Err_.new_wo_type(
         "fsdb.make:source fsdb not found", "version", version, "url", url.Raw());
   return rv;
 }
コード例 #3
0
ファイル: Pf_func_.java プロジェクト: gnosygnu/xowa_android
  public static Xot_defn Get_prototype(int id) {
    switch (id) {
      case Xol_kwd_grp_.Id_utc_year:
      case Xol_kwd_grp_.Id_utc_month_int_len2:
      case Xol_kwd_grp_.Id_utc_month_int:
      case Xol_kwd_grp_.Id_utc_day_int_len2:
      case Xol_kwd_grp_.Id_utc_day_int:
      case Xol_kwd_grp_.Id_utc_hour:
      case Xol_kwd_grp_.Id_utc_time:
      case Xol_kwd_grp_.Id_utc_timestamp:
      case Xol_kwd_grp_.Id_utc_week:
      case Xol_kwd_grp_.Id_utc_dow:
        return Pft_func_date_int.Utc;
      case Xol_kwd_grp_.Id_utc_month_abrv:
        return new Pft_func_date_name(
            -1,
            Pft_func_date_int.Date_tid_utc,
            DateAdp_.SegIdx_month,
            Xol_msg_itm_.Id_dte_month_abrv_jan - Int_.Base1);
      case Xol_kwd_grp_.Id_utc_month_name:
        return new Pft_func_date_name(
            -1,
            Pft_func_date_int.Date_tid_utc,
            DateAdp_.SegIdx_month,
            Xol_msg_itm_.Id_dte_month_name_january - Int_.Base1);
      case Xol_kwd_grp_.Id_utc_month_gen:
        return new Pft_func_date_name(
            -1,
            Pft_func_date_int.Date_tid_utc,
            DateAdp_.SegIdx_month,
            Xol_msg_itm_.Id_dte_month_gen_january - Int_.Base1);
      case Xol_kwd_grp_.Id_utc_day_name:
        return new Pft_func_date_name(
            -1,
            Pft_func_date_int.Date_tid_utc,
            DateAdp_.SegIdx_dayOfWeek,
            Xol_msg_itm_.Id_dte_dow_name_sunday);

      case Xol_kwd_grp_.Id_lcl_year:
      case Xol_kwd_grp_.Id_lcl_month_int_len2:
      case Xol_kwd_grp_.Id_lcl_month_int:
      case Xol_kwd_grp_.Id_lcl_day_int_len2:
      case Xol_kwd_grp_.Id_lcl_day_int:
      case Xol_kwd_grp_.Id_lcl_hour:
      case Xol_kwd_grp_.Id_lcl_time:
      case Xol_kwd_grp_.Id_lcl_timestamp:
      case Xol_kwd_grp_.Id_lcl_week:
      case Xol_kwd_grp_.Id_lcl_dow:
        return Pft_func_date_int.Lcl;
      case Xol_kwd_grp_.Id_lcl_month_abrv:
        return new Pft_func_date_name(
            -1,
            Pft_func_date_int.Date_tid_lcl,
            DateAdp_.SegIdx_month,
            Xol_msg_itm_.Id_dte_month_abrv_jan - Int_.Base1);
      case Xol_kwd_grp_.Id_lcl_month_name:
        return new Pft_func_date_name(
            -1,
            Pft_func_date_int.Date_tid_lcl,
            DateAdp_.SegIdx_month,
            Xol_msg_itm_.Id_dte_month_name_january - Int_.Base1);
      case Xol_kwd_grp_.Id_lcl_month_gen:
        return new Pft_func_date_name(
            -1,
            Pft_func_date_int.Date_tid_lcl,
            DateAdp_.SegIdx_month,
            Xol_msg_itm_.Id_dte_month_gen_january - Int_.Base1);
      case Xol_kwd_grp_.Id_lcl_day_name:
        return new Pft_func_date_name(
            -1,
            Pft_func_date_int.Date_tid_lcl,
            DateAdp_.SegIdx_dayOfWeek,
            Xol_msg_itm_.Id_dte_dow_name_sunday);

      case Xol_kwd_grp_.Id_rev_year:
      case Xol_kwd_grp_.Id_rev_month_int_len2:
      case Xol_kwd_grp_.Id_rev_month_int:
      case Xol_kwd_grp_.Id_rev_day_int_len2:
      case Xol_kwd_grp_.Id_rev_day_int:
      case Xol_kwd_grp_.Id_rev_timestamp:
        return Pft_func_date_int.Rev;

      case Xol_kwd_grp_.Id_ns_num:
      case Xol_kwd_grp_.Id_ns_txt:
      case Xol_kwd_grp_.Id_ns_url:
      case Xol_kwd_grp_.Id_ns_subj_txt:
      case Xol_kwd_grp_.Id_ns_subj_url:
      case Xol_kwd_grp_.Id_ns_talk_txt:
      case Xol_kwd_grp_.Id_ns_talk_url:
      case Xol_kwd_grp_.Id_ttl_full_txt:
      case Xol_kwd_grp_.Id_ttl_full_url:
      case Xol_kwd_grp_.Id_ttl_page_txt:
      case Xol_kwd_grp_.Id_ttl_base_txt:
      case Xol_kwd_grp_.Id_ttl_page_url:
      case Xol_kwd_grp_.Id_ttl_base_url:
      case Xol_kwd_grp_.Id_ttl_leaf_txt:
      case Xol_kwd_grp_.Id_ttl_leaf_url:
      case Xol_kwd_grp_.Id_ttl_subj_txt:
      case Xol_kwd_grp_.Id_ttl_subj_url:
      case Xol_kwd_grp_.Id_ttl_talk_txt:
      case Xol_kwd_grp_.Id_ttl_talk_url:
        return Pfunc_ttl.Instance;

      case Xol_kwd_grp_.Id_site_sitename:
      case Xol_kwd_grp_.Id_site_servername:
      case Xol_kwd_grp_.Id_site_server:
      case Xol_kwd_grp_.Id_site_articlepath:
      case Xol_kwd_grp_.Id_site_scriptpath:
      case Xol_kwd_grp_.Id_site_stylepath:
      case Xol_kwd_grp_.Id_site_contentlanguage:
      case Xol_kwd_grp_.Id_site_directionmark:
      case Xol_kwd_grp_.Id_site_currentversion:
        return Pfunc_wiki_props.Instance;

      case Xol_kwd_grp_.Id_num_pages:
      case Xol_kwd_grp_.Id_num_articles:
      case Xol_kwd_grp_.Id_num_files:
      case Xol_kwd_grp_.Id_num_edits:
      case Xol_kwd_grp_.Id_num_views:
      case Xol_kwd_grp_.Id_num_users:
      case Xol_kwd_grp_.Id_num_users_active:
      case Xol_kwd_grp_.Id_num_admins:
        return Pfunc_wiki_stats.Instance;

      case Xol_kwd_grp_.Id_page_id:
      case Xol_kwd_grp_.Id_rev_id:
      case Xol_kwd_grp_.Id_rev_pagesize:
      case Xol_kwd_grp_.Id_rev_revisionsize:
      case Xol_kwd_grp_.Id_rev_user:
      case Xol_kwd_grp_.Id_rev_protectionexpiry:
      case Xol_kwd_grp_.Id_rev_protectionlevel:
        return Pfunc_rev_props.Instance;
      case Xol_kwd_grp_.Id_page_displaytitle:
        return Pfunc_displaytitle.Instance;
      case Xol_kwd_grp_.Id_page_defaultsort:
        return Pfunc_defaultsort.Instance;
      case Xol_kwd_grp_.Id_noeditsection:
        return Pfunc_noeditsection.Instance;
      case Xol_kwd_grp_.Id_site_pagesincategory:
        return Pfunc_pagesincategory.Instance;

      case Xol_kwd_grp_.Id_url_ns:
        return new Pfunc_ns(false);
      case Xol_kwd_grp_.Id_url_nse:
        return new Pfunc_ns(true);
      case Xol_kwd_grp_.Id_url_urlencode:
        return new Pfunc_urlencode();
      case Xol_kwd_grp_.Id_str_lc:
        return new Pfunc_case(Xol_lang_itm.Tid_lower, false);
      case Xol_kwd_grp_.Id_str_lcfirst:
        return new Pfunc_case(Xol_lang_itm.Tid_lower, true);
      case Xol_kwd_grp_.Id_str_uc:
        return new Pfunc_case(Xol_lang_itm.Tid_upper, false);
      case Xol_kwd_grp_.Id_str_ucfirst:
        return new Pfunc_case(Xol_lang_itm.Tid_upper, true);
      case Xol_kwd_grp_.Id_str_padleft:
        return new Pfunc_pad(Xol_kwd_grp_.Id_str_padleft, false);
      case Xol_kwd_grp_.Id_str_padright:
        return new Pfunc_pad(Xol_kwd_grp_.Id_str_padright, true);
      case Xol_kwd_grp_.Id_str_formatnum:
        return new Pf_formatnum();
      case Xol_kwd_grp_.Id_str_formatdate:
        return new Pft_func_formatdate();
      case Xol_kwd_grp_.Id_url_localurl:
        return new Pfunc_urlfunc(Xol_kwd_grp_.Id_url_localurl, Pfunc_urlfunc.Tid_local, false);
      case Xol_kwd_grp_.Id_url_localurle:
        return new Pfunc_urlfunc(Xol_kwd_grp_.Id_url_localurle, Pfunc_urlfunc.Tid_local, true);
      case Xol_kwd_grp_.Id_url_fullurl:
        return new Pfunc_urlfunc(Xol_kwd_grp_.Id_url_fullurl, Pfunc_urlfunc.Tid_full, false);
      case Xol_kwd_grp_.Id_url_fullurle:
        return new Pfunc_urlfunc(Xol_kwd_grp_.Id_url_fullurle, Pfunc_urlfunc.Tid_full, true);
      case Xol_kwd_grp_.Id_url_canonicalurl:
        return new Pfunc_urlfunc(
            Xol_kwd_grp_.Id_url_canonicalurl, Pfunc_urlfunc.Tid_canonical, false);
      case Xol_kwd_grp_.Id_url_canonicalurle:
        return new Pfunc_urlfunc(
            Xol_kwd_grp_.Id_url_canonicalurle, Pfunc_urlfunc.Tid_canonical, false);
      case Xol_kwd_grp_.Id_url_filepath:
        return new Pfunc_filepath();
      case Xol_kwd_grp_.Id_url_anchorencode:
        return new Pfunc_anchorencode();
      case Xol_kwd_grp_.Id_strx_len:
        return new Pfunc_len();
      case Xol_kwd_grp_.Id_strx_pos:
        return new Pfunc_pos();
      case Xol_kwd_grp_.Id_strx_rpos:
        return new Pfunc_rpos();
      case Xol_kwd_grp_.Id_strx_sub:
        return new Pfunc_sub();
      case Xol_kwd_grp_.Id_strx_count:
        return new Pfunc_count();
      case Xol_kwd_grp_.Id_strx_replace:
        return new Pfunc_replace();
      case Xol_kwd_grp_.Id_strx_explode:
        return new Pfunc_explode();
      case Xol_kwd_grp_.Id_strx_urldecode:
        return new Pfunc_urldecode();

      case Xol_kwd_grp_.Id_i18n_plural:
        return new Pfunc_plural();
      case Xol_kwd_grp_.Id_i18n_language:
        return new Pfunc_language();
      case Xol_kwd_grp_.Id_i18n_int:
        return new Pfunc_int();
      case Xol_kwd_grp_.Id_i18n_grammar:
        return new Pfunc_grammar();
      case Xol_kwd_grp_.Id_i18n_gender:
        return new Pfunc_gender();
      case Xol_kwd_grp_.Id_misc_tag:
        return new Pfunc_tag();

      case Xol_kwd_grp_.Id_xtn_expr:
        return new gplx.xowa.xtns.pfuncs.exprs.Pfunc_expr();
      case Xol_kwd_grp_.Id_xtn_if:
        return new Pfunc_if();
      case Xol_kwd_grp_.Id_xtn_ifeq:
        return new Pfunc_ifeq();
      case Xol_kwd_grp_.Id_xtn_iferror:
        return new Pfunc_iferror();
      case Xol_kwd_grp_.Id_xtn_ifexpr:
        return new Pfunc_ifexpr();
      case Xol_kwd_grp_.Id_xtn_ifexist:
        return new Pfunc_ifexist();
      case Xol_kwd_grp_.Id_xtn_rel2abs:
        return new Pfunc_rel2abs();
      case Xol_kwd_grp_.Id_xtn_switch:
        return new Pfunc_switch();
      case Xol_kwd_grp_.Id_xtn_time:
        return Pft_func_time._Utc;
      case Xol_kwd_grp_.Id_xtn_timel:
        return Pft_func_time._Lcl;
      case Xol_kwd_grp_.Id_xtn_titleparts:
        return new Pfunc_titleparts();

      case Xol_kwd_grp_.Id_subst:
      case Xol_kwd_grp_.Id_safesubst:
      case Xol_kwd_grp_.Id_msg:
      case Xol_kwd_grp_.Id_msgnw:
      case Xol_kwd_grp_.Id_raw:
        return new Xot_defn_subst((byte) id, Bry_.Empty);

      case Xol_kwd_grp_.Id_xowa_dbg:
        return new Xop_xowa_dbg();
      case Xol_kwd_grp_.Id_xowa:
        return new gplx.xowa.xtns.xowa_cmds.Xop_xowa_func();
      case Xol_kwd_grp_.Id_xtn_geodata_coordinates:
        return gplx.xowa.xtns.geodata.Geo_coordinates_func.Instance;

      case Xol_kwd_grp_.Id_lst:
        return gplx.xowa.xtns.lst.Lst_pfunc_lst.Prime;
      case Xol_kwd_grp_.Id_lstx:
        return gplx.xowa.xtns.lst.Lst_pfunc_lstx.Prime;
      case Xol_kwd_grp_.Id_lsth:
        return gplx.xowa.xtns.lst.Lst_pfunc_lsth.Prime;

      case Xol_kwd_grp_.Id_invoke:
        return new gplx.xowa.xtns.scribunto.Scrib_invoke_func();
      case Xol_kwd_grp_.Id_pagebanner:
        return new gplx.xowa.xtns.pagebanners.Pgbnr_func();
      case Xol_kwd_grp_.Id_new_window_link:
        return new gplx.xowa.xtns.new_window_links.New_window_link_func();

      case Xol_kwd_grp_.Id_property:
        return new gplx.xowa.xtns.wbases.pfuncs.Wdata_pf_property();
      case Xol_kwd_grp_.Id_noexternallanglinks:
        return new gplx.xowa.xtns.wbases.pfuncs.Wdata_pf_noExternalLangLinks();
      case Xol_kwd_grp_.Id_wbreponame:
        return new gplx.xowa.xtns.wbases.pfuncs.Wdata_pf_wbreponame();

      case Xol_kwd_grp_.Id_mapSources_deg2dd:
        return gplx.xowa.xtns.mapSources.Map_deg2dd_func.Instance;
      case Xol_kwd_grp_.Id_mapSources_dd2dms:
        return gplx.xowa.xtns.mapSources.Map_dd2dms_func.Instance;
      case Xol_kwd_grp_.Id_mapSources_geoLink:
        return gplx.xowa.xtns.mapSources.Map_geolink_func.Instance;

      case Xol_kwd_grp_.Id_geoCrumbs_isin:
        return gplx.xowa.xtns.geoCrumbs.Geoc_isin_func.Instance;

      case Xol_kwd_grp_.Id_relatedArticles:
        return gplx.xowa.xtns.relatedArticles.Articles_func.Instance;
      case Xol_kwd_grp_.Id_insider:
        return gplx.xowa.xtns.insiders.Insider_func.Instance;

      case Xol_kwd_grp_.Id_massMessage_target:
        return gplx.xowa.xtns.massMessage.Message_target_func.Instance;
      case Xol_kwd_grp_.Id_categorytree:
        return gplx.xowa.xtns.categorytrees.Categorytree_func.Instance;

      case Xol_kwd_grp_.Id_pendingChangeLevel:
        return gplx.xowa.xtns.flaggedRevs.Pending_change_level_func.Instance;
      case Xol_kwd_grp_.Id_pagesUsingPendingChanges:
        return gplx.xowa.xtns.flaggedRevs.Pages_using_pending_changes_func.Instance;

      case Xol_kwd_grp_.Id_cascadingSources:
        return new Pf_func_noop(id);
      case Xol_kwd_grp_.Id_bang:
        return Pf_func_bang.Instance;
      default:
        throw Err_.new_unhandled(id);
    }
  }
コード例 #4
0
ファイル: Xowv_wiki.java プロジェクト: gnosygnu/xowa_android
 public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
   throw Err_.new_unimplemented_w_msg("implemented for Xoa_cfg_mgr");
 }