All files / output zcl_abapgit_gui_page_db_entry.clas.mjs

10.07% Statements 27/268
66.66% Branches 2/3
5.26% Functions 1/19
10.07% Lines 27/268

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 2681x 1x 1x                               1x 1x 1x 1x 1x     1x 1x     1x 1x     1x 1x     1x 1x                                                                                                                                                                                                                                                                                                                                                                                                                                                     1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x
const {zcl_abapgit_gui_component} = await import("./zcl_abapgit_gui_component.clas.mjs");
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_gui_page_db_entry.clas.abap
class zcl_abapgit_gui_page_db_entry extends zcl_abapgit_gui_component {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'ZCL_ABAPGIT_GUI_PAGE_DB_ENTRY';
  static IMPLEMENTED_INTERFACES = ["ZIF_ABAPGIT_GUI_EVENT_HANDLER","ZIF_ABAPGIT_GUI_RENDERABLE","ZIF_ABAPGIT_GUI_PAGE_TITLE"];
  static ATTRIBUTES = {"MS_KEY": {"type": () => {return new abap.types.Structure({
  "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
  "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
  "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MV_EDIT_MODE": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "C_ACTION": {"type": () => {return new abap.types.Structure({
  "update": new abap.types.String({qualifiedName: "STRING"}),
  "switch_mode": new abap.types.String({qualifiedName: "STRING"})}, undefined, undefined, {}, {});}, "visibility": "I", "is_constant": "X", "is_class": "X"},
  "C_EDIT_FORM_ID": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "visibility": "I", "is_constant": "X", "is_class": "X"},
  "C_CSS_URL": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "visibility": "I", "is_constant": "X", "is_class": "X"}};
  static METHODS = {"REGISTER_STYLESHEET": {"visibility": "I", "parameters": {}},
  "RENDER_VIEW": {"visibility": "I", "parameters": {"IV_RAW_DB_VALUE": {"type": () => {return new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"});}, "is_optional": " "}, "II_HTML": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"});}, "is_optional": " "}}},
  "RENDER_EDIT": {"visibility": "I", "parameters": {"IV_RAW_DB_VALUE": {"type": () => {return new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"});}, "is_optional": " "}, "II_HTML": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"});}, "is_optional": " "}}},
  "RENDER_HEADER": {"visibility": "I", "parameters": {"II_HTML": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"});}, "is_optional": " "}, "IO_TOOLBAR": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_HTML_TOOLBAR", RTTIName: "\\CLASS=ZCL_ABAPGIT_HTML_TOOLBAR"});}, "is_optional": " "}}},
  "BUILD_TOOLBAR": {"visibility": "I", "parameters": {"RO_TOOLBAR": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_HTML_TOOLBAR", RTTIName: "\\CLASS=ZCL_ABAPGIT_HTML_TOOLBAR"});}, "is_optional": " "}}},
  "RENDER_ENTRY_TAG": {"visibility": "I", "parameters": {"RV_HTML": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IS_KEY": {"type": () => {return new abap.types.Structure({
  "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
  "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
  "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {});}, "is_optional": " "}}},
  "DBCONTENT_DECODE": {"visibility": "I", "parameters": {"RS_CONTENT": {"type": () => {return new abap.types.Structure({
  "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
  "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
  "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {});}, "is_optional": " "}, "IO_FORM_DATA": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"});}, "is_optional": " "}}},
  "DO_UPDATE": {"visibility": "I", "parameters": {"IS_CONTENT": {"type": () => {return new abap.types.Structure({
  "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
  "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
  "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {});}, "is_optional": " "}}},
  "CREATE": {"visibility": "U", "parameters": {"RI_PAGE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"});}, "is_optional": " "}, "IS_KEY": {"type": () => {return new abap.types.Structure({
  "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
  "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
  "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {});}, "is_optional": " "}, "IV_EDIT_MODE": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}},
  "CONSTRUCTOR": {"visibility": "U", "parameters": {"IS_KEY": {"type": () => {return new abap.types.Structure({
  "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
  "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
  "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {});}, "is_optional": " "}, "IV_EDIT_MODE": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}}};
  #ms_key;
  #mv_edit_mode;
  constructor() {
    const sup = super();
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "SUPER": sup.FRIENDS_ACCESS_INSTANCE,
      "register_stylesheet": this.#register_stylesheet.bind(this),
      "render_view": this.#render_view.bind(this),
      "render_edit": this.#render_edit.bind(this),
      "render_header": this.#render_header.bind(this),
      "build_toolbar": this.#build_toolbar.bind(this),
    };
    this.#ms_key = new abap.types.Structure({
    "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
    "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
    "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {});
    this.FRIENDS_ACCESS_INSTANCE["ms_key"] = this.#ms_key;
    this.#mv_edit_mode = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    this.FRIENDS_ACCESS_INSTANCE["mv_edit_mode"] = this.#mv_edit_mode;
    this.c_action = zcl_abapgit_gui_page_db_entry.c_action;
    this.c_edit_form_id = zcl_abapgit_gui_page_db_entry.c_edit_form_id;
    this.c_css_url = zcl_abapgit_gui_page_db_entry.c_css_url;
  }
  async #build_toolbar() {
    let ro_toolbar = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_HTML_TOOLBAR", RTTIName: "\\CLASS=ZCL_ABAPGIT_HTML_TOOLBAR"});
    ro_toolbar.set((await abap.Classes['ZCL_ABAPGIT_HTML_TOOLBAR'].create({iv_id: abap.CharacterFactory.get(22, 'toolbar-database-entry')})));
    if (abap.compare.eq(this.#mv_edit_mode, abap.builtin.abap_true)) {
      await ro_toolbar.get().add({iv_act: new abap.types.String().set(`submitFormById('${abap.templateFormatting(zcl_abapgit_gui_page_db_entry.c_edit_form_id)}');`), iv_txt: abap.CharacterFactory.get(4, 'Save'), iv_typ: abap.Classes['ZIF_ABAPGIT_HTML'].zif_abapgit_html$c_action_type.get().onclick, iv_opt: abap.Classes['ZIF_ABAPGIT_HTML'].zif_abapgit_html$c_html_opt.get().strong});
    } else {
      await ro_toolbar.get().add({iv_act: new abap.types.String().set(`${abap.templateFormatting(zcl_abapgit_gui_page_db_entry.c_action.get().switch_mode)}`), iv_txt: abap.CharacterFactory.get(4, 'Edit')});
    }
    await ro_toolbar.get().add({iv_act: abap.Classes['ZIF_ABAPGIT_DEFINITIONS'].zif_abapgit_definitions$c_action.get().go_back, iv_txt: abap.CharacterFactory.get(4, 'Back')});
    return ro_toolbar;
  }
  async constructor_(INPUT) {
    let is_key = INPUT?.is_key;
    if (is_key?.getQualifiedName === undefined || is_key.getQualifiedName() !== "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT") { is_key = undefined; }
    if (is_key === undefined) { is_key = new abap.types.Structure({
    "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
    "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
    "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {}).set(INPUT.is_key); }
    let iv_edit_mode = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    if (INPUT && INPUT.iv_edit_mode) {iv_edit_mode.set(INPUT.iv_edit_mode);}
    if (INPUT === undefined || INPUT.iv_edit_mode === undefined) {iv_edit_mode = abap.builtin.abap_false;}
    await super.constructor_();
    await this.#register_stylesheet();
    this.#mv_edit_mode.set(iv_edit_mode);
    this.#ms_key.set(is_key);
    return this;
  }
  async create(INPUT) {
    return zcl_abapgit_gui_page_db_entry.create(INPUT);
  }
  static async create(INPUT) {
    let ri_page = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"});
    let is_key = INPUT?.is_key;
    if (is_key?.getQualifiedName === undefined || is_key.getQualifiedName() !== "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT") { is_key = undefined; }
    if (is_key === undefined) { is_key = new abap.types.Structure({
    "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
    "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
    "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {}).set(INPUT.is_key); }
    let iv_edit_mode = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    if (INPUT && INPUT.iv_edit_mode) {iv_edit_mode.set(INPUT.iv_edit_mode);}
    if (INPUT === undefined || INPUT.iv_edit_mode === undefined) {iv_edit_mode = abap.builtin.abap_false;}
    let lo_component = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_DB_ENTRY", RTTIName: "\\CLASS=ZCL_ABAPGIT_GUI_PAGE_DB_ENTRY"});
    lo_component.set(await (new abap.Classes['ZCL_ABAPGIT_GUI_PAGE_DB_ENTRY']()).constructor_({iv_edit_mode: iv_edit_mode, is_key: is_key}));
    ri_page.set((await abap.Classes['ZCL_ABAPGIT_GUI_PAGE_HOC'].create({iv_extra_css_url: zcl_abapgit_gui_page_db_entry.c_css_url, ii_page_title_provider: lo_component, ii_child_component: lo_component})));
    return ri_page;
  }
  async dbcontent_decode(INPUT) {
    return zcl_abapgit_gui_page_db_entry.dbcontent_decode(INPUT);
  }
  static async dbcontent_decode(INPUT) {
    let rs_content = new abap.types.Structure({
    "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
    "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
    "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {});
    let io_form_data = INPUT?.io_form_data;
    if (io_form_data?.getQualifiedName === undefined || io_form_data.getQualifiedName() !== "ZCL_ABAPGIT_STRING_MAP") { io_form_data = undefined; }
    if (io_form_data === undefined) { io_form_data = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"}).set(INPUT.io_form_data); }
    rs_content.get().type.set((await io_form_data.get().get({iv_key: abap.CharacterFactory.get(4, 'TYPE')})));
    rs_content.get().value.set((await io_form_data.get().get({iv_key: abap.CharacterFactory.get(5, 'VALUE')})));
    rs_content.get().data_str.set((await io_form_data.get().get({iv_key: abap.CharacterFactory.get(7, 'XMLDATA')})));
    if (abap.compare.ne(rs_content.get().data_str.getOffset({length: 1}), abap.CharacterFactory.get(1, '<')) && abap.compare.eq(rs_content.get().data_str.getOffset({offset: 1, length: 1}), abap.CharacterFactory.get(1, '<'))) {
      rs_content.get().data_str.set(rs_content.get().data_str.getOffset({offset: 1}));
    }
    return rs_content;
  }
  async do_update(INPUT) {
    return zcl_abapgit_gui_page_db_entry.do_update(INPUT);
  }
  static async do_update(INPUT) {
    let is_content = INPUT?.is_content;
    if (is_content?.getQualifiedName === undefined || is_content.getQualifiedName() !== "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT") { is_content = undefined; }
    if (is_content === undefined) { is_content = new abap.types.Structure({
    "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
    "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
    "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {}).set(INPUT.is_content); }
    abap.statements.assert(abap.compare.initial(is_content.get().type) === false);
    await (await abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].get_instance()).get().update({iv_type: is_content.get().type, iv_value: is_content.get().value, iv_data: is_content.get().data_str});
    abap.statements.commit();
  }
  async #register_stylesheet() {
    let lo_buf = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_BUFFER", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_BUFFER"});
    lo_buf.set(await (new abap.Classes['ZCL_ABAPGIT_STRING_BUFFER']()).constructor_());
    await (await this.gui_services()).get().zif_abapgit_gui_services$register_page_asset({iv_url: zcl_abapgit_gui_page_db_entry.c_css_url, iv_type: abap.CharacterFactory.get(8, 'text/css'), iv_mime_name: abap.CharacterFactory.get(26, 'ZABAPGIT_CSS_PAGE_DB_ENTRY'), iv_inline: (await lo_buf.get().join_w_newline_and_flush())});
  }
  async #render_edit(INPUT) {
    let iv_raw_db_value = INPUT?.iv_raw_db_value;
    if (iv_raw_db_value?.getQualifiedName === undefined || iv_raw_db_value.getQualifiedName() !== "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR") { iv_raw_db_value = undefined; }
    if (iv_raw_db_value === undefined) { iv_raw_db_value = new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"}).set(INPUT.iv_raw_db_value); }
    let ii_html = INPUT?.ii_html;
    if (ii_html?.getQualifiedName === undefined || ii_html.getQualifiedName() !== "ZIF_ABAPGIT_HTML") { ii_html = undefined; }
    if (ii_html === undefined) { ii_html = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"}).set(INPUT.ii_html); }
    let lv_formatted = new abap.types.String({qualifiedName: "STRING"});
    lv_formatted.set((abap.builtin.escape({val: (await abap.Classes['ZCL_ABAPGIT_XML_PRETTY'].print({iv_xml: iv_raw_db_value})), format: abap.Classes['CL_ABAP_FORMAT'].e_html_attr})));
    await ii_html.get().zif_abapgit_html$add({ig_chunk: new abap.types.String().set(`<form id="${abap.templateFormatting(zcl_abapgit_gui_page_db_entry.c_edit_form_id)}" method="post" action="sapevent:${abap.templateFormatting(zcl_abapgit_gui_page_db_entry.c_action.get().update)}">`)});
    await ii_html.get().zif_abapgit_html$add({ig_chunk: new abap.types.String().set(`<input type="hidden" name="type" value="${abap.templateFormatting(this.#ms_key.get().type)}">`)});
    await ii_html.get().zif_abapgit_html$add({ig_chunk: new abap.types.String().set(`<input type="hidden" name="value" value="${abap.templateFormatting(this.#ms_key.get().value)}">`)});
    await ii_html.get().zif_abapgit_html$add({ig_chunk: new abap.types.String().set(`<textarea rows="20" cols="100" name="xmldata">${abap.templateFormatting(lv_formatted)}</textarea>`)});
    await ii_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(7, '</form>')});
  }
  async render_entry_tag(INPUT) {
    return zcl_abapgit_gui_page_db_entry.render_entry_tag(INPUT);
  }
  static async render_entry_tag(INPUT) {
    let rv_html = new abap.types.String({qualifiedName: "STRING"});
    let is_key = INPUT?.is_key;
    if (is_key?.getQualifiedName === undefined || is_key.getQualifiedName() !== "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT") { is_key = undefined; }
    if (is_key === undefined) { is_key = new abap.types.Structure({
    "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
    "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
    "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {}).set(INPUT.is_key); }
    rv_html.set(abap.operators.concat(new abap.types.String().set(`<dl class="entry-tag">`),abap.operators.concat(new abap.types.String().set(`<div><dt>Type</dt><dd>${abap.templateFormatting(is_key.get().type)}</dd></div>`),abap.operators.concat(new abap.types.String().set(`<div><dt>Key</dt><dd>${abap.templateFormatting(is_key.get().value)}</dd></div>`),new abap.types.String().set(`</dl>`)))));
    return rv_html;
  }
  async #render_header(INPUT) {
    let ii_html = INPUT?.ii_html;
    if (ii_html?.getQualifiedName === undefined || ii_html.getQualifiedName() !== "ZIF_ABAPGIT_HTML") { ii_html = undefined; }
    if (ii_html === undefined) { ii_html = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"}).set(INPUT.ii_html); }
    let io_toolbar = INPUT?.io_toolbar;
    if (io_toolbar?.getQualifiedName === undefined || io_toolbar.getQualifiedName() !== "ZCL_ABAPGIT_HTML_TOOLBAR") { io_toolbar = undefined; }
    if (io_toolbar === undefined) { io_toolbar = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_HTML_TOOLBAR", RTTIName: "\\CLASS=ZCL_ABAPGIT_HTML_TOOLBAR"}).set(INPUT.io_toolbar); }
    await ii_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(21, '<div class="toolbar">')});
    await ii_html.get().zif_abapgit_html$add({ig_chunk: (await io_toolbar.get().render({iv_right: abap.builtin.abap_true}))});
    await ii_html.get().zif_abapgit_html$add({ig_chunk: (await this.render_entry_tag({is_key: this.#ms_key}))});
    await ii_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(6, '</div>')});
  }
  async #render_view(INPUT) {
    let iv_raw_db_value = INPUT?.iv_raw_db_value;
    if (iv_raw_db_value?.getQualifiedName === undefined || iv_raw_db_value.getQualifiedName() !== "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR") { iv_raw_db_value = undefined; }
    if (iv_raw_db_value === undefined) { iv_raw_db_value = new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"}).set(INPUT.iv_raw_db_value); }
    let ii_html = INPUT?.ii_html;
    if (ii_html?.getQualifiedName === undefined || ii_html.getQualifiedName() !== "ZIF_ABAPGIT_HTML") { ii_html = undefined; }
    if (ii_html === undefined) { ii_html = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"}).set(INPUT.ii_html); }
    let lo_highlighter = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_SYNTAX_HIGHLIGHTER", RTTIName: "\\CLASS=ZCL_ABAPGIT_SYNTAX_HIGHLIGHTER"});
    let lv_formatted = new abap.types.String({qualifiedName: "STRING"});
    lo_highlighter.set((await abap.Classes['ZCL_ABAPGIT_SYNTAX_FACTORY'].create({iv_filename: abap.CharacterFactory.get(5, '*.xml')})));
    lv_formatted.set((await lo_highlighter.get().process_line({iv_line: (await abap.Classes['ZCL_ABAPGIT_XML_PRETTY'].print({iv_xml: iv_raw_db_value}))})));
    await ii_html.get().zif_abapgit_html$add({ig_chunk: new abap.types.String().set(`<pre class="syntax-hl">${abap.templateFormatting(lv_formatted)}</pre>`)});
  }
  async zif_abapgit_gui_event_handler$on_event(INPUT) {
    let rs_handled = new abap.types.Structure({
    "page": new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"}),
    "state": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_GUI_EVENT_HANDLER=>TY_HANDLING_RESULT-STATE"})}, "zif_abapgit_gui_event_handler=>ty_handling_result", undefined, {}, {});
    let ii_event = INPUT?.ii_event;
    if (ii_event?.getQualifiedName === undefined || ii_event.getQualifiedName() !== "ZIF_ABAPGIT_GUI_EVENT") { ii_event = undefined; }
    if (ii_event === undefined) { ii_event = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_EVENT", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_EVENT"}).set(INPUT.ii_event); }
    let unique857 = ii_event.get().zif_abapgit_gui_event$mv_action;
    if (abap.compare.eq(unique857, zcl_abapgit_gui_page_db_entry.c_action.get().switch_mode)) {
      this.#mv_edit_mode.set(abap.builtin.boolc(abap.compare.eq(this.#mv_edit_mode, abap.builtin.abap_false)));
      rs_handled.get().state.set(abap.Classes['ZCL_ABAPGIT_GUI'].c_event_state.get().re_render);
    } else if (abap.compare.eq(unique857, zcl_abapgit_gui_page_db_entry.c_action.get().update)) {
      await this.do_update({is_content: (await this.dbcontent_decode({io_form_data: (await ii_event.get().zif_abapgit_gui_event$form_data())}))});
      rs_handled.get().state.set(abap.Classes['ZCL_ABAPGIT_GUI'].c_event_state.get().go_back);
    }
    return rs_handled;
  }
  async zif_abapgit_gui_page_title$get_page_title() {
    let rv_title = new abap.types.String({qualifiedName: "STRING"});
    if (abap.compare.eq(this.#mv_edit_mode, abap.builtin.abap_true)) {
      rv_title.set(abap.CharacterFactory.get(11, 'Config Edit'));
    } else {
      rv_title.set(abap.CharacterFactory.get(14, 'Config Display'));
    }
    return rv_title;
  }
  async zif_abapgit_gui_renderable$render() {
    let ri_html = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"});
    let lv_raw_db_value = new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"});
    await this.register_handlers();
    try {
      lv_raw_db_value.set((await (await abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].get_instance()).get().read({iv_type: this.#ms_key.get().type, iv_value: this.#ms_key.get().value})));
    } catch (e) {
      if ((abap.Classes['ZCX_ABAPGIT_NOT_FOUND'] && e instanceof abap.Classes['ZCX_ABAPGIT_NOT_FOUND'])) {
      } else {
        throw e;
      }
    }
    ri_html.set(await (new abap.Classes['ZCL_ABAPGIT_HTML']()).constructor_());
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(22, '<div class="db-entry">')});
    await this.#render_header({ii_html: ri_html, io_toolbar: (await this.#build_toolbar())});
    if (abap.compare.eq(this.#mv_edit_mode, abap.builtin.abap_true)) {
      await (await abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].get_instance()).get().lock({iv_type: this.#ms_key.get().type, iv_value: this.#ms_key.get().value});
      await this.#render_edit({iv_raw_db_value: lv_raw_db_value, ii_html: ri_html});
    } else {
      await this.#render_view({iv_raw_db_value: lv_raw_db_value, ii_html: ri_html});
    }
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(6, '</div>')});
    return ri_html;
  }
}
abap.Classes['ZCL_ABAPGIT_GUI_PAGE_DB_ENTRY'] = zcl_abapgit_gui_page_db_entry;
zcl_abapgit_gui_page_db_entry.c_action = new abap.types.Structure({
"update": new abap.types.String({qualifiedName: "STRING"}),
"switch_mode": new abap.types.String({qualifiedName: "STRING"})}, undefined, undefined, {}, {});
zcl_abapgit_gui_page_db_entry.c_action.get().update.set('update');
zcl_abapgit_gui_page_db_entry.c_action.get().switch_mode.set('switch_mode');
zcl_abapgit_gui_page_db_entry.c_edit_form_id = new abap.types.String({qualifiedName: "STRING"});
zcl_abapgit_gui_page_db_entry.c_edit_form_id.set(`db_form`);
zcl_abapgit_gui_page_db_entry.c_css_url = new abap.types.String({qualifiedName: "STRING"});
zcl_abapgit_gui_page_db_entry.c_css_url.set('css/page_db_entry.css');
export {zcl_abapgit_gui_page_db_entry};