public DocumentReference copy() { DocumentReference dst = new DocumentReference(); dst.masterIdentifier = masterIdentifier == null ? null : masterIdentifier.copy(); dst.identifier = new ArrayList<Identifier>(); for (Identifier i : identifier) dst.identifier.add(i.copy()); dst.subject = subject == null ? null : subject.copy(); dst.type = type == null ? null : type.copy(); dst.subtype = subtype == null ? null : subtype.copy(); dst.author = new ArrayList<ResourceReference>(); for (ResourceReference i : author) dst.author.add(i.copy()); dst.custodian = custodian == null ? null : custodian.copy(); dst.authenticator = authenticator == null ? null : authenticator.copy(); dst.created = created == null ? null : created.copy(); dst.indexed = indexed == null ? null : indexed.copy(); dst.status = status == null ? null : status.copy(); dst.docStatus = docStatus == null ? null : docStatus.copy(); dst.supercedes = supercedes == null ? null : supercedes.copy(); dst.description = description == null ? null : description.copy(); dst.confidentiality = confidentiality == null ? null : confidentiality.copy(); dst.primaryLanguage = primaryLanguage == null ? null : primaryLanguage.copy(); dst.mimeType = mimeType == null ? null : mimeType.copy(); dst.format = format == null ? null : format.copy(); dst.size = size == null ? null : size.copy(); dst.hash = hash == null ? null : hash.copy(); dst.location = location == null ? null : location.copy(); dst.service = service == null ? null : service.copy(dst); dst.context = context == null ? null : context.copy(dst); return dst; }
@Test public void Bidi() { fxt.Init_ttl("A" + String_.new_u8(Bry_.ints_(226, 128, 142)) + "B").Expd_page_txt("AB").Test(); fxt.Init_ttl("A" + String_.new_u8(Bry_.ints_(226, 128, 97)) + "B") .Expd_page_txt("A" + String_.new_u8(Bry_.ints_(226, 128, 97)) + "B") .Test(); }
public DocumentReferenceServiceParameterComponent copy(DocumentReference e) { DocumentReferenceServiceParameterComponent dst = e.new DocumentReferenceServiceParameterComponent(); dst.name = name == null ? null : name.copy(); dst.value = value == null ? null : value.copy(); return dst; }
public DeviceIdentityComponent copy(Device e) { DeviceIdentityComponent dst = e.new DeviceIdentityComponent(); dst.gtin = gtin == null ? null : gtin.copy(); dst.lot = lot == null ? null : lot.copy(); dst.serialNumber = serialNumber == null ? null : serialNumber.copy(); return dst; }
@Test public void Basic() { Tst_parse( String_.Concat_lines_nl( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>", "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">", "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">", "<head>", "<title>Index of /simplewiki/</title>", "<link rel=\"stylesheet\" type=\"text/css\" href=\"/pub/misc/lighttpd-white-dir.css\" />", "</head>", "<body>", "<h2>Index of /simplewiki/</h2>", "<div class=\"list\">", "<table summary=\"Directory Listing\" cellpadding=\"0\" cellspacing=\"0\">", "<thead><tr><th class=\"n\">Name</th><th class=\"m\">Last Modified</th><th class=\"s\">Size</th><th class=\"t\">Type</th></tr></thead>", "<tbody>", "<tr><td class=\"n\"><a href=\"../\">Parent Directory</a>/</td><td class=\"m\"> </td><td class=\"s\">- </td><td class=\"t\">Directory</td></tr>", "<tr><td class=\"n\"><a href=\"20120516/\">20120516</a>/</td><td class=\"m\">2012-May-17 01:04:39</td><td class=\"s\">- </td><td class=\"t\">Directory</td></tr>", "<tr><td class=\"n\"><a href=\"20121220/\">20121220</a>/</td><td class=\"m\">2012-Dec-20 20:15:55</td><td class=\"s\">- </td><td class=\"t\">Directory</td></tr>", "<tr><td class=\"n\"><a href=\"20130214/\">20130214</a>/</td><td class=\"m\">2013-Feb-14 06:28:41</td><td class=\"s\">- </td><td class=\"t\">Directory</td></tr>", "<tr><td class=\"n\"><a href=\"latest/\">latest</a>/</td><td class=\"m\">2013-Feb-14 06:28:41</td><td class=\"s\">- </td><td class=\"t\">Directory</td></tr>", "</tbody>", "</table>", "</div>", "<div class=\"foot\">lighttpd</div>", "</body>", "</html>"), String_.Ary("20120516", "20121220", "20130214", "latest")); }
public SecurityEventSourceComponent copy(SecurityEvent e) { SecurityEventSourceComponent dst = e.new SecurityEventSourceComponent(); dst.site = site == null ? null : site.copy(); dst.identifier = identifier == null ? null : identifier.copy(); dst.type = new ArrayList<Coding>(); for (Coding i : type) dst.type.add(i.copy()); return dst; }
public CodeableConcept copy() { CodeableConcept dst = new CodeableConcept(); dst.coding = new ArrayList<Coding>(); for (Coding i : coding) dst.coding.add(i.copy()); dst.text = text == null ? null : text.copy(); dst.primary = primary == null ? null : primary.copy(); return dst; }
public Mustache_doc_itm[] Mustache__subs(String key) { if (String_.Eq(key, "is_dir")) return Mustache_doc_itm_.Ary__bool(is_dir); else if (String_.Eq(key, "dir_cmd_exists")) return Mustache_doc_itm_.Ary__bool(Bry_.Len_gt_0(dir_cmd)); else if (String_.Eq(key, "is_core_xowa")) return Mustache_doc_itm_.Ary__bool(is_core_xowa); else if (String_.Eq(key, "subs")) return subs; return Mustache_doc_itm_.Ary__empty; }
public SpecimenCollectionComponent copy(Specimen e) { SpecimenCollectionComponent dst = e.new SpecimenCollectionComponent(); dst.collector = collector == null ? null : collector.copy(); dst.comments = new ArrayList<String_>(); for (String_ i : comments) dst.comments.add(i.copy()); dst.collectedTime = collectedTime == null ? null : collectedTime.copy(); dst.quantity = quantity == null ? null : quantity.copy(); return dst; }
public GVFVariantVariantEffectComponent copy(GVFVariant e) { GVFVariantVariantEffectComponent dst = e.new GVFVariantVariantEffectComponent(); dst.sequenceVariant = sequenceVariant == null ? null : sequenceVariant.copy(); dst.index = index == null ? null : index.copy(); dst.featureType = featureType == null ? null : featureType.copy(); dst.featureId = new ArrayList<String_>(); for (String_ i : featureId) dst.featureId.add(i.copy()); return dst; }
public Coding copy() { Coding dst = new Coding(); dst.system = system == null ? null : system.copy(); dst.version = version == null ? null : version.copy(); dst.code = code == null ? null : code.copy(); dst.display = display == null ? null : display.copy(); dst.primary = primary == null ? null : primary.copy(); dst.valueSet = valueSet == null ? null : valueSet.copy(); return dst; }
public String To_str(Object o) { if (o == null) return "<<NULL>>"; Class<?> type = Type_adp_.ClassOf_obj(o); String rv = null; if (type == String.class) rv = String_.cast(o); else if (Int_.TypeMatch(type)) return Int_.To_str(Int_.cast(o)); else if (Type_adp_.Eq(type, Bool_.Cls_ref_type)) return Yn.To_str(Bool_.cast(o)); else if (type == DateAdp.class) return DateAdp_.cast(o).XtoStr_gplx(); else rv = Object_.Xto_str_strict_or_empty(o); return String_.Replace(rv, "'", "''"); }
public SpecimenCollectionComponent copy(Specimen e) { SpecimenCollectionComponent dst = e.new SpecimenCollectionComponent(); dst.collector = collector == null ? null : collector.copy(); dst.comment = new ArrayList<String_>(); for (String_ i : comment) dst.comment.add(i.copy()); dst.collectedTime = collectedTime == null ? null : collectedTime.copy(); dst.quantity = quantity == null ? null : quantity.copy(); dst.method = method == null ? null : method.copy(); dst.sourceSite = sourceSite == null ? null : sourceSite.copy(); return dst; }
public GVFVariantSampleComponent copy(GVFVariant e) { GVFVariantSampleComponent dst = e.new GVFVariantSampleComponent(); dst.phased = new ArrayList<String_>(); for (String_ i : phased) dst.phased.add(i.copy()); dst.genotype = new ArrayList<String_>(); for (String_ i : genotype) dst.genotype.add(i.copy()); dst.variantReads = new ArrayList<Integer>(); for (Integer i : variantReads) dst.variantReads.add(i.copy()); dst.totalReads = totalReads == null ? null : totalReads.copy(); dst.zygosity = zygosity == null ? null : zygosity.copy(); return dst; }
public SecurityEventParticipantComponent copy(SecurityEvent e) { SecurityEventParticipantComponent dst = e.new SecurityEventParticipantComponent(); dst.role = new ArrayList<CodeableConcept>(); for (CodeableConcept i : role) dst.role.add(i.copy()); dst.reference = reference == null ? null : reference.copy(); dst.userId = userId == null ? null : userId.copy(); dst.authId = authId == null ? null : authId.copy(); dst.name = name == null ? null : name.copy(); dst.requestor = requestor == null ? null : requestor.copy(); dst.media = media == null ? null : media.copy(); dst.network = network == null ? null : network.copy(e); return dst; }
public boolean ReadYn_toggle(String k, boolean cur) { Object rv = ReadOr(k, "!"); if (rv == Nil) ThrowNotFound(k); if (!parse) throw Err_.new_wo_type("only parse supported"); String rv_str = (String) rv; return (String_.Eq(rv_str, "!")) ? !cur : Yn.parse(rv_str); }
public static void Val_by_obj(Db_stmt stmt, String key, Object val) { int tid = Type_adp_.To_tid_obj(val); switch (tid) { case Type_adp_.Tid__bool: stmt.Val_bool_as_byte(key, Bool_.cast(val)); break; case Type_adp_.Tid__byte: stmt.Val_byte(key, Byte_.cast(val)); break; case Type_adp_.Tid__int: stmt.Val_int(key, Int_.cast(val)); break; case Type_adp_.Tid__long: stmt.Val_long(key, Long_.cast(val)); break; case Type_adp_.Tid__float: stmt.Val_float(key, Float_.cast(val)); break; case Type_adp_.Tid__double: stmt.Val_double(key, Double_.cast(val)); break; case Type_adp_.Tid__str: stmt.Val_str(key, String_.cast(val)); break; case Type_adp_.Tid__bry: stmt.Val_bry(key, Bry_.cast(val)); break; default: throw Err_.new_unhandled_default(tid); } }
public void Init_by_wiki() { if (!init_needed) return; init_needed = false; if (String_.Eq(domain_str, "xowa")) return; // HACK: ignore "xowa" for now; WHEN:converting xowa to sqlitedb data_mgr__core_mgr = new Xow_db_mgr(this, fsys_mgr.Root_dir()); data_mgr__core_mgr.Init_by_load(gplx.xowa.wikis.data.Xow_db_file__core_.Find_core_fil(this)); app.Html__css_installer() .Install(this, Xowd_css_core_mgr.Key_mobile); // must init after data_mgr this.db_core_mgr = Fsdb_db_mgr_.new_detect(this, fsys_mgr.Root_dir(), fsys_mgr.File_dir()); if (db_core_mgr == null) // no fsdb; occurs during merge; also, will be null for xowa_db; DATE:2016-05-31 db_core_mgr = Fsdb_db_mgr__v2_bldr.Get_or_make(this, true); else // fsdb exists; load it fsdb_mgr.Mnt_mgr().Ctor_by_load(db_core_mgr); file_mgr__repo_mgr.Add_repo( app, fsys_mgr.File_dir(), Xow_domain_itm_.Bry__commons, Xow_domain_itm_.Bry__commons); file_mgr__repo_mgr.Add_repo(app, fsys_mgr.File_dir(), domain_bry, domain_bry); Xof_orig_tbl[] orig_tbls = db_core_mgr == null ? new Xof_orig_tbl[0] : db_core_mgr.File__orig_tbl_ary(); orig_mgr.Init_by_wiki(this, file_mgr__fsdb_mode, orig_tbls, Xof_url_bldr.new_v2()); fsdb_mgr.Init_by_wiki(this); data_mgr__core_mgr.Db__core().Tbl__ns().Select_all(ns_mgr); data_mgr__core_mgr.Db__core().Tbl__site_stats().Select(stats); html__hdump_mgr.Init_by_db(this); app.Addon_mgr().Load_by_wiki(this); ctg_pagebox_wtr.Init_by_wiki(this); }
public class Xob_xfer_regy_log_tbl { public static void Create_table(Db_conn p) { gplx.dbs.engines.sqlite.Sqlite_engine_.Tbl_create_and_delete(p, Tbl_name, Tbl_sql); } public static Db_stmt Insert_stmt(Db_conn p) { return Db_stmt_.new_insert_( p, Tbl_name, Fld_lnki_id, Fld_xfer_status, Fld_xfer_bin_tid, Fld_xfer_bin_msg); } public static void Insert(Db_stmt stmt, byte status, int id, byte wkr_tid, String wkr_msg) { stmt.Clear().Val_int(id).Val_byte(status).Val_byte(wkr_tid).Val_str(wkr_msg).Exec_insert(); } private static final String Tbl_sql = String_.Concat_lines_nl( "CREATE TABLE IF NOT EXISTS xfer_regy_log", "( lnki_id integer NOT NULL", ", xfer_status tinyint NOT NULL" // 0=todo; 1=fail; 2=pass; 3=done , ", xfer_bin_tid tinyint NOT NULL", ", xfer_bin_msg varchar(255) NOT NULL", ");"); public static final String Tbl_name = "xfer_regy_log", Fld_lnki_id = "lnki_id", Fld_xfer_status = "xfer_status", Fld_xfer_bin_tid = "xfer_bin_tid", Fld_xfer_bin_msg = "xfer_bin_msg"; }
public byte[] Bld(Xowe_wiki cur_wiki, Xoae_page page, Xow_popup_itm popup_itm, Bry_bfr wrdx_bfr) { if (output_js_clean) cur_wiki.Html_mgr().Js_cleaner().Clean_bfr(wiki, page.Ttl(), wrdx_bfr, 0); if (output_tidy) cur_wiki.Html_mgr().Tidy_mgr().Exec_tidy(wrdx_bfr, Bool_.Y, page.Url_bry_safe()); byte[] hdom_bry = wrdx_bfr.To_bry_and_clear(); String page_url = wrdx_bfr.Add(page.Wiki().Domain_bry()) .Add(gplx.xowa.htmls.hrefs.Xoh_href_.Bry__wiki) .Add( gplx.langs.htmls.encoders.Gfo_url_encoder_.Href.Encode( page.Ttl() .Full_db())) // NOTE: was page.Url().Raw(), but that doesn't work for // Special:Search; PAGE:en.w:Earth and "Quotations"; // DATE:2014-06-29 .To_str_and_clear(); fmtr_popup.Bld_bfr_many( wrdx_bfr, hdom_bry, wiki.Lang().Dir_ltr_bry(), page_url, String_.new_u8(page.Ttl().Full_txt_w_ttl_case()), popup_itm.Popup_id(), Xow_popup_html_bldr_.Bld_fmtr_wiki( fmtr_wiki, wrdx_bfr, cur_wiki.Domain_bry(), page.Wiki().Domain_bry()) // NOTE: use cur_wiki, not page_wiki; DATE:2014-06-28 , gplx.core.ios.Io_size_.To_str(page.Db().Text().Text_bry().length), page.Db().Page().Modified_on().XtoStr_fmt_yyyy_MM_dd_HH_mm_ss(), Xow_popup_html_bldr_.Bld_fmtr_viewed(fmtr_viewed, app, wiki, wrdx_bfr, page.Ttl()), app.Fsys_mgr().Root_dir().To_http_file_bry()); return wrdx_bfr.To_bry_and_clear(); }
// public Io_url[] Src_fils() {return src_fils;} public Io_line_rdr_fxt Src_fils_(Io_url[] v) // {src_fils = v; return this;} Io_url[] src_fils; public Io_line_rdr_fxt tst_Match(String match, String expd) { rdr.Key_gen_(Io_line_rdr_key_gen_.first_pipe); boolean match_v = rdr.Match(Bry_.new_u8(match)); String actl = match_v ? String_.new_u8(rdr.Bfr(), rdr.Key_pos_bgn(), rdr.Key_pos_end()) : ""; Tfds.Eq(expd, actl); return this; }
public Xowv_wiki(Xoav_app app, byte[] domain_bry, Io_url wiki_root_dir) { this.app = app; this.domain_bry = domain_bry; this.domain_str = String_.new_u8(domain_bry); this.domain_itm = Xow_domain_itm_.parse(domain_bry); this.domain_tid = domain_itm.Domain_type_id(); this.domain_abrv = Xow_abrv_wm_.To_abrv(Xow_domain_itm_.parse(domain_bry)); this.ns_mgr = Xow_ns_mgr_.default_(app.Utl_case_mgr()); this.lang = app.Lang_mgr() .Get_by_or_en( domain_itm .Lang_actl_key()); // NOTE: must not be null, or causes null ref exception on // redlinks in drd; DATE:2016-06-28 this.msg_mgr = new Xow_msg_mgr(this, lang); this.html__hdump_mgr = new Xow_hdump_mgr(this); this.special_mgr = new Xosp_special_mgr(this); this.fsys_mgr = new Xow_fsys_mgr(wiki_root_dir, app.Fsys_mgr().File_dir().GenSubDir(domain_str)); this.fsdb_mgr = new Xof_fsdb_mgr__sql(); this.url__parser = new Xow_url_parser(this); this.xwiki_mgr = new Xow_xwiki_mgr(this); this.stats = new Xow_site_stats_mgr(this); this.lnki_bldr = new Xoh_lnki_bldr(app, href_wtr); this.ctg_catpage_mgr = new Xoctg_catpage_mgr(this); }
public static Xob_db_file New__deletion_db(Xow_wiki wiki) { String name = String_.Format( "{0}-file-deletion-{1}.xowa", wiki.Domain_str(), Datetime_now.Get().XtoStr_fmt("yyyy.MM")); return New(wiki.Fsys_mgr().Root_dir(), name); }
public boolean Chk(Xowe_wiki wiki) { if (!wiki.App().App_type().Uid_is_gui()) return true; // NOTE: ignore during Server / Console modes; DATE:2015-04-01 if (in_progress_hash.Has(wiki.Domain_bry())) return true; // NOTE: ignore if currently building; different bldr commands call // wiki.Init_assert() which may lead to fals checks; Io_url url = url_(wiki); if (!Io_mgr.I.ExistsFil(url)) return true; Xoae_app app = wiki.Appe(); app.Usr_dlg().Log_many("", "", "import.marker: marker found: url=~{0}", url.Raw()); byte[] incompete_msg_bry = app.Usere() .Msg_mgr() .Val_by_key_args(Bry_.new_a7("api-xowa.import.core.incomplete"), wiki.Domain_str()); int rslt = app.Gui_mgr().Kit().Ask_yes_no_cancel("", "", String_.new_u8(incompete_msg_bry)); switch (rslt) { case Gfui_dlg_msg_.Btn_yes: Xob_cleanup_cmd.Delete_wiki_sql(wiki); End(wiki); return false; // delete wiki case Gfui_dlg_msg_.Btn_no: End(wiki); return true; // delete marker case Gfui_dlg_msg_.Btn_cancel: return true; // noop default: throw Err_.unhandled(rslt); } }
public static Io_url Eval_url(Bry_fmtr_eval_mgr eval_mgr, byte[] fmt) { if (eval_mgr == null) return Io_url_.new_any_(String_.new_u8(fmt)); Bry_bfr bfr = Bry_bfr.reset_(255); Bry_fmtr fmtr = Bry_fmtr.tmp_(); fmtr.Eval_mgr_(eval_mgr).Fmt_(fmt).Bld_bfr_none(bfr); return Io_url_.new_any_(bfr.Xto_str_and_clear()); }
public static Xog_history_itm Srl_load(byte[] raw) { byte[][] atrs = Bry_split_.Split(raw, Byte_ascii.Pipe); byte[] bmk_bry = atrs.length == 6 ? atrs[5] : Bry_.Empty; bmk_bry = Bry_.Replace(bmk_bry, Byte_ascii.Tilde, Byte_ascii.Pipe); return new Xog_history_itm( atrs[0], atrs[1], atrs[2], atrs[3], atrs[4] == Bool_.Y_bry, String_.new_a7(bmk_bry)); }
public void Select_tasks_steps( Xobc_task_step_hash task_step_hash, Xobc_step_map_tbl step_map_tbl, byte[] wiki_abrv, String wiki_date) { task_step_hash.Clear(); Db_rdr rdr = conn.Stmt_sql( String_.Concat_lines_nl_skip_last( "SELECT DISTINCT sm.task_id, sm.step_id", "FROM " + tbl_name + " imps", " JOIN " + step_map_tbl.Tbl_name() + " sm ON sm.step_id = imps.step_id", "WHERE imps.wiki_abrv = ?", "AND imps.wiki_date = ?")) .Crt_bry_as_str(fld_wiki_abrv, wiki_abrv) .Crt_str(fld_wiki_date, wiki_date) .Exec_select__rls_auto(); try { while (rdr.Move_next()) { task_step_hash.Add(rdr.Read_int("task_id"), rdr.Read_int("step_id")); } } finally { rdr.Rls(); } }
public SecurityEventParticipantNetworkComponent copy(SecurityEvent e) { SecurityEventParticipantNetworkComponent dst = e.new SecurityEventParticipantNetworkComponent(); dst.identifier = identifier == null ? null : identifier.copy(); dst.type = type == null ? null : type.copy(); return dst; }
public DocumentReferenceServiceComponent copy(DocumentReference e) { DocumentReferenceServiceComponent dst = e.new DocumentReferenceServiceComponent(); dst.type = type == null ? null : type.copy(); dst.address = address == null ? null : address.copy(); dst.parameter = new ArrayList<DocumentReferenceServiceParameterComponent>(); for (DocumentReferenceServiceParameterComponent i : parameter) dst.parameter.add(i.copy(e)); return dst; }
public GVFVariantBreakpointDetailComponent copy(GVFVariant e) { GVFVariantBreakpointDetailComponent dst = e.new GVFVariantBreakpointDetailComponent(); dst.seqid = seqid == null ? null : seqid.copy(); dst.start = start == null ? null : start.copy(); dst.end = end == null ? null : end.copy(); dst.strand = strand == null ? null : strand.copy(); return dst; }