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 | 1x 1x 20x 20x 20x 20x 20x 20x 20x 1x 1x 1x 20x 20x 20x 20x 20x 20x 20x 20x 20x 20x 20x 20x 20x 20x 20x 20x 20x 20x 20x 20x 20x 20x 20x 20x 20x 20x 20x 20x 20x 20x 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 1x 1x 1x 126x 126x 126x 1x 1x 1x 20x 26x 26x 26x 26x 26x 26x 26x 26x 26x 26x 26x 1x 1x 26x 1x 25x 26x 20x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 3x 3x 3x 2x 2x 20x 24x 24x 24x 24x 24x 24x 24x 24x 24x 24x 24x 24x 24x 24x 24x 24x 24x 24x 24x 24x 24x 24x 1x 24x 22x 24x 20x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 1x 23x 1x 19x 19x 23x 20x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 2x 34x 30x 30x 34x 34x 34x 20x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | const {cx_root} = await import("./cx_root.clas.mjs"); // zcl_abapgit_gui_asset_manager.clas.abap class zcl_abapgit_gui_asset_manager { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'ZCL_ABAPGIT_GUI_ASSET_MANAGER'; static IMPLEMENTED_INTERFACES = ["ZIF_ABAPGIT_GUI_ASSET_MANAGER"]; static ATTRIBUTES = {"MT_ASSET_REGISTER": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-URL"}), "type": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-type"}), "subtype": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-subtype"}), "content": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-CONTENT"}), "is_cacheable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "mime_name": new abap.types.Character(40, {})}, "zcl_abapgit_gui_asset_manager=>ty_asset_entry", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["URL"]},"secondary":[]}, "zcl_abapgit_gui_asset_manager=>ty_asset_register");}, "visibility": "I", "is_constant": " ", "is_class": " "}}; static METHODS = {"GET_MIME_ASSET": {"visibility": "I", "parameters": {"RV_XDATA": {"type": () => {return new abap.types.XString({qualifiedName: "XSTRING"});}, "is_optional": " "}, "IV_MIME_NAME": {"type": () => {return new abap.types.Character();}, "is_optional": " "}}}, "LOAD_ASSET": {"visibility": "I", "parameters": {"RS_ASSET": {"type": () => {return new abap.types.Structure({ "url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-URL"}), "type": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-type"}), "subtype": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-subtype"}), "content": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-CONTENT"}), "is_cacheable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_gui_asset_manager=>ty_web_asset", undefined, {}, {});}, "is_optional": " "}, "IS_ASSET_ENTRY": {"type": () => {return new abap.types.Structure({ "url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-URL"}), "type": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-type"}), "subtype": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-subtype"}), "content": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-CONTENT"}), "is_cacheable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "mime_name": new abap.types.Character(40, {})}, "zcl_abapgit_gui_asset_manager=>ty_asset_entry", undefined, {}, {});}, "is_optional": " "}}}, "CREATE": {"visibility": "U", "parameters": {"RI_ASSET_MANAGER": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_ASSET_MANAGER"});}, "is_optional": " "}}}}; #mt_asset_register; constructor() { this.me = new abap.types.ABAPObject(); this.me.set(this); this.INTERNAL_ID = abap.internalIdCounter++; this.FRIENDS_ACCESS_INSTANCE = { "get_mime_asset": this.#get_mime_asset.bind(this), "load_asset": this.#load_asset.bind(this), }; this.#mt_asset_register = abap.types.TableFactory.construct(new abap.types.Structure({ "url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-URL"}), "type": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-type"}), "subtype": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-subtype"}), "content": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-CONTENT"}), "is_cacheable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "mime_name": new abap.types.Character(40, {})}, "zcl_abapgit_gui_asset_manager=>ty_asset_entry", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["URL"]},"secondary":[]}, "zcl_abapgit_gui_asset_manager=>ty_asset_register"); this.FRIENDS_ACCESS_INSTANCE["mt_asset_register"] = this.#mt_asset_register; } async constructor_(INPUT) { if (super.constructor_) { await super.constructor_(INPUT); } return this; } async create() { return zcl_abapgit_gui_asset_manager.create(); } static async create() { let ri_asset_manager = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_ASSET_MANAGER"}); ri_asset_manager.set(await (new abap.Classes['ZCL_ABAPGIT_GUI_ASSET_MANAGER']()).constructor_()); return ri_asset_manager; } async #get_mime_asset(INPUT) { let rv_xdata = new abap.types.XString({qualifiedName: "XSTRING"}); let iv_mime_name = INPUT?.iv_mime_name; let ls_key = new abap.types.Structure({ "relid": new abap.types.Character(2, {}), "objid": new abap.types.Character(40, {}), "chname": new abap.types.Character(12, {}), "devclass": new abap.types.Character(30, {})}, "WWWDATATAB", "WWWDATATAB", {}, {}); let lv_size_c = new abap.types.Character(250, {}); let lv_size = new abap.types.Integer({qualifiedName: "I"}); let lt_w3mime = abap.types.TableFactory.construct(new abap.types.Structure({ "line": new abap.types.Hex({length: 255})}, "W3MIME", "W3MIME", {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, ""); let ls_w3mime = new abap.types.Structure({ "line": new abap.types.Hex({length: 255})}, "W3MIME", "W3MIME", {}, {}); ls_key.get().relid.set(abap.CharacterFactory.get(2, 'MI')); ls_key.get().objid.set(iv_mime_name); try { if (abap.FunctionModules['WWWPARAMS_READ'] === undefined) { if (abap.Classes['CX_SY_DYN_CALL_ILLEGAL_FUNC'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_FUNC not found"; } else { throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_FUNC'.trimEnd()]();} } await abap.FunctionModules['WWWPARAMS_READ']({exporting: {relid: ls_key.get().relid, objid: ls_key.get().objid, name: abap.CharacterFactory.get(8, 'filesize')}, importing: {value: lv_size_c}}); abap.builtin.sy.get().subrc.set(0); } catch (e) { if (e.classic) { switch (e.classic.toUpperCase()) { case "ENTRY_NOT_EXISTS": abap.builtin.sy.get().subrc.set(1); break; } } else { throw e; } } if (abap.compare.initial(abap.builtin.sy.get().subrc) === false) { return rv_xdata; } lv_size.set(lv_size_c); try { if (abap.FunctionModules['WWWDATA_IMPORT'] === undefined) { if (abap.Classes['CX_SY_DYN_CALL_ILLEGAL_FUNC'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_FUNC not found"; } else { throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_FUNC'.trimEnd()]();} } await abap.FunctionModules['WWWDATA_IMPORT']({exporting: {key: ls_key}, tables: {mime: lt_w3mime}}); abap.builtin.sy.get().subrc.set(0); } catch (e) { if (e.classic) { switch (e.classic.toUpperCase()) { case "WRONG_OBJECT_TYPE": abap.builtin.sy.get().subrc.set(1); break; case "IMPORT_ERROR": abap.builtin.sy.get().subrc.set(2); break; } } else { throw e; } } if (abap.compare.initial(abap.builtin.sy.get().subrc) === false) { return rv_xdata; } for await (const unique670 of abap.statements.loop(lt_w3mime)) { ls_w3mime.set(unique670); abap.statements.concatenate({source: [rv_xdata, ls_w3mime.get().line], target: rv_xdata}); } rv_xdata.set(rv_xdata.getOffset({length: lv_size})); return rv_xdata; } async #load_asset(INPUT) { let rs_asset = new abap.types.Structure({ "url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-URL"}), "type": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-type"}), "subtype": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-subtype"}), "content": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-CONTENT"}), "is_cacheable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_gui_asset_manager=>ty_web_asset", undefined, {}, {}); let is_asset_entry = INPUT?.is_asset_entry; if (is_asset_entry?.getQualifiedName === undefined || is_asset_entry.getQualifiedName() !== "ZCL_ABAPGIT_GUI_ASSET_MANAGER=>TY_ASSET_ENTRY") { is_asset_entry = undefined; } if (is_asset_entry === undefined) { is_asset_entry = new abap.types.Structure({ "url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-URL"}), "type": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-type"}), "subtype": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-subtype"}), "content": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-CONTENT"}), "is_cacheable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "mime_name": new abap.types.Character(40, {})}, "zcl_abapgit_gui_asset_manager=>ty_asset_entry", undefined, {}, {}).set(INPUT.is_asset_entry); } abap.statements.moveCorresponding(is_asset_entry, rs_asset); if (abap.compare.initial(rs_asset.get().content) && abap.compare.initial(is_asset_entry.get().mime_name) === false) { rs_asset.get().content.set((await this.#get_mime_asset({iv_mime_name: is_asset_entry.get().mime_name}))); } if (abap.compare.initial(rs_asset.get().content)) { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`failed to load GUI asset: ${abap.templateFormatting(is_asset_entry.get().url)}`)}); } return rs_asset; } async zif_abapgit_gui_asset_manager$get_all_assets() { let rt_assets = abap.types.TableFactory.construct(new abap.types.Structure({ "url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-URL"}), "type": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-type"}), "subtype": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-subtype"}), "content": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-CONTENT"}), "is_cacheable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_gui_asset_manager=>ty_web_asset", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_gui_asset_manager=>ty_web_assets"); let fs_ls_a_ = new abap.types.FieldSymbol(new abap.types.Structure({ "url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-URL"}), "type": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-type"}), "subtype": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-subtype"}), "content": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-CONTENT"}), "is_cacheable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "mime_name": new abap.types.Character(40, {})}, "zcl_abapgit_gui_asset_manager=>ty_asset_entry", undefined, {}, {})); for await (const unique671 of abap.statements.loop(this.#mt_asset_register)) { fs_ls_a_.assign(unique671); abap.statements.append({source: (await this.#load_asset({is_asset_entry: fs_ls_a_})), target: rt_assets}); } return rt_assets; } async zif_abapgit_gui_asset_manager$get_asset(INPUT) { let rs_asset = new abap.types.Structure({ "url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-URL"}), "type": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-type"}), "subtype": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-subtype"}), "content": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-CONTENT"}), "is_cacheable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_gui_asset_manager=>ty_web_asset", undefined, {}, {}); let iv_url = INPUT?.iv_url; if (iv_url?.getQualifiedName === undefined || iv_url.getQualifiedName() !== "STRING") { iv_url = undefined; } if (iv_url === undefined) { iv_url = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_url); } let fs_ls_a_ = new abap.types.FieldSymbol(new abap.types.Structure({ "url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-URL"}), "type": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-type"}), "subtype": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-subtype"}), "content": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-CONTENT"}), "is_cacheable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "mime_name": new abap.types.Character(40, {})}, "zcl_abapgit_gui_asset_manager=>ty_asset_entry", undefined, {}, {})); abap.statements.readTable(this.#mt_asset_register,{assigning: fs_ls_a_, withKey: (i) => {return abap.compare.eq(i.url, iv_url);}, withKeyValue: [{key: (i) => {return i.url}, value: iv_url}], usesTableLine: false, withKeySimple: {"url": iv_url}}); if (abap.compare.assigned(fs_ls_a_) === false) { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Cannot find GUI asset: ${abap.templateFormatting(iv_url)}`)}); } rs_asset.set((await this.#load_asset({is_asset_entry: fs_ls_a_}))); return rs_asset; } async zif_abapgit_gui_asset_manager$get_text_asset(INPUT) { let rv_asset = new abap.types.String({qualifiedName: "STRING"}); let iv_url = INPUT?.iv_url; if (iv_url?.getQualifiedName === undefined || iv_url.getQualifiedName() !== "STRING") { iv_url = undefined; } if (iv_url === undefined) { iv_url = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_url); } let iv_assert_subtype = new abap.types.String({qualifiedName: "STRING"}); if (INPUT && INPUT.iv_assert_subtype) {iv_assert_subtype.set(INPUT.iv_assert_subtype);} let ls_asset = new abap.types.Structure({ "url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-URL"}), "type": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-type"}), "subtype": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-subtype"}), "content": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-CONTENT"}), "is_cacheable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_gui_asset_manager=>ty_web_asset", undefined, {}, {}); ls_asset.set((await this.zif_abapgit_gui_asset_manager$get_asset({iv_url: iv_url}))); if (abap.compare.ne(ls_asset.get().type, abap.CharacterFactory.get(4, 'text'))) { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Not a text asset: ${abap.templateFormatting(iv_url)}`)}); } if (abap.compare.initial(iv_assert_subtype) === false && abap.compare.ne(ls_asset.get().subtype, iv_assert_subtype)) { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Wrong subtype (${abap.templateFormatting(iv_assert_subtype)}): ${abap.templateFormatting(iv_url)}`)}); } rv_asset.set((await abap.Classes['ZCL_ABAPGIT_CONVERT'].xstring_to_string_utf8({iv_data: ls_asset.get().content}))); return rv_asset; } async zif_abapgit_gui_asset_manager$register_asset(INPUT) { let iv_url = INPUT?.iv_url; if (iv_url?.getQualifiedName === undefined || iv_url.getQualifiedName() !== "STRING") { iv_url = undefined; } if (iv_url === undefined) { iv_url = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_url); } let iv_type = INPUT?.iv_type; if (iv_type?.getQualifiedName === undefined || iv_type.getQualifiedName() !== "STRING") { iv_type = undefined; } if (iv_type === undefined) { iv_type = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_type); } let iv_cacheable = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); if (INPUT && INPUT.iv_cacheable) {iv_cacheable.set(INPUT.iv_cacheable);} if (INPUT === undefined || INPUT.iv_cacheable === undefined) {iv_cacheable = abap.builtin.abap_true;} let iv_mime_name = new abap.types.Character(40, {}); if (INPUT && INPUT.iv_mime_name) {iv_mime_name.set(INPUT.iv_mime_name);} let iv_base64 = new abap.types.String({qualifiedName: "STRING"}); if (INPUT && INPUT.iv_base64) {iv_base64.set(INPUT.iv_base64);} let iv_inline = new abap.types.String({qualifiedName: "STRING"}); if (INPUT && INPUT.iv_inline) {iv_inline.set(INPUT.iv_inline);} let ls_asset = new abap.types.Structure({ "url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-URL"}), "type": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-type"}), "subtype": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-subtype"}), "content": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-CONTENT"}), "is_cacheable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "mime_name": new abap.types.Character(40, {})}, "zcl_abapgit_gui_asset_manager=>ty_asset_entry", undefined, {}, {}); abap.statements.split({source: iv_type, at: abap.CharacterFactory.get(1, '/'), targets: [ls_asset.get().type,ls_asset.get().subtype]}); ls_asset.get().url.set(iv_url); ls_asset.get().mime_name.set(iv_mime_name); ls_asset.get().is_cacheable.set(iv_cacheable); if (abap.compare.initial(iv_base64) === false) { ls_asset.get().content.set((await abap.Classes['ZCL_ABAPGIT_CONVERT'].base64_to_xstring({iv_base64: iv_base64}))); } else if (abap.compare.initial(iv_inline) === false) { ls_asset.get().content.set((await abap.Classes['ZCL_ABAPGIT_CONVERT'].string_to_xstring({iv_str: iv_inline}))); } await abap.statements.deleteInternal(this.#mt_asset_register,{where: async (I) => {return abap.compare.eq(I.url, iv_url);}}); abap.statements.append({source: ls_asset, target: this.#mt_asset_register}); } } abap.Classes['ZCL_ABAPGIT_GUI_ASSET_MANAGER'] = zcl_abapgit_gui_asset_manager; zcl_abapgit_gui_asset_manager.ty_asset_entry = new abap.types.Structure({ "url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-URL"}), "type": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-type"}), "subtype": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-subtype"}), "content": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-CONTENT"}), "is_cacheable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "mime_name": new abap.types.Character(40, {})}, "zcl_abapgit_gui_asset_manager=>ty_asset_entry", undefined, {}, {}); zcl_abapgit_gui_asset_manager.ty_asset_register = abap.types.TableFactory.construct(new abap.types.Structure({ "url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-URL"}), "type": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-type"}), "subtype": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-subtype"}), "content": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-CONTENT"}), "is_cacheable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "mime_name": new abap.types.Character(40, {})}, "zcl_abapgit_gui_asset_manager=>ty_asset_entry", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["URL"]},"secondary":[]}, "zcl_abapgit_gui_asset_manager=>ty_asset_register"); export {zcl_abapgit_gui_asset_manager}; |