예제 #1
0
 public void Special__gen(Xow_wiki wikii, Xoa_page pagei, Xoa_url url, Xoa_ttl ttl) {
   Xowe_wiki wiki = (Xowe_wiki) wikii;
   Xoae_page page = (Xoae_page) pagei;
   Xoa_app app = wiki.App();
   Dbui_tbl_itm__bmk ui_tbl =
       Dbui_tbl_itm__bmk.get_or_new(app, app.User().User_db_mgr().Bmk_mgr().Tbl__itm());
   page.Html_data().Head_mgr().Itm__dbui().Init(app).Enabled_y_();
   Bry_bfr bfr = wiki.Utl__bfr_mkr().Get_m001();
   ui_tbl.Select(bfr, Xoud_bmk_mgr.Owner_root);
   page.Db().Html().Html_bry_(bfr.To_bry_and_rls());
 }
예제 #2
0
 public void Special_gen(Xowe_wiki wiki, Xoae_page page, Xoa_url url, Xoa_ttl ttl) {
   if (cfg == null)
     cfg =
         (Wdata_itemByTitle_cfg) wiki.Appe().Special_mgr().Get_or_null(Wdata_itemByTitle_cfg.Key);
   // Special:ItemByTitle/enwiki/Earth -> www.wikidata.org/wiki/Q2
   Gfo_usr_dlg usr_dlg = wiki.Appe().Usr_dlg();
   byte[] site_bry = cfg.Site_default();
   byte[] page_bry = Bry_.Empty;
   byte[] raw_bry = ttl.Full_txt_wo_qarg(); // EX: enwiki/Earth
   int args_len = url.Args().length;
   if (args_len > 0) {
     arg_hash.Load(url);
     site_bry = arg_hash.Get_val_bry_or(Arg_site, Bry_.Empty);
     page_bry = arg_hash.Get_val_bry_or(Arg_page, Bry_.Empty);
   }
   int site_bgn = Bry_finder.Find_fwd(raw_bry, Xoa_ttl.Subpage_spr);
   if (site_bgn != Bry_.NotFound) { // leaf arg is available
     int page_bgn = Bry_finder.Find_fwd(raw_bry, Xoa_ttl.Subpage_spr, site_bgn + 1);
     int raw_bry_len = raw_bry.length;
     if (page_bgn != Bry_.NotFound
         && page_bgn < raw_bry_len) { // pipe is found and not last char (EX: "enwiki/" is invalid
       site_bry = Bry_.Mid(raw_bry, site_bgn + 1, page_bgn);
       page_bry = Bry_.Mid(raw_bry, page_bgn + 1, raw_bry_len);
     }
   }
   Xoae_app app = wiki.Appe();
   if (Bry_.Len_gt_0(site_bry) && Bry_.Len_gt_0(page_bry))
     if (Navigate(usr_dlg, app, app.Wiki_mgr().Wdata_mgr(), page, site_bry, page_bry)) return;
   Bry_bfr tmp_bfr = wiki.Utl__bfr_mkr().Get_k004();
   html_fmtr.Bld_bfr_many(
       tmp_bfr,
       "Search for items by site and title",
       "Site",
       site_bry,
       "Page",
       page_bry,
       "Search");
   page.Data_raw_(tmp_bfr.To_bry_and_rls());
   page.Html_data().Html_restricted_n_(); // [[Special:]] pages allow all HTML
 }