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 | 1x 1x 1x 1x 1x 1x 1x | const {cx_root} = await import("./cx_root.clas.mjs"); // zcl_abapgit_persist_packages.clas.abap class zcl_abapgit_persist_packages { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'ZCL_ABAPGIT_PERSIST_PACKAGES'; static IMPLEMENTED_INTERFACES = ["ZIF_ABAPGIT_PERSIST_PACKAGES"]; static ATTRIBUTES = {"MT_PACKAGES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "devclass": new abap.types.Character(30, {}), "component": new abap.types.Character(20, {}), "comp_posid": new abap.types.Character(24, {})}, "zif_abapgit_persist_packages=>ty_package", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"HASHED","isUnique":true,"keyFields":["DEVCLASS"]},"secondary":[]}, "zif_abapgit_persist_packages=>ty_packages");}, "visibility": "I", "is_constant": " ", "is_class": " "}}; static METHODS = {"FROM_XML": {"visibility": "I", "parameters": {"RT_PACKAGES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "devclass": new abap.types.Character(30, {}), "component": new abap.types.Character(20, {}), "comp_posid": new abap.types.Character(24, {})}, "zif_abapgit_persist_packages=>ty_package", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"HASHED","isUnique":true,"keyFields":["DEVCLASS"]},"secondary":[]}, "zif_abapgit_persist_packages=>ty_packages");}, "is_optional": " "}, "IV_XML": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "TO_XML": {"visibility": "I", "parameters": {"RV_XML": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IT_PACKAGES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "devclass": new abap.types.Character(30, {}), "component": new abap.types.Character(20, {}), "comp_posid": new abap.types.Character(24, {})}, "zif_abapgit_persist_packages=>ty_package", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"HASHED","isUnique":true,"keyFields":["DEVCLASS"]},"secondary":[]}, "zif_abapgit_persist_packages=>ty_packages");}, "is_optional": " "}}}, "INIT": {"visibility": "U", "parameters": {}}}; #mt_packages; constructor() { this.me = new abap.types.ABAPObject(); this.me.set(this); this.INTERNAL_ID = abap.internalIdCounter++; this.FRIENDS_ACCESS_INSTANCE = { "from_xml": this.#from_xml.bind(this), "to_xml": this.#to_xml.bind(this), "init": this.init.bind(this), }; this.#mt_packages = abap.types.TableFactory.construct(new abap.types.Structure({ "devclass": new abap.types.Character(30, {}), "component": new abap.types.Character(20, {}), "comp_posid": new abap.types.Character(24, {})}, "zif_abapgit_persist_packages=>ty_package", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"HASHED","isUnique":true,"keyFields":["DEVCLASS"]},"secondary":[]}, "zif_abapgit_persist_packages=>ty_packages"); this.FRIENDS_ACCESS_INSTANCE["mt_packages"] = this.#mt_packages; } async constructor_(INPUT) { if (super.constructor_) { await super.constructor_(INPUT); } return this; } async #from_xml(INPUT) { let rt_packages = abap.types.TableFactory.construct(new abap.types.Structure({ "devclass": new abap.types.Character(30, {}), "component": new abap.types.Character(20, {}), "comp_posid": new abap.types.Character(24, {})}, "zif_abapgit_persist_packages=>ty_package", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"HASHED","isUnique":true,"keyFields":["DEVCLASS"]},"secondary":[]}, "zif_abapgit_persist_packages=>ty_packages"); let iv_xml = INPUT?.iv_xml; if (iv_xml?.getQualifiedName === undefined || iv_xml.getQualifiedName() !== "STRING") { iv_xml = undefined; } if (iv_xml === undefined) { iv_xml = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_xml); } let lo_input = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_XML_INPUT", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_XML_INPUT"}); lo_input.set(await (new abap.Classes['ZCL_ABAPGIT_XML_INPUT']()).constructor_({iv_xml: iv_xml})); await lo_input.get().zif_abapgit_xml_input$read({iv_name: abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].c_type_packages, cg_data: rt_packages}); return rt_packages; } async init() { try { this.#mt_packages.set((await this.#from_xml({iv_xml: (await (await abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].get_instance()).get().read({iv_type: abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].c_type_packages, iv_value: abap.CharacterFactory.get(1, '')}))}))); } catch (e) { if ((abap.Classes['ZCX_ABAPGIT_EXCEPTION'] && e instanceof abap.Classes['ZCX_ABAPGIT_EXCEPTION']) || (abap.Classes['ZCX_ABAPGIT_NOT_FOUND'] && e instanceof abap.Classes['ZCX_ABAPGIT_NOT_FOUND'])) { } else { throw e; } } } async #to_xml(INPUT) { let rv_xml = new abap.types.String({qualifiedName: "STRING"}); let it_packages = INPUT?.it_packages; if (it_packages?.getQualifiedName === undefined || it_packages.getQualifiedName() !== "ZIF_ABAPGIT_PERSIST_PACKAGES=>TY_PACKAGES") { it_packages = undefined; } if (it_packages === undefined) { it_packages = abap.types.TableFactory.construct(new abap.types.Structure({ "devclass": new abap.types.Character(30, {}), "component": new abap.types.Character(20, {}), "comp_posid": new abap.types.Character(24, {})}, "zif_abapgit_persist_packages=>ty_package", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"HASHED","isUnique":true,"keyFields":["DEVCLASS"]},"secondary":[]}, "zif_abapgit_persist_packages=>ty_packages").set(INPUT.it_packages); } let li_output = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_XML_OUTPUT", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_XML_OUTPUT"}); li_output.set(await (new abap.Classes['ZCL_ABAPGIT_XML_OUTPUT']()).constructor_()); await li_output.get().zif_abapgit_xml_output$add({iv_name: abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].c_type_packages, ig_data: it_packages}); rv_xml.set((await li_output.get().zif_abapgit_xml_output$render())); return rv_xml; } async zif_abapgit_persist_packages$modify(INPUT) { let iv_package = INPUT?.iv_package; if (iv_package === undefined) { iv_package = new abap.types.Character(30, {}).set(INPUT.iv_package); } let iv_component = new abap.types.Character(20, {}); if (INPUT && INPUT.iv_component) {iv_component.set(INPUT.iv_component);} let iv_comp_posid = new abap.types.Character(24, {}); if (INPUT && INPUT.iv_comp_posid) {iv_comp_posid.set(INPUT.iv_comp_posid);} let ls_package = new abap.types.Structure({ "devclass": new abap.types.Character(30, {}), "component": new abap.types.Character(20, {}), "comp_posid": new abap.types.Character(24, {})}, "zif_abapgit_persist_packages=>ty_package", undefined, {}, {}); let fs_ls_package_ = new abap.types.FieldSymbol(new abap.types.Structure({ "devclass": new abap.types.Character(30, {}), "component": new abap.types.Character(20, {}), "comp_posid": new abap.types.Character(24, {})}, "zif_abapgit_persist_packages=>ty_package", undefined, {}, {})); await this.init(); if (abap.compare.initial(iv_component) && abap.compare.initial(iv_comp_posid)) { await abap.statements.deleteInternal(this.#mt_packages,{where: async (I) => {return abap.compare.eq(I.devclass, iv_package);}}); } else { abap.statements.readTable(this.#mt_packages,{withTableKey: true, assigning: fs_ls_package_, withKey: (i) => {return abap.compare.eq(i.devclass, iv_package);}, withKeyValue: [{key: (i) => {return i.devclass}, value: iv_package}], usesTableLine: false, withKeySimple: {"devclass": iv_package}}); if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { fs_ls_package_.get().component.set(iv_component); fs_ls_package_.get().comp_posid.set(iv_comp_posid); } else { ls_package.get().devclass.set(iv_package); ls_package.get().component.set(iv_component); ls_package.get().comp_posid.set(iv_comp_posid); abap.statements.insertInternal({data: ls_package, table: this.#mt_packages}); } } await (await abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].get_instance()).get().modify({iv_type: abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].c_type_packages, iv_value: abap.CharacterFactory.get(1, ''), iv_data: (await this.#to_xml({it_packages: this.#mt_packages}))}); abap.statements.commit(); } async zif_abapgit_persist_packages$read(INPUT) { let rs_package = new abap.types.Structure({ "devclass": new abap.types.Character(30, {}), "component": new abap.types.Character(20, {}), "comp_posid": new abap.types.Character(24, {})}, "zif_abapgit_persist_packages=>ty_package", undefined, {}, {}); let iv_package = INPUT?.iv_package; if (iv_package === undefined) { iv_package = new abap.types.Character(30, {}).set(INPUT.iv_package); } await this.init(); abap.statements.readTable(this.#mt_packages,{withTableKey: true, into: rs_package, withKey: (i) => {return abap.compare.eq(i.devclass, iv_package);}, withKeyValue: [{key: (i) => {return i.devclass}, value: iv_package}], usesTableLine: false, withKeySimple: {"devclass": iv_package}}); if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { rs_package.get().devclass.set(iv_package); } return rs_package; } } abap.Classes['ZCL_ABAPGIT_PERSIST_PACKAGES'] = zcl_abapgit_persist_packages; export {zcl_abapgit_persist_packages}; |