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 | 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 1x 1x 1x 1x 1x 1x 1x 1x 1x | const {cx_root} = await import("./cx_root.clas.mjs"); // zcl_abapgit_background.clas.abap class zcl_abapgit_background { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'ZCL_ABAPGIT_BACKGROUND'; static IMPLEMENTED_INTERFACES = []; static ATTRIBUTES = {"C_ENQ_TYPE": {"type": () => {return new abap.types.Character(12, {});}, "visibility": "I", "is_constant": "X", "is_class": "X"}, "C_INTERFACE": {"type": () => {return new abap.types.Structure({ "clsname": new abap.types.Character(30, {"qualifiedName":"SEOCLSNAME","ddicName":"SEOCLSNAME","description":"SEOCLSNAME"})}, "SEOCLSKEY", "SEOCLSKEY", {}, {});}, "visibility": "I", "is_constant": "X", "is_class": "X"}}; static METHODS = {"RUN": {"visibility": "U", "parameters": {}}, "LIST_METHODS": {"visibility": "U", "parameters": {"RT_METHODS": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "class": new abap.types.Character(30, {"qualifiedName":"SEOCLSNAME","ddicName":"SEOCLSNAME","description":"SEOCLSNAME"}), "description": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_BACKGROUND=>TY_METHOD-DESCRIPTION"})}, "zcl_abapgit_background=>ty_method", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["CLASS"]},"secondary":[]}, "zcl_abapgit_background=>ty_methods");}, "is_optional": " "}}}, "ENQUEUE": {"visibility": "U", "parameters": {}}, "DEQUEUE": {"visibility": "U", "parameters": {}}}; constructor() { this.me = new abap.types.ABAPObject(); this.me.set(this); this.INTERNAL_ID = abap.internalIdCounter++; this.FRIENDS_ACCESS_INSTANCE = { }; this.c_enq_type = zcl_abapgit_background.c_enq_type; this.c_interface = zcl_abapgit_background.c_interface; } async constructor_(INPUT) { if (super.constructor_) { await super.constructor_(INPUT); } return this; } async dequeue() { return zcl_abapgit_background.dequeue(); } static async dequeue() { if (abap.FunctionModules['DEQUEUE_EZABAPGIT'] === 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['DEQUEUE_EZABAPGIT']({exporting: {type: zcl_abapgit_background.c_enq_type}}); } async enqueue() { return zcl_abapgit_background.enqueue(); } static async enqueue() { try { if (abap.FunctionModules['ENQUEUE_EZABAPGIT'] === 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['ENQUEUE_EZABAPGIT']({exporting: {mode_zabapgit: abap.CharacterFactory.get(1, 'E'), type: zcl_abapgit_background.c_enq_type, _scope: abap.CharacterFactory.get(1, '3')}}); abap.builtin.sy.get().subrc.set(0); } catch (e) { if (e.classic) { switch (e.classic.toUpperCase()) { case "FOREIGN_LOCK": abap.builtin.sy.get().subrc.set(1); break; case "SYSTEM_FAILURE": abap.builtin.sy.get().subrc.set(2); break; default: abap.builtin.sy.get().subrc.set(3); break; } } else { throw e; } } if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise_t100(); } } async list_methods() { return zcl_abapgit_background.list_methods(); } static async list_methods() { let rt_methods = abap.types.TableFactory.construct(new abap.types.Structure({ "class": new abap.types.Character(30, {"qualifiedName":"SEOCLSNAME","ddicName":"SEOCLSNAME","description":"SEOCLSNAME"}), "description": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_BACKGROUND=>TY_METHOD-DESCRIPTION"})}, "zcl_abapgit_background=>ty_method", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["CLASS"]},"secondary":[]}, "zcl_abapgit_background=>ty_methods"); let ls_method = new abap.types.Structure({ "class": new abap.types.Character(30, {"qualifiedName":"SEOCLSNAME","ddicName":"SEOCLSNAME","description":"SEOCLSNAME"}), "description": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_BACKGROUND=>TY_METHOD-DESCRIPTION"})}, "zcl_abapgit_background=>ty_method", undefined, {}, {}); let lt_implementing = (() => { throw new Error("Void type: SEOR_IMPLEMENTING_KEYS") })(); let ls_implementing = (() => { throw new Error("Void type: SEOR_IMPLEMENTING_KEYS") })(); let lt_interf = abap.types.TableFactory.construct(new abap.types.Structure({ "name": new abap.types.Character(30, {"qualifiedName":"abap_intfname"}), "is_inherited": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "abap_intfdescr", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["NAME"]},"secondary":[]}, "abap_intfdescr_tab"); let lt_local_classes = abap.types.TableFactory.construct((() => { throw new Error("Void type: SCOMPO") })(), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, ""); let lv_classname = new abap.types.String({qualifiedName: "STRING"}); let lr_typedescr = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TYPEDESCR", RTTIName: "\\CLASS=CL_ABAP_TYPEDESCR"}); let lr_typedescr_class = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_CLASSDESCR", RTTIName: "\\CLASS=CL_ABAP_CLASSDESCR"}); let fs_ls_local_class_ = new abap.types.FieldSymbol((() => { throw new Error("Void type: SCOMPO") })()); let fs_ls_method_ = new abap.types.FieldSymbol(new abap.types.Structure({ "class": new abap.types.Character(30, {"qualifiedName":"SEOCLSNAME","ddicName":"SEOCLSNAME","description":"SEOCLSNAME"}), "description": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_BACKGROUND=>TY_METHOD-DESCRIPTION"})}, "zcl_abapgit_background=>ty_method", undefined, {}, {})); if (abap.compare.eq((await (await abap.Classes['ZCL_ABAPGIT_FACTORY'].get_environment()).get().zif_abapgit_environment$is_merged()), abap.builtin.abap_true)) { if (abap.FunctionModules['WB_TREE_GET_OBJECTS'] === 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['WB_TREE_GET_OBJECTS']({exporting: {include: abap.CharacterFactory.get(1, ' '), otype: abap.CharacterFactory.get(1, 'L'), program: abap.builtin.sy.get().repid}, tables: {olist: lt_local_classes}}); for await (const unique13 of abap.statements.loop(lt_local_classes)) { fs_ls_local_class_.assign(unique13); lv_classname.set(new abap.types.String().set(`\\PROGRAM=${abap.templateFormatting(abap.builtin.sy.get().repid)}\\CLASS=${abap.templateFormatting(fs_ls_local_class_.get().name)}`)); try { lr_typedescr.set(await abap.Classes['CL_ABAP_TYPEDESCR'].describe_by_name({p_name: lv_classname})); abap.builtin.sy.get().subrc.set(0); } catch (e) { if (e.classic) { switch (e.classic.toUpperCase()) { case "TYPE_NOT_FOUND": abap.builtin.sy.get().subrc.set(1); break; default: abap.builtin.sy.get().subrc.set(2); break; } } else { throw e; } } if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)) && abap.compare.initial(lr_typedescr) === false) { await abap.statements.cast(lr_typedescr_class, lr_typedescr); if (abap.compare.initial(lr_typedescr_class) === false) { lt_interf.set(lr_typedescr_class.get().interfaces); abap.statements.readTable(lt_interf,{withTableKey: true, withKey: (i) => {return abap.compare.eq(i.name, zcl_abapgit_background.c_interface);}, withKeyValue: [{key: (i) => {return i.name}, value: zcl_abapgit_background.c_interface}], usesTableLine: false, withKeySimple: {"name": zcl_abapgit_background.c_interface}}); if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { ls_method.get().class.set(fs_ls_local_class_.get().name); abap.statements.insertInternal({data: ls_method, table: rt_methods}); } } } } } else { try { if (abap.FunctionModules['SEO_INTERFACE_IMPLEM_GET_ALL'] === 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['SEO_INTERFACE_IMPLEM_GET_ALL']({exporting: {intkey: zcl_abapgit_background.c_interface}, importing: {impkeys: lt_implementing}}); abap.builtin.sy.get().subrc.set(0); } catch (e) { if (e.classic) { switch (e.classic.toUpperCase()) { case "NOT_EXISTING": abap.builtin.sy.get().subrc.set(1); break; default: abap.builtin.sy.get().subrc.set(2); break; } } else { throw e; } } if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { for await (const unique14 of abap.statements.loop(lt_implementing)) { ls_implementing.set(unique14); ls_method.get().class.set(ls_implementing.get().clsname); abap.statements.insertInternal({data: ls_method, table: rt_methods}); } } } for await (const unique15 of abap.statements.loop(rt_methods)) { fs_ls_method_.assign(unique15); if (abap.Classes[fs_ls_method_.get().class.get().trimEnd()] === undefined) { if (abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_CLASS not found"; } else {throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'.trimEnd()](); } } fs_ls_method_.get().description.set(await abap.Classes[fs_ls_method_.get().class.get().trimEnd()].zif_abapgit_background$get_description()); } return rt_methods; } async run() { return zcl_abapgit_background.run(); } static async run() { let li_repo = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_REPO", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_REPO"}); let li_repo_online = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_REPO_ONLINE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_REPO_ONLINE"}); let lt_list = abap.types.TableFactory.construct(new abap.types.Structure({ "key": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}), "method": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSIST_BACKGROUND=>TY_XML-METHOD"}), "username": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSIST_BACKGROUND=>TY_XML-USERNAME"}), "password": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSIST_BACKGROUND=>TY_XML-PASSWORD"}), "settings": abap.types.TableFactory.construct(new abap.types.Structure({ "key": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_BACKGROUND=>TY_SETTINGS-KEY"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_BACKGROUND=>TY_SETTINGS-VALUE"})}, "zif_abapgit_background=>ty_settings", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_background=>ty_settings_tt")}, "zif_abapgit_persist_background=>ty_background", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_persist_background=>ty_background_keys"); let li_background = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_BACKGROUND", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_BACKGROUND"}); let li_log = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_LOG", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_LOG"}); let lx_error = new abap.types.ABAPObject({qualifiedName: "ZCX_ABAPGIT_EXCEPTION", RTTIName: "\\CLASS=ZCX_ABAPGIT_EXCEPTION"}); let lv_repo_name = new abap.types.String({qualifiedName: "STRING"}); let fs_ls_list_ = new abap.types.FieldSymbol(new abap.types.Structure({ "key": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}), "method": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSIST_BACKGROUND=>TY_XML-METHOD"}), "username": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSIST_BACKGROUND=>TY_XML-USERNAME"}), "password": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSIST_BACKGROUND=>TY_XML-PASSWORD"}), "settings": abap.types.TableFactory.construct(new abap.types.Structure({ "key": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_BACKGROUND=>TY_SETTINGS-KEY"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_BACKGROUND=>TY_SETTINGS-VALUE"})}, "zif_abapgit_background=>ty_settings", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_background=>ty_settings_tt")}, "zif_abapgit_persist_background=>ty_background", undefined, {}, {})); try { await this.enqueue(); } catch (e) { if ((abap.Classes['ZCX_ABAPGIT_EXCEPTION'] && e instanceof abap.Classes['ZCX_ABAPGIT_EXCEPTION'])) { abap.statements.write(abap.CharacterFactory.get(50, 'Another instance of the program is already running'),{newLine: true}); return; } else { throw e; } } lt_list.set((await (await abap.Classes['ZCL_ABAPGIT_PERSIST_FACTORY'].get_background()).get().zif_abapgit_persist_background$list())); abap.statements.write(abap.CharacterFactory.get(15, 'Background mode'),{newLine: true}); for await (const unique16 of abap.statements.loop(lt_list)) { fs_ls_list_.assign(unique16); li_log.set(await (new abap.Classes['ZCL_ABAPGIT_LOG']()).constructor_()); try { li_repo.set((await (await abap.Classes['ZCL_ABAPGIT_REPO_SRV'].get_instance()).get().zif_abapgit_repo_srv$get({iv_key: fs_ls_list_.get().key}))); await abap.statements.cast(li_repo_online, li_repo); lv_repo_name.set((await li_repo.get().zif_abapgit_repo$get_name())); abap.statements.write(fs_ls_list_.get().method,{newLine: true}); abap.statements.write(lv_repo_name); await abap.Classes['ZCL_ABAPGIT_LOGIN_MANAGER'].set({iv_uri: (await li_repo_online.get().zif_abapgit_repo_online$get_url()), iv_username: fs_ls_list_.get().username, iv_password: fs_ls_list_.get().password}); try { let unique17 = abap.Classes["CLAS-ZCL_ABAPGIT_BACKGROUND-"+fs_ls_list_.get().method.get().trimEnd()]; if (unique17 === undefined) { unique17 = abap.Classes[fs_ls_list_.get().method.get().trimEnd()]; } if (unique17 === undefined) { throw new abap.Classes['CX_SY_CREATE_OBJECT_ERROR']; } li_background.set(await (new unique17()).constructor_()); await li_background.get().zif_abapgit_background$run({ii_repo_online: li_repo_online, ii_log: li_log, it_settings: fs_ls_list_.get().settings}); } catch (e) { if ((abap.Classes['CX_SY_CREATE_OBJECT_ERROR'] && e instanceof abap.Classes['CX_SY_CREATE_OBJECT_ERROR'])) { await li_log.get().zif_abapgit_log$add_warning({iv_msg: abap.operators.concat(new abap.types.String().set(`${abap.templateFormatting(fs_ls_list_.get().method)} could not be executed,`),new abap.types.String().set(` as it is not accessible (local/global class).`))}); } else { throw e; } } await li_repo.get().zif_abapgit_repo$refresh({iv_drop_cache: abap.builtin.abap_true, iv_drop_log: abap.builtin.abap_false}); } catch (e) { if ((abap.Classes['ZCX_ABAPGIT_EXCEPTION'] && e instanceof abap.Classes['ZCX_ABAPGIT_EXCEPTION'])) { lx_error.set(e); await li_log.get().zif_abapgit_log$add_exception({ix_exc: lx_error}); } else { throw e; } } await abap.Classes['ZCL_ABAPGIT_LOGIN_MANAGER'].clear(); await abap.Classes['ZCL_ABAPGIT_LOG_VIEWER'].write_log({ii_log: li_log}); } if (abap.compare.eq(abap.builtin.lines({val: lt_list}), abap.IntegerFactory.get(0))) { abap.statements.write(abap.CharacterFactory.get(18, 'Nothing configured'),{newLine: true}); } await this.dequeue(); } } abap.Classes['ZCL_ABAPGIT_BACKGROUND'] = zcl_abapgit_background; zcl_abapgit_background.c_enq_type = new abap.types.Character(12, {}); zcl_abapgit_background.c_enq_type.set('BACKGROUND'); zcl_abapgit_background.c_interface = new abap.types.Structure({ "clsname": new abap.types.Character(30, {"qualifiedName":"SEOCLSNAME","ddicName":"SEOCLSNAME","description":"SEOCLSNAME"})}, "SEOCLSKEY", "SEOCLSKEY", {}, {}); zcl_abapgit_background.c_interface.set('ZIF_ABAPGIT_BACKGROUND'); zcl_abapgit_background.ty_method = new abap.types.Structure({ "class": new abap.types.Character(30, {"qualifiedName":"SEOCLSNAME","ddicName":"SEOCLSNAME","description":"SEOCLSNAME"}), "description": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_BACKGROUND=>TY_METHOD-DESCRIPTION"})}, "zcl_abapgit_background=>ty_method", undefined, {}, {}); zcl_abapgit_background.ty_methods = abap.types.TableFactory.construct(new abap.types.Structure({ "class": new abap.types.Character(30, {"qualifiedName":"SEOCLSNAME","ddicName":"SEOCLSNAME","description":"SEOCLSNAME"}), "description": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_BACKGROUND=>TY_METHOD-DESCRIPTION"})}, "zcl_abapgit_background=>ty_method", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["CLASS"]},"secondary":[]}, "zcl_abapgit_background=>ty_methods"); export {zcl_abapgit_background}; |