예제 #1
0
	Xof_repo_itm Ini_repo_add(Xof_file_mgr file_mgr, byte[] key, String root, String wiki, boolean trg) {
		Xof_repo_itm repo = file_mgr.Repo_mgr().Set(String_.new_u8(key), root, wiki).Ext_rules_(Xof_rule_grp.Grp_app_default).Dir_depth_(2);
		if (trg) {
			byte[][] ary = repo.Mode_names();
			ary[0] = Bry_.new_a7("raw");
			ary[1] = Bry_.new_a7("fit");
		}
		return repo;
	}
예제 #2
0
 public static Xof_fsdb_itm Make_fsdb(
     Xowe_wiki wiki, byte[] lnki_ttl, Xof_img_size img_size, Xof_url_bldr url_bldr) {
   Xof_fsdb_itm fsdb = new Xof_fsdb_itm();
   lnki_ttl = Xoa_ttl.Replace_spaces(Xoa_app_.Utl__encoder_mgr().Http_url().Decode(lnki_ttl));
   fsdb.Init_at_lnki(
       Xof_exec_tid.Tid_viewer_app,
       wiki.Domain_itm().Abrv_xo(),
       lnki_ttl,
       Xop_lnki_type.Id_none,
       Xop_lnki_tkn.Upright_null,
       Xof_img_size.Size_null_deprecated,
       Xof_img_size.Size_null_deprecated,
       Xof_lnki_time.Null,
       Xof_lnki_page.Null,
       Xof_patch_upright_tid_.Tid_all);
   fsdb.Init_at_hdoc(
       Int_.MaxValue,
       Xof_html_elem
           .Tid_img); // NOTE: set elem_id to "impossible" number, otherwise it will auto-update an
   // image on the page with a super-large size; [[File:Alfred Sisley 062.jpg]]
   Xof_orig_itm orig = wiki.File__orig_mgr().Find_by_ttl_or_null(lnki_ttl);
   if (orig == Xof_orig_itm.Null) return null; // orig not found; need orig in order to get repo
   Xof_repo_itm repo =
       wiki.File__repo_mgr().Get_trg_by_id_or_null(orig.Repo(), lnki_ttl, Bry_.Empty);
   if (repo == null) return null; // repo not found
   fsdb.Init_at_orig(
       orig.Repo(),
       repo.Wiki_domain(),
       orig.Ttl(),
       orig.Ext(),
       orig.W(),
       orig.H(),
       orig.Redirect());
   fsdb.Init_at_html(Xof_exec_tid.Tid_viewer_app, img_size, repo, url_bldr);
   fsdb.File_is_orig_(true);
   return fsdb;
 }