From 771f7f9d0b45b814dac80c2f9007706510a524ca Mon Sep 17 00:00:00 2001 From: oblomov-dev <102328295+oblomov-dev@users.noreply.github.com> Date: Sun, 27 Oct 2024 15:33:52 +0100 Subject: [PATCH] Refactoring2 (#1520) * update * update * update * update --- .github/workflows/clean_up.yaml | 36 - cleaner-profile.cfj => ci/cleaner-profile.cfj | 2 +- src/01/00/02/z2ui5_cl_abap_api.clas.abap | 276 +-- .../z2ui5_cl_abap_api.clas.testclasses.abap | 32 +- src/01/00/02/z2ui5_cl_abap_api_http.clas.abap | 79 +- src/01/00/02/z2ui5_cx_abap_api.clas.abap | 17 +- .../z2ui5_cx_abap_api.clas.testclasses.abap | 15 +- src/01/00/03/z2ui5_cl_util.clas.abap | 381 ++-- .../00/03/z2ui5_cl_util.clas.locals_imp.abap | 4 - .../00/03/z2ui5_cl_util.clas.testclasses.abap | 329 ++-- src/01/00/03/z2ui5_cx_util_error.clas.abap | 17 +- .../z2ui5_cx_util_error.clas.testclasses.abap | 15 +- src/01/01/z2ui5_cl_core_srv_draft.clas.abap | 61 +- ...i5_cl_core_srv_draft.clas.testclasses.abap | 18 +- src/01/02/z2ui5_cl_core_action.clas.abap | 38 +- ...z2ui5_cl_core_action.clas.testclasses.abap | 10 +- src/01/02/z2ui5_cl_core_app.clas.abap | 74 +- .../z2ui5_cl_core_app.clas.testclasses.abap | 26 +- src/01/02/z2ui5_cl_core_client.clas.abap | 192 +- ...z2ui5_cl_core_client.clas.testclasses.abap | 7 +- src/01/02/z2ui5_cl_core_handler.clas.abap | 49 +- ...2ui5_cl_core_handler.clas.testclasses.abap | 20 +- src/01/02/z2ui5_cl_core_srv_attri.clas.abap | 24 +- ...i5_cl_core_srv_attri.clas.testclasses.abap | 116 +- src/01/02/z2ui5_cl_core_srv_bind.clas.abap | 144 +- ...ui5_cl_core_srv_bind.clas.testclasses.abap | 180 +- src/01/02/z2ui5_cl_core_srv_diss.clas.abap | 66 +- ...ui5_cl_core_srv_diss.clas.testclasses.abap | 101 +- src/01/02/z2ui5_cl_core_srv_event.clas.abap | 28 +- ...i5_cl_core_srv_event.clas.testclasses.abap | 20 +- src/01/02/z2ui5_cl_core_srv_json.clas.abap | 82 +- ...ui5_cl_core_srv_json.clas.testclasses.abap | 40 +- src/01/02/z2ui5_cl_core_srv_util.clas.abap | 20 +- src/01/03/z2ui5_cl_app_app_js.clas.abap | 1568 ++++++++--------- src/01/03/z2ui5_cl_app_app_xml.clas.abap | 26 +- src/01/03/z2ui5_cl_app_component_js.clas.abap | 132 +- src/01/03/z2ui5_cl_app_debugtool_js.clas.abap | 296 ++-- .../03/z2ui5_cl_app_debugtool_xml.clas.abap | 220 ++- src/01/03/z2ui5_cl_app_index_html.clas.abap | 80 +- .../03/z2ui5_cl_app_manifest_json.clas.abap | 298 ++-- src/01/03/z2ui5_cl_app_models_js.clas.abap | 48 +- src/01/03/z2ui5_cl_app_server_js.clas.abap | 304 ++-- src/01/03/z2ui5_cl_app_style_css.clas.abap | 12 +- src/01/03/z2ui5_cl_app_view1_js.clas.abap | 998 +++++------ src/01/03/z2ui5_cl_app_view1_xml.clas.abap | 20 +- src/02/01/z2ui5_cl_pop_error.clas.abap | 26 +- src/02/01/z2ui5_cl_pop_file_dl.clas.abap | 71 +- src/02/01/z2ui5_cl_pop_file_ul.clas.abap | 70 +- src/02/01/z2ui5_cl_pop_get_range.clas.abap | 87 +- src/02/01/z2ui5_cl_pop_get_range_m.clas.abap | 26 +- src/02/01/z2ui5_cl_pop_html.clas.abap | 44 +- src/02/01/z2ui5_cl_pop_input_val.clas.abap | 64 +- src/02/01/z2ui5_cl_pop_itab_json_dl.clas.abap | 40 +- src/02/01/z2ui5_cl_pop_js_loader.clas.abap | 34 +- src/02/01/z2ui5_cl_pop_messages.clas.abap | 58 +- src/02/01/z2ui5_cl_pop_pdf.clas.abap | 71 +- src/02/01/z2ui5_cl_pop_table.clas.abap | 41 +- src/02/01/z2ui5_cl_pop_textedit.clas.abap | 49 +- src/02/01/z2ui5_cl_pop_to_confirm.clas.abap | 63 +- src/02/01/z2ui5_cl_pop_to_inform.clas.abap | 41 +- src/02/01/z2ui5_cl_pop_to_select.clas.abap | 180 +- ...z2ui5_cl_app_startup.clas.testclasses.abap | 7 +- .../z2ui5_cl_xml_view.clas.testclasses.abap | 10 +- src/02/z2ui5_if_app.intf.abap | 8 +- src/02/z2ui5_if_client.intf.abap | 92 +- src/02/z2ui5_if_types.intf.abap | 2 +- 66 files changed, 3486 insertions(+), 4119 deletions(-) delete mode 100644 .github/workflows/clean_up.yaml rename cleaner-profile.cfj => ci/cleaner-profile.cfj (99%) diff --git a/.github/workflows/clean_up.yaml b/.github/workflows/clean_up.yaml deleted file mode 100644 index 2048cc29..00000000 --- a/.github/workflows/clean_up.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: Clean-up ABAP Files - -on: - push: - branches: ["main"] - # pull_request: - # branches: ["main"] - - workflow_dispatch: - -jobs: - Code-Cleanup: - runs-on: ubuntu-latest - - steps: - - run: git config --global core.autocrlf true - - - name: Checkout - uses: actions/checkout@v3 - - - name: Download ABAP Cleaner (latest version) - run: | - mkdir .cleanup - cd .cleanup - wget -q -c https://github.com/SAP/abap-cleaner/releases/latest/download/com.sap.adt.abapcleaner.app-linux.gtk.x86_64.tar.gz -O - | tar -xz - cd .. - - - name: Clean-up files in /src - run: ./.cleanup/abapcleaner/abap-cleaner --sourcedir src --recursive --overwrite --profile cleaner-profile.cfj --release 750 --stats --usedrules - - - name: Commit changes - uses: EndBug/add-and-commit@v9 - with: - default_author: github_actions - message: "style: code cleanup with ABAP cleaner" - add: "src" \ No newline at end of file diff --git a/cleaner-profile.cfj b/ci/cleaner-profile.cfj similarity index 99% rename from cleaner-profile.cfj rename to ci/cleaner-profile.cfj index ccb0eabf..bc607e5a 100644 --- a/cleaner-profile.cfj +++ b/ci/cleaner-profile.cfj @@ -33,7 +33,7 @@ "RemoveIncludeWarnings": "1", "RemoveEmptyLineAboveEndClass": "0", "AddEmptyLineAboveSections": "1", - "RemoveEmptyLineBelowSections": "1", + "RemoveEmptyLineBelowSections": "0", "MaxEmptyLines": "1", "AddLineBetweenDefTypes": "2" } diff --git a/src/01/00/02/z2ui5_cl_abap_api.clas.abap b/src/01/00/02/z2ui5_cl_abap_api.clas.abap index e4d119b2..3900bf93 100644 --- a/src/01/00/02/z2ui5_cl_abap_api.clas.abap +++ b/src/01/00/02/z2ui5_cl_abap_api.clas.abap @@ -1,14 +1,14 @@ CLASS z2ui5_cl_abap_api DEFINITION PUBLIC - CREATE PUBLIC . + CREATE PUBLIC. PUBLIC SECTION. -* abap-api - Serving a Release & Version Independent ABAP Layer -* version: '0.0.1'. -* origin: https://github.com/oblomov-dev/abap-api -* author: https://github.com/oblomov-dev -* license: MIT. + " abap-api - Serving a Release & Version Independent ABAP Layer + " version: '0.0.1'. + " origin: https://github.com/oblomov-dev/abap-api + " author: https://github.com/oblomov-dev + " license: MIT. TYPES: BEGIN OF ty_s_fix_val, @@ -78,7 +78,7 @@ CLASS z2ui5_cl_abap_api DEFINITION short TYPE string, medium TYPE string, long TYPE string, - END OF ty_s_data_element_text . + END OF ty_s_data_element_text. TYPES: BEGIN OF ty_s_class_descr, @@ -180,9 +180,7 @@ CLASS z2ui5_cl_abap_api DEFINITION ENDCLASS. - CLASS z2ui5_cl_abap_api IMPLEMENTATION. - METHOD context_check_abap_cloud. TRY. @@ -211,14 +209,11 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. lv_langu = langu. CALL METHOD elemdescr->('GET_DDIC_FIXED_VALUES') - EXPORTING - p_langu = lv_langu - RECEIVING - p_fixed_values = lt_values - EXCEPTIONS - not_found = 1 - no_ddic_type = 2 - OTHERS = 3. + EXPORTING p_langu = lv_langu + RECEIVING p_fixed_values = lt_values + EXCEPTIONS not_found = 1 + no_ddic_type = 2 + OTHERS = 3. LOOP AT lt_values REFERENCE INTO DATA(lr_fix). @@ -237,50 +232,40 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. DATA(lv_web_http_name) = 'CL_WEB_HTTP_UTILITY'. CALL METHOD (lv_web_http_name)=>('DECODE_X_BASE64') - EXPORTING - encoded = val - RECEIVING - decoded = result. + EXPORTING encoded = val + RECEIVING decoded = result. CATCH cx_root. DATA(classname) = 'CL_HTTP_UTILITY'. CALL METHOD (classname)=>('DECODE_X_BASE64') - EXPORTING - encoded = val - RECEIVING - decoded = result. + EXPORTING encoded = val + RECEIVING decoded = result. ENDTRY. ENDMETHOD. - METHOD conv_encode_x_base64. TRY. DATA(lv_web_http_name) = 'CL_WEB_HTTP_UTILITY'. CALL METHOD (lv_web_http_name)=>('ENCODE_X_BASE64') - EXPORTING - unencoded = val - RECEIVING - encoded = result. + EXPORTING unencoded = val + RECEIVING encoded = result. CATCH cx_root. DATA(classname) = 'CL_HTTP_UTILITY'. CALL METHOD (classname)=>('ENCODE_X_BASE64') - EXPORTING - unencoded = val - RECEIVING - encoded = result. + EXPORTING unencoded = val + RECEIVING encoded = result. ENDTRY. ENDMETHOD. - METHOD conv_get_string_by_xstring. DATA conv TYPE REF TO object. @@ -288,34 +273,26 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. TRY. DATA(conv_codepage) = 'CL_ABAP_CONV_CODEPAGE'. CALL METHOD (conv_codepage)=>create_in - RECEIVING - instance = conv. + RECEIVING instance = conv. CALL METHOD conv->('IF_ABAP_CONV_IN~CONVERT') - EXPORTING - source = val - RECEIVING - result = result. + EXPORTING source = val + RECEIVING result = result. CATCH cx_root. DATA(conv_in_class) = 'CL_ABAP_CONV_IN_CE'. CALL METHOD (conv_in_class)=>create - EXPORTING - encoding = 'UTF-8' - RECEIVING - conv = conv. + EXPORTING encoding = 'UTF-8' + RECEIVING conv = conv. CALL METHOD conv->('CONVERT') - EXPORTING - input = val - IMPORTING - data = result. + EXPORTING input = val + IMPORTING data = result. ENDTRY. ENDMETHOD. - METHOD conv_get_xstring_by_string. DATA conv TYPE REF TO object. @@ -323,34 +300,26 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. TRY. DATA(conv_codepage) = 'CL_ABAP_CONV_CODEPAGE'. CALL METHOD (conv_codepage)=>create_out - RECEIVING - instance = conv. + RECEIVING instance = conv. CALL METHOD conv->('IF_ABAP_CONV_OUT~CONVERT') - EXPORTING - source = val - RECEIVING - result = result. + EXPORTING source = val + RECEIVING result = result. CATCH cx_root. DATA(conv_out_class) = 'CL_ABAP_CONV_OUT_CE'. CALL METHOD (conv_out_class)=>create - EXPORTING - encoding = 'UTF-8' - RECEIVING - conv = conv. + EXPORTING encoding = 'UTF-8' + RECEIVING conv = conv. CALL METHOD conv->('CONVERT') - EXPORTING - data = val - IMPORTING - buffer = result. + EXPORTING data = val + IMPORTING buffer = result. ENDTRY. ENDMETHOD. - METHOD source_get_method. DATA object TYPE REF TO object. @@ -365,45 +334,35 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. DATA(xco_cp_abap) = 'XCO_CP_ABAP'. CALL METHOD (xco_cp_abap)=>('CLASS') - EXPORTING - iv_name = lv_class - RECEIVING - ro_class = object. + EXPORTING iv_name = lv_class + RECEIVING ro_class = object. ASSIGN ('OBJECT->IF_XCO_AO_CLASS~IMPLEMENTATION') TO . ASSERT sy-subrc = 0. object = . CALL METHOD object->('IF_XCO_CLAS_IMPLEMENTATION~METHOD') - EXPORTING - iv_name = lv_method - RECEIVING - ro_method = object. + EXPORTING iv_name = lv_method + RECEIVING ro_method = object. CALL METHOD object->('IF_XCO_CLAS_I_METHOD~CONTENT') - RECEIVING - ro_content = object. + RECEIVING ro_content = object. CALL METHOD object->('IF_XCO_CLAS_I_METHOD_CONTENT~GET_SOURCE') - RECEIVING - rt_source = result. + RECEIVING rt_source = result. CATCH cx_root. DATA(lv_name) = 'CL_OO_FACTORY'. CALL METHOD (lv_name)=>('CREATE_INSTANCE') - RECEIVING - result = object. + RECEIVING result = object. CALL METHOD object->('IF_OO_CLIF_SOURCE_FACTORY~CREATE_CLIF_SOURCE') - EXPORTING - clif_name = lv_class - RECEIVING - result = object. + EXPORTING clif_name = lv_class + RECEIVING result = object. CALL METHOD object->('IF_OO_CLIF_SOURCE~GET_SOURCE') - IMPORTING - source = lt_source. + IMPORTING source = lt_source. DATA(lv_check_method) = abap_false. LOOP AT lt_source INTO DATA(lv_source). @@ -413,7 +372,7 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. lv_check_method = abap_false. ENDIF. - IF lv_source_upper CS `METHOD ` && lv_method. + IF lv_source_upper CS |METHOD { lv_method }|. lv_check_method = abap_true. CONTINUE. ENDIF. @@ -430,23 +389,22 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. ENDMETHOD. - METHOD rtti_get_classes_impl_intf. DATA obj TYPE REF TO object. FIELD-SYMBOLS TYPE any. DATA lt_implementation_names TYPE string_table. TYPES BEGIN OF ty_s_impl. - TYPES clsname TYPE c LENGTH 30. - TYPES refclsname TYPE c LENGTH 30. + TYPES clsname TYPE c LENGTH 30. + TYPES refclsname TYPE c LENGTH 30. TYPES END OF ty_s_impl. DATA lt_impl TYPE STANDARD TABLE OF ty_s_impl WITH DEFAULT KEY. TYPES BEGIN OF ty_s_key. - TYPES intkey TYPE c LENGTH 30. + TYPES intkey TYPE c LENGTH 30. TYPES END OF ty_s_key. DATA ls_key TYPE ty_s_key. DATA BEGIN OF ls_clskey. - DATA clsname TYPE c LENGTH 30. + DATA clsname TYPE c LENGTH 30. DATA END OF ls_clskey. DATA class TYPE REF TO data. @@ -456,10 +414,8 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. DATA(xco_cp_abap) = 'XCO_CP_ABAP'. CALL METHOD (xco_cp_abap)=>interface - EXPORTING - iv_name = ls_clskey-clsname - RECEIVING - ro_interface = obj. + EXPORTING iv_name = ls_clskey-clsname + RECEIVING ro_interface = obj. ASSIGN obj->('IF_XCO_AO_INTERFACE~IMPLEMENTATIONS') TO . IF sy-subrc <> 0. @@ -474,13 +430,11 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. obj = . CALL METHOD obj->('IF_XCO_INTF_IMPLEMENTATIONS~GET_NAMES') - RECEIVING - rt_names = lt_implementation_names. + RECEIVING rt_names = lt_implementation_names. - result = VALUE #( - FOR implementation_name IN lt_implementation_names - ( classname = implementation_name - description = rtti_get_class_descr_on_cloud( implementation_name ) ) ). + result = VALUE #( FOR implementation_name IN lt_implementation_names + ( classname = implementation_name + description = rtti_get_class_descr_on_cloud( implementation_name ) ) ). CATCH cx_root. @@ -488,13 +442,10 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. DATA(lv_fm) = `SEO_INTERFACE_IMPLEM_GET_ALL`. CALL FUNCTION lv_fm - EXPORTING - intkey = ls_key - IMPORTING - impkeys = lt_impl - EXCEPTIONS - not_existing = 1 - OTHERS = 2. + EXPORTING intkey = ls_key + IMPORTING impkeys = lt_impl + EXCEPTIONS not_existing = 1 + OTHERS = 2. IF sy-subrc <> 0. RETURN. ENDIF. @@ -511,10 +462,8 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. lv_fm = `SEO_CLASS_READ`. CALL FUNCTION lv_fm - EXPORTING - clskey = ls_clskey - IMPORTING - class = . + EXPORTING clskey = ls_clskey + IMPORTING class = . ASSIGN COMPONENT 'DESCRIPT' @@ -532,20 +481,18 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. ENDMETHOD. - METHOD rtti_get_data_element_texts. - DATA: - ddic_ref TYPE REF TO data, - data_element TYPE REF TO object, - content TYPE REF TO object, - BEGIN OF ddic, - reptext TYPE string, - scrtext_s TYPE string, - scrtext_m TYPE string, - scrtext_l TYPE string, - END OF ddic, - exists TYPE abap_bool. + DATA ddic_ref TYPE REF TO data. + DATA data_element TYPE REF TO object. + DATA content TYPE REF TO object. + DATA: BEGIN OF ddic, + reptext TYPE string, + scrtext_s TYPE string, + scrtext_m TYPE string, + scrtext_l TYPE string, + END OF ddic. + DATA exists TYPE abap_bool. DATA(data_element_name) = i_data_element_name. @@ -558,13 +505,9 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. ASSIGN ddic_ref->* TO FIELD-SYMBOL(). ASSERT sy-subrc = 0. - cl_abap_elemdescr=>describe_by_name( - EXPORTING - p_name = data_element_name - RECEIVING - p_descr_ref = DATA(lo_typedescr) - EXCEPTIONS - OTHERS = 1 ). + cl_abap_elemdescr=>describe_by_name( EXPORTING p_name = data_element_name + RECEIVING p_descr_ref = DATA(lo_typedescr) + EXCEPTIONS OTHERS = 1 ). IF sy-subrc <> 0. RETURN. ENDIF. @@ -572,12 +515,10 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. DATA(data_descr) = CAST cl_abap_datadescr( lo_typedescr ). CALL METHOD data_descr->('GET_DDIC_FIELD') - RECEIVING - p_flddescr = - EXCEPTIONS - not_found = 1 - no_ddic_type = 2 - OTHERS = 3. + RECEIVING p_flddescr = + EXCEPTIONS not_found = 1 + no_ddic_type = 2 + OTHERS = 3. IF sy-subrc <> 0. RETURN. ENDIF. @@ -592,38 +533,30 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. TRY. DATA(xco_cp_abap_dictionary) = 'XCO_CP_ABAP_DICTIONARY'. CALL METHOD (xco_cp_abap_dictionary)=>('DATA_ELEMENT') - EXPORTING - iv_name = data_element_name - RECEIVING - ro_data_element = data_element. + EXPORTING iv_name = data_element_name + RECEIVING ro_data_element = data_element. CALL METHOD data_element->('IF_XCO_AD_DATA_ELEMENT~EXISTS') - RECEIVING - rv_exists = exists. + RECEIVING rv_exists = exists. IF exists = abap_false. RETURN. ENDIF. CALL METHOD data_element->('IF_XCO_AD_DATA_ELEMENT~CONTENT') - RECEIVING - ro_content = content. + RECEIVING ro_content = content. CALL METHOD content->('IF_XCO_DTEL_CONTENT~GET_HEADING_FIELD_LABEL') - RECEIVING - rs_heading_field_label = result-header. + RECEIVING rs_heading_field_label = result-header. CALL METHOD content->('IF_XCO_DTEL_CONTENT~GET_SHORT_FIELD_LABEL') - RECEIVING - rs_short_field_label = result-short. + RECEIVING rs_short_field_label = result-short. CALL METHOD content->('IF_XCO_DTEL_CONTENT~GET_MEDIUM_FIELD_LABEL') - RECEIVING - rs_medium_field_label = result-medium. + RECEIVING rs_medium_field_label = result-medium. CALL METHOD content->('IF_XCO_DTEL_CONTENT~GET_LONG_FIELD_LABEL') - RECEIVING - rs_long_field_label = result-long. + RECEIVING rs_long_field_label = result-long. CATCH cx_root. ENDTRY. @@ -631,7 +564,6 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. ENDMETHOD. - METHOD uuid_get_c22. DATA lv_uuid TYPE c LENGTH 22. @@ -641,15 +573,13 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. TRY. DATA(lv_classname) = `CL_SYSTEM_UUID`. CALL METHOD (lv_classname)=>if_system_uuid_static~create_uuid_c22 - RECEIVING - uuid = lv_uuid. + RECEIVING uuid = lv_uuid. CATCH cx_sy_dyn_call_illegal_class. DATA(lv_fm) = `GUID_CREATE`. CALL FUNCTION lv_fm - IMPORTING - ev_guid_22 = lv_uuid. + IMPORTING ev_guid_22 = lv_uuid. ENDTRY. @@ -678,7 +608,6 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. ENDMETHOD. - METHOD uuid_get_c32. DATA lv_uuid TYPE c LENGTH 32. @@ -687,15 +616,13 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. TRY. DATA(lv_classname) = `CL_SYSTEM_UUID`. CALL METHOD (lv_classname)=>if_system_uuid_static~create_uuid_c32 - RECEIVING - uuid = lv_uuid. + RECEIVING uuid = lv_uuid. CATCH cx_root. DATA(lv_fm) = `GUID_CREATE`. CALL FUNCTION lv_fm - IMPORTING - ev_guid_32 = lv_uuid. + IMPORTING ev_guid_32 = lv_uuid. ENDTRY. @@ -706,33 +633,27 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. ENDTRY. ENDMETHOD. - METHOD rtti_get_class_descr_on_cloud. - DATA obj TYPE REF TO object. - DATA content TYPE REF TO object. + DATA obj TYPE REF TO object. + DATA content TYPE REF TO object. DATA lv_classname TYPE c LENGTH 30. lv_classname = i_classname. DATA(xco_cp_abap) = 'XCO_CP_ABAP'. CALL METHOD (xco_cp_abap)=>('CLASS') - EXPORTING - iv_name = lv_classname - RECEIVING - ro_class = obj. + EXPORTING iv_name = lv_classname + RECEIVING ro_class = obj. CALL METHOD obj->('IF_XCO_AO_CLASS~CONTENT') - RECEIVING - ro_content = content. + RECEIVING ro_content = content. CALL METHOD content->('IF_XCO_CLAS_CONTENT~GET_SHORT_DESCRIPTION') - RECEIVING - rv_short_description = result. + RECEIVING rv_short_description = result. ENDMETHOD. - METHOD rtti_get_t_attri_on_prem. DATA structdescr TYPE REF TO cl_abap_structdescr. @@ -762,8 +683,7 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. IF tabname IS INITIAL. RAISE EXCEPTION TYPE z2ui5_cx_abap_api - EXPORTING - val = `RTTI_BY_NAME_TAB_INITIAL`. + EXPORTING val = `RTTI_BY_NAME_TAB_INITIAL`. ENDIF. structdescr ?= cl_abap_structdescr=>describe_by_name( tabname ). @@ -927,7 +847,6 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. ENDMETHOD. - METHOD rtti_get_t_dfies_by_table_name. IF context_check_abap_cloud( ). @@ -937,6 +856,5 @@ CLASS z2ui5_cl_abap_api IMPLEMENTATION. ENDIF. ENDMETHOD. - ENDCLASS. diff --git a/src/01/00/02/z2ui5_cl_abap_api.clas.testclasses.abap b/src/01/00/02/z2ui5_cl_abap_api.clas.testclasses.abap index 36219edb..32e2a3db 100644 --- a/src/01/00/02/z2ui5_cl_abap_api.clas.testclasses.abap +++ b/src/01/00/02/z2ui5_cl_abap_api.clas.testclasses.abap @@ -1,26 +1,23 @@ -CLASS ltcl_test DEFINITION FINAL FOR TESTING - DURATION SHORT - RISK LEVEL HARMLESS. +CLASS ltcl_test DEFINITION FINAL + FOR TESTING RISK LEVEL HARMLESS DURATION SHORT. PRIVATE SECTION. - METHODS test_func_get_uuid_32 FOR TESTING RAISING cx_static_check. - METHODS test_func_get_uuid_22 FOR TESTING RAISING cx_static_check. - METHODS test_encoding FOR TESTING RAISING cx_static_check. - METHODS test_element_text FOR TESTING RAISING cx_static_check. - METHODS test_classes_impl_intf FOR TESTING RAISING cx_static_check. + METHODS test_func_get_uuid_32 FOR TESTING RAISING cx_static_check. + METHODS test_func_get_uuid_22 FOR TESTING RAISING cx_static_check. + METHODS test_encoding FOR TESTING RAISING cx_static_check. + METHODS test_element_text FOR TESTING RAISING cx_static_check. + METHODS test_classes_impl_intf FOR TESTING RAISING cx_static_check. ENDCLASS. CLASS ltcl_test IMPLEMENTATION. - METHOD test_func_get_uuid_32. DATA(lv_uuid) = z2ui5_cl_abap_api=>uuid_get_c32( ). cl_abap_unit_assert=>assert_not_initial( lv_uuid ). - cl_abap_unit_assert=>assert_equals( - act = 32 - exp = strlen( lv_uuid ) ). + cl_abap_unit_assert=>assert_equals( exp = strlen( lv_uuid ) + act = 32 ). ENDMETHOD. @@ -28,9 +25,8 @@ CLASS ltcl_test IMPLEMENTATION. DATA(lv_uuid) = z2ui5_cl_abap_api=>uuid_get_c22( ). cl_abap_unit_assert=>assert_not_initial( lv_uuid ). - cl_abap_unit_assert=>assert_equals( - act = 22 - exp = strlen( lv_uuid ) ). + cl_abap_unit_assert=>assert_equals( exp = strlen( lv_uuid ) + act = 22 ). ENDMETHOD. @@ -42,9 +38,8 @@ CLASS ltcl_test IMPLEMENTATION. DATA(lv_xstring2) = z2ui5_cl_abap_api=>conv_decode_x_base64( lv_string2 ). DATA(lv_string3) = z2ui5_cl_abap_api=>conv_get_string_by_xstring( lv_xstring2 ). - cl_abap_unit_assert=>assert_equals( - act = lv_string3 - exp = lv_string ). + cl_abap_unit_assert=>assert_equals( exp = lv_string + act = lv_string3 ). ENDMETHOD. @@ -69,5 +64,4 @@ CLASS ltcl_test IMPLEMENTATION. cl_abap_unit_assert=>assert_not_initial( mt_classes ). ENDMETHOD. - ENDCLASS. diff --git a/src/01/00/02/z2ui5_cl_abap_api_http.clas.abap b/src/01/00/02/z2ui5_cl_abap_api_http.clas.abap index b27b835a..08931934 100644 --- a/src/01/00/02/z2ui5_cl_abap_api_http.clas.abap +++ b/src/01/00/02/z2ui5_cl_abap_api_http.clas.abap @@ -35,7 +35,7 @@ CLASS z2ui5_cl_abap_api_http DEFINITION PUBLIC. METHODS set_status IMPORTING - code TYPE i + !code TYPE i reason TYPE clike. METHODS set_session_stateful @@ -54,19 +54,20 @@ CLASS z2ui5_cl_abap_api_http DEFINITION PUBLIC. METHODS set_header_field IMPORTING - n TYPE clike - v TYPE clike. + !n TYPE clike + v TYPE clike. - DATA mo_server_onprem TYPE REF TO object. - DATA mo_request_cloud TYPE REF TO object. + DATA mo_server_onprem TYPE REF TO object. + DATA mo_request_cloud TYPE REF TO object. DATA mo_response_cloud TYPE REF TO object. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. -CLASS z2ui5_cl_abap_api_http IMPLEMENTATION. +CLASS z2ui5_cl_abap_api_http IMPLEMENTATION. METHOD delete_response_cookie. DATA(lv_val) = CONV string( val ). @@ -80,8 +81,7 @@ CLASS z2ui5_cl_abap_api_http IMPLEMENTATION. object = . CALL METHOD object->('DELETE_COOKIE') - EXPORTING - name = lv_val. + EXPORTING name = lv_val. ELSE. @@ -97,6 +97,7 @@ CLASS z2ui5_cl_abap_api_http IMPLEMENTATION. DATA object TYPE REF TO object. FIELD-SYMBOLS TYPE any. + DATA(lv_val) = CONV string( val ). IF mo_server_onprem IS BOUND. @@ -105,10 +106,8 @@ CLASS z2ui5_cl_abap_api_http IMPLEMENTATION. object = . CALL METHOD object->('GET_COOKIE') - EXPORTING - name = lv_val - IMPORTING - value = result. + EXPORTING name = lv_val + IMPORTING value = result. ELSE. @@ -126,6 +125,7 @@ CLASS z2ui5_cl_abap_api_http IMPLEMENTATION. DATA object TYPE REF TO object. FIELD-SYMBOLS TYPE any. + DATA(lv_val) = CONV string( val ). IF mo_server_onprem IS BOUND. @@ -134,18 +134,14 @@ CLASS z2ui5_cl_abap_api_http IMPLEMENTATION. object = . CALL METHOD object->('GET_HEADER_FIELD') - EXPORTING - name = lv_val - RECEIVING - value = result. + EXPORTING name = lv_val + RECEIVING value = result. ELSE. CALL METHOD mo_request_cloud->('IF_WEB_HTTP_REQUEST~GET_HEADER_FIELD') - EXPORTING - i_name = lv_val - RECEIVING - r_value = result. + EXPORTING i_name = lv_val + RECEIVING r_value = result. ENDIF. @@ -164,16 +160,14 @@ CLASS z2ui5_cl_abap_api_http IMPLEMENTATION. object = . CALL METHOD object->('SET_HEADER_FIELD') - EXPORTING - name = lv_n - value = lv_v. + EXPORTING name = lv_n + value = lv_v. ELSE. CALL METHOD mo_response_cloud->('IF_WEB_HTTP_RESPONSE~SET_HEADER_FIELD') - EXPORTING - i_name = lv_n - i_value = lv_v. + EXPORTING i_name = lv_n + i_value = lv_v. ENDIF. @@ -205,14 +199,12 @@ CLASS z2ui5_cl_abap_api_http IMPLEMENTATION. object = . CALL METHOD object->('GET_CDATA') - RECEIVING - data = result. + RECEIVING data = result. ELSE. CALL METHOD mo_request_cloud->('IF_WEB_HTTP_REQUEST~GET_TEXT') - RECEIVING - r_value = result. + RECEIVING r_value = result. ENDIF. @@ -229,14 +221,12 @@ CLASS z2ui5_cl_abap_api_http IMPLEMENTATION. object = . CALL METHOD object->('IF_HTTP_REQUEST~GET_METHOD') - RECEIVING - method = result. + RECEIVING method = result. ELSE. CALL METHOD mo_request_cloud->('IF_WEB_HTTP_REQUEST~GET_METHOD') - RECEIVING - r_value = result. + RECEIVING r_value = result. ENDIF. @@ -253,14 +243,12 @@ CLASS z2ui5_cl_abap_api_http IMPLEMENTATION. object = . CALL METHOD object->('SET_CDATA') - EXPORTING - data = val. + EXPORTING data = val. ELSE. CALL METHOD mo_response_cloud->('IF_WEB_HTTP_RESPONSE~SET_TEXT') - EXPORTING - i_text = val. + EXPORTING i_text = val. ENDIF. @@ -270,6 +258,7 @@ CLASS z2ui5_cl_abap_api_http IMPLEMENTATION. DATA object TYPE REF TO object. FIELD-SYMBOLS TYPE any. + DATA(lv_reason) = CONV string( reason ). IF mo_server_onprem IS BOUND. @@ -278,16 +267,14 @@ CLASS z2ui5_cl_abap_api_http IMPLEMENTATION. object = . CALL METHOD object->('IF_HTTP_RESPONSE~SET_STATUS') - EXPORTING - code = code - reason = lv_reason. + EXPORTING code = code + reason = lv_reason. ELSE. CALL METHOD mo_response_cloud->('IF_WEB_HTTP_RESPONSE~SET_STATUS') - EXPORTING - i_code = code - i_reason = lv_reason. + EXPORTING i_code = code + i_reason = lv_reason. ENDIF. @@ -298,8 +285,7 @@ CLASS z2ui5_cl_abap_api_http IMPLEMENTATION. IF mo_server_onprem IS BOUND. CALL METHOD mo_server_onprem->('SET_SESSION_STATEFUL') - EXPORTING - stateful = val. + EXPORTING stateful = val. ELSE. @@ -308,5 +294,4 @@ CLASS z2ui5_cl_abap_api_http IMPLEMENTATION. ENDIF. ENDMETHOD. - ENDCLASS. diff --git a/src/01/00/02/z2ui5_cx_abap_api.clas.abap b/src/01/00/02/z2ui5_cx_abap_api.clas.abap index d478e1a0..a50c645e 100644 --- a/src/01/00/02/z2ui5_cx_abap_api.clas.abap +++ b/src/01/00/02/z2ui5_cx_abap_api.clas.abap @@ -1,8 +1,7 @@ CLASS z2ui5_cx_abap_api DEFINITION PUBLIC - INHERITING FROM cx_no_check - FINAL - CREATE PUBLIC . + INHERITING FROM cx_no_check FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -11,26 +10,23 @@ CLASS z2ui5_cx_abap_api DEFINITION x_root TYPE REF TO cx_root, * uuid TYPE string, text TYPE string, - END OF ms_error . + END OF ms_error. METHODS constructor IMPORTING - !val TYPE any OPTIONAL + val TYPE any OPTIONAL !previous TYPE REF TO cx_root OPTIONAL PREFERRED PARAMETER val. - METHODS if_message~get_text - REDEFINITION. + METHODS if_message~get_text REDEFINITION. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. - CLASS z2ui5_cx_abap_api IMPLEMENTATION. - - METHOD constructor ##ADT_SUPPRESS_GENERATION. super->constructor( previous = previous ). @@ -45,7 +41,6 @@ CLASS z2ui5_cx_abap_api IMPLEMENTATION. ENDMETHOD. - METHOD if_message~get_text. IF ms_error-x_root IS NOT INITIAL. diff --git a/src/01/00/02/z2ui5_cx_abap_api.clas.testclasses.abap b/src/01/00/02/z2ui5_cx_abap_api.clas.testclasses.abap index d4721576..2869c14e 100644 --- a/src/01/00/02/z2ui5_cx_abap_api.clas.testclasses.abap +++ b/src/01/00/02/z2ui5_cx_abap_api.clas.testclasses.abap @@ -1,6 +1,5 @@ -CLASS ltcl_unit_test DEFINITION FINAL FOR TESTING - DURATION SHORT - RISK LEVEL DANGEROUS. +CLASS ltcl_unit_test DEFINITION FINAL + FOR TESTING RISK LEVEL DANGEROUS DURATION SHORT. PRIVATE SECTION. METHODS test_raise FOR TESTING RAISING cx_static_check. @@ -8,21 +7,17 @@ ENDCLASS. CLASS ltcl_unit_test IMPLEMENTATION. - METHOD test_raise. TRY. RAISE EXCEPTION TYPE z2ui5_cx_abap_api - EXPORTING - val = `this is an error text`. + EXPORTING val = `this is an error text`. CATCH z2ui5_cx_abap_api INTO DATA(lx). - cl_abap_unit_assert=>assert_equals( - act = lx->get_text( ) - exp = `this is an error text` ). + cl_abap_unit_assert=>assert_equals( exp = `this is an error text` + act = lx->get_text( ) ). ENDTRY. ENDMETHOD. - ENDCLASS. diff --git a/src/01/00/03/z2ui5_cl_util.clas.abap b/src/01/00/03/z2ui5_cl_util.clas.abap index 46f6bbf4..5a70d750 100644 --- a/src/01/00/03/z2ui5_cl_util.clas.abap +++ b/src/01/00/03/z2ui5_cl_util.clas.abap @@ -1,15 +1,15 @@ CLASS z2ui5_cl_util DEFINITION PUBLIC - CREATE PUBLIC - INHERITING FROM z2ui5_cl_abap_api. + INHERITING FROM z2ui5_cl_abap_api + CREATE PUBLIC. PUBLIC SECTION. -* abap-toolkit - Utility Functions for ABAP Cloud & Standard ABAP -* version: '0.0.1'. -* origin: https://github.com/oblomov-dev/abap-toolkit -* author: https://github.com/oblomov-dev -* license: MIT. + " abap-toolkit - Utility Functions for ABAP Cloud & Standard ABAP + " version: '0.0.1'. + " origin: https://github.com/oblomov-dev/abap-toolkit + " author: https://github.com/oblomov-dev + " license: MIT. TYPES: BEGIN OF ty_s_name_value, @@ -85,7 +85,7 @@ CLASS z2ui5_cl_util DEFINITION CLASS-METHODS rtti_get_t_attri_by_include IMPORTING - type TYPE REF TO cl_abap_datadescr + !type TYPE REF TO cl_abap_datadescr RETURNING VALUE(result) TYPE abap_component_tab. @@ -153,9 +153,9 @@ CLASS z2ui5_cl_util DEFINITION CLASS-METHODS filter_itab IMPORTING - filter TYPE ty_t_filter_multi + !filter TYPE ty_t_filter_multi CHANGING - val TYPE STANDARD TABLE. + val TYPE STANDARD TABLE. CLASS-METHODS filter_get_multi_by_data IMPORTING @@ -175,7 +175,6 @@ CLASS z2ui5_cl_util DEFINITION RETURNING VALUE(result) TYPE string. - CLASS-METHODS filter_get_sql_by_sql_string IMPORTING val TYPE clike @@ -184,20 +183,20 @@ CLASS z2ui5_cl_util DEFINITION CLASS-METHODS url_param_get IMPORTING - !val TYPE string - !url TYPE string + val TYPE string + url TYPE string RETURNING VALUE(result) TYPE string. CLASS-METHODS url_param_create_url IMPORTING - !t_params TYPE ty_t_name_value + t_params TYPE ty_t_name_value RETURNING VALUE(result) TYPE string. CLASS-METHODS url_param_set IMPORTING - !url TYPE string + url TYPE string !name TYPE string !value TYPE string RETURNING @@ -223,7 +222,7 @@ CLASS z2ui5_cl_util DEFINITION CLASS-METHODS x_check_raise IMPORTING - !v TYPE clike DEFAULT `CX_SY_SUBRC` + v TYPE clike DEFAULT `CX_SY_SUBRC` !when TYPE xfeld. CLASS-METHODS x_raise @@ -237,19 +236,19 @@ CLASS z2ui5_cl_util DEFINITION CLASS-METHODS json_stringify IMPORTING - any TYPE any + !any TYPE any RETURNING VALUE(result) TYPE string. CLASS-METHODS xml_parse IMPORTING - xml TYPE clike + !xml TYPE clike EXPORTING - any TYPE any. + !any TYPE any. CLASS-METHODS xml_stringify IMPORTING - any TYPE any + !any TYPE any RETURNING VALUE(result) TYPE string RAISING @@ -269,9 +268,9 @@ CLASS z2ui5_cl_util DEFINITION CLASS-METHODS json_parse IMPORTING - val TYPE any + val TYPE any CHANGING - data TYPE any. + !data TYPE any. CLASS-METHODS c_trim_upper IMPORTING @@ -281,7 +280,7 @@ CLASS z2ui5_cl_util DEFINITION CLASS-METHODS xml_srtti_stringify IMPORTING - data TYPE any + !data TYPE any RETURNING VALUE(result) TYPE string. @@ -297,8 +296,8 @@ CLASS z2ui5_cl_util DEFINITION CLASS-METHODS time_substract_seconds IMPORTING - time TYPE timestampl - seconds TYPE i + !time TYPE timestampl + !seconds TYPE i RETURNING VALUE(result) TYPE timestampl. @@ -377,7 +376,7 @@ CLASS z2ui5_cl_util DEFINITION CLASS-METHODS filter_update_tokens IMPORTING val TYPE ty_t_filter_multi - name TYPE string + !name TYPE string RETURNING VALUE(result) TYPE ty_t_filter_multi. @@ -405,21 +404,21 @@ CLASS z2ui5_cl_util DEFINITION CLASS-METHODS itab_corresponding IMPORTING - val TYPE STANDARD TABLE + val TYPE STANDARD TABLE CHANGING - tab TYPE STANDARD TABLE. + !tab TYPE STANDARD TABLE. CLASS-METHODS itab_filter_by_val IMPORTING - val TYPE clike + val TYPE clike CHANGING - tab TYPE STANDARD TABLE. + !tab TYPE STANDARD TABLE. CLASS-METHODS itab_filter_by_t_range IMPORTING - val TYPE ty_t_filter_multi + val TYPE ty_t_filter_multi CHANGING - tab TYPE STANDARD TABLE. + !tab TYPE STANDARD TABLE. CLASS-METHODS time_get_time_by_stampl IMPORTING @@ -435,7 +434,7 @@ CLASS z2ui5_cl_util DEFINITION CLASS-METHODS conv_copy_ref_data IMPORTING - from TYPE any + !from TYPE any RETURNING VALUE(result) TYPE REF TO data. @@ -445,11 +444,12 @@ CLASS z2ui5_cl_util DEFINITION CLASS-METHODS rtti_tab_get_relative_name IMPORTING - table TYPE any + !table TYPE any RETURNING VALUE(result) TYPE string. CLASS-METHODS check_raise_srtti_installed. + CLASS-METHODS rtti_check_clike IMPORTING val TYPE any @@ -457,15 +457,13 @@ CLASS z2ui5_cl_util DEFINITION VALUE(result) TYPE abap_bool. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. - CLASS z2ui5_cl_util IMPLEMENTATION. - - METHOD boolean_abap_2_json. IF boolean_check_by_data( val ). @@ -476,7 +474,6 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD boolean_check_by_data. TRY. @@ -487,7 +484,6 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD boolean_check_by_name. CASE val. @@ -505,7 +501,6 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD check_bound_a_not_inital. IF val IS NOT BOUND. @@ -516,7 +511,6 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD check_unassign_inital. IF val IS INITIAL. @@ -531,10 +525,9 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD conv_copy_ref_data. - FIELD-SYMBOLS TYPE data. + FIELD-SYMBOLS TYPE data. FIELD-SYMBOLS TYPE data. IF rtti_check_ref_data( from ). @@ -549,14 +542,12 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD conv_get_as_data_ref. GET REFERENCE OF val INTO result. ENDMETHOD. - METHOD c_trim. result = shift_left( shift_right( CONV string( val ) ) ). @@ -568,21 +559,18 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD c_trim_lower. result = to_lower( c_trim( CONV string( val ) ) ). ENDMETHOD. - METHOD c_trim_upper. result = to_upper( c_trim( CONV string( val ) ) ). ENDMETHOD. - METHOD filter_itab. DATA ref TYPE REF TO data. @@ -606,7 +594,6 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD filter_get_multi_by_data. LOOP AT rtti_get_t_attri_by_any( val ) REFERENCE INTO DATA(lr_comp). @@ -615,32 +602,43 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD filter_get_range_by_token. DATA(lv_length) = strlen( value ) - 1. CASE value(1). WHEN `=`. - result = VALUE #( sign = `I` option = `EQ` low = value+1 ). + result = VALUE #( sign = `I` + option = `EQ` + low = value+1 ). WHEN `<`. IF value+1(1) = `=`. - result = VALUE #( sign = `I` option = `LE` low = value+2 ). + result = VALUE #( sign = `I` + option = `LE` + low = value+2 ). ELSE. - result = VALUE #( sign = `I` option = `LT` low = value+1 ). + result = VALUE #( sign = `I` + option = `LT` + low = value+1 ). ENDIF. WHEN `>`. IF value+1(1) = `=`. - result = VALUE #( sign = `I` option = `GE` low = value+2 ). + result = VALUE #( sign = `I` + option = `GE` + low = value+2 ). ELSE. - result = VALUE #( sign = `I` option = `GT` low = value+1 ). + result = VALUE #( sign = `I` + option = `GT` + low = value+1 ). ENDIF. WHEN `*`. IF value+lv_length(1) = `*`. SHIFT value RIGHT DELETING TRAILING `*`. SHIFT value LEFT DELETING LEADING `*`. - result = VALUE #( sign = `I` option = `CP` low = value ). + result = VALUE #( sign = `I` + option = `CP` + low = value ). ENDIF. WHEN OTHERS. @@ -648,14 +646,15 @@ CLASS z2ui5_cl_util IMPLEMENTATION. SPLIT value AT `...` INTO result-low result-high. result-option = `BT`. ELSE. - result = VALUE #( sign = `I` option = `EQ` low = value ). + result = VALUE #( sign = `I` + option = `EQ` + low = value ). ENDIF. ENDCASE. ENDMETHOD. - METHOD filter_update_tokens. result = val. @@ -665,12 +664,16 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDLOOP. LOOP AT lr_filter->t_token_added INTO ls_token. - INSERT VALUE #( key = ls_token-key text = ls_token-text visible = abap_true editable = abap_true ) INTO TABLE lr_filter->t_token. + INSERT VALUE #( key = ls_token-key + text = ls_token-text + visible = abap_true + editable = abap_true ) INTO TABLE lr_filter->t_token. ENDLOOP. CLEAR lr_filter->t_token_removed. CLEAR lr_filter->t_token_added. + " TODO: variable is assigned but never used (ABAP cleaner) DATA(lt_token) = result[ name = name ]-t_token. DATA(lt_range) = z2ui5_cl_util=>filter_get_range_t_by_token_t( result[ name = name ]-t_token ). lr_filter->t_range = lt_range. @@ -685,35 +688,29 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD filter_get_token_range_mapping. - result = VALUE #( - ( n = `EQ` v = `={LOW}` ) - ( n = `LT` v = `<{LOW}` ) - ( n = `LE` v = `<={LOW}` ) - ( n = `GT` v = `>{LOW}` ) - ( n = `GE` v = `>={LOW}` ) - ( n = `CP` v = `*{LOW}*` ) - ( n = `BT` v = `{LOW}...{HIGH}` ) - ( n = `NE` v = `!(={LOW})` ) - ( n = `NE` v = `!()` ) - ( n = `` v = `` ) ). + result = VALUE #( ( n = `EQ` v = `={LOW}` ) + ( n = `LT` v = `<{LOW}` ) + ( n = `LE` v = `<={LOW}` ) + ( n = `GT` v = `>{LOW}` ) + ( n = `GE` v = `>={LOW}` ) + ( n = `CP` v = `*{LOW}*` ) + ( n = `BT` v = `{LOW}...{HIGH}` ) + ( n = `NE` v = `!(={LOW})` ) + ( n = `NE` v = `!()` ) + ( n = `` v = `` ) ). ENDMETHOD. - METHOD filter_get_token_t_by_range_t. DATA(lt_mapping) = filter_get_token_range_mapping( ). DATA(lt_tab) = VALUE ty_t_range( ). - itab_corresponding( - EXPORTING - val = val - CHANGING - tab = lt_tab + itab_corresponding( EXPORTING val = val + CHANGING tab = lt_tab ). LOOP AT lt_tab REFERENCE INTO DATA(lr_row). @@ -722,12 +719,14 @@ CLASS z2ui5_cl_util IMPLEMENTATION. REPLACE `{LOW}` IN lv_value WITH lr_row->low. REPLACE `{HIGH}` IN lv_value WITH lr_row->high. - INSERT VALUE #( key = lv_value text = lv_value visible = abap_true editable = abap_true ) INTO TABLE result. + INSERT VALUE #( key = lv_value + text = lv_value + visible = abap_true + editable = abap_true ) INTO TABLE result. ENDLOOP. ENDMETHOD. - METHOD itab_filter_by_val. FIELD-SYMBOLS TYPE any. @@ -751,17 +750,17 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD itab_get_csv_by_itab. FIELD-SYMBOLS TYPE table. + ASSIGN val TO . DATA(tab) = CAST cl_abap_tabledescr( cl_abap_typedescr=>describe_by_data( ) ). DATA(struc) = CAST cl_abap_structdescr( tab->get_table_line_type( ) ). LOOP AT struc->get_components( ) REFERENCE INTO DATA(lr_comp). - result = result && lr_comp->name && ';'. + result = |{ result }{ lr_comp->name };|. ENDLOOP. result = result && cl_abap_char_utilities=>cr_lf. @@ -777,14 +776,13 @@ CLASS z2ui5_cl_util IMPLEMENTATION. EXIT. ENDIF. lv_index = lv_index + 1. - result = result && && ';'. + result = |{ result }{ };|. ENDDO. result = result && cl_abap_char_utilities=>cr_lf. ENDLOOP. ENDMETHOD. - METHOD itab_get_itab_by_csv. DATA lt_comp TYPE cl_abap_structdescr=>component_table. @@ -794,20 +792,19 @@ CLASS z2ui5_cl_util IMPLEMENTATION. SPLIT val AT cl_abap_char_utilities=>newline INTO TABLE DATA(lt_rows). SPLIT lt_rows[ 1 ] AT ';' INTO TABLE DATA(lt_cols). - LOOP AT lt_cols REFERENCE INTO DATA(lr_col). DATA(lv_name) = c_trim_upper( lr_col->* ). REPLACE ` ` IN lv_name WITH `_`. - INSERT VALUE #( name = lv_name type = cl_abap_elemdescr=>get_c( 40 ) ) INTO TABLE lt_comp. + INSERT VALUE #( name = lv_name + type = cl_abap_elemdescr=>get_c( 40 ) ) INTO TABLE lt_comp. ENDLOOP. DATA(struc) = cl_abap_structdescr=>get( lt_comp ). - DATA(o_table_desc) = cl_abap_tabledescr=>create( - p_line_type = CAST #( struc ) - p_table_kind = cl_abap_tabledescr=>tablekind_std - p_unique = abap_false ). + DATA(o_table_desc) = cl_abap_tabledescr=>create( p_line_type = CAST #( struc ) + p_table_kind = cl_abap_tabledescr=>tablekind_std + p_unique = abap_false ). CREATE DATA result TYPE HANDLE o_table_desc. ASSIGN result->* TO . @@ -830,42 +827,34 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD json_parse. TRY. - z2ui5_cl_ajson=>parse( val )->to_abap( - EXPORTING - iv_corresponding = abap_true - IMPORTING - ev_container = data ). + z2ui5_cl_ajson=>parse( val )->to_abap( EXPORTING iv_corresponding = abap_true + IMPORTING ev_container = data ). CATCH cx_root INTO DATA(x). ASSERT x IS NOT BOUND. ENDTRY. ENDMETHOD. - METHOD json_stringify. TRY. DATA(li_ajson) = CAST z2ui5_if_ajson( z2ui5_cl_ajson=>create_empty( ) ). - result = li_ajson->set( iv_path = `/` iv_val = any )->stringify( ). + result = li_ajson->set( iv_path = `/` + iv_val = any )->stringify( ). CATCH cx_root INTO DATA(x). ASSERT x IS NOT BOUND. ENDTRY. ENDMETHOD. - METHOD rtti_check_class_exists. TRY. - cl_abap_classdescr=>describe_by_name( - EXPORTING - p_name = val - EXCEPTIONS - type_not_found = 1 ). + cl_abap_classdescr=>describe_by_name( EXPORTING p_name = val + EXCEPTIONS type_not_found = 1 ). IF sy-subrc = 0. result = abap_true. ENDIF. @@ -876,7 +865,6 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD rtti_check_ref_data. TRY. @@ -888,7 +876,6 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD rtti_check_type_kind_dref. DATA(lv_type_kind) = cl_abap_datadescr=>get_data_type_kind( val ). @@ -896,44 +883,41 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD rtti_get_classname_by_ref. DATA(lv_classname) = cl_abap_classdescr=>get_class_name( in ). - result = substring_after( val = lv_classname sub = `\CLASS=` ). + result = substring_after( val = lv_classname + sub = `\CLASS=` ). ENDMETHOD. - METHOD rtti_get_intfname_by_ref. - DATA(rtti) = cl_abap_typedescr=>describe_by_data( in ). + DATA(rtti) = cl_abap_typedescr=>describe_by_data( in ). DATA(ref) = CAST cl_abap_refdescr( rtti ). DATA(name) = ref->get_referenced_type( )->absolute_name. - result = substring_after( val = name sub = `\INTERFACE=` ). + result = substring_after( val = name + sub = `\INTERFACE=` ). ENDMETHOD. - METHOD rtti_get_type_kind. result = cl_abap_datadescr=>get_data_type_kind( val ). ENDMETHOD. - METHOD rtti_get_type_name. TRY. DATA(lo_descr) = cl_abap_elemdescr=>describe_by_data( val ). DATA(lo_ele) = CAST cl_abap_elemdescr( lo_descr ). - result = lo_ele->get_relative_name( ). + result = lo_ele->get_relative_name( ). CATCH cx_root. ENDTRY. ENDMETHOD. - METHOD rtti_get_t_attri_by_include. DATA(sdescr) = CAST cl_abap_structdescr( cl_abap_typedescr=>describe_by_name( type->absolute_name ) ). @@ -961,7 +945,6 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD rtti_get_t_attri_by_oref. DATA(lo_obj_ref) = cl_abap_objectdescr=>describe_by_object_ref( val ). @@ -969,7 +952,6 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD rtti_get_t_attri_by_any. TRY. @@ -993,7 +975,7 @@ CLASS z2ui5_cl_util IMPLEMENTATION. result = lo_struct->get_components( ). LOOP AT result REFERENCE INTO DATA(lr_comp) - WHERE as_include = abap_true. + WHERE as_include = abap_true. DATA(lt_attri) = rtti_get_t_attri_by_include( lr_comp->type ). @@ -1003,7 +985,6 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD rtti_get_t_ddic_fixed_values. IF rollname IS INITIAL. @@ -1022,16 +1003,14 @@ CLASS z2ui5_cl_util IMPLEMENTATION. DATA(elemdescr) = CAST cl_abap_elemdescr( typedescr ). - result = rtti_get_t_fixvalues( - elemdescr = elemdescr - langu = langu ). + result = rtti_get_t_fixvalues( elemdescr = elemdescr + langu = langu ). CATCH cx_root. ENDTRY. ENDMETHOD. - METHOD rtti_tab_get_relative_name. FIELD-SYMBOLS TYPE any. @@ -1058,32 +1037,28 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD source_get_file_types. - DATA(lv_types) = `abap, abc, actionscript, ada, apache_conf, applescript, asciidoc, assembly_x86, autohotkey, batchfile, bro, c9search, c_cpp, cirru, clojure, cobol, coffee, coldfusion, csharp, css, curly, d, dart, diff, django, dockerfile, ` && -`dot, drools, eiffel, yaml, ejs, elixir, elm, erlang, forth, fortran, ftl, gcode, gherkin, gitignore, glsl, gobstones, golang, groovy, haml, handlebars, haskell, haskell_cabal, haxe, hjson, html, html_elixir, html_ruby, ini, io, jack, jade, java, ja` && - `vascri` && -`pt, json, jsoniq, jsp, jsx, julia, kotlin, latex, lean, less, liquid, lisp, live_script, livescript, logiql, lsl, lua, luapage, lucene, makefile, markdown, mask, matlab, mavens_mate_log, maze, mel, mips_assembler, mipsassembler, mushcode, mysql, ni` && -`x, nsis, objectivec, ocaml, pascal, perl, pgsql, php, plain_text, powershell, praat, prolog, properties, protobuf, python, r, razor, rdoc, rhtml, rst, ruby, rust, sass, scad, scala, scheme, scss, sh, sjs, smarty, snippets, soy_template, space, sql,` && - ` sqlserver, stylus, svg, swift, swig, tcl, tex, text, textile, toml, tsx, twig, typescript, vala, vbscript, velocity, verilog, vhdl, wollok, xml, xquery, terraform, slim, redshift, red, puppet, php_laravel_blade, mixal, jssm, fsharp, edifact,` && - ` csp, cssound_score, cssound_orchestra, cssound_document`. + DATA(lv_types) = |abap, abc, actionscript, ada, apache_conf, applescript, asciidoc, assembly_x86, autohotkey, batchfile, bro, c9search, c_cpp, cirru, clojure, cobol, coffee, coldfusion, csharp, css, curly, d, dart, diff, django, dockerfile, | && +|dot, drools, eiffel, yaml, ejs, elixir, elm, erlang, forth, fortran, ftl, gcode, gherkin, gitignore, glsl, gobstones, golang, groovy, haml, handlebars, haskell, haskell_cabal, haxe, hjson, html, html_elixir, html_ruby, ini, io, jack, jade, java, ja| && + |vascri| && +|pt, json, jsoniq, jsp, jsx, julia, kotlin, latex, lean, less, liquid, lisp, live_script, livescript, logiql, lsl, lua, luapage, lucene, makefile, markdown, mask, matlab, mavens_mate_log, maze, mel, mips_assembler, mipsassembler, mushcode, mysql, ni| && +|x, nsis, objectivec, ocaml, pascal, perl, pgsql, php, plain_text, powershell, praat, prolog, properties, protobuf, python, r, razor, rdoc, rhtml, rst, ruby, rust, sass, scad, scala, scheme, scss, sh, sjs, smarty, snippets, soy_template, space, sql,| && + | sqlserver, stylus, svg, swift, swig, tcl, tex, text, textile, toml, tsx, twig, typescript, vala, vbscript, velocity, verilog, vhdl, wollok, xml, xquery, terraform, slim, redshift, red, puppet, php_laravel_blade, mixal, jssm, fsharp, edifact,| && + | csp, cssound_score, cssound_orchestra, cssound_document|. SPLIT lv_types AT ',' INTO TABLE result. ENDMETHOD. - METHOD source_get_method2. - DATA(lt_source) = source_get_method( - iv_classname = iv_classname - iv_methodname = iv_methodname ). + DATA(lt_source) = source_get_method( iv_classname = iv_classname + iv_methodname = iv_methodname ). result = source_method_to_file( lt_source ). ENDMETHOD. - METHOD source_method_to_file. LOOP AT it_source INTO DATA(lv_source). @@ -1095,11 +1070,10 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD filter_get_sql_by_sql_string. DATA(lv_sql) = CONV string( val ). - REPLACE ALL OCCURRENCES OF ` ` IN lv_sql WITH ``. + REPLACE ALL OCCURRENCES OF ` ` IN lv_sql WITH ``. lv_sql = to_upper( lv_sql ). SPLIT lv_sql AT 'SELECTFROM' INTO DATA(lv_dummy) DATA(lv_tab). SPLIT lv_tab AT `FIELDS` INTO lv_tab lv_dummy. @@ -1108,58 +1082,54 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD time_get_date_by_stampl. + " TODO: variable is assigned but never used (ABAP cleaner) CONVERT TIME STAMP val TIME ZONE sy-zonlo INTO DATE result TIME DATA(lv_dummy). ENDMETHOD. - METHOD time_get_timestampl. GET TIME STAMP FIELD result. ENDMETHOD. - METHOD time_get_time_by_stampl. + " TODO: variable is assigned but never used (ABAP cleaner) CONVERT TIME STAMP val TIME ZONE sy-zonlo INTO DATE DATA(lv_dummy) TIME result. ENDMETHOD. - METHOD time_substract_seconds. result = cl_abap_tstmp=>subtractsecs( tstmp = time secs = seconds ). ENDMETHOD. - METHOD unassign_data. FIELD-SYMBOLS TYPE any. + ASSIGN val->* TO . result = . ENDMETHOD. - METHOD unassign_object. FIELD-SYMBOLS TYPE any. + ASSIGN val->* TO . result = . ENDMETHOD. - METHOD url_param_create_url. LOOP AT t_params INTO DATA(ls_param). - result = result && ls_param-n && `=` && ls_param-v && `&`. + result = |{ result }{ ls_param-n }={ ls_param-v }&|. ENDLOOP. result = shift_right( val = result sub = `&` ). ENDMETHOD. - METHOD url_param_get. DATA(lt_params) = url_param_get_tab( url ). @@ -1168,7 +1138,6 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD url_param_get_tab. DATA(lv_search) = replace( val = i_val @@ -1199,44 +1168,42 @@ CLASS z2ui5_cl_util IMPLEMENTATION. LOOP AT lt_param REFERENCE INTO DATA(lr_param). SPLIT lr_param->* AT `=` INTO DATA(lv_name) DATA(lv_value). - INSERT VALUE #( n = c_trim_lower( lv_name ) v = c_trim_lower( lv_value ) ) INTO TABLE rt_params. + INSERT VALUE #( n = c_trim_lower( lv_name ) + v = c_trim_lower( lv_value ) ) INTO TABLE rt_params. ENDLOOP. ENDMETHOD. - METHOD url_param_set. DATA(lt_params) = url_param_get_tab( url ). DATA(lv_n) = c_trim_lower( name ). LOOP AT lt_params REFERENCE INTO DATA(lr_params) - WHERE n = lv_n. + WHERE n = lv_n. lr_params->v = c_trim_lower( value ). ENDLOOP. IF sy-subrc <> 0. - INSERT VALUE #( n = lv_n v = c_trim_lower( value ) ) INTO TABLE lt_params. + INSERT VALUE #( n = lv_n + v = c_trim_lower( value ) ) INTO TABLE lt_params. ENDIF. result = url_param_create_url( lt_params ). ENDMETHOD. - METHOD context_get_user_tech. result = sy-uname. ENDMETHOD. - METHOD xml_parse. CALL TRANSFORMATION id - SOURCE XML xml - RESULT data = any. + SOURCE XML xml + RESULT data = any. ENDMETHOD. - METHOD xml_srtti_parse. check_raise_srtti_installed( ). @@ -1246,8 +1213,7 @@ CLASS z2ui5_cl_util IMPLEMENTATION. DATA rtti_type TYPE REF TO cl_abap_typedescr. CALL METHOD srtti->('GET_RTTI') - RECEIVING - rtti = rtti_type. + RECEIVING rtti = rtti_type. DATA lo_datadescr TYPE REF TO cl_abap_datadescr. lo_datadescr ?= rtti_type. @@ -1258,7 +1224,6 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD xml_srtti_stringify. check_raise_srtti_installed( ). @@ -1266,16 +1231,13 @@ CLASS z2ui5_cl_util IMPLEMENTATION. DATA srtti TYPE REF TO object. DATA(lv_classname) = 'ZCL_SRTTI_TYPEDESCR'. CALL METHOD (lv_classname)=>('CREATE_BY_DATA_OBJECT') - EXPORTING - data_object = data - RECEIVING - srtti = srtti. + EXPORTING data_object = data + RECEIVING srtti = srtti. CALL TRANSFORMATION id SOURCE srtti = srtti dobj = data RESULT XML result. ENDMETHOD. - METHOD xml_stringify. CALL TRANSFORMATION id @@ -1285,16 +1247,15 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD x_check_raise. IF when = abap_true. - RAISE EXCEPTION TYPE z2ui5_cx_util_error EXPORTING val = v. + RAISE EXCEPTION TYPE z2ui5_cx_util_error + EXPORTING val = v. ENDIF. ENDMETHOD. - METHOD x_get_last_t100. DATA(x) = val. @@ -1312,70 +1273,56 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD x_raise. - RAISE EXCEPTION TYPE z2ui5_cx_util_error EXPORTING val = v. + RAISE EXCEPTION TYPE z2ui5_cx_util_error + EXPORTING val = v. ENDMETHOD. - METHOD check_raise_srtti_installed. IF rtti_check_class_exists( 'ZCL_SRTTI_TYPEDESCR' ) = abap_false. DATA(lv_text) = `UNSUPPORTED_FEATURE - Please install the open-source project S-RTTI by sandraros and try again: https://github.com/sandraros/S-RTTI`. RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - val = lv_text. + EXPORTING val = lv_text. ENDIF. ENDMETHOD. - METHOD rtti_get_t_attri_by_table_name. IF table_name IS INITIAL. RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - val = 'TABLE_NAME_INITIAL_ERROR'. + EXPORTING val = 'TABLE_NAME_INITIAL_ERROR'. ENDIF. TRY. - cl_abap_structdescr=>describe_by_name( - EXPORTING - p_name = table_name - RECEIVING - p_descr_ref = DATA(lo_obj) - EXCEPTIONS - type_not_found = 1 - OTHERS = 2 + cl_abap_structdescr=>describe_by_name( EXPORTING p_name = table_name + RECEIVING p_descr_ref = DATA(lo_obj) + EXCEPTIONS type_not_found = 1 + OTHERS = 2 ). IF sy-subrc <> 0. RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - val = 'TABLE_NOT_FOUD_NAME___' && table_name. + EXPORTING val = |TABLE_NOT_FOUD_NAME___{ table_name }|. ENDIF. DATA(lo_struct) = CAST cl_abap_structdescr( lo_obj ). CATCH cx_root. TRY. - cl_abap_structdescr=>describe_by_name( - EXPORTING - p_name = table_name - RECEIVING - p_descr_ref = lo_obj - EXCEPTIONS - type_not_found = 1 - OTHERS = 2 + cl_abap_structdescr=>describe_by_name( EXPORTING p_name = table_name + RECEIVING p_descr_ref = lo_obj + EXCEPTIONS type_not_found = 1 + OTHERS = 2 ). IF sy-subrc <> 0. RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - val = 'TABLE_NOT_FOUD_NAME___' && table_name. + EXPORTING val = |TABLE_NOT_FOUD_NAME___{ table_name }|. ENDIF. DATA(lo_tab) = CAST cl_abap_tabledescr( lo_obj ). @@ -1399,10 +1346,9 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDMETHOD. - METHOD itab_corresponding. - FIELD-SYMBOLS TYPE any. + FIELD-SYMBOLS TYPE any. FIELD-SYMBOLS TYPE any. LOOP AT val ASSIGNING . @@ -1414,39 +1360,34 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDIF. INSERT INITIAL LINE INTO tab ASSIGNING INDEX lv_lines. - = CORRESPONDING #( ). + = CORRESPONDING #( ). ENDLOOP. ENDMETHOD. - METHOD itab_filter_by_t_range. ENDMETHOD. METHOD filter_get_data_by_multi. - - ENDMETHOD. METHOD filter_get_sql_where. LOOP AT val INTO DATA(ls_filter). + " TODO: variable is assigned but never used (ABAP cleaner) DATA lo_range TYPE REF TO lcl_range_to_sql. - CREATE OBJECT lo_range - EXPORTING - iv_fieldname = ls_filter-name - ir_range = REF #( ls_filter-t_range ). + lo_range = NEW #( iv_fieldname = ls_filter-name + ir_range = REF #( ls_filter-t_range ) ). ENDLOOP. ENDMETHOD. - METHOD msg_get. DATA(lv_kind) = z2ui5_cl_util=>rtti_get_type_kind( val ). @@ -1470,7 +1411,7 @@ CLASS z2ui5_cl_util IMPLEMENTATION. DATA(ls_result) = VALUE ty_s_msg( ). LOOP AT lt_attri REFERENCE INTO DATA(ls_attri). - DATA(lv_name) = 'VAL-' && ls_attri->name. + DATA(lv_name) = |VAL-{ ls_attri->name }|. ASSIGN (lv_name) TO FIELD-SYMBOL(). CASE ls_attri->name. WHEN 'ID' OR 'MSGID'. @@ -1493,22 +1434,21 @@ CLASS z2ui5_cl_util IMPLEMENTATION. ENDLOOP. IF ls_result-text IS INITIAL AND ls_result-id IS NOT INITIAL. MESSAGE ID ls_result-id TYPE 'I' NUMBER ls_result-no - WITH ls_result-v1 ls_result-v2 ls_result-v3 ls_result-v4 - INTO ls_result-text. + WITH ls_result-v1 ls_result-v2 ls_result-v3 ls_result-v4 + INTO ls_result-text. ENDIF. INSERT ls_result INTO TABLE result. WHEN cl_abap_datadescr=>typekind_oref. TRY. DATA(lx) = CAST cx_root( val ). - ls_result = VALUE #( - type = 'E' - text = lx->get_text( ) + ls_result = VALUE #( type = 'E' + text = lx->get_text( ) ). DATA(lt_attri_o) = z2ui5_cl_util=>rtti_get_t_attri_by_oref( val ). LOOP AT lt_attri_o REFERENCE INTO DATA(ls_attri_o) - WHERE visibility = 'U'. + WHERE visibility = 'U'. CASE ls_attri_o->name. WHEN 'ID' OR 'MSGID'. ASSIGN val->(ls_attri_o->name) TO . @@ -1547,16 +1487,14 @@ CLASS z2ui5_cl_util IMPLEMENTATION. WHEN OTHERS. IF rtti_check_clike( val ). - INSERT VALUE #( - text = val + INSERT VALUE #( text = val ) - INTO TABLE result. + INTO TABLE result. ENDIF. ENDCASE. ENDMETHOD. - METHOD rtti_check_clike. DATA(lv_type) = rtti_get_type_kind( val ). @@ -1572,11 +1510,12 @@ CLASS z2ui5_cl_util IMPLEMENTATION. METHOD ui5_get_msg_type. - result = SWITCH #( val WHEN 'E' THEN `Error` - WHEN 'S' THEN `Success` WHEN `W` THEN `Warning` - else `Information` + result = SWITCH #( val + WHEN 'E' THEN `Error` + WHEN 'S' THEN `Success` + WHEN `W` THEN `Warning` + ELSE `Information` ). ENDMETHOD. - ENDCLASS. diff --git a/src/01/00/03/z2ui5_cl_util.clas.locals_imp.abap b/src/01/00/03/z2ui5_cl_util.clas.locals_imp.abap index 3ecd77ff..f56ad803 100644 --- a/src/01/00/03/z2ui5_cl_util.clas.locals_imp.abap +++ b/src/01/00/03/z2ui5_cl_util.clas.locals_imp.abap @@ -40,13 +40,10 @@ CLASS lcl_range_to_sql DEFINITION RETURNING VALUE(out) TYPE string. - - ENDCLASS. CLASS lcl_range_to_sql IMPLEMENTATION. - METHOD constructor. mr_range = ir_range. @@ -118,5 +115,4 @@ CLASS lcl_range_to_sql IMPLEMENTATION. with = `''` occ = 0 ) }'|. ENDMETHOD. - ENDCLASS. diff --git a/src/01/00/03/z2ui5_cl_util.clas.testclasses.abap b/src/01/00/03/z2ui5_cl_util.clas.testclasses.abap index 16a0ca43..bc5c9946 100644 --- a/src/01/00/03/z2ui5_cl_util.clas.testclasses.abap +++ b/src/01/00/03/z2ui5_cl_util.clas.testclasses.abap @@ -21,6 +21,7 @@ CLASS ltcl_test_app DEFINITION FOR TESTING. CLASS-DATA sv_var TYPE string. CLASS-DATA ss_tab TYPE ty_row. CLASS-DATA st_tab TYPE STANDARD TABLE OF ty_row WITH EMPTY KEY. + CLASS-METHODS class_constructor. DATA mv_val TYPE string ##NEEDED. @@ -28,11 +29,12 @@ CLASS ltcl_test_app DEFINITION FOR TESTING. DATA mt_tab TYPE STANDARD TABLE OF ty_row WITH EMPTY KEY ##NEEDED. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. -CLASS ltcl_test_app IMPLEMENTATION. +CLASS ltcl_test_app IMPLEMENTATION. METHOD class_constructor. sv_var = 1. @@ -42,9 +44,9 @@ CLASS ltcl_test_app IMPLEMENTATION. ENDMETHOD. ENDCLASS. -CLASS ltcl_unit_test_abap_api DEFINITION FINAL FOR TESTING - DURATION SHORT - RISK LEVEL HARMLESS. + +CLASS ltcl_unit_test_abap_api DEFINITION FINAL + FOR TESTING RISK LEVEL HARMLESS DURATION SHORT. PRIVATE SECTION. @@ -54,41 +56,40 @@ CLASS ltcl_unit_test_abap_api DEFINITION FINAL FOR TESTING RETURNING VALUE(result) TYPE abap_bool. - METHODS test_assign FOR TESTING RAISING cx_static_check. - METHODS test_eledescr_rel_name FOR TESTING RAISING cx_static_check. - METHODS test_classdescr FOR TESTING RAISING cx_static_check. - METHODS test_substring_after FOR TESTING RAISING cx_static_check. - METHODS test_substring_before FOR TESTING RAISING cx_static_check. - METHODS test_string_shift FOR TESTING RAISING cx_static_check. - METHODS test_string_replace FOR TESTING RAISING cx_static_check. - METHODS test_raise_error FOR TESTING RAISING cx_static_check. - METHODS test_xsdbool FOR TESTING RAISING cx_static_check. - METHODS test_xsdbool_nested FOR TESTING RAISING cx_static_check. + METHODS test_assign FOR TESTING RAISING cx_static_check. + METHODS test_eledescr_rel_name FOR TESTING RAISING cx_static_check. + METHODS test_classdescr FOR TESTING RAISING cx_static_check. + METHODS test_substring_after FOR TESTING RAISING cx_static_check. + METHODS test_substring_before FOR TESTING RAISING cx_static_check. + METHODS test_string_shift FOR TESTING RAISING cx_static_check. + METHODS test_string_replace FOR TESTING RAISING cx_static_check. + METHODS test_raise_error FOR TESTING RAISING cx_static_check. + METHODS test_xsdbool FOR TESTING RAISING cx_static_check. + METHODS test_xsdbool_nested FOR TESTING RAISING cx_static_check. ENDCLASS. -CLASS ltcl_unit_test DEFINITION FINAL FOR TESTING - DURATION MEDIUM - RISK LEVEL HARMLESS. + +CLASS ltcl_unit_test DEFINITION FINAL + FOR TESTING RISK LEVEL HARMLESS DURATION MEDIUM. PRIVATE SECTION. - METHODS test_create FOR TESTING RAISING cx_static_check. + METHODS test_create FOR TESTING RAISING cx_static_check. - METHODS test_boolean_abap_2_json FOR TESTING RAISING cx_static_check. - METHODS test_boolean_check FOR TESTING RAISING cx_static_check. + METHODS test_boolean_abap_2_json FOR TESTING RAISING cx_static_check. + METHODS test_boolean_check FOR TESTING RAISING cx_static_check. - METHODS test_c_trim FOR TESTING RAISING cx_static_check. - METHODS test_c_trim_lower FOR TESTING RAISING cx_static_check. - METHODS test_c_trim_upper FOR TESTING RAISING cx_static_check. - METHODS test_c_trim_horizontal_tab FOR TESTING RAISING cx_static_check. + METHODS test_c_trim FOR TESTING RAISING cx_static_check. + METHODS test_c_trim_lower FOR TESTING RAISING cx_static_check. + METHODS test_c_trim_upper FOR TESTING RAISING cx_static_check. + METHODS test_c_trim_horizontal_tab FOR TESTING RAISING cx_static_check. METHODS test_time_get_timestampl FOR TESTING RAISING cx_static_check. METHODS test_time_substract_seconds FOR TESTING RAISING cx_static_check. METHODS test_func_get_user_tech FOR TESTING RAISING cx_static_check. - - METHODS test_rtti_get_t_attri_by_incl FOR TESTING RAISING cx_static_check. + METHODS test_rtti_get_t_attri_by_incl FOR TESTING RAISING cx_static_check. METHODS test_rtti_get_classname_by_ref FOR TESTING RAISING cx_static_check. METHODS test_rtti_get_type_name FOR TESTING RAISING cx_static_check. METHODS test_rtti_get_type_kind FOR TESTING RAISING cx_static_check. @@ -96,32 +97,31 @@ CLASS ltcl_unit_test DEFINITION FINAL FOR TESTING METHODS test_rtti_get_t_attri_by_obj FOR TESTING RAISING cx_static_check. METHODS test_rtti_get_t_comp_by_struc FOR TESTING RAISING cx_static_check. - METHODS test_trans_json_any_2__w_struc FOR TESTING RAISING cx_static_check. - METHODS test_trans_xml_any_2__w_obj FOR TESTING RAISING cx_static_check. - METHODS test_trans_xml_any_2__w_data FOR TESTING RAISING cx_static_check. - METHODS test_trans_xml_2_any__w_obj FOR TESTING RAISING cx_static_check. - METHODS test_trans_xml_2_any__w_data FOR TESTING RAISING cx_static_check. + METHODS test_trans_json_any_2__w_struc FOR TESTING RAISING cx_static_check. + METHODS test_trans_xml_any_2__w_obj FOR TESTING RAISING cx_static_check. + METHODS test_trans_xml_any_2__w_data FOR TESTING RAISING cx_static_check. + METHODS test_trans_xml_2_any__w_obj FOR TESTING RAISING cx_static_check. + METHODS test_trans_xml_2_any__w_data FOR TESTING RAISING cx_static_check. - METHODS test_url_param_create_url FOR TESTING RAISING cx_static_check. - METHODS test_url_param_get FOR TESTING RAISING cx_static_check. - METHODS test_url_param_get_tab FOR TESTING RAISING cx_static_check. - METHODS test_url_param_set FOR TESTING RAISING cx_static_check. + METHODS test_url_param_create_url FOR TESTING RAISING cx_static_check. + METHODS test_url_param_get FOR TESTING RAISING cx_static_check. + METHODS test_url_param_get_tab FOR TESTING RAISING cx_static_check. + METHODS test_url_param_set FOR TESTING RAISING cx_static_check. - METHODS test_x_check_raise FOR TESTING RAISING cx_static_check. - METHODS test_x_check_raise_not FOR TESTING RAISING cx_static_check. - METHODS test_x_raise FOR TESTING RAISING cx_static_check. - METHODS test_check_unassign_inital FOR TESTING RAISING cx_static_check. - METHODS conv_copy_ref_data FOR TESTING RAISING cx_static_check. - METHODS rtti_check_ref_data FOR TESTING RAISING cx_static_check. - METHODS test_check_bound_a_not_inital FOR TESTING RAISING cx_static_check. - METHODS test_sql_get_by_string FOR TESTING RAISING cx_static_check. - METHODS test_get_token_t_by_r_t FOR TESTING RAISING cx_static_check. + METHODS test_x_check_raise FOR TESTING RAISING cx_static_check. + METHODS test_x_check_raise_not FOR TESTING RAISING cx_static_check. + METHODS test_x_raise FOR TESTING RAISING cx_static_check. + METHODS test_check_unassign_inital FOR TESTING RAISING cx_static_check. + METHODS conv_copy_ref_data FOR TESTING RAISING cx_static_check. + METHODS rtti_check_ref_data FOR TESTING RAISING cx_static_check. + METHODS test_check_bound_a_not_inital FOR TESTING RAISING cx_static_check. + METHODS test_sql_get_by_string FOR TESTING RAISING cx_static_check. + METHODS test_get_token_t_by_r_t FOR TESTING RAISING cx_static_check. ENDCLASS. + CLASS ltcl_unit_test_abap_api IMPLEMENTATION. - - METHOD test_assign. DATA(lo_app) = NEW ltcl_test_app( ). @@ -129,23 +129,22 @@ CLASS ltcl_unit_test_abap_api IMPLEMENTATION. lo_app->mv_val = `ABC`. - DATA(lv_assign) = `LO_APP->` && 'MV_VAL'. + DATA(lv_assign) = |LO_APP->MV_VAL|. ASSIGN (lv_assign) TO . ASSERT sy-subrc = 0. - cl_abap_unit_assert=>assert_equals( - act = - exp = `ABC` ). + cl_abap_unit_assert=>assert_equals( exp = `ABC` + act = ). ENDMETHOD. - METHOD test_classdescr. DATA(lo_app) = NEW ltcl_test_app( ). DATA(lt_attri) = CAST cl_abap_classdescr( cl_abap_objectdescr=>describe_by_object_ref( lo_app ) )->attributes. + " TODO: variable is assigned but never used (ABAP cleaner) DATA(lv_test) = lt_attri[ name = `MS_TAB` ]. lv_test = lt_attri[ name = `MT_TAB` ]. lv_test = lt_attri[ name = `MV_VAL` ]. @@ -160,33 +159,32 @@ CLASS ltcl_unit_test_abap_api IMPLEMENTATION. DATA(lo_ele) = CAST cl_abap_elemdescr( cl_abap_elemdescr=>describe_by_data( abap_true ) ). - cl_abap_unit_assert=>assert_equals( - act = lo_ele->get_relative_name( ) - exp = `ABAP_BOOL` ). + cl_abap_unit_assert=>assert_equals( exp = `ABAP_BOOL` + act = lo_ele->get_relative_name( ) ). ENDMETHOD. METHOD test_substring_after. - cl_abap_unit_assert=>assert_equals( - act = substring_after( val = 'this is a string' sub = 'a' ) - exp = ` string` ). + cl_abap_unit_assert=>assert_equals( exp = ` string` + act = substring_after( val = 'this is a string' + sub = 'a' ) ). ENDMETHOD. METHOD test_substring_before. - cl_abap_unit_assert=>assert_equals( - act = substring_before( val = 'this is a string' sub = 'a' ) - exp = `this is ` ). + cl_abap_unit_assert=>assert_equals( exp = `this is ` + act = substring_before( val = 'this is a string' + sub = 'a' ) ). ENDMETHOD. METHOD test_string_shift. - cl_abap_unit_assert=>assert_equals( - act = shift_left( shift_right( val = ` string ` sub = ` ` ) ) - exp = `string` ). + cl_abap_unit_assert=>assert_equals( exp = `string` + act = shift_left( shift_right( val = ` string ` + sub = ` ` ) ) ). ENDMETHOD. @@ -197,9 +195,11 @@ CLASS ltcl_unit_test_abap_api IMPLEMENTATION. with = 'ABC' occ = 0 ) ##NEEDED. - cl_abap_unit_assert=>assert_equals( - act = replace( val = `one two three` sub = `two` with = 'ABC' occ = 0 ) - exp = `one ABC three` ). + cl_abap_unit_assert=>assert_equals( exp = `one ABC three` + act = replace( val = `one two three` + sub = `two` + with = 'ABC' + occ = 0 ) ). ENDMETHOD. @@ -221,9 +221,7 @@ CLASS ltcl_unit_test_abap_api IMPLEMENTATION. DATA(lv_xsdbool) = xsdbool( 1 = 1 ). IF lv_xsdbool = abap_false. - cl_abap_unit_assert=>assert_equals( - act = lv_xsdbool - exp = abap_false ). + cl_abap_unit_assert=>assert_false( lv_xsdbool ). ENDIF. IF xsdbool( 1 = 1 ) = abap_false. @@ -236,9 +234,7 @@ CLASS ltcl_unit_test_abap_api IMPLEMENTATION. DATA(lv_xsdbool) = check_input( xsdbool( 1 = 1 ) ). IF lv_xsdbool = abap_false. - cl_abap_unit_assert=>assert_equals( - act = lv_xsdbool - exp = abap_false ). + cl_abap_unit_assert=>assert_false( lv_xsdbool ). ENDIF. IF check_input( abap_false ). @@ -256,30 +252,21 @@ CLASS ltcl_unit_test_abap_api IMPLEMENTATION. result = val. ENDMETHOD. - ENDCLASS. -CLASS ltcl_unit_test IMPLEMENTATION. +CLASS ltcl_unit_test IMPLEMENTATION. METHOD test_boolean_check. DATA(lv_bool) = xsdbool( 1 = 1 ). - cl_abap_unit_assert=>assert_equals( - act = z2ui5_cl_util=>boolean_check_by_data( lv_bool ) - exp = abap_true ). + cl_abap_unit_assert=>assert_true( z2ui5_cl_util=>boolean_check_by_data( lv_bool ) ). lv_bool = xsdbool( 1 = 2 ). - cl_abap_unit_assert=>assert_equals( - act = z2ui5_cl_util=>boolean_check_by_data( lv_bool ) - exp = abap_true ). + cl_abap_unit_assert=>assert_true( z2ui5_cl_util=>boolean_check_by_data( lv_bool ) ). - cl_abap_unit_assert=>assert_equals( - act = z2ui5_cl_util=>boolean_check_by_data( abap_true ) - exp = abap_true ). + cl_abap_unit_assert=>assert_true( z2ui5_cl_util=>boolean_check_by_data( abap_true ) ). - cl_abap_unit_assert=>assert_equals( - act = z2ui5_cl_util=>boolean_check_by_data( abap_false ) - exp = abap_true ). + cl_abap_unit_assert=>assert_true( z2ui5_cl_util=>boolean_check_by_data( abap_false ) ). ENDMETHOD. @@ -341,13 +328,9 @@ CLASS ltcl_unit_test IMPLEMENTATION. DATA lr_data TYPE REF TO data. GET REFERENCE OF lv_test INTO lr_data. - cl_abap_unit_assert=>assert_equals( - act = z2ui5_cl_util=>rtti_check_ref_data( lr_data ) - exp = abap_true ). + cl_abap_unit_assert=>assert_true( z2ui5_cl_util=>rtti_check_ref_data( lr_data ) ). - cl_abap_unit_assert=>assert_equals( - act = z2ui5_cl_util=>rtti_check_ref_data( lv_test ) - exp = abap_false ). + cl_abap_unit_assert=>assert_false( z2ui5_cl_util=>rtti_check_ref_data( lv_test ) ). ENDMETHOD. @@ -362,17 +345,15 @@ CLASS ltcl_unit_test IMPLEMENTATION. FIELD-SYMBOLS TYPE data. ASSIGN lr_test2->* TO . - cl_abap_unit_assert=>assert_equals( - act = - exp = lv_test ). + cl_abap_unit_assert=>assert_equals( exp = lv_test + act = ). ENDMETHOD. METHOD test_boolean_abap_2_json. - cl_abap_unit_assert=>assert_equals( - act = z2ui5_cl_util=>boolean_abap_2_json( `{ABCD}` ) - exp = `{ABCD}` ). + cl_abap_unit_assert=>assert_equals( exp = `{ABCD}` + act = z2ui5_cl_util=>boolean_abap_2_json( `{ABCD}` ) ). ENDMETHOD. @@ -380,9 +361,8 @@ CLASS ltcl_unit_test IMPLEMENTATION. DATA(lv_time) = z2ui5_cl_util=>time_get_timestampl( ). - DATA(lv_time2) = z2ui5_cl_util=>time_substract_seconds( - time = lv_time - seconds = 60 * 60 * 4 ). + DATA(lv_time2) = z2ui5_cl_util=>time_substract_seconds( time = lv_time + seconds = 60 * 60 * 4 ). IF lv_time IS INITIAL OR lv_time2 IS INITIAL. cl_abap_unit_assert=>fail( ). @@ -411,33 +391,29 @@ CLASS ltcl_unit_test IMPLEMENTATION. METHOD test_c_trim. - cl_abap_unit_assert=>assert_equals( - act = z2ui5_cl_util=>c_trim( ` JsadfHHs ` ) - exp = `JsadfHHs` ). + cl_abap_unit_assert=>assert_equals( exp = `JsadfHHs` + act = z2ui5_cl_util=>c_trim( ` JsadfHHs ` ) ). ENDMETHOD. METHOD test_c_trim_lower. - cl_abap_unit_assert=>assert_equals( - act = z2ui5_cl_util=>c_trim_lower( ` JsadfHHs ` ) - exp = `jsadfhhs` ). + cl_abap_unit_assert=>assert_equals( exp = `jsadfhhs` + act = z2ui5_cl_util=>c_trim_lower( ` JsadfHHs ` ) ). ENDMETHOD. METHOD test_c_trim_upper. - cl_abap_unit_assert=>assert_equals( - act = z2ui5_cl_util=>c_trim_upper( ` JsadfHHs ` ) - exp = `JSADFHHS` ). + cl_abap_unit_assert=>assert_equals( exp = `JSADFHHS` + act = z2ui5_cl_util=>c_trim_upper( ` JsadfHHs ` ) ). ENDMETHOD. METHOD test_func_get_user_tech. - cl_abap_unit_assert=>assert_equals( - act = sy-uname - exp = z2ui5_cl_util=>context_get_user_tech( ) ). + cl_abap_unit_assert=>assert_equals( exp = z2ui5_cl_util=>context_get_user_tech( ) + act = sy-uname ). cl_abap_unit_assert=>assert_not_initial( z2ui5_cl_util=>context_get_user_tech( ) ). @@ -453,7 +429,6 @@ CLASS ltcl_unit_test IMPLEMENTATION. ENDMETHOD. - METHOD test_x_check_raise. TRY. @@ -470,7 +445,6 @@ CLASS ltcl_unit_test IMPLEMENTATION. ENDMETHOD. - METHOD test_trans_json_any_2__w_struc. TYPES: @@ -479,62 +453,58 @@ CLASS ltcl_unit_test IMPLEMENTATION. value TYPE string, selected TYPE abap_bool, END OF ty_row. + DATA(ls_row) = VALUE ty_row( title = `test` ). - cl_abap_unit_assert=>assert_equals( - act = z2ui5_cl_util=>json_stringify( ls_row ) - exp = `{"selected":false,"title":"test","value":""}` ). + cl_abap_unit_assert=>assert_equals( exp = `{"selected":false,"title":"test","value":""}` + act = z2ui5_cl_util=>json_stringify( ls_row ) ). ENDMETHOD. - METHOD test_url_param_create_url. - DATA(lt_param) = z2ui5_cl_util=>url_param_get_tab( `https://url.com/rvice_for_ui?sap-client=100&app_start=z2ui5_cl_app_hello_world` ). + DATA(lt_param) = z2ui5_cl_util=>url_param_get_tab( + `https://url.com/rvice_for_ui?sap-client=100&app_start=z2ui5_cl_app_hello_world` ). DATA(lv_url) = z2ui5_cl_util=>url_param_create_url( lt_param ). - cl_abap_unit_assert=>assert_equals( - act = lv_url - exp = `sap-client=100&app_start=z2ui5_cl_app_hello_world` ). + cl_abap_unit_assert=>assert_equals( exp = `sap-client=100&app_start=z2ui5_cl_app_hello_world` + act = lv_url ). ENDMETHOD. METHOD test_url_param_get. DATA(lv_param) = z2ui5_cl_util=>url_param_get( - val = `app_start` - url = `https://url.com/rvice_for_ui?sap-client=100&app_start=z2ui5_cl_app_hello_world` ). + val = `app_start` + url = `https://url.com/rvice_for_ui?sap-client=100&app_start=z2ui5_cl_app_hello_world` ). - cl_abap_unit_assert=>assert_equals( - act = lv_param - exp = `z2ui5_cl_app_hello_world` ). + cl_abap_unit_assert=>assert_equals( exp = `z2ui5_cl_app_hello_world` + act = lv_param ). ENDMETHOD. METHOD test_url_param_get_tab. - DATA(lt_param) = z2ui5_cl_util=>url_param_get_tab( `https://url.com/rvice_for_ui?sap-client=100&app_start=z2ui5_cl_app_hello_world` ). + DATA(lt_param) = z2ui5_cl_util=>url_param_get_tab( + `https://url.com/rvice_for_ui?sap-client=100&app_start=z2ui5_cl_app_hello_world` ). - cl_abap_unit_assert=>assert_equals( - act = lt_param[ n = `sap-client` ]-v - exp = `100` ). + cl_abap_unit_assert=>assert_equals( exp = `100` + act = lt_param[ n = `sap-client` ]-v ). - cl_abap_unit_assert=>assert_equals( - act = lt_param[ n = `app_start` ]-v - exp = `z2ui5_cl_app_hello_world` ). + cl_abap_unit_assert=>assert_equals( exp = `z2ui5_cl_app_hello_world` + act = lt_param[ n = `app_start` ]-v ). ENDMETHOD. METHOD test_url_param_set. DATA(lv_param) = z2ui5_cl_util=>url_param_set( - name = `app_start` - value = `z2ui5_cl_app_hello_world2` - url = `https://url.com/rvice_for_ui?sap-client=100&app_start=z2ui5_cl_app_hello_world` ). + name = `app_start` + value = `z2ui5_cl_app_hello_world2` + url = `https://url.com/rvice_for_ui?sap-client=100&app_start=z2ui5_cl_app_hello_world` ). - cl_abap_unit_assert=>assert_equals( - act = lv_param - exp = `sap-client=100&app_start=z2ui5_cl_app_hello_world2` ). + cl_abap_unit_assert=>assert_equals( exp = `sap-client=100&app_start=z2ui5_cl_app_hello_world2` + act = lv_param ). ENDMETHOD. @@ -551,9 +521,8 @@ CLASS ltcl_unit_test IMPLEMENTATION. DATA(lv_xsdbool) = VALUE xsdboolean( ). DATA(lv_name) = z2ui5_cl_util=>rtti_get_type_name( lv_xsdbool ). - cl_abap_unit_assert=>assert_equals( - act = lv_name - exp = `XSDBOOLEAN` ). + cl_abap_unit_assert=>assert_equals( exp = `XSDBOOLEAN` + act = lv_name ). ENDMETHOD. @@ -563,16 +532,13 @@ CLASS ltcl_unit_test IMPLEMENTATION. DATA(lv_type_kind) = z2ui5_cl_util=>rtti_get_type_kind( lv_string ). DATA lr_string TYPE REF TO string. - cl_abap_unit_assert=>assert_equals( - act = lv_type_kind - exp = cl_abap_typedescr=>typekind_string ). - + cl_abap_unit_assert=>assert_equals( exp = cl_abap_typedescr=>typekind_string + act = lv_type_kind ). CREATE DATA lr_string. lv_type_kind = z2ui5_cl_util=>rtti_get_type_kind( lr_string ). - cl_abap_unit_assert=>assert_equals( - act = lv_type_kind - exp = cl_abap_typedescr=>typekind_dref ). + cl_abap_unit_assert=>assert_equals( exp = cl_abap_typedescr=>typekind_dref + act = lv_type_kind ). ENDMETHOD. @@ -580,15 +546,10 @@ CLASS ltcl_unit_test IMPLEMENTATION. DATA(lv_string) = VALUE string( ). DATA lr_string TYPE REF TO string. - cl_abap_unit_assert=>assert_equals( - act = z2ui5_cl_util=>rtti_check_type_kind_dref( lv_string ) - exp = abap_false ). - + cl_abap_unit_assert=>assert_false( z2ui5_cl_util=>rtti_check_type_kind_dref( lv_string ) ). CREATE DATA lr_string. - cl_abap_unit_assert=>assert_equals( - act = z2ui5_cl_util=>rtti_check_type_kind_dref( lr_string ) - exp = abap_true ). + cl_abap_unit_assert=>assert_true( z2ui5_cl_util=>rtti_check_type_kind_dref( lr_string ) ). ENDMETHOD. @@ -605,15 +566,21 @@ CLASS ltcl_unit_test IMPLEMENTATION. cl_abap_unit_assert=>fail( ). ENDIF. - IF NOT line_exists( lt_attri[ name = `SS_TAB` type_kind = `v` ] ). + IF NOT line_exists( lt_attri[ name = `SS_TAB` + type_kind = `v` ] ). cl_abap_unit_assert=>fail( ). ENDIF. - IF NOT line_exists( lt_attri[ name = `SV_VAR` type_kind = `g` is_class = abap_true ] ). + IF NOT line_exists( lt_attri[ name = `SV_VAR` + type_kind = `g` + is_class = abap_true ] ). cl_abap_unit_assert=>fail( ). ENDIF. - IF NOT line_exists( lt_attri[ name = `SV_STATUS` type_kind = `g` is_class = abap_true is_constant = `X` ] ). + IF NOT line_exists( lt_attri[ name = `SV_STATUS` + type_kind = `g` + is_class = abap_true + is_constant = `X` ] ). cl_abap_unit_assert=>fail( ). ENDIF. @@ -680,11 +647,8 @@ CLASS ltcl_unit_test IMPLEMENTATION. DATA(lv_xml) = z2ui5_cl_util=>xml_stringify( lo_obj ). CLEAR lo_obj. - z2ui5_cl_util=>xml_parse( - EXPORTING - xml = lv_xml - IMPORTING - any = lo_obj ). + z2ui5_cl_util=>xml_parse( EXPORTING xml = lv_xml + IMPORTING any = lo_obj ). IF lo_obj IS NOT BOUND. cl_abap_unit_assert=>fail( ). @@ -735,19 +699,14 @@ CLASS ltcl_unit_test IMPLEMENTATION. DATA(lv_xml) = z2ui5_cl_util=>xml_stringify( ls_row ). - z2ui5_cl_util=>xml_parse( - EXPORTING - xml = lv_xml - IMPORTING - any = ls_row2 ). + z2ui5_cl_util=>xml_parse( EXPORTING xml = lv_xml + IMPORTING any = ls_row2 ). - cl_abap_unit_assert=>assert_equals( - act = ls_row - exp = ls_row2 ). + cl_abap_unit_assert=>assert_equals( exp = ls_row2 + act = ls_row ). ENDMETHOD. - METHOD test_c_trim_horizontal_tab. IF z2ui5_cl_util=>c_trim( |{ cl_abap_char_utilities=>horizontal_tab }| @@ -761,19 +720,17 @@ CLASS ltcl_unit_test IMPLEMENTATION. METHOD test_get_token_t_by_r_t. - DATA(lt_range) = VALUE z2ui5_cl_util=>ty_t_range( - ( sign = 'I' option = 'EQ' low = `table` high = `` ) + DATA(lt_range) = VALUE z2ui5_cl_util=>ty_t_range( ( sign = 'I' option = 'EQ' low = `table` high = `` ) ). DATA(lt_result) = z2ui5_cl_util=>filter_get_token_t_by_range_t( lt_range ). DATA(lt_exp) = VALUE z2ui5_cl_util=>ty_t_token( - ( key = `=table` text = `=table` visible = 'X' selkz = '' editable = 'X' ) + ( key = `=table` text = `=table` visible = 'X' selkz = '' editable = 'X' ) ). - cl_abap_unit_assert=>assert_equals( - act = lt_result - exp = lt_exp + cl_abap_unit_assert=>assert_equals( exp = lt_exp + act = lt_result ). ENDMETHOD. @@ -798,11 +755,10 @@ CLASS ltcl_unit_test IMPLEMENTATION. value2 TYPE string, END OF ty_struc. - DATA - BEGIN OF ms_struc2. - INCLUDE TYPE ty_struc. - INCLUDE TYPE ty_struc_incl. - DATA END OF ms_struc2. + DATA BEGIN OF ms_struc2. + INCLUDE TYPE ty_struc. + INCLUDE TYPE ty_struc_incl. + DATA END OF ms_struc2. DATA(lo_datadescr) = cl_abap_typedescr=>describe_by_data( ms_struc2 ). DATA(lt_attri) = z2ui5_cl_util=>rtti_get_t_attri_by_include( CAST #( lo_datadescr ) ). @@ -812,5 +768,4 @@ CLASS ltcl_unit_test IMPLEMENTATION. ENDIF. ENDMETHOD. - ENDCLASS. diff --git a/src/01/00/03/z2ui5_cx_util_error.clas.abap b/src/01/00/03/z2ui5_cx_util_error.clas.abap index 40c7f95e..49a78b2c 100644 --- a/src/01/00/03/z2ui5_cx_util_error.clas.abap +++ b/src/01/00/03/z2ui5_cx_util_error.clas.abap @@ -1,8 +1,7 @@ CLASS z2ui5_cx_util_error DEFINITION PUBLIC - INHERITING FROM cx_no_check - FINAL - CREATE PUBLIC . + INHERITING FROM cx_no_check FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -11,26 +10,23 @@ CLASS z2ui5_cx_util_error DEFINITION x_root TYPE REF TO cx_root, uuid TYPE string, text TYPE string, - END OF ms_error . + END OF ms_error. METHODS constructor IMPORTING - !val TYPE any OPTIONAL + val TYPE any OPTIONAL !previous TYPE REF TO cx_root OPTIONAL PREFERRED PARAMETER val. - METHODS if_message~get_text - REDEFINITION. + METHODS if_message~get_text REDEFINITION. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. - CLASS z2ui5_cx_util_error IMPLEMENTATION. - - METHOD constructor ##ADT_SUPPRESS_GENERATION. super->constructor( previous = previous ). @@ -45,7 +41,6 @@ CLASS z2ui5_cx_util_error IMPLEMENTATION. ENDMETHOD. - METHOD if_message~get_text. IF ms_error-x_root IS NOT INITIAL. diff --git a/src/01/00/03/z2ui5_cx_util_error.clas.testclasses.abap b/src/01/00/03/z2ui5_cx_util_error.clas.testclasses.abap index 70adc073..3af68568 100644 --- a/src/01/00/03/z2ui5_cx_util_error.clas.testclasses.abap +++ b/src/01/00/03/z2ui5_cx_util_error.clas.testclasses.abap @@ -1,6 +1,5 @@ -CLASS ltcl_unit_test DEFINITION FINAL FOR TESTING - DURATION SHORT - RISK LEVEL DANGEROUS. +CLASS ltcl_unit_test DEFINITION FINAL + FOR TESTING RISK LEVEL DANGEROUS DURATION SHORT. PRIVATE SECTION. METHODS test_raise FOR TESTING RAISING cx_static_check. @@ -8,21 +7,17 @@ ENDCLASS. CLASS ltcl_unit_test IMPLEMENTATION. - METHOD test_raise. TRY. RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - val = `this is an error text`. + EXPORTING val = `this is an error text`. CATCH z2ui5_cx_util_error INTO DATA(lx). - cl_abap_unit_assert=>assert_equals( - act = lx->get_text( ) - exp = `this is an error text` ). + cl_abap_unit_assert=>assert_equals( exp = `this is an error text` + act = lx->get_text( ) ). ENDTRY. ENDMETHOD. - ENDCLASS. diff --git a/src/01/01/z2ui5_cl_core_srv_draft.clas.abap b/src/01/01/z2ui5_cl_core_srv_draft.clas.abap index a1f564ef..3749c185 100644 --- a/src/01/01/z2ui5_cl_core_srv_draft.clas.abap +++ b/src/01/01/z2ui5_cl_core_srv_draft.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_core_srv_draft DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -11,8 +10,8 @@ CLASS z2ui5_cl_core_srv_draft DEFINITION METHODS create IMPORTING - !draft TYPE z2ui5_if_types=>ty_s_draft - !model_xml TYPE clike. + draft TYPE z2ui5_if_types=>ty_s_draft + model_xml TYPE clike. METHODS read_draft IMPORTING @@ -32,61 +31,52 @@ CLASS z2ui5_cl_core_srv_draft DEFINITION METHODS read IMPORTING - !id TYPE clike - !check_load_app TYPE abap_bool DEFAULT abap_true + !id TYPE clike + check_load_app TYPE abap_bool DEFAULT abap_true RETURNING - VALUE(result) TYPE z2ui5_if_core_types=>ty_s_db. + VALUE(result) TYPE z2ui5_if_core_types=>ty_s_db. PRIVATE SECTION. ENDCLASS. - CLASS z2ui5_cl_core_srv_draft IMPLEMENTATION. - - METHOD cleanup. - DATA(lv_four_hours_ago) = z2ui5_cl_util=>time_substract_seconds( - time = z2ui5_cl_util=>time_get_timestampl( ) - seconds = 60 * 60 * 4 ). + DATA(lv_four_hours_ago) = z2ui5_cl_util=>time_substract_seconds( time = z2ui5_cl_util=>time_get_timestampl( ) + seconds = 60 * 60 * 4 ). DELETE FROM z2ui5_t_01 WHERE timestampl < @lv_four_hours_ago. COMMIT WORK. ENDMETHOD. - METHOD create. ASSERT draft-id IS NOT INITIAL. - DATA(ls_db) = VALUE z2ui5_if_core_types=>ty_s_db( - id = draft-id - id_prev = draft-id_prev - id_prev_app = draft-id_prev_app - id_prev_app_stack = draft-id_prev_app_stack - uname = z2ui5_cl_util=>context_get_user_tech( ) - timestampl = z2ui5_cl_util=>time_get_timestampl( ) - data = model_xml ). + DATA(ls_db) = VALUE z2ui5_if_core_types=>ty_s_db( id = draft-id + id_prev = draft-id_prev + id_prev_app = draft-id_prev_app + id_prev_app_stack = draft-id_prev_app_stack + uname = z2ui5_cl_util=>context_get_user_tech( ) + timestampl = z2ui5_cl_util=>time_get_timestampl( ) + data = model_xml ). MODIFY z2ui5_t_01 FROM @ls_db. IF sy-subrc <> 0. RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - val = `CREATE_OF_DRAFT_ENTRY_ON_DATABASE_FAILED`. + EXPORTING val = `CREATE_OF_DRAFT_ENTRY_ON_DATABASE_FAILED`. ENDIF. COMMIT WORK AND WAIT. ENDMETHOD. - METHOD read. IF check_load_app = abap_true. - SELECT SINGLE * - FROM z2ui5_t_01 + SELECT SINGLE * FROM z2ui5_t_01 WHERE id = @id INTO @result ##SUBRC_OK. @@ -101,38 +91,31 @@ CLASS z2ui5_cl_core_srv_draft IMPLEMENTATION. IF sy-subrc <> 0. RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - val = `NO_DRAFT_ENTRY_OF_PREVIOUS_REQUEST_FOUND`. + EXPORTING val = `NO_DRAFT_ENTRY_OF_PREVIOUS_REQUEST_FOUND`. ENDIF. ENDMETHOD. - METHOD read_draft. result = read( id ). ENDMETHOD. - METHOD read_info. - DATA(ls_db) = read( - id = id - check_load_app = abap_false ). + DATA(ls_db) = read( id = id + check_load_app = abap_false ). result = CORRESPONDING #( ls_db ). ENDMETHOD. - METHOD count_entries. - SELECT - COUNT( * ) + SELECT COUNT( * ) FROM z2ui5_t_01 INTO @result. ENDMETHOD. - ENDCLASS. diff --git a/src/01/01/z2ui5_cl_core_srv_draft.clas.testclasses.abap b/src/01/01/z2ui5_cl_core_srv_draft.clas.testclasses.abap index 3639ce77..2bdd341e 100644 --- a/src/01/01/z2ui5_cl_core_srv_draft.clas.testclasses.abap +++ b/src/01/01/z2ui5_cl_core_srv_draft.clas.testclasses.abap @@ -1,6 +1,5 @@ -CLASS ltcl_test DEFINITION FINAL FOR TESTING - DURATION LONG - RISK LEVEL HARMLESS. +CLASS ltcl_test DEFINITION FINAL + FOR TESTING RISK LEVEL HARMLESS DURATION LONG. PUBLIC SECTION. @@ -8,12 +7,12 @@ CLASS ltcl_test DEFINITION FINAL FOR TESTING METHODS test_create FOR TESTING. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. CLASS ltcl_test IMPLEMENTATION. - METHOD constructor. ENDMETHOD. @@ -22,17 +21,14 @@ CLASS ltcl_test IMPLEMENTATION. DATA(lo_draft) = NEW z2ui5_cl_core_srv_draft( ). - lo_draft->create( - draft = VALUE #( id = `TEST_ID` ) - model_xml = `my xml` + lo_draft->create( draft = VALUE #( id = `TEST_ID` ) + model_xml = `my xml` ). DATA(ls_db) = lo_draft->read_draft( `TEST_ID` ). - cl_abap_unit_assert=>assert_equals( - act = ls_db-data - exp = `my xml` ). + cl_abap_unit_assert=>assert_equals( exp = `my xml` + act = ls_db-data ). ENDMETHOD. - ENDCLASS. diff --git a/src/01/02/z2ui5_cl_core_action.clas.abap b/src/01/02/z2ui5_cl_core_action.clas.abap index 614be362..15f25ccd 100644 --- a/src/01/02/z2ui5_cl_core_action.clas.abap +++ b/src/01/02/z2ui5_cl_core_action.clas.abap @@ -1,6 +1,5 @@ CLASS z2ui5_cl_core_action DEFINITION - PUBLIC - FINAL + PUBLIC FINAL CREATE PUBLIC. PUBLIC SECTION. @@ -8,8 +7,8 @@ CLASS z2ui5_cl_core_action DEFINITION DATA mo_http_post TYPE REF TO z2ui5_cl_core_handler. DATA mo_app TYPE REF TO z2ui5_cl_core_app. - DATA ms_actual TYPE z2ui5_if_core_types=>ty_s_actual. - DATA ms_next TYPE z2ui5_if_core_types=>ty_s_next. + DATA ms_actual TYPE z2ui5_if_core_types=>ty_s_actual. + DATA ms_next TYPE z2ui5_if_core_types=>ty_s_next. METHODS factory_system_startup RETURNING @@ -47,10 +46,7 @@ CLASS z2ui5_cl_core_action DEFINITION ENDCLASS. - CLASS z2ui5_cl_core_action IMPLEMENTATION. - - METHOD constructor. mo_http_post = val. @@ -58,7 +54,6 @@ CLASS z2ui5_cl_core_action IMPLEMENTATION. ENDMETHOD. - METHOD factory_by_frontend. result = NEW #( mo_http_post ). @@ -69,14 +64,12 @@ CLASS z2ui5_cl_core_action IMPLEMENTATION. result->mo_app = z2ui5_cl_core_app=>db_load( mo_http_post->ms_request-s_front-id ). ENDIF. - result->mo_app->ms_draft-id = z2ui5_cl_util=>uuid_get_c32( ). result->mo_app->ms_draft-id_prev = mo_http_post->ms_request-s_front-id. result->ms_actual-view = mo_http_post->ms_request-s_front-view. - result->mo_app->model_json_parse( - iv_view = mo_http_post->ms_request-s_front-view - io_model = mo_http_post->ms_request-o_model ). + result->mo_app->model_json_parse( iv_view = mo_http_post->ms_request-s_front-view + io_model = mo_http_post->ms_request-o_model ). result->ms_actual-event = mo_http_post->ms_request-s_front-event. result->ms_actual-t_event_arg = mo_http_post->ms_request-s_front-t_event_arg. @@ -84,7 +77,6 @@ CLASS z2ui5_cl_core_action IMPLEMENTATION. ENDMETHOD. - METHOD factory_first_start. TRY. @@ -100,14 +92,12 @@ CLASS z2ui5_cl_core_action IMPLEMENTATION. CATCH cx_root INTO DATA(x). RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - val = `App with name ` && mo_http_post->ms_request-s_control-app_start && ` not found...` - previous = x. + EXPORTING val = |App with name { mo_http_post->ms_request-s_control-app_start } not found...| + previous = x. ENDTRY. ENDMETHOD. - METHOD factory_stack_call. result = prepare_app_stack( ms_next-o_app_call ). @@ -115,12 +105,11 @@ CLASS z2ui5_cl_core_action IMPLEMENTATION. ENDMETHOD. - METHOD factory_stack_leave. result = prepare_app_stack( ms_next-o_app_leave ). - "check for new app? + " check for new app? TRY. DATA(lo_draft) = NEW z2ui5_cl_core_srv_draft( ). DATA(ls_draft) = lo_draft->read_info( ms_next-o_app_leave->id_draft ). @@ -129,7 +118,7 @@ CLASS z2ui5_cl_core_action IMPLEMENTATION. RETURN. ENDTRY. - "check for already existing app? + " check for already existing app? IF mo_app->ms_draft-id_prev_app_stack IS NOT INITIAL. ls_draft = lo_draft->read_info( mo_app->ms_draft-id_prev_app_stack ). result->mo_app->ms_draft-id_prev_app_stack = ls_draft-id_prev_app_stack. @@ -155,8 +144,8 @@ CLASS z2ui5_cl_core_action IMPLEMENTATION. mo_app->db_save( ). val->id_draft = COND string( WHEN val->id_draft IS INITIAL - THEN z2ui5_cl_util=>uuid_get_c32( ) - ELSE ms_next-o_app_leave->id_draft ). + THEN z2ui5_cl_util=>uuid_get_c32( ) + ELSE ms_next-o_app_leave->id_draft ). result = NEW #( mo_http_post ). TRY. @@ -177,9 +166,9 @@ CLASS z2ui5_cl_core_action IMPLEMENTATION. result->ms_next-s_set-s_popup-check_update_model = abap_false. result->ms_next-s_set-s_popover-check_update_model = abap_false. - IF ms_next-s_set-s_follow_up_action IS NOT INITIAL. -* .eB(['POPUP_CONFIRM']) + " .eB(['POPUP_CONFIRM']) + " TODO: variable is assigned but never used (ABAP cleaner) SPLIT ms_next-s_set-s_follow_up_action-custom_js AT `.eB(['` INTO DATA(lv_dummy) result->ms_actual-event. SPLIT result->ms_actual-event AT `']` INTO result->ms_actual-event lv_dummy. @@ -190,5 +179,4 @@ CLASS z2ui5_cl_core_action IMPLEMENTATION. CLEAR result->ms_next-s_set-s_msg_toast. ENDMETHOD. - ENDCLASS. diff --git a/src/01/02/z2ui5_cl_core_action.clas.testclasses.abap b/src/01/02/z2ui5_cl_core_action.clas.testclasses.abap index 16546303..3d530a56 100644 --- a/src/01/02/z2ui5_cl_core_action.clas.testclasses.abap +++ b/src/01/02/z2ui5_cl_core_action.clas.testclasses.abap @@ -1,21 +1,17 @@ -CLASS ltcl_test DEFINITION FINAL FOR TESTING - DURATION SHORT - RISK LEVEL HARMLESS. +CLASS ltcl_test DEFINITION FINAL + FOR TESTING RISK LEVEL HARMLESS DURATION SHORT. PRIVATE SECTION. - METHODS - first_test FOR TESTING RAISING cx_static_check. + METHODS first_test FOR TESTING RAISING cx_static_check. ENDCLASS. CLASS z2ui5_cl_core_action DEFINITION LOCAL FRIENDS ltcl_test. CLASS ltcl_test IMPLEMENTATION. - METHOD first_test. DATA(lo_http) = NEW z2ui5_cl_core_handler( `` ). DATA(lo_action) = NEW z2ui5_cl_core_action( lo_http ) ##NEEDED. ENDMETHOD. - ENDCLASS. diff --git a/src/01/02/z2ui5_cl_core_app.clas.abap b/src/01/02/z2ui5_cl_core_app.clas.abap index a2ab1197..1aab08e1 100644 --- a/src/01/02/z2ui5_cl_core_app.clas.abap +++ b/src/01/02/z2ui5_cl_core_app.clas.abap @@ -1,24 +1,23 @@ CLASS z2ui5_cl_core_app DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. INTERFACES if_serializable_object. - DATA mt_attri TYPE REF TO z2ui5_if_core_types=>ty_t_attri. - DATA mo_app TYPE REF TO object. - DATA ms_draft TYPE z2ui5_if_types=>ty_s_get-s_draft. + DATA mt_attri TYPE REF TO z2ui5_if_core_types=>ty_t_attri. + DATA mo_app TYPE REF TO object. + DATA ms_draft TYPE z2ui5_if_types=>ty_s_get-s_draft. METHODS model_json_stringify RETURNING - VALUE(result) TYPE string . + VALUE(result) TYPE string. METHODS model_json_parse IMPORTING - !iv_view TYPE clike - !io_model TYPE REF TO z2ui5_if_ajson. + iv_view TYPE clike + io_model TYPE REF TO z2ui5_if_ajson. METHODS all_xml_stringify RETURNING @@ -46,32 +45,25 @@ CLASS z2ui5_cl_core_app DEFINITION METHODS db_save. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. - CLASS z2ui5_cl_core_app IMPLEMENTATION. - - METHOD all_xml_parse. - z2ui5_cl_util=>xml_parse( - EXPORTING - xml = xml - IMPORTING - any = result ). + z2ui5_cl_util=>xml_parse( EXPORTING xml = xml + IMPORTING any = result ). ENDMETHOD. - METHOD all_xml_stringify. TRY. - DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( - attri = mt_attri - app = mo_app ). + DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( attri = mt_attri + app = mo_app ). lo_model->attri_before_save( ). result = z2ui5_cl_util=>xml_stringify( me ). @@ -82,15 +74,13 @@ CLASS z2ui5_cl_core_app IMPLEMENTATION. CLEAR mt_attri->*. - DATA(lo_dissolver) = NEW z2ui5_cl_core_srv_diss( - attri = mt_attri - app = mo_app ). + DATA(lo_dissolver) = NEW z2ui5_cl_core_srv_diss( attri = mt_attri + app = mo_app ). lo_dissolver->main( ). lo_dissolver->main( ). - lo_model = NEW z2ui5_cl_core_srv_attri( - attri = mt_attri - app = mo_app ). + lo_model = NEW z2ui5_cl_core_srv_attri( attri = mt_attri + app = mo_app ). lo_model->attri_before_save( ). result = z2ui5_cl_util=>xml_stringify( me ). @@ -99,36 +89,32 @@ CLASS z2ui5_cl_core_app IMPLEMENTATION. RAISE EXCEPTION TYPE z2ui5_cx_util_error EXPORTING - val = `

` && cx->get_text( ) && `

` && x2->get_text( ) && ` or

Please check if all generic data references are public attributes of your class`. + val = |

{ cx->get_text( ) }

{ x2->get_text( ) } or

Please check if all generic data references are public attributes of your class|. ENDTRY. ENDTRY. ENDMETHOD. - METHOD constructor. CREATE DATA mt_attri. ENDMETHOD. - METHOD db_load. DATA(lo_db) = NEW z2ui5_cl_core_srv_draft( ). DATA(ls_db) = lo_db->read_draft( id ). result = all_xml_parse( ls_db-data ). - DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( - attri = result->mt_attri - app = result->mo_app ). + DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( attri = result->mt_attri + app = result->mo_app ). lo_model->attri_after_load( ). ENDMETHOD. - METHOD db_load_by_app. DATA(lo_db) = NEW z2ui5_cl_core_srv_draft( ). @@ -137,15 +123,13 @@ CLASS z2ui5_cl_core_app IMPLEMENTATION. result->mo_app = app. - DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( - attri = result->mt_attri - app = result->mo_app ). + DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( attri = result->mt_attri + app = result->mo_app ). lo_model->attri_refs_update( ). ENDMETHOD. - METHOD db_save. IF mo_app IS BOUND. @@ -154,24 +138,20 @@ CLASS z2ui5_cl_core_app IMPLEMENTATION. ENDIF. DATA(lo_db) = NEW z2ui5_cl_core_srv_draft( ). - lo_db->create( - draft = ms_draft - model_xml = all_xml_stringify( ) ). + lo_db->create( draft = ms_draft + model_xml = all_xml_stringify( ) ). ENDMETHOD. - METHOD model_json_parse. DATA(lo_json_mapper) = NEW z2ui5_cl_core_srv_json( ). - lo_json_mapper->model_front_to_back( - view = iv_view - t_attri = mt_attri - model = io_model ). + lo_json_mapper->model_front_to_back( view = iv_view + t_attri = mt_attri + model = io_model ). ENDMETHOD. - METHOD model_json_stringify. DATA(lo_json_mapper) = NEW z2ui5_cl_core_srv_json( ). diff --git a/src/01/02/z2ui5_cl_core_app.clas.testclasses.abap b/src/01/02/z2ui5_cl_core_app.clas.testclasses.abap index 4598c4df..c9e91ef0 100644 --- a/src/01/02/z2ui5_cl_core_app.clas.testclasses.abap +++ b/src/01/02/z2ui5_cl_core_app.clas.testclasses.abap @@ -1,43 +1,41 @@ -CLASS ltcl_test DEFINITION FINAL FOR TESTING - DURATION SHORT - RISK LEVEL HARMLESS. +CLASS ltcl_test DEFINITION FINAL + FOR TESTING RISK LEVEL HARMLESS DURATION SHORT. PRIVATE SECTION. - METHODS - first_test FOR TESTING RAISING cx_static_check. + METHODS first_test FOR TESTING RAISING cx_static_check. ENDCLASS. CLASS z2ui5_cl_core_app DEFINITION LOCAL FRIENDS ltcl_test. CLASS ltcl_test IMPLEMENTATION. - METHOD first_test. DATA(lo_action) = NEW z2ui5_cl_core_app( ) ##NEEDED. ENDMETHOD. - ENDCLASS. -CLASS ltcl_test_db DEFINITION FINAL FOR TESTING - DURATION LONG - RISK LEVEL HARMLESS. + +CLASS ltcl_test_db DEFINITION FINAL + FOR TESTING RISK LEVEL HARMLESS DURATION LONG. PUBLIC SECTION. DATA mv_value TYPE string. + INTERFACES z2ui5_if_app. + METHODS constructor. METHODS test_db_save FOR TESTING. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. CLASS ltcl_test_db IMPLEMENTATION. - METHOD constructor. ENDMETHOD. @@ -60,14 +58,12 @@ CLASS ltcl_test_db IMPLEMENTATION. DATA(lo_app_db) = z2ui5_cl_core_app=>db_load( `TEST_ID` ). DATA(lo_app_user_db) = CAST ltcl_test_db( lo_app_db->mo_app ). - cl_abap_unit_assert=>assert_equals( - act = lo_app_user_db->mv_value - exp = lo_app_user->mv_value ). + cl_abap_unit_assert=>assert_equals( exp = lo_app_user->mv_value + act = lo_app_user_db->mv_value ). ENDMETHOD. METHOD z2ui5_if_app~main. ENDMETHOD. - ENDCLASS. diff --git a/src/01/02/z2ui5_cl_core_client.clas.abap b/src/01/02/z2ui5_cl_core_client.clas.abap index 511e9d41..bf963931 100644 --- a/src/01/02/z2ui5_cl_core_client.clas.abap +++ b/src/01/02/z2ui5_cl_core_client.clas.abap @@ -1,10 +1,10 @@ CLASS z2ui5_cl_core_client DEFINITION PUBLIC - CREATE PUBLIC . + CREATE PUBLIC. PUBLIC SECTION. - INTERFACES z2ui5_if_client . + INTERFACES z2ui5_if_client. DATA mo_action TYPE REF TO z2ui5_cl_core_action. @@ -13,38 +13,33 @@ CLASS z2ui5_cl_core_client DEFINITION !action TYPE REF TO z2ui5_cl_core_action. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. - CLASS z2ui5_cl_core_client IMPLEMENTATION. - - METHOD constructor. mo_action = action. ENDMETHOD. - METHOD z2ui5_if_client~follow_up_action. mo_action->ms_next-s_set-s_follow_up_action-custom_js = val. ENDMETHOD. - METHOD z2ui5_if_client~get. - result = VALUE #( - event = mo_action->ms_actual-event - check_launchpad_active = mo_action->mo_http_post->ms_request-s_control-check_launchpad - t_event_arg = mo_action->ms_actual-t_event_arg - s_draft = CORRESPONDING #( mo_action->mo_app->ms_draft ) - check_on_navigated = mo_action->ms_actual-check_on_navigated - s_config = CORRESPONDING #( mo_action->mo_http_post->ms_request-s_front ) - r_event_data = mo_action->ms_actual-r_data + result = VALUE #( event = mo_action->ms_actual-event + check_launchpad_active = mo_action->mo_http_post->ms_request-s_control-check_launchpad + t_event_arg = mo_action->ms_actual-t_event_arg + s_draft = CORRESPONDING #( mo_action->mo_app->ms_draft ) + check_on_navigated = mo_action->ms_actual-check_on_navigated + s_config = CORRESPONDING #( mo_action->mo_http_post->ms_request-s_front ) + r_event_data = mo_action->ms_actual-r_data ). TRY. @@ -53,12 +48,13 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION. RETURN. ENDIF. LOOP AT lo_params->mt_json_tree - REFERENCE INTO DATA(lr_comp) - WHERE name = `1`. + REFERENCE INTO DATA(lr_comp) + WHERE name = `1`. - INSERT VALUE #( - n = shift_left( val = shift_right( val = lr_comp->path sub = `/` ) sub = `/` ) - v = lr_comp->value ) INTO TABLE result-t_comp_params. + INSERT VALUE #( n = shift_left( val = shift_right( val = lr_comp->path + sub = `/` ) + sub = `/` ) + v = lr_comp->value ) INTO TABLE result-t_comp_params. ENDLOOP. CATCH cx_root. ENDTRY. @@ -85,7 +81,6 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION. ENDMETHOD. - METHOD z2ui5_if_client~message_box_display. IF z2ui5_cl_util=>rtti_check_clike( text ) = abap_false. @@ -95,22 +90,25 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION. DATA(lv_type) = z2ui5_cl_util=>ui5_get_msg_type( lt_msg[ 1 ]-type ). lv_type = to_lower( lv_type ). - DATA(lv_title) = SWITCH #( lt_msg[ 1 ]-type WHEN 'E' THEN `Error` - WHEN 'S' THEN `Success` WHEN `W` THEN `Warning` - ELSE `Information` ). - + DATA(lv_title) = SWITCH #( lt_msg[ 1 ]-type + WHEN 'E' THEN `Error` + WHEN 'S' THEN `Success` + WHEN `W` THEN `Warning` + ELSE `Information` ). ELSEIF lines( lt_msg ) > 1. lv_text = | { lines( lt_msg ) } Messages found: |. DATA(lv_details) = `

    `. LOOP AT lt_msg REFERENCE INTO DATA(lr_msg). - lv_details = lv_details && |
  • | && lr_msg->text && |
  • |. + lv_details = |{ lv_details }
  • { lr_msg->text }
  • |. ENDLOOP. - lv_details = lv_details && |
|. + lv_details = |{ lv_details }|. IF title IS INITIAL. - lv_title = SWITCH #( lt_msg[ 1 ]-type WHEN 'E' THEN `Error` - WHEN 'S' THEN `Success` WHEN `W` THEN `Warning` - ELSE `Information` ). + lv_title = SWITCH #( lt_msg[ 1 ]-type + WHEN 'E' THEN `Error` + WHEN 'S' THEN `Success` + WHEN `W` THEN `Warning` + ELSE `Information` ). ENDIF. lv_type = z2ui5_cl_util=>ui5_get_msg_type( lt_msg[ 1 ]-type ). ELSE. @@ -134,28 +132,25 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION. lv_type = 'show'. ENDIF. - mo_action->ms_next-s_set-s_msg_box = VALUE #( - text = lv_text - type = lv_type - title = lv_title - styleclass = styleclass - onclose = onclose - actions = actions - emphasizedaction = emphasizedaction - initialfocus = initialfocus - textdirection = textdirection - icon = icon - details = lv_details - closeonnavigation = closeonnavigation + mo_action->ms_next-s_set-s_msg_box = VALUE #( text = lv_text + type = lv_type + title = lv_title + styleclass = styleclass + onclose = onclose + actions = actions + emphasizedaction = emphasizedaction + initialfocus = initialfocus + textdirection = textdirection + icon = icon + details = lv_details + closeonnavigation = closeonnavigation ). ENDMETHOD. - METHOD z2ui5_if_client~message_toast_display. - mo_action->ms_next-s_set-s_msg_toast = VALUE #( - text = text + mo_action->ms_next-s_set-s_msg_toast = VALUE #( text = text duration = duration width = width my = my @@ -173,7 +168,6 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION. ENDMETHOD. - METHOD z2ui5_if_client~nav_app_call. IF app IS NOT BOUND. @@ -188,7 +182,6 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION. result = app->id_app. ENDMETHOD. - METHOD z2ui5_if_client~nav_app_leave. IF app IS NOT SUPPLIED. @@ -208,175 +201,149 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION. ENDMETHOD. - METHOD z2ui5_if_client~nest2_view_destroy. mo_action->ms_next-s_set-s_view_nest2-check_update_model = abap_true. ENDMETHOD. - METHOD z2ui5_if_client~nest2_view_display. - mo_action->ms_next-s_set-s_view_nest2-xml = val. - mo_action->ms_next-s_set-s_view_nest2-id = id. + mo_action->ms_next-s_set-s_view_nest2-xml = val. + mo_action->ms_next-s_set-s_view_nest2-id = id. mo_action->ms_next-s_set-s_view_nest2-method_destroy = method_destroy. - mo_action->ms_next-s_set-s_view_nest2-method_insert = method_insert. + mo_action->ms_next-s_set-s_view_nest2-method_insert = method_insert. ENDMETHOD. - METHOD z2ui5_if_client~nest2_view_model_update. mo_action->ms_next-s_set-s_view_nest2-check_update_model = abap_true. ENDMETHOD. - METHOD z2ui5_if_client~nest_view_destroy. mo_action->ms_next-s_set-s_view_nest-check_update_model = abap_true. ENDMETHOD. - METHOD z2ui5_if_client~nest_view_display. - mo_action->ms_next-s_set-s_view_nest-xml = val. - mo_action->ms_next-s_set-s_view_nest-id = id. + mo_action->ms_next-s_set-s_view_nest-xml = val. + mo_action->ms_next-s_set-s_view_nest-id = id. mo_action->ms_next-s_set-s_view_nest-method_destroy = method_destroy. - mo_action->ms_next-s_set-s_view_nest-method_insert = method_insert. + mo_action->ms_next-s_set-s_view_nest-method_insert = method_insert. ENDMETHOD. - METHOD z2ui5_if_client~nest_view_model_update. mo_action->ms_next-s_set-s_view_nest-check_update_model = abap_true. ENDMETHOD. - METHOD z2ui5_if_client~popover_destroy. mo_action->ms_next-s_set-s_popover-check_destroy = abap_true. ENDMETHOD. - METHOD z2ui5_if_client~popover_display. mo_action->ms_next-s_set-s_popover-check_destroy = abap_false. - mo_action->ms_next-s_set-s_popover-xml = xml. - mo_action->ms_next-s_set-s_popover-open_by_id = by_id. + mo_action->ms_next-s_set-s_popover-xml = xml. + mo_action->ms_next-s_set-s_popover-open_by_id = by_id. ENDMETHOD. - METHOD z2ui5_if_client~popover_model_update. mo_action->ms_next-s_set-s_popover-check_update_model = abap_true. ENDMETHOD. - METHOD z2ui5_if_client~popup_destroy. mo_action->ms_next-s_set-s_popup = VALUE #( check_destroy = abap_true ). ENDMETHOD. - METHOD z2ui5_if_client~popup_display. mo_action->ms_next-s_set-s_popup-check_destroy = abap_false. - mo_action->ms_next-s_set-s_popup-xml = val. + mo_action->ms_next-s_set-s_popup-xml = val. ENDMETHOD. - METHOD z2ui5_if_client~popup_model_update. mo_action->ms_next-s_set-s_popup-check_update_model = abap_true. ENDMETHOD. - METHOD z2ui5_if_client~view_destroy. mo_action->ms_next-s_set-s_view-check_destroy = abap_true. ENDMETHOD. - METHOD z2ui5_if_client~view_display. mo_action->ms_next-s_set-s_view-xml = val. ENDMETHOD. - METHOD z2ui5_if_client~view_model_update. mo_action->ms_next-s_set-s_view-check_update_model = abap_true. ENDMETHOD. - METHOD z2ui5_if_client~_bind. DATA(lo_bind) = NEW z2ui5_cl_core_srv_bind( mo_action->mo_app ). - result = lo_bind->main( - val = z2ui5_cl_util=>conv_get_as_data_ref( val ) - type = z2ui5_if_core_types=>cs_bind_type-one_way - config = VALUE #( - path_only = path - custom_filter = custom_filter - custom_mapper = custom_mapper - tab = z2ui5_cl_util=>conv_get_as_data_ref( tab ) - tab_index = tab_index ) ). + result = lo_bind->main( val = z2ui5_cl_util=>conv_get_as_data_ref( val ) + type = z2ui5_if_core_types=>cs_bind_type-one_way + config = VALUE #( path_only = path + custom_filter = custom_filter + custom_mapper = custom_mapper + tab = z2ui5_cl_util=>conv_get_as_data_ref( tab ) + tab_index = tab_index ) ). ENDMETHOD. - METHOD z2ui5_if_client~_bind_edit. DATA(lo_bind) = NEW z2ui5_cl_core_srv_bind( mo_action->mo_app ). - result = lo_bind->main( - val = z2ui5_cl_util=>conv_get_as_data_ref( val ) - type = z2ui5_if_core_types=>cs_bind_type-two_way - config = VALUE #( - path_only = path - custom_filter = custom_filter - custom_filter_back = custom_filter_back - custom_mapper = custom_mapper - custom_mapper_back = custom_mapper_back - tab = z2ui5_cl_util=>conv_get_as_data_ref( tab ) - tab_index = tab_index ) ). + result = lo_bind->main( val = z2ui5_cl_util=>conv_get_as_data_ref( val ) + type = z2ui5_if_core_types=>cs_bind_type-two_way + config = VALUE #( path_only = path + custom_filter = custom_filter + custom_filter_back = custom_filter_back + custom_mapper = custom_mapper + custom_mapper_back = custom_mapper_back + tab = z2ui5_cl_util=>conv_get_as_data_ref( tab ) + tab_index = tab_index ) ). ENDMETHOD. - METHOD z2ui5_if_client~_bind_local. DATA(lo_bind) = NEW z2ui5_cl_core_srv_bind( mo_action->mo_app ). - result = lo_bind->main_local( - val = val - config = VALUE #( - path_only = path - custom_mapper = custom_mapper - custom_filter = custom_filter ) ). + result = lo_bind->main_local( val = val + config = VALUE #( path_only = path + custom_mapper = custom_mapper + custom_filter = custom_filter ) ). ENDMETHOD. - METHOD z2ui5_if_client~_event. DATA(lo_ui5) = NEW z2ui5_cl_core_srv_event( ). - result = lo_ui5->get_event( - val = val - t_arg = t_arg - s_cnt = s_ctrl ). + result = lo_ui5->get_event( val = val + t_arg = t_arg + s_cnt = s_ctrl ). IF r_data IS NOT INITIAL. CREATE DATA mo_action->ms_next-r_data LIKE r_data. @@ -385,24 +352,20 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION. ENDMETHOD. - METHOD z2ui5_if_client~_event_client. DATA(lo_ui5) = NEW z2ui5_cl_core_srv_event( ). - result = lo_ui5->get_event_client( - val = val - t_arg = t_arg ). + result = lo_ui5->get_event_client( val = val + t_arg = t_arg ). ENDMETHOD. - METHOD z2ui5_if_client~set_session_stateful. - DATA(lv_check_sticky) = CAST z2ui5_if_app( mo_action->mo_app->mo_app )->check_sticky. + DATA(lv_check_sticky) = CAST z2ui5_if_app( mo_action->mo_app->mo_app )->check_sticky. IF lv_check_sticky = abap_true AND stateful = abap_true. RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - val = `STATEFUL_ALREADY_ACTIVATED_ERROR`. + EXPORTING val = `STATEFUL_ALREADY_ACTIVATED_ERROR`. ENDIF. IF stateful = abap_true. mo_action->ms_next-s_set-s_stateful-active = 1. @@ -441,5 +404,4 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION. result = z2ui5_if_client~get_app( ls_get-s_draft-id_prev_app ). ENDMETHOD. - ENDCLASS. diff --git a/src/01/02/z2ui5_cl_core_client.clas.testclasses.abap b/src/01/02/z2ui5_cl_core_client.clas.testclasses.abap index 01583e09..91a3ee1a 100644 --- a/src/01/02/z2ui5_cl_core_client.clas.testclasses.abap +++ b/src/01/02/z2ui5_cl_core_client.clas.testclasses.abap @@ -1,6 +1,5 @@ -CLASS ltcl_test_client DEFINITION FINAL FOR TESTING - DURATION LONG - RISK LEVEL HARMLESS. +CLASS ltcl_test_client DEFINITION FINAL + FOR TESTING RISK LEVEL HARMLESS DURATION LONG. PRIVATE SECTION. METHODS first_test FOR TESTING RAISING cx_static_check. @@ -9,7 +8,6 @@ ENDCLASS. CLASS z2ui5_cl_core_client DEFINITION LOCAL FRIENDS ltcl_test_client. CLASS ltcl_test_client IMPLEMENTATION. - METHOD first_test. DATA(lo_http) = NEW z2ui5_cl_core_handler( `` ). @@ -17,5 +15,4 @@ CLASS ltcl_test_client IMPLEMENTATION. DATA(lo_client) = NEW z2ui5_cl_core_client( lo_action ) ##NEEDED. ENDMETHOD. - ENDCLASS. diff --git a/src/01/02/z2ui5_cl_core_handler.clas.abap b/src/01/02/z2ui5_cl_core_handler.clas.abap index eda95d15..c3ea33aa 100644 --- a/src/01/02/z2ui5_cl_core_handler.clas.abap +++ b/src/01/02/z2ui5_cl_core_handler.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_core_handler DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -33,10 +32,7 @@ CLASS z2ui5_cl_core_handler DEFINITION ENDCLASS. - CLASS z2ui5_cl_core_handler IMPLEMENTATION. - - METHOD constructor. mv_request_json = val. @@ -44,7 +40,6 @@ CLASS z2ui5_cl_core_handler IMPLEMENTATION. ENDMETHOD. - METHOD main. main_begin( ). @@ -54,14 +49,12 @@ CLASS z2ui5_cl_core_handler IMPLEMENTATION. ENDIF. ENDDO. - result = VALUE #( - body = mv_response - s_stateful = ms_response-s_front-params-s_stateful + result = VALUE #( body = mv_response + s_stateful = ms_response-s_front-params-s_stateful ). ENDMETHOD. - METHOD main_begin. TRY. @@ -84,29 +77,26 @@ CLASS z2ui5_cl_core_handler IMPLEMENTATION. ENDTRY. ENDMETHOD. - METHOD main_end. - ms_response = VALUE #( - s_front-params = mo_action->ms_next-s_set - s_front-id = mo_action->mo_app->ms_draft-id - s_front-app = z2ui5_cl_util=>rtti_get_classname_by_ref( mo_action->mo_app->mo_app ) + ms_response = VALUE #( s_front-params = mo_action->ms_next-s_set + s_front-id = mo_action->mo_app->ms_draft-id + s_front-app = z2ui5_cl_util=>rtti_get_classname_by_ref( mo_action->mo_app->mo_app ) ). - IF ms_response-s_front-params-s_view-check_update_model = abap_true - OR ms_response-s_front-params-s_view_nest-check_update_model = abap_true - OR ms_response-s_front-params-s_view_nest2-check_update_model = abap_true - OR ms_response-s_front-params-s_popup-check_update_model = abap_true - OR ms_response-s_front-params-s_popover-check_update_model = abap_true - OR ms_response-s_front-params-s_view-xml IS NOT INITIAL - OR ms_response-s_front-params-s_view_nest-xml IS NOT INITIAL - OR ms_response-s_front-params-s_view_nest2-xml IS NOT INITIAL - OR ms_response-s_front-params-s_popup-xml IS NOT INITIAL - OR ms_response-s_front-params-s_popover-xml IS NOT INITIAL. + IF ms_response-s_front-params-s_view-check_update_model = abap_true + OR ms_response-s_front-params-s_view_nest-check_update_model = abap_true + OR ms_response-s_front-params-s_view_nest2-check_update_model = abap_true + OR ms_response-s_front-params-s_popup-check_update_model = abap_true + OR ms_response-s_front-params-s_popover-check_update_model = abap_true + OR ms_response-s_front-params-s_view-xml IS NOT INITIAL + OR ms_response-s_front-params-s_view_nest-xml IS NOT INITIAL + OR ms_response-s_front-params-s_view_nest2-xml IS NOT INITIAL + OR ms_response-s_front-params-s_popup-xml IS NOT INITIAL + OR ms_response-s_front-params-s_popover-xml IS NOT INITIAL. - DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( - attri = mo_action->mo_app->mt_attri - app = mo_action->mo_app->mo_app ). + DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( attri = mo_action->mo_app->mt_attri + app = mo_action->mo_app->mo_app ). lo_model->attri_refs_update( ). ms_response-model = mo_action->mo_app->model_json_stringify( ). @@ -125,7 +115,6 @@ CLASS z2ui5_cl_core_handler IMPLEMENTATION. ENDMETHOD. - METHOD main_process. TRY. diff --git a/src/01/02/z2ui5_cl_core_handler.clas.testclasses.abap b/src/01/02/z2ui5_cl_core_handler.clas.testclasses.abap index 873e4fa6..07eb89b1 100644 --- a/src/01/02/z2ui5_cl_core_handler.clas.testclasses.abap +++ b/src/01/02/z2ui5_cl_core_handler.clas.testclasses.abap @@ -1,17 +1,14 @@ -CLASS ltcl_test_handler_post DEFINITION FINAL FOR TESTING - DURATION SHORT - RISK LEVEL HARMLESS. +CLASS ltcl_test_handler_post DEFINITION FINAL + FOR TESTING RISK LEVEL HARMLESS DURATION SHORT. PRIVATE SECTION. - METHODS - load_startup_app FOR TESTING RAISING cx_static_check. + METHODS load_startup_app FOR TESTING RAISING cx_static_check. ENDCLASS. CLASS z2ui5_cl_core_handler DEFINITION LOCAL FRIENDS ltcl_test_handler_post. CLASS ltcl_test_handler_post IMPLEMENTATION. - METHOD load_startup_app. IF sy-sysid = 'ABC'. @@ -24,16 +21,13 @@ CLASS ltcl_test_handler_post IMPLEMENTATION. cl_abap_unit_assert=>assert_bound( lo_post->mo_action ). - cl_abap_unit_assert=>assert_equals( - act = lo_post->ms_request-s_front-origin - exp = `ORIGIN` ). + cl_abap_unit_assert=>assert_equals( exp = `ORIGIN` + act = lo_post->ms_request-s_front-origin ). - cl_abap_unit_assert=>assert_equals( - act = lo_post->ms_request-s_front-pathname - exp = `PATHNAME` ). + cl_abap_unit_assert=>assert_equals( exp = `PATHNAME` + act = lo_post->ms_request-s_front-pathname ). DATA(lo_startup) = CAST z2ui5_cl_app_startup( lo_post->mo_action->mo_app->mo_app ) ##NEEDED. ENDMETHOD. - ENDCLASS. diff --git a/src/01/02/z2ui5_cl_core_srv_attri.clas.abap b/src/01/02/z2ui5_cl_core_srv_attri.clas.abap index 436ef64b..8eb0b4c5 100644 --- a/src/01/02/z2ui5_cl_core_srv_attri.clas.abap +++ b/src/01/02/z2ui5_cl_core_srv_attri.clas.abap @@ -41,12 +41,11 @@ ENDCLASS. CLASS z2ui5_cl_core_srv_attri IMPLEMENTATION. - METHOD attri_after_load. LOOP AT mt_attri->* REFERENCE INTO DATA(lr_attri). TRY. - lr_attri->r_ref = attri_get_val_ref( lr_attri->name ). + lr_attri->r_ref = attri_get_val_ref( lr_attri->name ). lr_attri->o_typedescr = cl_abap_datadescr=>describe_by_data_ref( lr_attri->r_ref ). IF lr_attri->srtti_data IS NOT INITIAL. @@ -104,9 +103,8 @@ CLASS z2ui5_cl_core_srv_attri IMPLEMENTATION. RETURN. ENDIF. - DATA(lo_dissolve) = NEW z2ui5_cl_core_srv_diss( - attri = mt_attri - app = mo_app ). + DATA(lo_dissolve) = NEW z2ui5_cl_core_srv_diss( attri = mt_attri + app = mo_app ). DO 5 TIMES. @@ -137,9 +135,9 @@ CLASS z2ui5_cl_core_srv_attri IMPLEMENTATION. LOOP AT mt_attri->* ASSIGNING FIELD-SYMBOL(). DATA(lv_name) = -name. IF line_exists( lt_attri[ name = lv_name ] ). - -bind_type = lt_attri[ name = lv_name ]-bind_type. + -bind_type = lt_attri[ name = lv_name ]-bind_type. -name_client = lt_attri[ name = lv_name ]-name_client. - -view = lt_attri[ name = lv_name ]-view. + -view = lt_attri[ name = lv_name ]-view. ENDIF. ENDLOOP. RETURN. @@ -152,7 +150,6 @@ CLASS z2ui5_cl_core_srv_attri IMPLEMENTATION. EXIT. ENDDO. - """"" RAISE EXCEPTION TYPE z2ui5_cx_util_error @@ -167,8 +164,7 @@ CLASS z2ui5_cl_core_srv_attri IMPLEMENTATION. IF sy-subrc <> 0. RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - val = `DEREF_FAILED_TARGET_INITIAL`. + EXPORTING val = `DEREF_FAILED_TARGET_INITIAL`. ENDIF. GET REFERENCE OF INTO result. @@ -182,7 +178,7 @@ CLASS z2ui5_cl_core_srv_attri IMPLEMENTATION. LOOP AT mt_attri->* REFERENCE INTO DATA(lr_attri). TRY. - lr_attri->r_ref = attri_get_val_ref( lr_attri->name ). + lr_attri->r_ref = attri_get_val_ref( lr_attri->name ). lr_attri->o_typedescr = cl_abap_datadescr=>describe_by_data_ref( lr_attri->r_ref ). * TRY. @@ -211,9 +207,9 @@ CLASS z2ui5_cl_core_srv_attri IMPLEMENTATION. LOOP AT mt_attri->* REFERENCE INTO DATA(lr_attri) WHERE o_typedescr IS BOUND. - IF lr_attri->o_typedescr->kind <> cl_abap_typedescr=>kind_elem + IF lr_attri->o_typedescr->kind <> cl_abap_typedescr=>kind_elem AND lr_attri->o_typedescr->kind <> cl_abap_typedescr=>kind_struct - AND lr_attri->o_typedescr->kind <> cl_abap_typedescr=>kind_table. + AND lr_attri->o_typedescr->kind <> cl_abap_typedescr=>kind_table. CONTINUE. ENDIF. @@ -224,7 +220,5 @@ CLASS z2ui5_cl_core_srv_attri IMPLEMENTATION. ENDLOOP. ENDMETHOD. - - ENDCLASS. diff --git a/src/01/02/z2ui5_cl_core_srv_attri.clas.testclasses.abap b/src/01/02/z2ui5_cl_core_srv_attri.clas.testclasses.abap index 7efb309f..1ff4a9e3 100644 --- a/src/01/02/z2ui5_cl_core_srv_attri.clas.testclasses.abap +++ b/src/01/02/z2ui5_cl_core_srv_attri.clas.testclasses.abap @@ -1,58 +1,53 @@ -CLASS ltcl_test_app2 DEFINITION FINAL FOR TESTING - DURATION MEDIUM - RISK LEVEL HARMLESS. +CLASS ltcl_test_app2 DEFINITION FINAL + FOR TESTING RISK LEVEL HARMLESS DURATION MEDIUM. PUBLIC SECTION. - DATA mv_value TYPE string ##NEEDED. - DATA mr_value TYPE REF TO data. + DATA mv_value TYPE string ##NEEDED. + DATA mr_value TYPE REF TO data. DATA mr_value2 TYPE REF TO data. - DATA mo_app TYPE REF TO ltcl_test_app2. + DATA mo_app TYPE REF TO ltcl_test_app2. + + DATA xx TYPE string ##NEEDED. - DATA xx TYPE string ##NEEDED. METHODS constructor. ENDCLASS. -CLASS ltcl_test_app2 IMPLEMENTATION. +CLASS ltcl_test_app2 IMPLEMENTATION. METHOD constructor. ENDMETHOD. - ENDCLASS. - -CLASS ltcl_test_search_attri DEFINITION FINAL FOR TESTING - DURATION SHORT - RISK LEVEL HARMLESS. +CLASS ltcl_test_search_attri DEFINITION FINAL + FOR TESTING RISK LEVEL HARMLESS DURATION SHORT. PRIVATE SECTION. - METHODS first_test FOR TESTING RAISING cx_static_check. + METHODS first_test FOR TESTING RAISING cx_static_check. METHODS second_test FOR TESTING RAISING cx_static_check. - METHODS third_test FOR TESTING RAISING cx_static_check. + METHODS third_test FOR TESTING RAISING cx_static_check. ENDCLASS. CLASS z2ui5_cl_core_srv_attri DEFINITION LOCAL FRIENDS ltcl_test_search_attri. CLASS ltcl_test_search_attri IMPLEMENTATION. - METHOD first_test. DATA(lo_app_client) = NEW ltcl_test_app2( ). DATA lr_value TYPE REF TO data. GET REFERENCE OF lo_app_client->mv_value INTO lr_value. - DATA(lt_attri) = VALUE z2ui5_if_core_types=>ty_t_attri( ( - r_ref = lr_value - o_typedescr = cl_abap_datadescr=>describe_by_data_ref( lr_value ) + DATA(lt_attri) = VALUE z2ui5_if_core_types=>ty_t_attri( ( r_ref = lr_value + o_typedescr = cl_abap_datadescr=>describe_by_data_ref( + lr_value ) ) ). - DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( - attri = REF #( lt_attri ) - app = lo_app_client ). + DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( attri = REF #( lt_attri ) + app = lo_app_client ). DATA(lr_attri) = lo_model->attri_search_a_dissolve( REF #( lo_app_client->mv_value ) ). @@ -68,14 +63,13 @@ CLASS ltcl_test_search_attri IMPLEMENTATION. DATA lr_value TYPE REF TO data. GET REFERENCE OF lo_app_client->mv_value INTO lr_value. - DATA(lt_attri) = VALUE z2ui5_if_core_types=>ty_t_attri( ( - r_ref = REF #( lo_app_client->mv_value ) - o_typedescr = cl_abap_datadescr=>describe_by_data_ref( lr_value ) + DATA(lt_attri) = VALUE z2ui5_if_core_types=>ty_t_attri( ( r_ref = REF #( lo_app_client->mv_value ) + o_typedescr = cl_abap_datadescr=>describe_by_data_ref( + lr_value ) ) ). - DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( - attri = REF #( lt_attri ) - app = lo_app_client ). + DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( attri = REF #( lt_attri ) + app = lo_app_client ). DATA(lr_attri) = lo_model->attri_search_a_dissolve( REF #( lo_app_client->mv_value ) ). @@ -93,11 +87,10 @@ CLASS ltcl_test_search_attri IMPLEMENTATION. lo_app_client->mo_app = NEW #( ). - DATA(lt_attri) = VALUE z2ui5_if_core_types=>ty_t_attri( - ( name = `1` r_ref = REF #( lo_app_client->mr_value ) ) - ( name = `4` r_ref = REF #( lo_app_client->mr_value2 ) ) - ( name = `2` r_ref = REF #( lo_app_client->mo_app ) ) - ( name = `3` r_ref = REF #( lo_app_client->mv_value ) ) ). + DATA(lt_attri) = VALUE z2ui5_if_core_types=>ty_t_attri( ( name = `1` r_ref = REF #( lo_app_client->mr_value ) ) + ( name = `4` r_ref = REF #( lo_app_client->mr_value2 ) ) + ( name = `2` r_ref = REF #( lo_app_client->mo_app ) ) + ( name = `3` r_ref = REF #( lo_app_client->mv_value ) ) ). DATA(lr_attri) = REF #( lt_attri[ r_ref = lr_value ] ). IF lr_attri->r_ref <> lr_value. @@ -105,13 +98,11 @@ CLASS ltcl_test_search_attri IMPLEMENTATION. ENDIF. ENDMETHOD. - ENDCLASS. -CLASS ltcl_test_app_sub DEFINITION FINAL FOR TESTING - DURATION MEDIUM - RISK LEVEL HARMLESS. +CLASS ltcl_test_app_sub DEFINITION FINAL + FOR TESTING RISK LEVEL HARMLESS DURATION MEDIUM. PUBLIC SECTION. @@ -122,61 +113,59 @@ CLASS ltcl_test_app_sub DEFINITION FINAL FOR TESTING METHODS constructor. ENDCLASS. -CLASS ltcl_test_app_sub IMPLEMENTATION. +CLASS ltcl_test_app_sub IMPLEMENTATION. METHOD constructor. ENDMETHOD. - ENDCLASS. -CLASS ltcl_test_app3 DEFINITION FINAL FOR TESTING - DURATION MEDIUM - RISK LEVEL HARMLESS. + +CLASS ltcl_test_app3 DEFINITION FINAL + FOR TESTING RISK LEVEL HARMLESS DURATION MEDIUM. PUBLIC SECTION. DATA mv_value TYPE string ##NEEDED. DATA mr_value TYPE REF TO string. * DATA mr_value2 TYPE REF TO data. - DATA mo_app TYPE REF TO ltcl_test_app_sub. + DATA mo_app TYPE REF TO ltcl_test_app_sub. METHODS constructor. ENDCLASS. -CLASS ltcl_test_app3 IMPLEMENTATION. +CLASS ltcl_test_app3 IMPLEMENTATION. METHOD constructor. mo_app = NEW #( ). ENDMETHOD. - ENDCLASS. -CLASS ltcl_test_get_attri DEFINITION FINAL FOR TESTING - DURATION SHORT - RISK LEVEL HARMLESS. + +CLASS ltcl_test_get_attri DEFINITION FINAL + FOR TESTING RISK LEVEL HARMLESS DURATION SHORT. PRIVATE SECTION. - METHODS first_test FOR TESTING RAISING cx_static_check. + METHODS first_test FOR TESTING RAISING cx_static_check. METHODS second_test FOR TESTING RAISING cx_static_check. - METHODS third_test FOR TESTING RAISING cx_static_check. - METHODS test4 FOR TESTING RAISING cx_static_check. + METHODS third_test FOR TESTING RAISING cx_static_check. + METHODS test4 FOR TESTING RAISING cx_static_check. ENDCLASS. -CLASS ltcl_test_get_attri IMPLEMENTATION. +CLASS ltcl_test_get_attri IMPLEMENTATION. METHOD first_test. DATA(lo_app_client) = NEW ltcl_test_app3( ). + " TODO: variable is assigned but never used (ABAP cleaner) DATA lr_value TYPE REF TO data. GET REFERENCE OF lo_app_client->mv_value INTO lr_value. DATA(lt_attri) = VALUE z2ui5_if_core_types=>ty_t_attri( ). - DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( - attri = REF #( lt_attri ) - app = lo_app_client ). + DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( attri = REF #( lt_attri ) + app = lo_app_client ). DATA(lr_attri) = lo_model->attri_get_val_ref( `MV_VALUE` ). @@ -192,9 +181,8 @@ CLASS ltcl_test_get_attri IMPLEMENTATION. CREATE DATA lo_app_client->mr_value. DATA(lt_attri) = VALUE z2ui5_if_core_types=>ty_t_attri( ). - DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( - attri = REF #( lt_attri ) - app = lo_app_client ). + DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( attri = REF #( lt_attri ) + app = lo_app_client ). DATA(lr_attri) = lo_model->attri_get_val_ref( `MR_VALUE->*` ). @@ -209,9 +197,8 @@ CLASS ltcl_test_get_attri IMPLEMENTATION. DATA(lo_app_client) = NEW ltcl_test_app3( ). DATA(lt_attri) = VALUE z2ui5_if_core_types=>ty_t_attri( ). - DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( - attri = REF #( lt_attri ) - app = lo_app_client ). + DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( attri = REF #( lt_attri ) + app = lo_app_client ). DATA(lr_attri) = lo_model->attri_get_val_ref( `MO_APP->MV_VALUE` ). @@ -227,9 +214,8 @@ CLASS ltcl_test_get_attri IMPLEMENTATION. CREATE DATA lo_app_client->mo_app->mr_value. DATA(lt_attri) = VALUE z2ui5_if_core_types=>ty_t_attri( ). - DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( - attri = REF #( lt_attri ) - app = lo_app_client ). + DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( attri = REF #( lt_attri ) + app = lo_app_client ). DATA(lr_attri) = lo_model->attri_get_val_ref( `MO_APP->MR_VALUE->*` ). @@ -238,6 +224,4 @@ CLASS ltcl_test_get_attri IMPLEMENTATION. ENDIF. ENDMETHOD. - - ENDCLASS. diff --git a/src/01/02/z2ui5_cl_core_srv_bind.clas.abap b/src/01/02/z2ui5_cl_core_srv_bind.clas.abap index 6b0e039c..92210e1a 100644 --- a/src/01/02/z2ui5_cl_core_srv_bind.clas.abap +++ b/src/01/02/z2ui5_cl_core_srv_bind.clas.abap @@ -1,50 +1,49 @@ CLASS z2ui5_cl_core_srv_bind DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. - DATA mo_app TYPE REF TO z2ui5_cl_core_app . - DATA mr_attri TYPE REF TO z2ui5_if_core_types=>ty_s_attri . - DATA ms_config TYPE z2ui5_if_core_types=>ty_s_bind_config . - DATA mv_type TYPE string . + DATA mo_app TYPE REF TO z2ui5_cl_core_app. + DATA mr_attri TYPE REF TO z2ui5_if_core_types=>ty_s_attri. + DATA ms_config TYPE z2ui5_if_core_types=>ty_s_bind_config. + DATA mv_type TYPE string. METHODS constructor IMPORTING - !app TYPE REF TO z2ui5_cl_core_app . + app TYPE REF TO z2ui5_cl_core_app. METHODS main_local IMPORTING - !val TYPE data - !config TYPE z2ui5_if_core_types=>ty_s_bind_config OPTIONAL + val TYPE data + config TYPE z2ui5_if_core_types=>ty_s_bind_config OPTIONAL RETURNING - VALUE(result) TYPE string . + VALUE(result) TYPE string. METHODS main IMPORTING - !val TYPE REF TO data + val TYPE REF TO data !type TYPE string - !config TYPE z2ui5_if_core_types=>ty_s_bind_config OPTIONAL + config TYPE z2ui5_if_core_types=>ty_s_bind_config OPTIONAL RETURNING - VALUE(result) TYPE string . + VALUE(result) TYPE string. METHODS main_cell IMPORTING - !val TYPE data + val TYPE data !type TYPE string - !config TYPE z2ui5_if_core_types=>ty_s_bind_config OPTIONAL + config TYPE z2ui5_if_core_types=>ty_s_bind_config OPTIONAL RETURNING - VALUE(result) TYPE string . + VALUE(result) TYPE string. METHODS clear IMPORTING - !val TYPE string. + val TYPE string. METHODS bind_tab_cell IMPORTING - !iv_name TYPE string - !i_val TYPE data + iv_name TYPE string + i_val TYPE data RETURNING VALUE(result) TYPE string. @@ -62,17 +61,15 @@ CLASS z2ui5_cl_core_srv_bind DEFINITION ENDCLASS. - CLASS z2ui5_cl_core_srv_bind IMPLEMENTATION. - - METHOD bind_tab_cell. - FIELD-SYMBOLS TYPE any. - FIELD-SYMBOLS TYPE any. + FIELD-SYMBOLS TYPE any. + FIELD-SYMBOLS TYPE any. DATA lr_ref_in TYPE REF TO data. FIELD-SYMBOLS TYPE STANDARD TABLE. + ASSIGN ms_config-tab->* TO . ASSIGN [ ms_config-tab_index ] TO . @@ -84,7 +81,7 @@ CLASS z2ui5_cl_core_srv_bind IMPLEMENTATION. lr_ref_in = REF #( ). IF i_val = lr_ref_in. - result = iv_name && '/' && shift_right( CONV string( ms_config-tab_index - 1 ) ) && '/' && -name. + result = |{ iv_name }/{ shift_right( CONV string( ms_config-tab_index - 1 ) ) }/{ -name }|. RETURN. ENDIF. @@ -96,13 +93,11 @@ CLASS z2ui5_cl_core_srv_bind IMPLEMENTATION. ENDMETHOD. - METHOD check_raise_existing. IF mr_attri->bind_type <> mv_type. RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - val = `

Binding Error - Two different binding types for same attribute used (` && mr_attri->name && `).`. + EXPORTING val = |

Binding Error - Two different binding types for same attribute used ({ mr_attri->name }).|. ENDIF. IF mr_attri->custom_mapper IS BOUND. @@ -111,26 +106,22 @@ CLASS z2ui5_cl_core_srv_bind IMPLEMENTATION. DATA(lv_name2) = z2ui5_cl_util=>rtti_get_classname_by_ref( ms_config-custom_mapper ). IF lv_name1 <> lv_name2. RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - val = `

Binding Error - Two different mapper for same attribute used (` && mr_attri->name && `).`. + EXPORTING val = |

Binding Error - Two different mapper for same attribute used ({ mr_attri->name }).|. ENDIF. ENDIF. IF mr_attri->custom_mapper_back IS BOUND AND mr_attri->custom_mapper_back <> ms_config-custom_mapper_back. RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - val = `

Binding Error - Two different mapper back for same attribute used (` && mr_attri->name && `).`. + EXPORTING val = |

Binding Error - Two different mapper back for same attribute used ({ mr_attri->name }).|. ENDIF. IF mr_attri->custom_filter IS BOUND AND mr_attri->custom_filter <> ms_config-custom_filter. RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - val = `

Binding Error - Two different filter for same attribute used (` && mr_attri->name && `).`. + EXPORTING val = |

Binding Error - Two different filter for same attribute used ({ mr_attri->name }).|. ENDIF. ENDMETHOD. - METHOD check_raise_new. IF mr_attri->custom_filter_back IS BOUND. @@ -138,8 +129,7 @@ CLASS z2ui5_cl_core_srv_bind IMPLEMENTATION. DATA(lo_dummy) = CAST if_serializable_object( mr_attri->custom_filter_back ) ##NEEDED. CATCH cx_root. RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - val = `

custom_filter_back used but it is not serializable, please use if_serializable_object`. + EXPORTING val = `

custom_filter_back used but it is not serializable, please use if_serializable_object`. ENDTRY. ENDIF. @@ -157,18 +147,18 @@ CLASS z2ui5_cl_core_srv_bind IMPLEMENTATION. ENDMETHOD. - METHOD clear. TRY. - DATA(lv_path) = shift_right( val = val sub = `->*` ). + DATA(lv_path) = shift_right( val = val + sub = `->*` ). mo_app->mt_attri->*[ name = lv_path ]-check_dissolved = abap_false. mo_app->mt_attri->*[ name = val ]-check_dissolved = abap_false. mo_app->mt_attri->*[ name = lv_path ]-name_client = ``. mo_app->mt_attri->*[ name = lv_path ]-bind_type = ``. LOOP AT mo_app->mt_attri->* REFERENCE INTO DATA(lr_bind2) - WHERE name = lv_path. + WHERE name = lv_path. CLEAR lr_bind2->r_ref. ENDLOOP. @@ -177,33 +167,35 @@ CLASS z2ui5_cl_core_srv_bind IMPLEMENTATION. ENDMETHOD. - METHOD constructor. mo_app = app. ENDMETHOD. - METHOD get_client_name. - result = replace( val = mr_attri->name sub = `-` with = `/` occ = 0 ). - result = replace( val = result sub = `>` with = `` occ = 0 ). + result = replace( val = mr_attri->name + sub = `-` + with = `/` + occ = 0 ). + result = replace( val = result + sub = `>` + with = `` + occ = 0 ). result = COND #( WHEN mv_type = z2ui5_if_core_types=>cs_bind_type-two_way - THEN `/` && z2ui5_if_core_types=>cs_ui5-two_way_model ) - && `/` && result. + THEN |/{ z2ui5_if_core_types=>cs_ui5-two_way_model }| ) + && |/{ result }|. ENDMETHOD. - METHOD main. IF z2ui5_cl_util=>check_bound_a_not_inital( config-tab ). - result = main_cell( - val = val - type = type - config = config ). + result = main_cell( val = val + type = type + config = config ). RETURN. ENDIF. @@ -211,9 +203,8 @@ CLASS z2ui5_cl_core_srv_bind IMPLEMENTATION. ms_config = config. mv_type = type. - DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( - attri = mo_app->mt_attri - app = mo_app->mo_app ). + DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( attri = mo_app->mt_attri + app = mo_app->mo_app ). lo_model->attri_refs_update( ). @@ -227,44 +218,43 @@ CLASS z2ui5_cl_core_srv_bind IMPLEMENTATION. ENDIF. result = mr_attri->name_client. - IF `/` && z2ui5_if_core_types=>cs_ui5-two_way_model = result. + IF |/{ z2ui5_if_core_types=>cs_ui5-two_way_model }| = result. RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - val = `

Name of variable not allowed - x is reserved word - use anoter name for your attribute`. + EXPORTING val = `

Name of variable not allowed - x is reserved word - use anoter name for your attribute`. ENDIF. IF ms_config-path_only = abap_false. - result = `{` && result && `}`. + result = |\{{ result }\}|. ENDIF. ENDMETHOD. - METHOD main_cell. ms_config = config. mv_type = type. DATA(lo_bind) = NEW z2ui5_cl_core_srv_bind( mo_app ). - result = lo_bind->main( val = config-tab type = type config = VALUE #( path_only = abap_true ) ). + result = lo_bind->main( val = config-tab + type = type + config = VALUE #( path_only = abap_true ) ). - result = bind_tab_cell( - iv_name = result - i_val = val ). + result = bind_tab_cell( iv_name = result + i_val = val ). IF ms_config-path_only = abap_false. - result = `{` && result && `}`. + result = |\{{ result }\}|. ENDIF. ENDMETHOD. - METHOD main_local. TRY. DATA(lo_json) = CAST z2ui5_if_ajson( z2ui5_cl_ajson=>new( ) ). - lo_json->set( iv_path = `/` iv_val = val ). + lo_json->set( iv_path = `/` + iv_val = val ). IF config-custom_mapper IS BOUND. lo_json = lo_json->map( config-custom_mapper ). @@ -283,12 +273,12 @@ CLASS z2ui5_cl_core_srv_bind IMPLEMENTATION. name = lv_id json_bind_local = lo_json bind_type = z2ui5_if_core_types=>cs_bind_type-one_time ) - INTO TABLE mo_app->mt_attri->*. + INTO TABLE mo_app->mt_attri->*. result = |/{ lv_id }|. IF config-path_only = abap_false. - result = `{` && result && `}`. + result = |\{{ result }\}|. ENDIF. CATCH cx_root INTO DATA(x). @@ -296,18 +286,18 @@ CLASS z2ui5_cl_core_srv_bind IMPLEMENTATION. ENDTRY. ENDMETHOD. - METHOD update_model_attri. - mr_attri->bind_type = mv_type. - mr_attri->view = ms_config-view. - mr_attri->custom_filter = ms_config-custom_filter. + mr_attri->bind_type = mv_type. + mr_attri->view = ms_config-view. + mr_attri->custom_filter = ms_config-custom_filter. mr_attri->custom_filter_back = ms_config-custom_filter_back. - mr_attri->custom_mapper = ms_config-custom_mapper. + mr_attri->custom_mapper = ms_config-custom_mapper. mr_attri->custom_mapper_back = ms_config-custom_mapper_back. - mr_attri->view = COND #( WHEN ms_config-view IS INITIAL THEN z2ui5_if_client=>cs_view-main ELSE ms_config-view ). - mr_attri->name_client = get_client_name( ). + mr_attri->view = COND #( WHEN ms_config-view IS INITIAL + THEN z2ui5_if_client=>cs_view-main + ELSE ms_config-view ). + mr_attri->name_client = get_client_name( ). ENDMETHOD. - ENDCLASS. diff --git a/src/01/02/z2ui5_cl_core_srv_bind.clas.testclasses.abap b/src/01/02/z2ui5_cl_core_srv_bind.clas.testclasses.abap index 8b4306a4..37b9844b 100644 --- a/src/01/02/z2ui5_cl_core_srv_bind.clas.testclasses.abap +++ b/src/01/02/z2ui5_cl_core_srv_bind.clas.testclasses.abap @@ -2,9 +2,8 @@ CLASS ltcl_test_bind DEFINITION DEFERRED. CLASS z2ui5_cl_core_srv_bind DEFINITION LOCAL FRIENDS ltcl_test_bind. -CLASS ltcl_test_app DEFINITION FINAL FOR TESTING - DURATION MEDIUM - RISK LEVEL HARMLESS. +CLASS ltcl_test_app DEFINITION FINAL + FOR TESTING RISK LEVEL HARMLESS DURATION MEDIUM. PUBLIC SECTION. @@ -26,38 +25,40 @@ CLASS ltcl_test_app DEFINITION FINAL FOR TESTING DATA mv_value TYPE string ##NEEDED. DATA mr_value TYPE REF TO data ##NEEDED. DATA mr_struc TYPE REF TO s_01 ##NEEDED. - DATA mo_app TYPE REF TO ltcl_test_bind ##NEEDED. + DATA mo_app TYPE REF TO ltcl_test_bind ##NEEDED. + + DATA xx TYPE string ##NEEDED. - DATA xx TYPE string ##NEEDED. METHODS constructor. ENDCLASS. -CLASS ltcl_test_app IMPLEMENTATION. +CLASS ltcl_test_app IMPLEMENTATION. METHOD constructor. ENDMETHOD. - ENDCLASS. -CLASS ltcl_test_bind DEFINITION FINAL FOR TESTING - DURATION MEDIUM - RISK LEVEL HARMLESS. + +CLASS ltcl_test_bind DEFINITION FINAL + FOR TESTING RISK LEVEL HARMLESS DURATION MEDIUM. PUBLIC SECTION. + PROTECTED SECTION. + PRIVATE SECTION. - METHODS test_one_way FOR TESTING RAISING cx_static_check. - METHODS test_one_way_w_x_error FOR TESTING RAISING cx_static_check. - METHODS test_error_diff FOR TESTING RAISING cx_static_check. - METHODS test_two_way FOR TESTING RAISING cx_static_check. - METHODS test_local FOR TESTING RAISING cx_static_check. - METHODS test_local_one FOR TESTING RAISING cx_static_check. + METHODS test_one_way FOR TESTING RAISING cx_static_check. + METHODS test_one_way_w_x_error FOR TESTING RAISING cx_static_check. + METHODS test_error_diff FOR TESTING RAISING cx_static_check. + METHODS test_two_way FOR TESTING RAISING cx_static_check. + METHODS test_local FOR TESTING RAISING cx_static_check. + METHODS test_local_one FOR TESTING RAISING cx_static_check. ENDCLASS. -CLASS ltcl_test_bind IMPLEMENTATION. +CLASS ltcl_test_bind IMPLEMENTATION. METHOD test_one_way_w_x_error. DATA(lo_app_client) = NEW ltcl_test_app( ). @@ -67,9 +68,8 @@ CLASS ltcl_test_bind IMPLEMENTATION. DATA(lo_bind) = NEW z2ui5_cl_core_srv_bind( lo_app ). TRY. - lo_bind->main( - val = REF #( lo_app_client->xx ) - type = z2ui5_if_core_types=>cs_bind_type-one_way ). + lo_bind->main( val = REF #( lo_app_client->xx ) + type = z2ui5_if_core_types=>cs_bind_type-one_way ). cl_abap_unit_assert=>abort( ). @@ -86,13 +86,11 @@ CLASS ltcl_test_bind IMPLEMENTATION. DATA(lo_bind) = NEW z2ui5_cl_core_srv_bind( lo_app ). - DATA(lv_bind) = lo_bind->main( - val = REF #( lo_app_client->mv_value ) - type = z2ui5_if_core_types=>cs_bind_type-one_way ). + DATA(lv_bind) = lo_bind->main( val = REF #( lo_app_client->mv_value ) + type = z2ui5_if_core_types=>cs_bind_type-one_way ). - cl_abap_unit_assert=>assert_equals( - act = lv_bind - exp = `{/MV_VALUE}` ). + cl_abap_unit_assert=>assert_equals( exp = `{/MV_VALUE}` + act = lv_bind ). ENDMETHOD. @@ -104,14 +102,12 @@ CLASS ltcl_test_bind IMPLEMENTATION. DATA(lo_bind) = NEW z2ui5_cl_core_srv_bind( lo_app ). - lo_bind->main( - val = REF #( lo_app_client->mv_value ) - type = z2ui5_if_core_types=>cs_bind_type-one_way ). + lo_bind->main( val = REF #( lo_app_client->mv_value ) + type = z2ui5_if_core_types=>cs_bind_type-one_way ). TRY. - lo_bind->main( - val = REF #( lo_app_client->mv_value ) - type = z2ui5_if_core_types=>cs_bind_type-two_way ). + lo_bind->main( val = REF #( lo_app_client->mv_value ) + type = z2ui5_if_core_types=>cs_bind_type-two_way ). cl_abap_unit_assert=>abort( ). @@ -120,7 +116,6 @@ CLASS ltcl_test_bind IMPLEMENTATION. ENDMETHOD. - METHOD test_two_way. * IF sy-sysid = 'ABC'. @@ -133,17 +128,14 @@ CLASS ltcl_test_bind IMPLEMENTATION. DATA(lo_bind) = NEW z2ui5_cl_core_srv_bind( lo_app ). - DATA(lv_bind) = lo_bind->main( - val = REF #( lo_app_client->mv_value ) - type = z2ui5_if_core_types=>cs_bind_type-two_way ). + DATA(lv_bind) = lo_bind->main( val = REF #( lo_app_client->mv_value ) + type = z2ui5_if_core_types=>cs_bind_type-two_way ). - DATA(lv_bind2) = lo_bind->main( - val = REF #( lo_app_client->mv_value ) - type = z2ui5_if_core_types=>cs_bind_type-two_way ). + DATA(lv_bind2) = lo_bind->main( val = REF #( lo_app_client->mv_value ) + type = z2ui5_if_core_types=>cs_bind_type-two_way ). - cl_abap_unit_assert=>assert_equals( - act = lv_bind - exp = lv_bind2 ). + cl_abap_unit_assert=>assert_equals( exp = lv_bind2 + act = lv_bind ). cl_abap_unit_assert=>assert_not_initial( lv_bind ). @@ -175,20 +167,17 @@ CLASS ltcl_test_bind IMPLEMENTATION. cl_abap_unit_assert=>assert_not_initial( lv_bind ). - DATA(lv_bind2) = lo_bind->main( - val = REF #( lo_app_client->mv_value ) - type = z2ui5_if_core_types=>cs_bind_type-two_way ). + DATA(lv_bind2) = lo_bind->main( val = REF #( lo_app_client->mv_value ) + type = z2ui5_if_core_types=>cs_bind_type-two_way ). cl_abap_unit_assert=>assert_not_initial( lv_bind2 ). ENDMETHOD. - ENDCLASS. -CLASS ltcl_test_main_structure DEFINITION FINAL FOR TESTING - DURATION MEDIUM - RISK LEVEL HARMLESS. +CLASS ltcl_test_main_structure DEFINITION FINAL + FOR TESTING RISK LEVEL HARMLESS DURATION MEDIUM. PUBLIC SECTION. @@ -210,16 +199,15 @@ CLASS ltcl_test_main_structure DEFINITION FINAL FOR TESTING PRIVATE SECTION. - METHODS test_one_way_lev1 FOR TESTING RAISING cx_static_check. - METHODS test_one_way_lev2 FOR TESTING RAISING cx_static_check. - METHODS test_one_way_lev3 FOR TESTING RAISING cx_static_check. + METHODS test_one_way_lev1 FOR TESTING RAISING cx_static_check. + METHODS test_one_way_lev2 FOR TESTING RAISING cx_static_check. + METHODS test_one_way_lev3 FOR TESTING RAISING cx_static_check. METHODS test_one_way_lev4_long_name FOR TESTING RAISING cx_static_check. - ENDCLASS. -CLASS ltcl_test_main_structure IMPLEMENTATION. +CLASS ltcl_test_main_structure IMPLEMENTATION. METHOD test_one_way_lev1. DATA(lo_test_app) = NEW ltcl_test_main_structure( ). @@ -227,22 +215,18 @@ CLASS ltcl_test_main_structure IMPLEMENTATION. lo_app->mo_app = lo_test_app. DATA(lo_bind) = NEW z2ui5_cl_core_srv_bind( lo_app ). - DATA(lv_result) = lo_bind->main( - val = REF #( lo_test_app->ms_struc-input ) - type = z2ui5_if_core_types=>cs_bind_type-one_way ). + DATA(lv_result) = lo_bind->main( val = REF #( lo_test_app->ms_struc-input ) + type = z2ui5_if_core_types=>cs_bind_type-one_way ). - cl_abap_unit_assert=>assert_equals( - act = lv_result - exp = `{/MS_STRUC/INPUT}` ). + cl_abap_unit_assert=>assert_equals( exp = `{/MS_STRUC/INPUT}` + act = lv_result ). - lv_result = lo_bind->main( - val = REF #( lo_test_app->ms_struc-input ) - config = VALUE #( path_only = abap_true ) - type = z2ui5_if_core_types=>cs_bind_type-one_way ). + lv_result = lo_bind->main( val = REF #( lo_test_app->ms_struc-input ) + config = VALUE #( path_only = abap_true ) + type = z2ui5_if_core_types=>cs_bind_type-one_way ). - cl_abap_unit_assert=>assert_equals( - act = lv_result - exp = `/MS_STRUC/INPUT` ). + cl_abap_unit_assert=>assert_equals( exp = `/MS_STRUC/INPUT` + act = lv_result ). ENDMETHOD. @@ -253,13 +237,11 @@ CLASS ltcl_test_main_structure IMPLEMENTATION. lo_app->mo_app = lo_test_app. DATA(lo_bind) = NEW z2ui5_cl_core_srv_bind( lo_app ). - DATA(lv_result) = lo_bind->main( - val = REF #( lo_test_app->ms_struc-s_02-input ) - type = z2ui5_if_core_types=>cs_bind_type-one_way ). + DATA(lv_result) = lo_bind->main( val = REF #( lo_test_app->ms_struc-s_02-input ) + type = z2ui5_if_core_types=>cs_bind_type-one_way ). - cl_abap_unit_assert=>assert_equals( - act = lv_result - exp = `{/MS_STRUC/S_02/INPUT}` ). + cl_abap_unit_assert=>assert_equals( exp = `{/MS_STRUC/S_02/INPUT}` + act = lv_result ). ENDMETHOD. @@ -270,13 +252,11 @@ CLASS ltcl_test_main_structure IMPLEMENTATION. lo_app->mo_app = lo_test_app. DATA(lo_bind) = NEW z2ui5_cl_core_srv_bind( lo_app ). - DATA(lv_result) = lo_bind->main( - val = REF #( lo_test_app->ms_struc-s_02-s_03-input ) - type = z2ui5_if_core_types=>cs_bind_type-one_way ). + DATA(lv_result) = lo_bind->main( val = REF #( lo_test_app->ms_struc-s_02-s_03-input ) + type = z2ui5_if_core_types=>cs_bind_type-one_way ). - cl_abap_unit_assert=>assert_equals( - act = lv_result - exp = `{/MS_STRUC/S_02/S_03/INPUT}` ). + cl_abap_unit_assert=>assert_equals( exp = `{/MS_STRUC/S_02/S_03/INPUT}` + act = lv_result ). ENDMETHOD. @@ -287,26 +267,22 @@ CLASS ltcl_test_main_structure IMPLEMENTATION. lo_app->mo_app = lo_test_app. DATA(lo_bind) = NEW z2ui5_cl_core_srv_bind( lo_app ). - DATA(lv_result) = lo_bind->main( - val = REF #( lo_test_app->ms_struc-s_02-s_03-s_04-input ) - type = z2ui5_if_core_types=>cs_bind_type-one_way ). + DATA(lv_result) = lo_bind->main( val = REF #( lo_test_app->ms_struc-s_02-s_03-s_04-input ) + type = z2ui5_if_core_types=>cs_bind_type-one_way ). - cl_abap_unit_assert=>assert_equals( - act = lv_result - exp = `{/MS_STRUC/S_02/S_03/S_04/INPUT}` ). + cl_abap_unit_assert=>assert_equals( exp = `{/MS_STRUC/S_02/S_03/S_04/INPUT}` + act = lv_result ). ENDMETHOD. - ENDCLASS. -CLASS ltcl_test_main_object DEFINITION FINAL FOR TESTING - DURATION MEDIUM - RISK LEVEL HARMLESS. +CLASS ltcl_test_main_object DEFINITION FINAL + FOR TESTING RISK LEVEL HARMLESS DURATION MEDIUM. PUBLIC SECTION. - DATA mo_obj TYPE REF TO ltcl_test_main_object. + DATA mo_obj TYPE REF TO ltcl_test_main_object. DATA mv_value TYPE string. TYPES: @@ -330,11 +306,10 @@ CLASS ltcl_test_main_object DEFINITION FINAL FOR TESTING METHODS test_one_way_value FOR TESTING RAISING cx_static_check. METHODS test_one_way_struc FOR TESTING RAISING cx_static_check. - ENDCLASS. -CLASS ltcl_test_main_object IMPLEMENTATION. +CLASS ltcl_test_main_object IMPLEMENTATION. METHOD test_one_way_value. DATA(lo_test_app) = NEW ltcl_test_main_object( ). @@ -344,13 +319,11 @@ CLASS ltcl_test_main_object IMPLEMENTATION. lo_app->mo_app = lo_test_app. DATA(lo_bind) = NEW z2ui5_cl_core_srv_bind( lo_app ). - DATA(lv_result) = lo_bind->main( - val = REF #( lo_test_app->mo_obj->mv_value ) - type = z2ui5_if_core_types=>cs_bind_type-one_way ). + DATA(lv_result) = lo_bind->main( val = REF #( lo_test_app->mo_obj->mv_value ) + type = z2ui5_if_core_types=>cs_bind_type-one_way ). - cl_abap_unit_assert=>assert_equals( - act = lv_result - exp = `{/MO_OBJ/MV_VALUE}` ). + cl_abap_unit_assert=>assert_equals( exp = `{/MO_OBJ/MV_VALUE}` + act = lv_result ). ENDMETHOD. @@ -362,14 +335,11 @@ CLASS ltcl_test_main_object IMPLEMENTATION. lo_app->mo_app = lo_test_app. DATA(lo_bind) = NEW z2ui5_cl_core_srv_bind( lo_app ). - DATA(lv_result) = lo_bind->main( - val = REF #( lo_test_app->mo_obj->ms_struc-input ) - type = z2ui5_if_core_types=>cs_bind_type-one_way ). + DATA(lv_result) = lo_bind->main( val = REF #( lo_test_app->mo_obj->ms_struc-input ) + type = z2ui5_if_core_types=>cs_bind_type-one_way ). - cl_abap_unit_assert=>assert_equals( - act = lv_result - exp = `{/MO_OBJ/MS_STRUC/INPUT}` ). + cl_abap_unit_assert=>assert_equals( exp = `{/MO_OBJ/MS_STRUC/INPUT}` + act = lv_result ). ENDMETHOD. - ENDCLASS. diff --git a/src/01/02/z2ui5_cl_core_srv_diss.clas.abap b/src/01/02/z2ui5_cl_core_srv_diss.clas.abap index b2cb4726..49fded6b 100644 --- a/src/01/02/z2ui5_cl_core_srv_diss.clas.abap +++ b/src/01/02/z2ui5_cl_core_srv_diss.clas.abap @@ -1,16 +1,16 @@ CLASS z2ui5_cl_core_srv_diss DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. METHODS constructor IMPORTING - !attri TYPE REF TO z2ui5_if_core_types=>ty_t_attri - !app TYPE REF TO object. + attri TYPE REF TO z2ui5_if_core_types=>ty_t_attri + app TYPE REF TO object. + + METHODS main. - METHODS main . PROTECTED SECTION. DATA mt_attri TYPE REF TO z2ui5_if_core_types=>ty_t_attri. @@ -32,12 +32,14 @@ CLASS z2ui5_cl_core_srv_diss DEFINITION VALUE(result) TYPE z2ui5_if_core_types=>ty_t_attri. METHODS diss_oref - IMPORTING ir_attri TYPE REF TO z2ui5_if_core_types=>ty_s_attri - RETURNING VALUE(result) TYPE z2ui5_if_core_types=>ty_t_attri. + IMPORTING + ir_attri TYPE REF TO z2ui5_if_core_types=>ty_s_attri + RETURNING + VALUE(result) TYPE z2ui5_if_core_types=>ty_t_attri. METHODS create_new_entry IMPORTING - name TYPE string + !name TYPE string RETURNING VALUE(result) TYPE z2ui5_if_core_types=>ty_s_attri. @@ -45,10 +47,7 @@ CLASS z2ui5_cl_core_srv_diss DEFINITION ENDCLASS. - CLASS z2ui5_cl_core_srv_diss IMPLEMENTATION. - - METHOD constructor. mt_attri = attri. @@ -56,20 +55,17 @@ CLASS z2ui5_cl_core_srv_diss IMPLEMENTATION. ENDMETHOD. - METHOD create_new_entry. - result = VALUE z2ui5_if_core_types=>ty_s_attri( ). - result-name = name. - DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( - attri = mt_attri - app = mo_app ). + result = VALUE z2ui5_if_core_types=>ty_s_attri( ). + result-name = name. + DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( attri = mt_attri + app = mo_app ). result-r_ref = lo_model->attri_get_val_ref( name ). result-o_typedescr = cl_abap_datadescr=>describe_by_data_ref( result-r_ref ). ENDMETHOD. - METHOD diss_dref. IF z2ui5_cl_util=>check_unassign_inital( ir_attri->r_ref ). @@ -92,10 +88,9 @@ CLASS z2ui5_cl_core_srv_diss IMPLEMENTATION. WHEN OTHERS. - ls_attri2-name = ir_attri->name && `->*`. - DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( - attri = mt_attri - app = mo_app ). + ls_attri2-name = |{ ir_attri->name }->*|. + DATA(lo_model) = NEW z2ui5_cl_core_srv_attri( attri = mt_attri + app = mo_app ). ls_attri2-r_ref = lo_model->attri_get_val_ref( ls_attri2-name ). INSERT ls_attri2 INTO TABLE result. @@ -103,7 +98,6 @@ CLASS z2ui5_cl_core_srv_diss IMPLEMENTATION. ENDMETHOD. - METHOD diss_oref. IF z2ui5_cl_util=>check_unassign_inital( ir_attri->r_ref ). @@ -114,11 +108,11 @@ CLASS z2ui5_cl_core_srv_diss IMPLEMENTATION. DATA(lt_attri) = z2ui5_cl_util=>rtti_get_t_attri_by_oref( lr_ref ). LOOP AT lt_attri REFERENCE INTO DATA(lr_attri) - WHERE visibility = cl_abap_objectdescr=>public - AND is_interface = abap_false - AND is_constant = abap_false. + WHERE visibility = cl_abap_objectdescr=>public + AND is_interface = abap_false + AND is_constant = abap_false. TRY. - DATA(lv_name) = COND #( WHEN ir_attri->name IS NOT INITIAL THEN ir_attri->name && `->` ) && lr_attri->name. + DATA(lv_name) = COND #( WHEN ir_attri->name IS NOT INITIAL THEN |{ ir_attri->name }->| ) && lr_attri->name. DATA(ls_new) = create_new_entry( lv_name ). INSERT ls_new INTO TABLE result. @@ -128,14 +122,13 @@ CLASS z2ui5_cl_core_srv_diss IMPLEMENTATION. ENDMETHOD. - METHOD diss_struc. IF ir_attri->o_typedescr->kind = cl_abap_typedescr=>kind_ref. - DATA(lv_name) = ir_attri->name && `->`. + DATA(lv_name) = |{ ir_attri->name }->|. DATA(lr_ref) = z2ui5_cl_util=>unassign_data( ir_attri->r_ref ). ELSE. - lv_name = ir_attri->name && `-`. + lv_name = |{ ir_attri->name }-|. lr_ref = ir_attri->r_ref. ENDIF. @@ -148,7 +141,6 @@ CLASS z2ui5_cl_core_srv_diss IMPLEMENTATION. ENDMETHOD. - METHOD main. TRY. @@ -170,12 +162,11 @@ CLASS z2ui5_cl_core_srv_diss IMPLEMENTATION. ENDMETHOD. - METHOD main_init. IF mt_attri->* IS NOT INITIAL. LOOP AT mt_attri->* TRANSPORTING NO FIELDS - WHERE bind_type <> z2ui5_if_core_types=>cs_bind_type-one_time. + WHERE bind_type <> z2ui5_if_core_types=>cs_bind_type-one_time. ENDLOOP. IF sy-subrc = 0. RETURN. @@ -188,21 +179,20 @@ CLASS z2ui5_cl_core_srv_diss IMPLEMENTATION. ENDMETHOD. - METHOD main_run. DATA(lt_attri_new) = VALUE z2ui5_if_core_types=>ty_t_attri( ). LOOP AT mt_attri->* REFERENCE INTO DATA(lr_attri) - WHERE check_dissolved = abap_false - AND bind_type <> z2ui5_if_core_types=>cs_bind_type-one_time. + WHERE check_dissolved = abap_false + AND bind_type <> z2ui5_if_core_types=>cs_bind_type-one_time. lr_attri->check_dissolved = abap_true. IF lr_attri->o_typedescr IS NOT BOUND. DATA(ls_entry) = create_new_entry( lr_attri->name ). lr_attri->o_typedescr = ls_entry-o_typedescr. - lr_attri->r_ref = ls_entry-r_ref. + lr_attri->r_ref = ls_entry-r_ref. ENDIF. CASE lr_attri->o_typedescr->kind. diff --git a/src/01/02/z2ui5_cl_core_srv_diss.clas.testclasses.abap b/src/01/02/z2ui5_cl_core_srv_diss.clas.testclasses.abap index a13603ff..f56755b7 100644 --- a/src/01/02/z2ui5_cl_core_srv_diss.clas.testclasses.abap +++ b/src/01/02/z2ui5_cl_core_srv_diss.clas.testclasses.abap @@ -1,9 +1,8 @@ CLASS ltcl_test_dissolve DEFINITION DEFERRED. CLASS z2ui5_cl_core_srv_diss DEFINITION LOCAL FRIENDS ltcl_test_dissolve. -CLASS ltcl_test_dissolve DEFINITION FINAL FOR TESTING - DURATION SHORT - RISK LEVEL HARMLESS. +CLASS ltcl_test_dissolve DEFINITION FINAL + FOR TESTING RISK LEVEL HARMLESS DURATION SHORT. PUBLIC SECTION. @@ -27,38 +26,36 @@ CLASS ltcl_test_dissolve DEFINITION FINAL FOR TESTING s_01 TYPE s_01, END OF ty_s_struc. - DATA ms_struc TYPE s_01 ##NEEDED. - DATA mv_value TYPE string ##NEEDED. - DATA mr_value TYPE REF TO data. - DATA mr_struc TYPE REF TO s_01. - DATA mo_app TYPE REF TO ltcl_test_dissolve. + DATA ms_struc TYPE s_01 ##NEEDED. + DATA mv_value TYPE string ##NEEDED. + DATA mr_value TYPE REF TO data. + DATA mr_struc TYPE REF TO s_01. + DATA mo_app TYPE REF TO ltcl_test_dissolve. DATA ms_struc2 TYPE ty_s_struc. PRIVATE SECTION. - METHODS test_init FOR TESTING RAISING cx_static_check. - METHODS test_struc FOR TESTING RAISING cx_static_check. - METHODS test_dref FOR TESTING RAISING cx_static_check. - METHODS test_struc_dref FOR TESTING RAISING cx_static_check. - METHODS test_oref FOR TESTING RAISING cx_static_check. - METHODS test_ref FOR TESTING RAISING cx_static_check. - METHODS test_oref_dref_struc FOR TESTING RAISING cx_static_check. - METHODS test_oref_dref FOR TESTING RAISING cx_static_check. - METHODS test_dref_struc FOR TESTING RAISING cx_static_check. + METHODS test_init FOR TESTING RAISING cx_static_check. + METHODS test_struc FOR TESTING RAISING cx_static_check. + METHODS test_dref FOR TESTING RAISING cx_static_check. + METHODS test_struc_dref FOR TESTING RAISING cx_static_check. + METHODS test_oref FOR TESTING RAISING cx_static_check. + METHODS test_ref FOR TESTING RAISING cx_static_check. + METHODS test_oref_dref_struc FOR TESTING RAISING cx_static_check. + METHODS test_oref_dref FOR TESTING RAISING cx_static_check. + METHODS test_dref_struc FOR TESTING RAISING cx_static_check. ENDCLASS. + CLASS ltcl_test_dissolve IMPLEMENTATION. - - METHOD test_ref. - DATA(lo_app) = NEW ltcl_test_dissolve( ). + DATA(lo_app) = NEW ltcl_test_dissolve( ). DATA lt_attri TYPE z2ui5_if_core_types=>ty_t_attri. - DATA(lo_model) = NEW z2ui5_cl_core_srv_diss( - attri = REF #( lt_attri ) - app = lo_app ). + DATA(lo_model) = NEW z2ui5_cl_core_srv_diss( attri = REF #( lt_attri ) + app = lo_app ). lo_model->main( ). @@ -73,12 +70,11 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. METHOD test_init. - DATA(lo_app) = NEW ltcl_test_dissolve( ). + DATA(lo_app) = NEW ltcl_test_dissolve( ). DATA lt_attri TYPE z2ui5_if_core_types=>ty_t_attri. - DATA(lo_model) = NEW z2ui5_cl_core_srv_diss( - attri = REF #( lt_attri ) - app = lo_app ). + DATA(lo_model) = NEW z2ui5_cl_core_srv_diss( attri = REF #( lt_attri ) + app = lo_app ). lo_model->main( ). lo_model->main( ). @@ -93,14 +89,13 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. METHOD test_dref. - DATA(lo_app) = NEW ltcl_test_dissolve( ). + DATA(lo_app) = NEW ltcl_test_dissolve( ). CREATE DATA lo_app->mr_struc. CREATE DATA lo_app->mr_value TYPE string. DATA lt_attri TYPE z2ui5_if_core_types=>ty_t_attri. - DATA(lo_model) = NEW z2ui5_cl_core_srv_diss( - attri = REF #( lt_attri ) - app = lo_app ). + DATA(lo_model) = NEW z2ui5_cl_core_srv_diss( attri = REF #( lt_attri ) + app = lo_app ). lo_model->main( ). lo_model->main( ). @@ -111,7 +106,7 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. METHOD test_oref. - DATA(lo_app) = NEW ltcl_test_dissolve( ). + DATA(lo_app) = NEW ltcl_test_dissolve( ). lo_app->mo_app = NEW #( ). DATA(lo_app2) = NEW ltcl_test_dissolve( ). lo_app2->mo_app = lo_app. @@ -120,9 +115,8 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. CREATE DATA lo_app->mo_app->mr_value TYPE string. DATA lt_attri TYPE z2ui5_if_core_types=>ty_t_attri. - DATA(lo_model) = NEW z2ui5_cl_core_srv_diss( - attri = REF #( lt_attri ) - app = lo_app2 ). + DATA(lo_model) = NEW z2ui5_cl_core_srv_diss( attri = REF #( lt_attri ) + app = lo_app2 ). lo_model->main( ). lo_model->main( ). @@ -137,11 +131,10 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. METHOD test_struc. - DATA(lo_app) = NEW ltcl_test_dissolve( ). + DATA(lo_app) = NEW ltcl_test_dissolve( ). DATA lt_attri TYPE z2ui5_if_core_types=>ty_t_attri. - DATA(lo_model) = NEW z2ui5_cl_core_srv_diss( - attri = REF #( lt_attri ) - app = lo_app ). + DATA(lo_model) = NEW z2ui5_cl_core_srv_diss( attri = REF #( lt_attri ) + app = lo_app ). lo_model->main( ). lo_model->main( ). @@ -157,7 +150,7 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. METHOD test_dref_struc. - DATA(lo_app) = NEW ltcl_test_dissolve( ). + DATA(lo_app) = NEW ltcl_test_dissolve( ). lo_app->mo_app = NEW #( ). DATA(lo_app2) = NEW ltcl_test_dissolve( ). lo_app2->mo_app = lo_app. @@ -165,9 +158,8 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. CREATE DATA lo_app->mr_struc. DATA lt_attri TYPE z2ui5_if_core_types=>ty_t_attri. - DATA(lo_model) = NEW z2ui5_cl_core_srv_diss( - attri = REF #( lt_attri ) - app = lo_app ). + DATA(lo_model) = NEW z2ui5_cl_core_srv_diss( attri = REF #( lt_attri ) + app = lo_app ). lo_model->main( ). lo_model->main( ). @@ -181,7 +173,7 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. METHOD test_oref_dref. - DATA(lo_app) = NEW ltcl_test_dissolve( ). + DATA(lo_app) = NEW ltcl_test_dissolve( ). lo_app->mo_app = NEW #( ). DATA(lo_app2) = NEW ltcl_test_dissolve( ). lo_app->mo_app = lo_app2. @@ -189,9 +181,8 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. CREATE DATA lo_app2->mr_value TYPE string. DATA lt_attri TYPE z2ui5_if_core_types=>ty_t_attri. - DATA(lo_model) = NEW z2ui5_cl_core_srv_diss( - attri = REF #( lt_attri ) - app = lo_app ). + DATA(lo_model) = NEW z2ui5_cl_core_srv_diss( attri = REF #( lt_attri ) + app = lo_app ). lo_model->main( ). lo_model->main( ). @@ -203,7 +194,7 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. METHOD test_oref_dref_struc. - DATA(lo_app) = NEW ltcl_test_dissolve( ). + DATA(lo_app) = NEW ltcl_test_dissolve( ). lo_app->mo_app = NEW #( ). DATA(lo_app2) = NEW ltcl_test_dissolve( ). lo_app->mo_app = lo_app2. @@ -211,9 +202,8 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. CREATE DATA lo_app->mo_app->mr_struc. DATA lt_attri TYPE z2ui5_if_core_types=>ty_t_attri. - DATA(lo_model) = NEW z2ui5_cl_core_srv_diss( - attri = REF #( lt_attri ) - app = lo_app ). + DATA(lo_model) = NEW z2ui5_cl_core_srv_diss( attri = REF #( lt_attri ) + app = lo_app ). lo_model->main( ). lo_model->main( ). @@ -226,17 +216,15 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. ENDMETHOD. - METHOD test_struc_dref. - DATA(lo_app) = NEW ltcl_test_dissolve( ). + DATA(lo_app) = NEW ltcl_test_dissolve( ). lo_app->mo_app = NEW #( ). CREATE DATA lo_app->mo_app->ms_struc2-r_ref TYPE string. DATA lt_attri TYPE z2ui5_if_core_types=>ty_t_attri. - DATA(lo_model) = NEW z2ui5_cl_core_srv_diss( - attri = REF #( lt_attri ) - app = lo_app ). + DATA(lo_model) = NEW z2ui5_cl_core_srv_diss( attri = REF #( lt_attri ) + app = lo_app ). lo_model->main( ). lo_model->main( ). @@ -247,5 +235,4 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. cl_abap_unit_assert=>assert_not_initial( VALUE #( lt_attri[ name = `MO_APP->MS_STRUC2-R_REF->*` ] OPTIONAL ) ). ENDMETHOD. - ENDCLASS. diff --git a/src/01/02/z2ui5_cl_core_srv_event.clas.abap b/src/01/02/z2ui5_cl_core_srv_event.clas.abap index 7b053a10..ef0d9c3f 100644 --- a/src/01/02/z2ui5_cl_core_srv_event.clas.abap +++ b/src/01/02/z2ui5_cl_core_srv_event.clas.abap @@ -1,23 +1,22 @@ CLASS z2ui5_cl_core_srv_event DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. METHODS get_event IMPORTING - !val TYPE clike OPTIONAL - !t_arg TYPE string_table OPTIONAL - !s_cnt TYPE z2ui5_if_types=>ty_s_event_control OPTIONAL + val TYPE clike OPTIONAL + t_arg TYPE string_table OPTIONAL + s_cnt TYPE z2ui5_if_types=>ty_s_event_control OPTIONAL PREFERRED PARAMETER val RETURNING VALUE(result) TYPE string. METHODS get_event_client IMPORTING - !val TYPE clike - !t_arg TYPE string_table OPTIONAL + val TYPE clike + t_arg TYPE string_table OPTIONAL RETURNING VALUE(result) TYPE string. @@ -34,20 +33,18 @@ ENDCLASS. CLASS z2ui5_cl_core_srv_event IMPLEMENTATION. - METHOD get_event. result = |{ z2ui5_if_core_types=>cs_ui5-event_backend_function }(['{ val }'|. IF s_cnt-check_allow_multi_req = abap_true. - result = result && `,false,true`. + result = |{ result },false,true|. ENDIF. - result = result && `]` && get_t_arg( t_arg ). + result = |{ result }]{ get_t_arg( t_arg ) }|. ENDMETHOD. - METHOD get_event_client. result = |{ z2ui5_if_core_types=>cs_ui5-event_frontend_function }('{ val }'|. @@ -55,7 +52,6 @@ CLASS z2ui5_cl_core_srv_event IMPLEMENTATION. ENDMETHOD. - METHOD get_t_arg. IF val IS NOT INITIAL. @@ -66,14 +62,14 @@ CLASS z2ui5_cl_core_srv_event IMPLEMENTATION. CONTINUE. ENDIF. IF lv_new(1) <> `$` AND lv_new(1) <> `{`. - lv_new = `'` && lv_new && `'`. + lv_new = |'{ lv_new }'|. ENDIF. - result = result && `, ` && lv_new. + result = |{ result }, { lv_new }|. ENDLOOP. ENDIF. - result = result && `)`. + result = |{ result })|. ENDMETHOD. ENDCLASS. diff --git a/src/01/02/z2ui5_cl_core_srv_event.clas.testclasses.abap b/src/01/02/z2ui5_cl_core_srv_event.clas.testclasses.abap index e028fb4e..2d0c3665 100644 --- a/src/01/02/z2ui5_cl_core_srv_event.clas.testclasses.abap +++ b/src/01/02/z2ui5_cl_core_srv_event.clas.testclasses.abap @@ -1,25 +1,24 @@ -CLASS ltcl_test DEFINITION FINAL FOR TESTING - DURATION LONG - RISK LEVEL HARMLESS. +CLASS ltcl_test DEFINITION FINAL + FOR TESTING RISK LEVEL HARMLESS DURATION LONG. PUBLIC SECTION. - METHODS event FOR TESTING. + METHODS event FOR TESTING. METHODS event_backend FOR TESTING. + PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. CLASS ltcl_test IMPLEMENTATION. - METHOD event. DATA(lo_event) = NEW z2ui5_cl_core_srv_event( ). DATA(lv_event) = lo_event->get_event( `POST` ). - cl_abap_unit_assert=>assert_equals( - act = lv_event - exp = `.eB(['POST'])` ). + cl_abap_unit_assert=>assert_equals( exp = `.eB(['POST'])` + act = lv_event ). ENDMETHOD. @@ -28,9 +27,8 @@ CLASS ltcl_test IMPLEMENTATION. DATA(lo_event) = NEW z2ui5_cl_core_srv_event( ). DATA(lv_event) = lo_event->get_event_client( z2ui5_if_client=>cs_event-popover_close ). - cl_abap_unit_assert=>assert_equals( - act = lv_event - exp = `.eF('POPOVER_CLOSE')` ). + cl_abap_unit_assert=>assert_equals( exp = `.eF('POPOVER_CLOSE')` + act = lv_event ). ENDMETHOD. ENDCLASS. diff --git a/src/01/02/z2ui5_cl_core_srv_json.clas.abap b/src/01/02/z2ui5_cl_core_srv_json.clas.abap index 389efa01..ae08ddd3 100644 --- a/src/01/02/z2ui5_cl_core_srv_json.clas.abap +++ b/src/01/02/z2ui5_cl_core_srv_json.clas.abap @@ -1,45 +1,42 @@ CLASS z2ui5_cl_core_srv_json DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. - INTERFACES z2ui5_if_ajson_filter . + INTERFACES z2ui5_if_ajson_filter. METHODS request_json_to_abap IMPORTING val TYPE string RETURNING - VALUE(result) TYPE z2ui5_if_core_types=>ty_s_request . + VALUE(result) TYPE z2ui5_if_core_types=>ty_s_request. METHODS response_abap_to_json IMPORTING val TYPE z2ui5_if_core_types=>ty_s_response RETURNING - VALUE(result) TYPE string . + VALUE(result) TYPE string. METHODS model_front_to_back IMPORTING view TYPE string t_attri TYPE REF TO z2ui5_if_core_types=>ty_t_attri - model TYPE REF TO z2ui5_if_ajson . + model TYPE REF TO z2ui5_if_ajson. METHODS model_back_to_front IMPORTING t_attri TYPE REF TO z2ui5_if_core_types=>ty_t_attri RETURNING - VALUE(result) TYPE string . + VALUE(result) TYPE string. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. - CLASS z2ui5_cl_core_srv_json IMPLEMENTATION. - - METHOD model_front_to_back. IF line_exists( t_attri->*[ view = view ] ). @@ -49,8 +46,8 @@ CLASS z2ui5_cl_core_srv_json IMPLEMENTATION. ENDIF. LOOP AT t_attri->* REFERENCE INTO DATA(lr_attri) - WHERE bind_type = z2ui5_if_core_types=>cs_bind_type-two_way - AND view = lv_view. + WHERE bind_type = z2ui5_if_core_types=>cs_bind_type-two_way + AND view = lv_view. TRY. DATA(lo_val_front) = model->slice( lr_attri->name_client ). @@ -71,19 +68,15 @@ CLASS z2ui5_cl_core_srv_json IMPLEMENTATION. CONTINUE. ENDIF. - lo_val_front->to_abap( - IMPORTING - ev_container = ). + lo_val_front->to_abap( IMPORTING ev_container = ). CATCH cx_root INTO DATA(x). z2ui5_cl_util=>x_raise( |JSON_PARSING_ERROR: { x->get_text( ) } | ). ENDTRY. ENDLOOP. - ENDMETHOD. - METHOD model_back_to_front. TRY. @@ -91,9 +84,11 @@ CLASS z2ui5_cl_core_srv_json IMPLEMENTATION. LOOP AT t_attri->* REFERENCE INTO DATA(lr_attri) WHERE bind_type <> ``. IF lr_attri->custom_mapper IS BOUND. - DATA(ajson) = CAST z2ui5_if_ajson( z2ui5_cl_ajson=>create_empty( ii_custom_mapping = lr_attri->custom_mapper ) ). + DATA(ajson) = CAST z2ui5_if_ajson( z2ui5_cl_ajson=>create_empty( + ii_custom_mapping = lr_attri->custom_mapper ) ). ELSE. - ajson = CAST z2ui5_if_ajson( z2ui5_cl_ajson=>create_empty( ii_custom_mapping = z2ui5_cl_ajson_mapping=>create_upper_case( ) ) ). + ajson = CAST z2ui5_if_ajson( z2ui5_cl_ajson=>create_empty( + ii_custom_mapping = z2ui5_cl_ajson_mapping=>create_upper_case( ) ) ). ENDIF. CASE lr_attri->bind_type. @@ -105,10 +100,14 @@ CLASS z2ui5_cl_core_srv_json IMPLEMENTATION. CONTINUE. ENDIF. * ASSERT sy-subrc = 0. - ajson->set( iv_ignore_empty = abap_false iv_path = `/` iv_val = ). + ajson->set( iv_ignore_empty = abap_false + iv_path = `/` + iv_val = ). WHEN z2ui5_if_core_types=>cs_bind_type-one_time. - ajson->set( iv_ignore_empty = abap_false iv_path = `/` iv_val = lr_attri->json_bind_local ). + ajson->set( iv_ignore_empty = abap_false + iv_path = `/` + iv_val = lr_attri->json_bind_local ). WHEN OTHERS. ASSERT `` = `ERROR_UNKNOWN_BIND_MODE`. @@ -118,7 +117,8 @@ CLASS z2ui5_cl_core_srv_json IMPLEMENTATION. ajson = ajson->filter( lr_attri->custom_filter ). ENDIF. - ajson_result->set( iv_path = lr_attri->name_client iv_val = ajson ). + ajson_result->set( iv_path = lr_attri->name_client + iv_val = ajson ). ENDLOOP. result = ajson_result->stringify( ). @@ -129,31 +129,28 @@ CLASS z2ui5_cl_core_srv_json IMPLEMENTATION. ENDTRY. ENDMETHOD. - METHOD request_json_to_abap. TRY. DATA(lo_ajson) = CAST z2ui5_if_ajson( z2ui5_cl_ajson=>parse( val ) ). - DATA(lv_model_edit_name) = `/` && z2ui5_if_core_types=>cs_ui5-two_way_model. + DATA(lv_model_edit_name) = |/{ z2ui5_if_core_types=>cs_ui5-two_way_model }|. result-o_model = z2ui5_cl_ajson=>create_empty( ). DATA(lo_model) = lo_ajson->slice( lv_model_edit_name ). - result-o_model->set( iv_path = lv_model_edit_name iv_val = lo_model ). + result-o_model->set( iv_path = lv_model_edit_name + iv_val = lo_model ). lo_ajson->delete( lv_model_edit_name ). lo_ajson = lo_ajson->slice( `/S_FRONT` ). - lo_ajson->to_abap( - EXPORTING - iv_corresponding = abap_true - IMPORTING - ev_container = result-s_front ). + lo_ajson->to_abap( EXPORTING iv_corresponding = abap_true + IMPORTING ev_container = result-s_front ). result-s_front-o_comp_data = lo_ajson->slice( `/CONFIG/ComponentData` ). - result-s_control-check_launchpad = xsdbool( result-s_front-search CS `scenario=LAUNCHPAD` - OR result-s_front-pathname CS `/ui2/flp` - OR result-s_front-pathname CS `test/flpSandbox` + result-s_control-check_launchpad = xsdbool( result-s_front-search CS `scenario=LAUNCHPAD` + OR result-s_front-pathname CS `/ui2/flp` + OR result-s_front-pathname CS `test/flpSandbox` ). IF result-s_front-id IS NOT INITIAL. RETURN. @@ -175,37 +172,36 @@ CLASS z2ui5_cl_core_srv_json IMPLEMENTATION. ENDIF. result-s_control-app_start = z2ui5_cl_util=>c_trim_upper( - z2ui5_cl_util=>url_param_get( val = `app_start` url = result-s_front-search ) ). + z2ui5_cl_util=>url_param_get( val = `app_start` + url = result-s_front-search ) ). CATCH cx_root INTO DATA(x). RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - val = x. + EXPORTING val = x. ENDTRY. ENDMETHOD. - METHOD response_abap_to_json. TRY. DATA(ajson_result) = CAST z2ui5_if_ajson( z2ui5_cl_ajson=>create_empty( - ii_custom_mapping = z2ui5_cl_ajson_mapping=>create_upper_case( ) ) ). + ii_custom_mapping = z2ui5_cl_ajson_mapping=>create_upper_case( ) ) ). - ajson_result->set( iv_path = `/` iv_val = val-s_front ). + ajson_result->set( iv_path = `/` + iv_val = val-s_front ). ajson_result = ajson_result->filter( NEW z2ui5_cl_core_srv_json( ) ). DATA(lv_frontend) = ajson_result->stringify( ). - result = `{` && + result = |\{| && |"S_FRONT":{ lv_frontend },| && |"MODEL":{ val-model }| && - `}`. + |\}|. CATCH cx_root INTO DATA(x). ASSERT x IS NOT BOUND. ENDTRY. ENDMETHOD. - METHOD z2ui5_if_ajson_filter~keep_node. rv_keep = abap_true. diff --git a/src/01/02/z2ui5_cl_core_srv_json.clas.testclasses.abap b/src/01/02/z2ui5_cl_core_srv_json.clas.testclasses.abap index 0208e6d7..57d1f693 100644 --- a/src/01/02/z2ui5_cl_core_srv_json.clas.testclasses.abap +++ b/src/01/02/z2ui5_cl_core_srv_json.clas.testclasses.abap @@ -1,6 +1,5 @@ -CLASS ltcl_test DEFINITION FINAL FOR TESTING - DURATION SHORT - RISK LEVEL HARMLESS. +CLASS ltcl_test DEFINITION FINAL + FOR TESTING RISK LEVEL HARMLESS DURATION SHORT. PRIVATE SECTION. METHODS request_json_to_abap FOR TESTING RAISING cx_static_check. @@ -9,39 +8,32 @@ ENDCLASS. CLASS ltcl_test IMPLEMENTATION. - METHOD request_json_to_abap. - DATA(lv_payload) = `{"XX":{"NAME":"test"},"S_FRONT":{"ID":"ID_NR","EDIT":{"NAME":"test"},"ORIGIN":"ORIGIN","PATHNAME":"PATHNAME","SEARCH":"SEARCH"` && - `,"VIEW":"MAIN","EVENT":"BUTTON_POST","T_EVENT_ARG":[]}}`. + DATA(lv_payload) = |\{"XX":\{"NAME":"test"\},"S_FRONT":\{"ID":"ID_NR","EDIT":\{"NAME":"test"\},"ORIGIN":"ORIGIN","PATHNAME":"PATHNAME","SEARCH":"SEARCH"| && + |,"VIEW":"MAIN","EVENT":"BUTTON_POST","T_EVENT_ARG":[]\}\}|. DATA(lo_mapper) = NEW z2ui5_cl_core_srv_json( ). DATA(ls_result) = lo_mapper->request_json_to_abap( lv_payload ). - DATA(ls_exp) = VALUE z2ui5_if_core_types=>ty_s_request( - s_front = VALUE #( - id = `ID_NR` - view = `MAIN` - origin = `ORIGIN` - pathname = `PATHNAME` - search = `SEARCH` - event = `BUTTON_POST` ) ). + DATA(ls_exp) = VALUE z2ui5_if_core_types=>ty_s_request( s_front = VALUE #( id = `ID_NR` + view = `MAIN` + origin = `ORIGIN` + pathname = `PATHNAME` + search = `SEARCH` + event = `BUTTON_POST` ) ). - cl_abap_unit_assert=>assert_equals( - act = ls_result-s_front - exp = ls_exp-s_front ). + cl_abap_unit_assert=>assert_equals( exp = ls_exp-s_front + act = ls_result-s_front ). DATA(lt_tree) = VALUE z2ui5_if_ajson_types=>ty_nodes_ts( ). lt_tree = ls_result-o_model->mt_json_tree. - cl_abap_unit_assert=>assert_equals( - act = lt_tree[ name = `NAME` ]-value - exp = `test` ). + cl_abap_unit_assert=>assert_equals( exp = `test` + act = lt_tree[ name = `NAME` ]-value ). - cl_abap_unit_assert=>assert_equals( - act = lines( lt_tree ) - exp = 3 ). + cl_abap_unit_assert=>assert_equals( exp = 3 + act = lines( lt_tree ) ). ENDMETHOD. - ENDCLASS. diff --git a/src/01/02/z2ui5_cl_core_srv_util.clas.abap b/src/01/02/z2ui5_cl_core_srv_util.clas.abap index 63b0598d..c63b2696 100644 --- a/src/01/02/z2ui5_cl_core_srv_util.clas.abap +++ b/src/01/02/z2ui5_cl_core_srv_util.clas.abap @@ -1,7 +1,7 @@ CLASS z2ui5_cl_core_srv_util DEFINITION PUBLIC INHERITING FROM z2ui5_cl_util - CREATE PUBLIC . + CREATE PUBLIC. PUBLIC SECTION. @@ -19,37 +19,33 @@ CLASS z2ui5_cl_core_srv_util DEFINITION VALUE(result) TYPE string. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. - CLASS z2ui5_cl_core_srv_util IMPLEMENTATION. - - METHOD app_get_url. IF classname IS INITIAL. classname = rtti_get_classname_by_ref( client->get_app( ) ). ENDIF. - DATA(lv_url) = client->get( )-s_config-origin && client->get( )-s_config-pathname && `?`. + DATA(lv_url) = |{ client->get( )-s_config-origin }{ client->get( )-s_config-pathname }?|. DATA(lt_param) = url_param_get_tab( client->get( )-s_config-search ). DELETE lt_param WHERE n = `app_start`. - INSERT VALUE #( n = `app_start` v = to_lower( classname ) ) INTO TABLE lt_param. + INSERT VALUE #( n = `app_start` + v = to_lower( classname ) ) INTO TABLE lt_param. - result = lv_url && url_param_create_url( lt_param ) && client->get( )-s_config-hash. + result = lv_url && url_param_create_url( lt_param ) && client->get( )-s_config-hash. ENDMETHOD. - METHOD app_get_url_source_code. DATA(ls_config) = client->get( )-s_config. - result = ls_config-origin && `/sap/bc/adt/oo/classes/` - && rtti_get_classname_by_ref( client->get_app( ) ) && `/source/main`. + result = |{ ls_config-origin }/sap/bc/adt/oo/classes/| + && |{ rtti_get_classname_by_ref( client->get_app( ) ) }/source/main|. ENDMETHOD. - - ENDCLASS. diff --git a/src/01/03/z2ui5_cl_app_app_js.clas.abap b/src/01/03/z2ui5_cl_app_app_js.clas.abap index 47192cd4..dc59cddf 100644 --- a/src/01/03/z2ui5_cl_app_app_js.clas.abap +++ b/src/01/03/z2ui5_cl_app_app_js.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_app_app_js DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -10,797 +9,796 @@ CLASS z2ui5_cl_app_app_js DEFINITION VALUE(result) TYPE string. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. CLASS z2ui5_cl_app_app_js IMPLEMENTATION. - METHOD get. - result = `sap.ui.define(["sap/ui/core/mvc/Controller",` && |\n| && - ` "z2ui5/controller/View1.controller",` && |\n| && - `], function (BaseController, Controller) {` && |\n| && - ` return BaseController.extend("z2ui5.controller.App", {` && |\n| && - `` && |\n| && - ` onInit: async function () {` && |\n| && - `` && |\n| && - ` z2ui5.oConfig.pathname = this.getView().getModel().sServiceUrl;` && |\n| && - ` if (z2ui5?.checkLocal == true ) {` && |\n| && - ` z2ui5.oConfig.pathname = window.location.href;` && |\n| && - ` };` && |\n| && - `` && |\n| && - ` z2ui5.oController = new Controller();` && |\n| && - ` z2ui5.oController.setApp(this.getView().byId("app"));` && |\n| && - `` && |\n| && - ` z2ui5.oControllerNest = new Controller();` && |\n| && - ` z2ui5.oControllerNest2 = new Controller();` && |\n| && - ` z2ui5.oControllerPopup = new Controller();` && |\n| && - ` z2ui5.oControllerPopover = new Controller();` && |\n| && - `` && |\n| && - ` z2ui5.onBeforeRoundtrip = [];` && |\n| && - ` z2ui5.onAfterRendering = [];` && |\n| && - ` z2ui5.onBeforeEventFrontend = [];` && |\n| && - ` z2ui5.onAfterRoundtrip = [];` && |\n| && - `` && |\n| && - ` z2ui5.checkNestAfter = false;` && |\n| && - `` && |\n| && - ` }` && |\n| && - ` });` && |\n| && - `});` && |\n| && - `` && |\n| && - `` && |\n| && - `sap.ui.define("z2ui5/Timer", ["sap/ui/core/Control"], (Control) => {` && |\n| && - ` "use strict";` && |\n| && - `` && |\n| && - ` return Control.extend("z2ui5.Timer", {` && |\n| && - ` metadata: {` && |\n| && - ` properties: {` && |\n| && - ` delayMS: {` && |\n| && - ` type: "string",` && |\n| && - ` defaultValue: ""` && |\n| && - ` },` && |\n| && - ` checkActive: {` && |\n| && - ` type: "boolean",` && |\n| && - ` defaultValue: true` && |\n| && - ` },` && |\n| && - ` checkRepeat: {` && |\n| && - ` type: "boolean",` && |\n| && - ` defaultValue: false` && |\n| && - ` },` && |\n| && - ` },` && |\n| && - ` events: {` && |\n| && - ` "finished": {` && |\n| && - ` allowPreventDefault: true,` && |\n| && - ` parameters: {},` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` onAfterRendering() { },` && |\n| && - ` delayedCall(oControl) {` && |\n| && - `` && |\n| && - ` if (oControl.getProperty("checkActive") == false) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` setTimeout((oControl) => {` && |\n| && - ` oControl.setProperty("checkActive", false)` && |\n| && - ` oControl.fireFinished();` && |\n| && - ` if (oControl.getProperty("checkRepeat")) {` && |\n| && - ` oControl.delayedCall(oControl);` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` , parseInt(oControl.getProperty("delayMS")), oControl);` && |\n| && - ` },` && |\n| && - ` renderer(oRm, oControl) {` && |\n| && - ` oControl.delayedCall(oControl);` && |\n| && - ` }` && |\n| && - ` });` && |\n| && - `}` && |\n| && - `);` && |\n| && - `` && |\n| && - `sap.ui.define("z2ui5/Focus", ["sap/ui/core/Control",], (Control) => {` && |\n| && - ` "use strict";` && |\n| && - ` return Control.extend("z2ui5.Focus", {` && |\n| && - ` metadata: {` && |\n| && - ` properties: {` && |\n| && - ` setUpdate: {` && |\n| && - ` type: "boolean",` && |\n| && - ` defaultValue: true` && |\n| && - ` },` && |\n| && - ` focusId: {` && |\n| && - ` type: "string"` && |\n| && - ` },` && |\n| && - ` selectionStart: {` && |\n| && - ` type: "string",` && |\n| && - ` defaultValue: "0"` && |\n| && - ` },` && |\n| && - ` selectionEnd: {` && |\n| && - ` type: "string",` && |\n| && - ` defaultValue: "0"` && |\n| && - ` },` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` init() { },` && |\n| && - ` setFocusId(val) {` && |\n| && - ` try {` && |\n| && - ` this.setProperty("focusId", val);` && |\n| && - ` var oElement = z2ui5.oView.byId(val);` && |\n| && - ` var oFocus = oElement.getFocusInfo();` && |\n| && - ` oElement.applyFocusInfo(oFocus);` && |\n| && - ` } catch (e) { }` && |\n| && - ` },` && |\n| && - ` renderer(oRm, oControl) {` && |\n| && - ` if (!oControl.getProperty("setUpdate")) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` oControl.setProperty("setUpdate", false);` && |\n| && - ` setTimeout((oControl) => {` && |\n| && - ` var oElement = z2ui5.oView.byId(oControl.getProperty("focusId"));` && |\n| && - ` var oFocus = oElement.getFocusInfo();` && |\n| && - ` oFocus.selectionStart = parseInt(oControl.getProperty("selectionStart"));` && |\n| && - ` oFocus.selectionEnd = parseInt(oControl.getProperty("selectionEnd"));` && |\n| && - ` oElement.applyFocusInfo(oFocus);` && |\n| && - ` }` && |\n| && - ` , 100, oControl);` && |\n| && - ` }` && |\n| && - ` });` && |\n| && - `}` && |\n| && - `);` && |\n| && - `` && |\n| && - `sap.ui.define("z2ui5/Title", ["sap/ui/core/Control"], (Control) => {` && |\n| && - ` "use strict";` && |\n| && - ` return Control.extend("z2ui5.Title", {` && |\n| && - ` metadata: {` && |\n| && - ` properties: {` && |\n| && - ` title: {` && |\n| && - ` type: "string"` && |\n| && - ` },` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` setTitle(val) {` && |\n| && - ` this.setProperty("title", val);` && |\n| && - ` document.title = val;` && |\n| && - ` },` && |\n| && - ` renderer(oRm, oControl) { }` && |\n| && - ` });` && |\n| && - `}` && |\n| && - `);` && |\n| && - `sap.ui.define("z2ui5/LPTitle", ["sap/ui/core/Control"], (Control) => {` && |\n| && - ` "use strict";` && |\n| && - ` return Control.extend("z2ui5.LPTitle", {` && |\n| && - ` metadata: {` && |\n| && - ` properties: {` && |\n| && - ` title: {` && |\n| && - ` type: "string"` && |\n| && - ` },` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` setTitle(val) {` && |\n| && - ` try {` && |\n| && - ` this.setProperty("title", val);` && |\n| && - ` z2ui5.oLaunchpadService.setTitle(val);` && |\n| && - ` } catch (e) {` && |\n| && - ` console.error("Launchpad Service to set Title not found");` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` renderer(oRm, oControl) { }` && |\n| && - ` });` && |\n| && - `}` && |\n| && - `);` && |\n| && - `sap.ui.define("z2ui5/History", ["sap/ui/core/Control"], (Control) => {` && |\n| && - ` "use strict";` && |\n| && - ` return Control.extend("z2ui5.History", {` && |\n| && - ` metadata: {` && |\n| && - ` properties: {` && |\n| && - ` search: {` && |\n| && - ` type: "string"` && |\n| && - ` },` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` setSearch(val) {` && |\n| && - ` this.setProperty("search", val);` && |\n| && - ` history.replaceState(null, null, window.location.pathname + val);` && |\n| && - ` },` && |\n| && - ` renderer(oRm, oControl) { }` && |\n| && - ` });` && |\n| && - `}` && |\n| && - `);` && |\n| && - `sap.ui.define("z2ui5/Scrolling", ["sap/ui/core/Control"], (Control) => {` && |\n| && - ` "use strict";` && |\n| && - `` && |\n| && - ` return Control.extend("z2ui5.Scrolling", {` && |\n| && - ` metadata: {` && |\n| && - ` properties: {` && |\n| && - ` setUpdate: {` && |\n| && - ` type: "boolean",` && |\n| && - ` defaultValue: true` && |\n| && - ` },` && |\n| && - ` items: {` && |\n| && - ` type: "Array"` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` setBackend() {` && |\n| && - ` const items = this.getProperty("items");` && |\n| && - `` && |\n| && - ` if (items) {` && |\n| && - ` items.forEach(item => {` && |\n| && - ` try {` && |\n| && - ` const scrollDelegate = z2ui5.oView.byId(item.ID).getScrollDelegate();` && |\n| && - ` item.SCROLLTO = scrollDelegate ? scrollDelegate.getScrollTop() : 0;` && |\n| && - ` } catch {` && |\n| && - ` try {` && |\n| && - ` const element = document.getElementById(``${z2ui5.oView.byId(item.ID).getId()}-inner``);` && |\n| && - ` item.SCROLLTO = element ? element.scrollTop : 0;` && |\n| && - ` } catch {}` && |\n| && - ` }` && |\n| && - ` });` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` init() {` && |\n| && - ` z2ui5.onBeforeRoundtrip.push(this.setBackend.bind(this));` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` renderer(oRm, oControl) {` && |\n| && - ` if (!oControl.getProperty("setUpdate")) return;` && |\n| && - `` && |\n| && - ` oControl.setProperty("setUpdate", false);` && |\n| && - ` const items = oControl.getProperty("items");` && |\n| && - ` if (!items) return;` && |\n| && - `` && |\n| && - ` setTimeout(() => {` && |\n| && - ` items.forEach(item => {` && |\n| && - ` try {` && |\n| && - ` z2ui5.oView.byId(item.ID).scrollTo(item.SCROLLTO);` && |\n| && - ` } catch {` && |\n| && - ` try {` && |\n| && - ` const element = document.getElementById(``${z2ui5.oView.byId(item.ID).getId()}-inner``);` && |\n| && - ` if (element) element.scrollTop = item.SCROLLTO;` && |\n| && - ` } catch {` && |\n| && - ` setTimeout(() => {` && |\n| && - ` z2ui5.oView.byId(item.ID).scrollTo(item.SCROLLTO);` && |\n| && - ` }, 1);` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` });` && |\n| && - ` }, 100);` && |\n| && - ` }` && |\n| && - ` });` && |\n| && - `});` && |\n| && - `` && |\n| && - `` && |\n| && - `` && |\n| && - `sap.ui.define("z2ui5/Info", ["sap/ui/core/Control", "sap/ui/VersionInfo", "sap/ui/Device"], (Control, VersionInfo, Device) => {` && |\n| && - ` "use strict";` && |\n| && - `` && |\n| && - ` return Control.extend("z2ui5.Info", {` && |\n| && - ` metadata: {` && |\n| && - ` properties: {` && |\n| && - ` ui5_version: {` && |\n| && - ` type: "string"` && |\n| && - ` },` && |\n| && - ` device_phone: {` && |\n| && - ` type: "string"` && |\n| && - ` },` && |\n| && - ` device_desktop: {` && |\n| && - ` type: "string"` && |\n| && - ` },` && |\n| && - ` device_tablet: {` && |\n| && - ` type: "string"` && |\n| && - ` },` && |\n| && - ` device_combi: {` && |\n| && - ` type: "string"` && |\n| && - ` },` && |\n| && - ` device_height: {` && |\n| && - ` type: "string"` && |\n| && - ` },` && |\n| && - ` device_width: {` && |\n| && - ` type: "string"` && |\n| && - ` },` && |\n| && - ` ui5_theme: {` && |\n| && - ` type: "string"` && |\n| && - ` },` && |\n| && - ` device_os: {` && |\n| && - ` type: "string"` && |\n| && - ` },` && |\n| && - ` device_systemtype: {` && |\n| && - ` type: "string"` && |\n| && - ` },` && |\n| && - ` device_browser: {` && |\n| && - ` type: "string"` && |\n| && - ` },` && |\n| && - ` },` && |\n| && - ` events: {` && |\n| && - ` "finished": {` && |\n| && - ` allowPreventDefault: true,` && |\n| && - ` parameters: {},` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` init() { },` && |\n| && - `` && |\n| && - ` onAfterRendering() {` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` async renderer(oRm, oControl) {` && |\n| && - `` && |\n| && - ` debugger;` && |\n| && - ` let oDevice = z2ui5.oView.getModel("device").oData;` && |\n| && - ` oControl.setProperty("ui5_version", sap.ui.version);` && |\n| && - ` oControl.setProperty("device_phone", oDevice.system.phone);` && |\n| && - ` oControl.setProperty("device_desktop", oDevice.system.desktop);` && |\n| && - ` oControl.setProperty("device_tablet", oDevice.system.tablet);` && |\n| && - ` oControl.setProperty("device_combi", oDevice.system.combi);` && |\n| && - ` oControl.setProperty("device_height", oDevice.resize.height);` && |\n| && - ` oControl.setProperty("device_width", oDevice.resize.width);` && |\n| && - ` oControl.setProperty("device_os", oDevice.os.name);` && |\n| && - ` oControl.setProperty("device_browser", oDevice.browser.name);` && |\n| && - ` oControl.fireFinished();` && |\n| && - `` && |\n| && - ` }` && |\n| && - ` });` && |\n| && - `}` && |\n| && - `);` && |\n| && - `` && |\n| && - `sap.ui.define("z2ui5/Geolocation", ["sap/ui/core/Control"], (Control) => {` && |\n| && - ` "use strict";` && |\n| && - `` && |\n| && - ` return Control.extend("z2ui5.Geolocation", {` && |\n| && - ` metadata: {` && |\n| && - ` properties: {` && |\n| && - ` longitude: {` && |\n| && - ` type: "string",` && |\n| && - ` defaultValue: ""` && |\n| && - ` },` && |\n| && - ` latitude: {` && |\n| && - ` type: "string",` && |\n| && - ` defaultValue: ""` && |\n| && - ` },` && |\n| && - ` altitude: {` && |\n| && - ` type: "string",` && |\n| && - ` defaultValue: ""` && |\n| && - ` },` && |\n| && - ` accuracy: {` && |\n| && - ` type: "string",` && |\n| && - ` defaultValue: ""` && |\n| && - ` },` && |\n| && - ` altitudeAccuracy: {` && |\n| && - ` type: "string",` && |\n| && - ` defaultValue: ""` && |\n| && - ` },` && |\n| && - ` speed: {` && |\n| && - ` type: "string",` && |\n| && - ` defaultValue: false` && |\n| && - ` },` && |\n| && - ` heading: {` && |\n| && - ` type: "string",` && |\n| && - ` defaultValue: false` && |\n| && - ` },` && |\n| && - ` enableHighAccuracy: {` && |\n| && - ` type: "boolean",` && |\n| && - ` defaultValue: false` && |\n| && - ` },` && |\n| && - ` timeout: {` && |\n| && - ` type: "string",` && |\n| && - ` defaultValue: "5000"` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` events: {` && |\n| && - ` "finished": {` && |\n| && - ` allowPreventDefault: true,` && |\n| && - ` parameters: {},` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` callbackPosition(position) {` && |\n| && - `` && |\n| && - ` var test = position.coords.longitude` && |\n| && - ` this.setProperty("longitude", position.coords.longitude, true);` && |\n| && - ` this.setProperty("latitude", position.coords.latitude, true);` && |\n| && - ` this.setProperty("altitude", position.coords.altitude, true);` && |\n| && - ` this.setProperty("accuracy", position.coords.accuracy, true);` && |\n| && - ` this.setProperty("altitudeAccuracy", position.coords.altitudeAccuracy, true);` && |\n| && - ` this.setProperty("speed", position.coords.speed, true);` && |\n| && - ` this.setProperty("heading", position.coords.heading, true);` && |\n| && - ` this.fireFinished();` && |\n| && - ` //this.getParent().getParent().getModel().refresh();` && |\n| && - `` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` async init() {` && |\n| && - `` && |\n| && - ` navigator.geolocation.getCurrentPosition(this.callbackPosition.bind(this));` && |\n| && - ` //navigator.geolocation.watchPosition(this.callbackPosition.bind(this));` && |\n| && - `` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` exit() {//clearWatch` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` onAfterRendering() {` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` renderer(oRm, oControl) {` && |\n| && - ` }` && |\n| && - ` });` && |\n| && - `}` && |\n| && - `);` && |\n| && - `` && |\n| && - `sap.ui.define("z2ui5/FileUploader", ["sap/ui/core/Control", "sap/m/Button", "sap/ui/unified/FileUploader", "sap/m/HBox"], function (Control, Button, FileUploader, HBox) {` && |\n| && - ` "use strict";` && |\n| && - `` && |\n| && - ` return Control.extend("z2ui5.FileUploader", {` && |\n| && - `` && |\n| && - ` metadata: {` && |\n| && - ` properties: {` && |\n| && - ` value: {` && |\n| && - ` type: "string",` && |\n| && - ` defaultValue: ""` && |\n| && - ` },` && |\n| && - ` path: {` && |\n| && - ` type: "string",` && |\n| && - ` defaultValue: ""` && |\n| && - ` },` && |\n| && - ` tooltip: {` && |\n| && - ` type: "string",` && |\n| && - ` defaultValue: ""` && |\n| && - ` },` && |\n| && - ` fileType: {` && |\n| && - ` type: "string",` && |\n| && - ` defaultValue: ""` && |\n| && - ` },` && |\n| && - ` placeholder: {` && |\n| && - ` type: "string",` && |\n| && - ` defaultValue: ""` && |\n| && - ` },` && |\n| && - ` buttonText: {` && |\n| && - ` type: "string",` && |\n| && - ` defaultValue: ""` && |\n| && - ` },` && |\n| && - ` style: {` && |\n| && - ` type: "string",` && |\n| && - ` defaultValue: ""` && |\n| && - ` },` && |\n| && - ` uploadButtonText: {` && |\n| && - ` type: "string",` && |\n| && - ` defaultValue: "Upload"` && |\n| && - ` },` && |\n| && - ` enabled: {` && |\n| && - ` type: "boolean",` && |\n| && - ` defaultValue: true` && |\n| && - ` },` && |\n| && - ` icon: {` && |\n| && - ` type: "string",` && |\n| && - ` defaultValue: "sap-icon://browse-folder"` && |\n| && - ` },` && |\n| && - ` iconOnly: {` && |\n| && - ` type: "boolean",` && |\n| && - ` defaultValue: false` && |\n| && - ` },` && |\n| && - ` buttonOnly: {` && |\n| && - ` type: "boolean",` && |\n| && - ` defaultValue: false` && |\n| && - ` },` && |\n| && - ` multiple: {` && |\n| && - ` type: "boolean",` && |\n| && - ` defaultValue: false` && |\n| && - ` },` && |\n| && - ` visible: {` && |\n| && - ` type: "boolean",` && |\n| && - ` defaultValue: true` && |\n| && - ` },` && |\n| && - ` checkDirectUpload: {` && |\n| && - ` type: "boolean",` && |\n| && - ` defaultValue: false` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` aggregations: {},` && |\n| && - ` events: {` && |\n| && - ` "upload": {` && |\n| && - ` allowPreventDefault: true,` && |\n| && - ` parameters: {}` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` renderer: null` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` renderer: function (oRm, oControl) {` && |\n| && - `` && |\n| && - ` if (!oControl.getProperty("checkDirectUpload")) {` && |\n| && - ` oControl.oUploadButton = new Button({` && |\n| && - ` text: oControl.getProperty("uploadButtonText"),` && |\n| && - ` enabled: oControl.getProperty("path") !== "",` && |\n| && - ` press: function (oEvent) {` && |\n| && - `` && |\n| && - ` this.setProperty("path", this.oFileUploader.getProperty("value"));` && |\n| && - `` && |\n| && + result = |sap.ui.define(["sap/ui/core/mvc/Controller",| && |\n| && + | "z2ui5/controller/View1.controller",| && |\n| && + |], function (BaseController, Controller) \{| && |\n| && + | return BaseController.extend("z2ui5.controller.App", \{| && |\n| && + || && |\n| && + | onInit: async function () \{| && |\n| && + || && |\n| && + | z2ui5.oConfig.pathname = this.getView().getModel().sServiceUrl;| && |\n| && + | if (z2ui5?.checkLocal == true ) \{| && |\n| && + | z2ui5.oConfig.pathname = window.location.href;| && |\n| && + | \};| && |\n| && + || && |\n| && + | z2ui5.oController = new Controller();| && |\n| && + | z2ui5.oController.setApp(this.getView().byId("app"));| && |\n| && + || && |\n| && + | z2ui5.oControllerNest = new Controller();| && |\n| && + | z2ui5.oControllerNest2 = new Controller();| && |\n| && + | z2ui5.oControllerPopup = new Controller();| && |\n| && + | z2ui5.oControllerPopover = new Controller();| && |\n| && + || && |\n| && + | z2ui5.onBeforeRoundtrip = [];| && |\n| && + | z2ui5.onAfterRendering = [];| && |\n| && + | z2ui5.onBeforeEventFrontend = [];| && |\n| && + | z2ui5.onAfterRoundtrip = [];| && |\n| && + || && |\n| && + | z2ui5.checkNestAfter = false;| && |\n| && + || && |\n| && + | \}| && |\n| && + | \});| && |\n| && + |\});| && |\n| && + || && |\n| && + || && |\n| && + |sap.ui.define("z2ui5/Timer", ["sap/ui/core/Control"], (Control) => \{| && |\n| && + | "use strict";| && |\n| && + || && |\n| && + | return Control.extend("z2ui5.Timer", \{| && |\n| && + | metadata: \{| && |\n| && + | properties: \{| && |\n| && + | delayMS: \{| && |\n| && + | type: "string",| && |\n| && + | defaultValue: ""| && |\n| && + | \},| && |\n| && + | checkActive: \{| && |\n| && + | type: "boolean",| && |\n| && + | defaultValue: true| && |\n| && + | \},| && |\n| && + | checkRepeat: \{| && |\n| && + | type: "boolean",| && |\n| && + | defaultValue: false| && |\n| && + | \},| && |\n| && + | \},| && |\n| && + | events: \{| && |\n| && + | "finished": \{| && |\n| && + | allowPreventDefault: true,| && |\n| && + | parameters: \{\},| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + | onAfterRendering() \{ \},| && |\n| && + | delayedCall(oControl) \{| && |\n| && + || && |\n| && + | if (oControl.getProperty("checkActive") == false) \{| && |\n| && + | return;| && |\n| && + | \}| && |\n| && + | setTimeout((oControl) => \{| && |\n| && + | oControl.setProperty("checkActive", false)| && |\n| && + | oControl.fireFinished();| && |\n| && + | if (oControl.getProperty("checkRepeat")) \{| && |\n| && + | oControl.delayedCall(oControl);| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | , parseInt(oControl.getProperty("delayMS")), oControl);| && |\n| && + | \},| && |\n| && + | renderer(oRm, oControl) \{| && |\n| && + | oControl.delayedCall(oControl);| && |\n| && + | \}| && |\n| && + | \});| && |\n| && + |\}| && |\n| && + |);| && |\n| && + || && |\n| && + |sap.ui.define("z2ui5/Focus", ["sap/ui/core/Control",], (Control) => \{| && |\n| && + | "use strict";| && |\n| && + | return Control.extend("z2ui5.Focus", \{| && |\n| && + | metadata: \{| && |\n| && + | properties: \{| && |\n| && + | setUpdate: \{| && |\n| && + | type: "boolean",| && |\n| && + | defaultValue: true| && |\n| && + | \},| && |\n| && + | focusId: \{| && |\n| && + | type: "string"| && |\n| && + | \},| && |\n| && + | selectionStart: \{| && |\n| && + | type: "string",| && |\n| && + | defaultValue: "0"| && |\n| && + | \},| && |\n| && + | selectionEnd: \{| && |\n| && + | type: "string",| && |\n| && + | defaultValue: "0"| && |\n| && + | \},| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + | init() \{ \},| && |\n| && + | setFocusId(val) \{| && |\n| && + | try \{| && |\n| && + | this.setProperty("focusId", val);| && |\n| && + | var oElement = z2ui5.oView.byId(val);| && |\n| && + | var oFocus = oElement.getFocusInfo();| && |\n| && + | oElement.applyFocusInfo(oFocus);| && |\n| && + | \} catch (e) \{ \}| && |\n| && + | \},| && |\n| && + | renderer(oRm, oControl) \{| && |\n| && + | if (!oControl.getProperty("setUpdate")) \{| && |\n| && + | return;| && |\n| && + | \}| && |\n| && + | oControl.setProperty("setUpdate", false);| && |\n| && + | setTimeout((oControl) => \{| && |\n| && + | var oElement = z2ui5.oView.byId(oControl.getProperty("focusId"));| && |\n| && + | var oFocus = oElement.getFocusInfo();| && |\n| && + | oFocus.selectionStart = parseInt(oControl.getProperty("selectionStart"));| && |\n| && + | oFocus.selectionEnd = parseInt(oControl.getProperty("selectionEnd"));| && |\n| && + | oElement.applyFocusInfo(oFocus);| && |\n| && + | \}| && |\n| && + | , 100, oControl);| && |\n| && + | \}| && |\n| && + | \});| && |\n| && + |\}| && |\n| && + |);| && |\n| && + || && |\n| && + |sap.ui.define("z2ui5/Title", ["sap/ui/core/Control"], (Control) => \{| && |\n| && + | "use strict";| && |\n| && + | return Control.extend("z2ui5.Title", \{| && |\n| && + | metadata: \{| && |\n| && + | properties: \{| && |\n| && + | title: \{| && |\n| && + | type: "string"| && |\n| && + | \},| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + | setTitle(val) \{| && |\n| && + | this.setProperty("title", val);| && |\n| && + | document.title = val;| && |\n| && + | \},| && |\n| && + | renderer(oRm, oControl) \{ \}| && |\n| && + | \});| && |\n| && + |\}| && |\n| && + |);| && |\n| && + |sap.ui.define("z2ui5/LPTitle", ["sap/ui/core/Control"], (Control) => \{| && |\n| && + | "use strict";| && |\n| && + | return Control.extend("z2ui5.LPTitle", \{| && |\n| && + | metadata: \{| && |\n| && + | properties: \{| && |\n| && + | title: \{| && |\n| && + | type: "string"| && |\n| && + | \},| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + | setTitle(val) \{| && |\n| && + | try \{| && |\n| && + | this.setProperty("title", val);| && |\n| && + | z2ui5.oLaunchpadService.setTitle(val);| && |\n| && + | \} catch (e) \{| && |\n| && + | console.error("Launchpad Service to set Title not found");| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + | renderer(oRm, oControl) \{ \}| && |\n| && + | \});| && |\n| && + |\}| && |\n| && + |);| && |\n| && + |sap.ui.define("z2ui5/History", ["sap/ui/core/Control"], (Control) => \{| && |\n| && + | "use strict";| && |\n| && + | return Control.extend("z2ui5.History", \{| && |\n| && + | metadata: \{| && |\n| && + | properties: \{| && |\n| && + | search: \{| && |\n| && + | type: "string"| && |\n| && + | \},| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + | setSearch(val) \{| && |\n| && + | this.setProperty("search", val);| && |\n| && + | history.replaceState(null, null, window.location.pathname + val);| && |\n| && + | \},| && |\n| && + | renderer(oRm, oControl) \{ \}| && |\n| && + | \});| && |\n| && + |\}| && |\n| && + |);| && |\n| && + |sap.ui.define("z2ui5/Scrolling", ["sap/ui/core/Control"], (Control) => \{| && |\n| && + | "use strict";| && |\n| && + || && |\n| && + | return Control.extend("z2ui5.Scrolling", \{| && |\n| && + | metadata: \{| && |\n| && + | properties: \{| && |\n| && + | setUpdate: \{| && |\n| && + | type: "boolean",| && |\n| && + | defaultValue: true| && |\n| && + | \},| && |\n| && + | items: \{| && |\n| && + | type: "Array"| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + || && |\n| && + | setBackend() \{| && |\n| && + | const items = this.getProperty("items");| && |\n| && + || && |\n| && + | if (items) \{| && |\n| && + | items.forEach(item => \{| && |\n| && + | try \{| && |\n| && + | const scrollDelegate = z2ui5.oView.byId(item.ID).getScrollDelegate();| && |\n| && + | item.SCROLLTO = scrollDelegate ? scrollDelegate.getScrollTop() : 0;| && |\n| && + | \} catch \{| && |\n| && + | try \{| && |\n| && + | const element = document.getElementById(`$\{z2ui5.oView.byId(item.ID).getId()\}-inner`);| && |\n| && + | item.SCROLLTO = element ? element.scrollTop : 0;| && |\n| && + | \} catch \{\}| && |\n| && + | \}| && |\n| && + | \});| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + || && |\n| && + | init() \{| && |\n| && + | z2ui5.onBeforeRoundtrip.push(this.setBackend.bind(this));| && |\n| && + | \},| && |\n| && + || && |\n| && + | renderer(oRm, oControl) \{| && |\n| && + | if (!oControl.getProperty("setUpdate")) return;| && |\n| && + || && |\n| && + | oControl.setProperty("setUpdate", false);| && |\n| && + | const items = oControl.getProperty("items");| && |\n| && + | if (!items) return;| && |\n| && + || && |\n| && + | setTimeout(() => \{| && |\n| && + | items.forEach(item => \{| && |\n| && + | try \{| && |\n| && + | z2ui5.oView.byId(item.ID).scrollTo(item.SCROLLTO);| && |\n| && + | \} catch \{| && |\n| && + | try \{| && |\n| && + | const element = document.getElementById(`$\{z2ui5.oView.byId(item.ID).getId()\}-inner`);| && |\n| && + | if (element) element.scrollTop = item.SCROLLTO;| && |\n| && + | \} catch \{| && |\n| && + | setTimeout(() => \{| && |\n| && + | z2ui5.oView.byId(item.ID).scrollTo(item.SCROLLTO);| && |\n| && + | \}, 1);| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | \});| && |\n| && + | \}, 100);| && |\n| && + | \}| && |\n| && + | \});| && |\n| && + |\});| && |\n| && + || && |\n| && + || && |\n| && + || && |\n| && + |sap.ui.define("z2ui5/Info", ["sap/ui/core/Control", "sap/ui/VersionInfo", "sap/ui/Device"], (Control, VersionInfo, Device) => \{| && |\n| && + | "use strict";| && |\n| && + || && |\n| && + | return Control.extend("z2ui5.Info", \{| && |\n| && + | metadata: \{| && |\n| && + | properties: \{| && |\n| && + | ui5_version: \{| && |\n| && + | type: "string"| && |\n| && + | \},| && |\n| && + | device_phone: \{| && |\n| && + | type: "string"| && |\n| && + | \},| && |\n| && + | device_desktop: \{| && |\n| && + | type: "string"| && |\n| && + | \},| && |\n| && + | device_tablet: \{| && |\n| && + | type: "string"| && |\n| && + | \},| && |\n| && + | device_combi: \{| && |\n| && + | type: "string"| && |\n| && + | \},| && |\n| && + | device_height: \{| && |\n| && + | type: "string"| && |\n| && + | \},| && |\n| && + | device_width: \{| && |\n| && + | type: "string"| && |\n| && + | \},| && |\n| && + | ui5_theme: \{| && |\n| && + | type: "string"| && |\n| && + | \},| && |\n| && + | device_os: \{| && |\n| && + | type: "string"| && |\n| && + | \},| && |\n| && + | device_systemtype: \{| && |\n| && + | type: "string"| && |\n| && + | \},| && |\n| && + | device_browser: \{| && |\n| && + | type: "string"| && |\n| && + | \},| && |\n| && + | \},| && |\n| && + | events: \{| && |\n| && + | "finished": \{| && |\n| && + | allowPreventDefault: true,| && |\n| && + | parameters: \{\},| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + || && |\n| && + | init() \{ \},| && |\n| && + || && |\n| && + | onAfterRendering() \{| && |\n| && + | \},| && |\n| && + || && |\n| && + | async renderer(oRm, oControl) \{| && |\n| && + || && |\n| && + | debugger;| && |\n| && + | let oDevice = z2ui5.oView.getModel("device").oData;| && |\n| && + | oControl.setProperty("ui5_version", sap.ui.version);| && |\n| && + | oControl.setProperty("device_phone", oDevice.system.phone);| && |\n| && + | oControl.setProperty("device_desktop", oDevice.system.desktop);| && |\n| && + | oControl.setProperty("device_tablet", oDevice.system.tablet);| && |\n| && + | oControl.setProperty("device_combi", oDevice.system.combi);| && |\n| && + | oControl.setProperty("device_height", oDevice.resize.height);| && |\n| && + | oControl.setProperty("device_width", oDevice.resize.width);| && |\n| && + | oControl.setProperty("device_os", oDevice.os.name);| && |\n| && + | oControl.setProperty("device_browser", oDevice.browser.name);| && |\n| && + | oControl.fireFinished();| && |\n| && + || && |\n| && + | \}| && |\n| && + | \});| && |\n| && + |\}| && |\n| && + |);| && |\n| && + || && |\n| && + |sap.ui.define("z2ui5/Geolocation", ["sap/ui/core/Control"], (Control) => \{| && |\n| && + | "use strict";| && |\n| && + || && |\n| && + | return Control.extend("z2ui5.Geolocation", \{| && |\n| && + | metadata: \{| && |\n| && + | properties: \{| && |\n| && + | longitude: \{| && |\n| && + | type: "string",| && |\n| && + | defaultValue: ""| && |\n| && + | \},| && |\n| && + | latitude: \{| && |\n| && + | type: "string",| && |\n| && + | defaultValue: ""| && |\n| && + | \},| && |\n| && + | altitude: \{| && |\n| && + | type: "string",| && |\n| && + | defaultValue: ""| && |\n| && + | \},| && |\n| && + | accuracy: \{| && |\n| && + | type: "string",| && |\n| && + | defaultValue: ""| && |\n| && + | \},| && |\n| && + | altitudeAccuracy: \{| && |\n| && + | type: "string",| && |\n| && + | defaultValue: ""| && |\n| && + | \},| && |\n| && + | speed: \{| && |\n| && + | type: "string",| && |\n| && + | defaultValue: false| && |\n| && + | \},| && |\n| && + | heading: \{| && |\n| && + | type: "string",| && |\n| && + | defaultValue: false| && |\n| && + | \},| && |\n| && + | enableHighAccuracy: \{| && |\n| && + | type: "boolean",| && |\n| && + | defaultValue: false| && |\n| && + | \},| && |\n| && + | timeout: \{| && |\n| && + | type: "string",| && |\n| && + | defaultValue: "5000"| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + | events: \{| && |\n| && + | "finished": \{| && |\n| && + | allowPreventDefault: true,| && |\n| && + | parameters: \{\},| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + || && |\n| && + | callbackPosition(position) \{| && |\n| && + || && |\n| && + | var test = position.coords.longitude| && |\n| && + | this.setProperty("longitude", position.coords.longitude, true);| && |\n| && + | this.setProperty("latitude", position.coords.latitude, true);| && |\n| && + | this.setProperty("altitude", position.coords.altitude, true);| && |\n| && + | this.setProperty("accuracy", position.coords.accuracy, true);| && |\n| && + | this.setProperty("altitudeAccuracy", position.coords.altitudeAccuracy, true);| && |\n| && + | this.setProperty("speed", position.coords.speed, true);| && |\n| && + | this.setProperty("heading", position.coords.heading, true);| && |\n| && + | this.fireFinished();| && |\n| && + | //this.getParent().getParent().getModel().refresh();| && |\n| && + || && |\n| && + | \},| && |\n| && + || && |\n| && + | async init() \{| && |\n| && + || && |\n| && + | navigator.geolocation.getCurrentPosition(this.callbackPosition.bind(this));| && |\n| && + | //navigator.geolocation.watchPosition(this.callbackPosition.bind(this));| && |\n| && + || && |\n| && + | \},| && |\n| && + || && |\n| && + | exit() \{//clearWatch| && |\n| && + | \},| && |\n| && + || && |\n| && + | onAfterRendering() \{| && |\n| && + | \},| && |\n| && + || && |\n| && + | renderer(oRm, oControl) \{| && |\n| && + | \}| && |\n| && + | \});| && |\n| && + |\}| && |\n| && + |);| && |\n| && + || && |\n| && + |sap.ui.define("z2ui5/FileUploader", ["sap/ui/core/Control", "sap/m/Button", "sap/ui/unified/FileUploader", "sap/m/HBox"], function (Control, Button, FileUploader, HBox) \{| && |\n| && + | "use strict";| && |\n| && + || && |\n| && + | return Control.extend("z2ui5.FileUploader", \{| && |\n| && + || && |\n| && + | metadata: \{| && |\n| && + | properties: \{| && |\n| && + | value: \{| && |\n| && + | type: "string",| && |\n| && + | defaultValue: ""| && |\n| && + | \},| && |\n| && + | path: \{| && |\n| && + | type: "string",| && |\n| && + | defaultValue: ""| && |\n| && + | \},| && |\n| && + | tooltip: \{| && |\n| && + | type: "string",| && |\n| && + | defaultValue: ""| && |\n| && + | \},| && |\n| && + | fileType: \{| && |\n| && + | type: "string",| && |\n| && + | defaultValue: ""| && |\n| && + | \},| && |\n| && + | placeholder: \{| && |\n| && + | type: "string",| && |\n| && + | defaultValue: ""| && |\n| && + | \},| && |\n| && + | buttonText: \{| && |\n| && + | type: "string",| && |\n| && + | defaultValue: ""| && |\n| && + | \},| && |\n| && + | style: \{| && |\n| && + | type: "string",| && |\n| && + | defaultValue: ""| && |\n| && + | \},| && |\n| && + | uploadButtonText: \{| && |\n| && + | type: "string",| && |\n| && + | defaultValue: "Upload"| && |\n| && + | \},| && |\n| && + | enabled: \{| && |\n| && + | type: "boolean",| && |\n| && + | defaultValue: true| && |\n| && + | \},| && |\n| && + | icon: \{| && |\n| && + | type: "string",| && |\n| && + | defaultValue: "sap-icon://browse-folder"| && |\n| && + | \},| && |\n| && + | iconOnly: \{| && |\n| && + | type: "boolean",| && |\n| && + | defaultValue: false| && |\n| && + | \},| && |\n| && + | buttonOnly: \{| && |\n| && + | type: "boolean",| && |\n| && + | defaultValue: false| && |\n| && + | \},| && |\n| && + | multiple: \{| && |\n| && + | type: "boolean",| && |\n| && + | defaultValue: false| && |\n| && + | \},| && |\n| && + | visible: \{| && |\n| && + | type: "boolean",| && |\n| && + | defaultValue: true| && |\n| && + | \},| && |\n| && + | checkDirectUpload: \{| && |\n| && + | type: "boolean",| && |\n| && + | defaultValue: false| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + || && |\n| && + | aggregations: \{\},| && |\n| && + | events: \{| && |\n| && + | "upload": \{| && |\n| && + | allowPreventDefault: true,| && |\n| && + | parameters: \{\}| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + | renderer: null| && |\n| && + | \},| && |\n| && + || && |\n| && + | renderer: function (oRm, oControl) \{| && |\n| && + || && |\n| && + | if (!oControl.getProperty("checkDirectUpload")) \{| && |\n| && + | oControl.oUploadButton = new Button(\{| && |\n| && + | text: oControl.getProperty("uploadButtonText"),| && |\n| && + | enabled: oControl.getProperty("path") !== "",| && |\n| && + | press: function (oEvent) \{| && |\n| && + || && |\n| && + | this.setProperty("path", this.oFileUploader.getProperty("value"));| && |\n| && + || && |\n| && |\n|. result = result && - ` var file = z2ui5.oUpload.oFileUpload.files[0];` && |\n| && - ` var reader = new FileReader();` && |\n| && - `` && |\n| && - ` reader.onload = function (evt) {` && |\n| && - ` var vContent = evt.currentTarget.result;` && |\n| && - ` this.setProperty("value", vContent);` && |\n| && - ` this.fireUpload();` && |\n| && - ` //this.getView().byId('picture' ).getDomRef().src = vContent;` && |\n| && - ` }` && |\n| && - ` .bind(this)` && |\n| && - `` && |\n| && - ` reader.readAsDataURL(file);` && |\n| && - ` }` && |\n| && - ` .bind(oControl)` && |\n| && - ` });` && |\n| && - ` }` && |\n| && - `` && |\n| && - ` oControl.oFileUploader = new FileUploader({` && |\n| && - ` icon: oControl.getProperty("icon"),` && |\n| && - ` iconOnly: oControl.getProperty("iconOnly"),` && |\n| && - ` buttonOnly: oControl.getProperty("buttonOnly"),` && |\n| && - ` buttonText: oControl.getProperty("buttonText"),` && |\n| && - ` style: oControl.getProperty("style"),` && |\n| && - ` fileType: oControl.getProperty("fileType"),` && |\n| && - ` visible: oControl.getProperty("visible"),` && |\n| && - ` uploadOnChange: true,` && |\n| && - ` enabled: oControl.getProperty("enabled"),` && |\n| && - ` value: oControl.getProperty("path"),` && |\n| && - ` placeholder: oControl.getProperty("placeholder"),` && |\n| && - ` change: function (oEvent) {` && |\n| && - ` if (oControl.getProperty("checkDirectUpload")) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - `` && |\n| && - ` var value = oEvent.getSource().getProperty("value");` && |\n| && - ` this.setProperty("path", value);` && |\n| && - ` if (value) {` && |\n| && - ` this.oUploadButton.setEnabled();` && |\n| && - ` } else {` && |\n| && - ` this.oUploadButton.setEnabled(false);` && |\n| && - ` }` && |\n| && - ` this.oUploadButton.rerender();` && |\n| && - ` z2ui5.oUpload = oEvent.oSource;` && |\n| && - ` }` && |\n| && - ` .bind(oControl),` && |\n| && - ` uploadComplete: function (oEvent) {` && |\n| && - ` if (!oControl.getProperty("checkDirectUpload")) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - `` && |\n| && - ` var value = oEvent.getSource().getProperty("value");` && |\n| && - ` this.setProperty("path", value);` && |\n| && - `` && |\n| && - ` var file = oEvent.oSource.oFileUpload.files[0];` && |\n| && - ` var reader = new FileReader();` && |\n| && - `` && |\n| && - ` reader.onload = function (evt) {` && |\n| && - ` var vContent = evt.currentTarget.result;` && |\n| && - ` this.setProperty("value", vContent);` && |\n| && - ` this.fireUpload();` && |\n| && - ` }` && |\n| && - ` .bind(this)` && |\n| && - `` && |\n| && - ` reader.readAsDataURL(file);` && |\n| && - ` }` && |\n| && - ` .bind(oControl)` && |\n| && - ` });` && |\n| && - `` && |\n| && - ` var hbox = new HBox();` && |\n| && - ` hbox.addItem(oControl.oFileUploader);` && |\n| && - ` hbox.addItem(oControl.oUploadButton);` && |\n| && - ` oRm.renderControl(hbox);` && |\n| && - ` }` && |\n| && - ` });` && |\n| && - `});` && |\n| && - `` && |\n| && - `sap.ui.define("z2ui5/MultiInputExt", ["sap/ui/core/Control", "sap/m/Token", "sap/ui/core/Core", "sap/ui/core/Element"], (Control, Token, Core, Element) => {` && |\n| && - ` "use strict";` && |\n| && - `` && |\n| && - ` return Control.extend("z2ui5.MultiInputExt", {` && |\n| && - ` metadata: {` && |\n| && - ` properties: {` && |\n| && - ` MultiInputId: {` && |\n| && - ` type: "String"` && |\n| && - ` },` && |\n| && - ` MultiInputName: {` && |\n| && - ` type: "String"` && |\n| && - ` },` && |\n| && - ` addedTokens: {` && |\n| && - ` type: "Array"` && |\n| && - ` },` && |\n| && - ` checkInit: {` && |\n| && - ` type: "Boolean",` && |\n| && - ` defaultValue: false` && |\n| && - ` },` && |\n| && - ` removedTokens: {` && |\n| && - ` type: "Array"` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` events: {` && |\n| && - ` "change": {` && |\n| && - ` allowPreventDefault: true,` && |\n| && - ` parameters: {}` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` init() {` && |\n| && - ` z2ui5.onAfterRendering.push(this.setControl.bind(this));` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` onTokenUpdate(oEvent) {` && |\n| && - ` this.setProperty("addedTokens", []);` && |\n| && - ` this.setProperty("removedTokens", []);` && |\n| && - `` && |\n| && - ` if (oEvent.mParameters.type == "removed") {` && |\n| && - ` let removedTokens = [];` && |\n| && - ` oEvent.mParameters.removedTokens.forEach((item) => {` && |\n| && - ` removedTokens.push({` && |\n| && - ` KEY: item.getKey(),` && |\n| && - ` TEXT: item.getText()` && |\n| && - ` });` && |\n| && - ` }` && |\n| && - ` );` && |\n| && - ` this.setProperty("removedTokens", removedTokens);` && |\n| && - ` } else {` && |\n| && - ` let addedTokens = [];` && |\n| && - ` oEvent.mParameters.addedTokens.forEach((item) => {` && |\n| && - ` addedTokens.push({` && |\n| && - ` KEY: item.getKey(),` && |\n| && - ` TEXT: item.getText()` && |\n| && - ` });` && |\n| && - ` }` && |\n| && - ` );` && |\n| && - ` this.setProperty("addedTokens", addedTokens);` && |\n| && - ` }` && |\n| && - ` this.fireChange();` && |\n| && - ` },` && |\n| && - ` renderer(oRm, oControl) {` && |\n| && - ` z2ui5.onAfterRendering.push(this.setControl.bind(oControl));` && |\n| && - ` },` && |\n| && - ` setControl() {` && |\n| && - ` let table = z2ui5.oView.byId(this.getProperty("MultiInputId"));` && |\n| && - ` if (!table) {` && |\n| && - ` try {` && |\n| && - ` table = Core.byId(Element.getElementsByName(this.getProperty("MultiInputName"))[0].id.replace('-inner', ''));` && |\n| && - ` } catch (e) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` if (!table) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` if (this.getProperty("checkInit") == true) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` this.setProperty("checkInit", true);` && |\n| && - ` table.attachTokenUpdate(this.onTokenUpdate.bind(this));` && |\n| && - ` var fnValidator = function (args) {` && |\n| && - ` var text = args.text;` && |\n| && - ` return new Token({` && |\n| && - ` key: text,` && |\n| && - ` text: text` && |\n| && - ` });` && |\n| && - ` };` && |\n| && - ` table.addValidator(fnValidator);` && |\n| && - ` },` && |\n| && - ` renderer(oRM, oControl) { }` && |\n| && - ` });` && |\n| && - `}` && |\n| && - `);` && |\n| && - `` && |\n| && - `sap.ui.define("z2ui5/UITableExt", ["sap/ui/core/Control"], (Control) => {` && |\n| && - ` "use strict";` && |\n| && - `` && |\n| && - ` return Control.extend("z2ui5.UITableExt", {` && |\n| && - ` metadata: {` && |\n| && - ` properties: {` && |\n| && - ` tableId: {` && |\n| && - ` type: "String"` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` init() {` && |\n| && - ` z2ui5.onBeforeRoundtrip.push(this.readFilter.bind(this));` && |\n| && - ` z2ui5.onAfterRoundtrip.push(this.setFilter.bind(this));` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` readFilter() {` && |\n| && - ` try {` && |\n| && - ` let id = this.getProperty("tableId");` && |\n| && - ` let oTable = z2ui5.oView.byId(id);` && |\n| && - ` this.aFilters = oTable.getBinding().aFilters;` && |\n| && - ` } catch (e) { }` && |\n| && - ` ;` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` setFilter() {` && |\n| && - ` try {` && |\n| && - ` setTimeout((aFilters) => {` && |\n| && - ` let id = this.getProperty("tableId");` && |\n| && - ` let oTable = z2ui5.oView.byId(id);` && |\n| && - ` oTable.getBinding().filter(aFilters);` && |\n| && - ` }` && |\n| && - ` , 100, this.aFilters);` && |\n| && - ` } catch (e) { }` && |\n| && - ` ;` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` renderer(oRM, oControl) { }` && |\n| && - ` });` && |\n| && - `}` && |\n| && - `);` && |\n| && - `` && |\n| && - `sap.ui.define("z2ui5/Util", [], () => {` && |\n| && - ` "use strict";` && |\n| && - ` return {` && |\n| && - ` DateCreateObject: (s) => new Date(s),` && |\n| && - ` DateAbapTimestampToDate: (sTimestamp) => new sap.gantt.misc.Format.abapTimestampToDate(sTimestamp),` && |\n| && - ` DateAbapDateToDateObject: (d) => new Date(d.slice(0, 4), parseInt(d.slice(4, 6)) - 1, d.slice(6, 8)),` && |\n| && - ` DateAbapDateTimeToDateObject: (d, t = '000000') => new Date(d.slice(0, 4), parseInt(d.slice(4, 6)) - 1, d.slice(6, 8), t.slice(0, 2), t.slice(2, 4), t.slice(4, 6)),` && |\n| && - ` };` && |\n| && - `}` && |\n| && - `);` && |\n| && - `sap.ui.require(["z2ui5/Util"], (Util) => {` && |\n| && - ` z2ui5.Util = Util;` && |\n| && - `}` && |\n| && - `);` && |\n| && - `` && |\n| && - `sap.ui.define("z2ui5/Favicon", ["sap/ui/core/Control"], (Control) => {` && |\n| && - ` "use strict";` && |\n| && - ` return Control.extend("z2ui5.Favicon", {` && |\n| && - ` metadata: {` && |\n| && - ` properties: {` && |\n| && - ` favicon: {` && |\n| && - ` type: "string"` && |\n| && - ` },` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` setFavicon(val) {` && |\n| && - ` this.setProperty("favicon", val);` && |\n| && - ` let headTitle = document.querySelector('head');` && |\n| && - ` let setFavicon = document.createElement('link');` && |\n| && - ` setFavicon.setAttribute('rel', 'shortcut icon');` && |\n| && - ` setFavicon.setAttribute('href', val);` && |\n| && - ` headTitle.appendChild(setFavicon);` && |\n| && - ` },` && |\n| && - ` renderer(oRm, oControl) { }` && |\n| && - ` });` && |\n| && - `}` && |\n| && - `);` && |\n| && - `` && |\n| && - `sap.ui.define("z2ui5/Dirty", ["sap/ui/core/Control", "sap/ushell/Container"], (Control, Container) => {` && |\n| && - ` "use strict";` && |\n| && - ` return Control.extend("z2ui5.Dirty", {` && |\n| && - ` metadata: {` && |\n| && - ` properties: {` && |\n| && - ` isDirty: {` && |\n| && - ` type: "string"` && |\n| && - ` },` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` setIsDirty(val) {` && |\n| && - ` if (Container) {` && |\n| && - ` Container.setDirtyFlag(val);` && |\n| && - ` } else {` && |\n| && - ` window.onbeforeunload = function (e) {` && |\n| && - ` if (val) {` && |\n| && - ` e.preventDefault();` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` renderer(oRm, oControl) { }` && |\n| && - ` });` && |\n| && - `}` && |\n| && - `);` && |\n| && - ``. + | var file = z2ui5.oUpload.oFileUpload.files[0];| && |\n| && + | var reader = new FileReader();| && |\n| && + || && |\n| && + | reader.onload = function (evt) \{| && |\n| && + | var vContent = evt.currentTarget.result;| && |\n| && + | this.setProperty("value", vContent);| && |\n| && + | this.fireUpload();| && |\n| && + | //this.getView().byId('picture' ).getDomRef().src = vContent;| && |\n| && + | \}| && |\n| && + | .bind(this)| && |\n| && + || && |\n| && + | reader.readAsDataURL(file);| && |\n| && + | \}| && |\n| && + | .bind(oControl)| && |\n| && + | \});| && |\n| && + | \}| && |\n| && + || && |\n| && + | oControl.oFileUploader = new FileUploader(\{| && |\n| && + | icon: oControl.getProperty("icon"),| && |\n| && + | iconOnly: oControl.getProperty("iconOnly"),| && |\n| && + | buttonOnly: oControl.getProperty("buttonOnly"),| && |\n| && + | buttonText: oControl.getProperty("buttonText"),| && |\n| && + | style: oControl.getProperty("style"),| && |\n| && + | fileType: oControl.getProperty("fileType"),| && |\n| && + | visible: oControl.getProperty("visible"),| && |\n| && + | uploadOnChange: true,| && |\n| && + | enabled: oControl.getProperty("enabled"),| && |\n| && + | value: oControl.getProperty("path"),| && |\n| && + | placeholder: oControl.getProperty("placeholder"),| && |\n| && + | change: function (oEvent) \{| && |\n| && + | if (oControl.getProperty("checkDirectUpload")) \{| && |\n| && + | return;| && |\n| && + | \}| && |\n| && + || && |\n| && + | var value = oEvent.getSource().getProperty("value");| && |\n| && + | this.setProperty("path", value);| && |\n| && + | if (value) \{| && |\n| && + | this.oUploadButton.setEnabled();| && |\n| && + | \} else \{| && |\n| && + | this.oUploadButton.setEnabled(false);| && |\n| && + | \}| && |\n| && + | this.oUploadButton.rerender();| && |\n| && + | z2ui5.oUpload = oEvent.oSource;| && |\n| && + | \}| && |\n| && + | .bind(oControl),| && |\n| && + | uploadComplete: function (oEvent) \{| && |\n| && + | if (!oControl.getProperty("checkDirectUpload")) \{| && |\n| && + | return;| && |\n| && + | \}| && |\n| && + || && |\n| && + | var value = oEvent.getSource().getProperty("value");| && |\n| && + | this.setProperty("path", value);| && |\n| && + || && |\n| && + | var file = oEvent.oSource.oFileUpload.files[0];| && |\n| && + | var reader = new FileReader();| && |\n| && + || && |\n| && + | reader.onload = function (evt) \{| && |\n| && + | var vContent = evt.currentTarget.result;| && |\n| && + | this.setProperty("value", vContent);| && |\n| && + | this.fireUpload();| && |\n| && + | \}| && |\n| && + | .bind(this)| && |\n| && + || && |\n| && + | reader.readAsDataURL(file);| && |\n| && + | \}| && |\n| && + | .bind(oControl)| && |\n| && + | \});| && |\n| && + || && |\n| && + | var hbox = new HBox();| && |\n| && + | hbox.addItem(oControl.oFileUploader);| && |\n| && + | hbox.addItem(oControl.oUploadButton);| && |\n| && + | oRm.renderControl(hbox);| && |\n| && + | \}| && |\n| && + | \});| && |\n| && + |\});| && |\n| && + || && |\n| && + |sap.ui.define("z2ui5/MultiInputExt", ["sap/ui/core/Control", "sap/m/Token", "sap/ui/core/Core", "sap/ui/core/Element"], (Control, Token, Core, Element) => \{| && |\n| && + | "use strict";| && |\n| && + || && |\n| && + | return Control.extend("z2ui5.MultiInputExt", \{| && |\n| && + | metadata: \{| && |\n| && + | properties: \{| && |\n| && + | MultiInputId: \{| && |\n| && + | type: "String"| && |\n| && + | \},| && |\n| && + | MultiInputName: \{| && |\n| && + | type: "String"| && |\n| && + | \},| && |\n| && + | addedTokens: \{| && |\n| && + | type: "Array"| && |\n| && + | \},| && |\n| && + | checkInit: \{| && |\n| && + | type: "Boolean",| && |\n| && + | defaultValue: false| && |\n| && + | \},| && |\n| && + | removedTokens: \{| && |\n| && + | type: "Array"| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + | events: \{| && |\n| && + | "change": \{| && |\n| && + | allowPreventDefault: true,| && |\n| && + | parameters: \{\}| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + | \},| && |\n| && + || && |\n| && + | init() \{| && |\n| && + | z2ui5.onAfterRendering.push(this.setControl.bind(this));| && |\n| && + | \},| && |\n| && + || && |\n| && + | onTokenUpdate(oEvent) \{| && |\n| && + | this.setProperty("addedTokens", []);| && |\n| && + | this.setProperty("removedTokens", []);| && |\n| && + || && |\n| && + | if (oEvent.mParameters.type == "removed") \{| && |\n| && + | let removedTokens = [];| && |\n| && + | oEvent.mParameters.removedTokens.forEach((item) => \{| && |\n| && + | removedTokens.push(\{| && |\n| && + | KEY: item.getKey(),| && |\n| && + | TEXT: item.getText()| && |\n| && + | \});| && |\n| && + | \}| && |\n| && + | );| && |\n| && + | this.setProperty("removedTokens", removedTokens);| && |\n| && + | \} else \{| && |\n| && + | let addedTokens = [];| && |\n| && + | oEvent.mParameters.addedTokens.forEach((item) => \{| && |\n| && + | addedTokens.push(\{| && |\n| && + | KEY: item.getKey(),| && |\n| && + | TEXT: item.getText()| && |\n| && + | \});| && |\n| && + | \}| && |\n| && + | );| && |\n| && + | this.setProperty("addedTokens", addedTokens);| && |\n| && + | \}| && |\n| && + | this.fireChange();| && |\n| && + | \},| && |\n| && + | renderer(oRm, oControl) \{| && |\n| && + | z2ui5.onAfterRendering.push(this.setControl.bind(oControl));| && |\n| && + | \},| && |\n| && + | setControl() \{| && |\n| && + | let table = z2ui5.oView.byId(this.getProperty("MultiInputId"));| && |\n| && + | if (!table) \{| && |\n| && + | try \{| && |\n| && + | table = Core.byId(Element.getElementsByName(this.getProperty("MultiInputName"))[0].id.replace('-inner', ''));| && |\n| && + | \} catch (e) \{| && |\n| && + | return;| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | if (!table) \{| && |\n| && + | return;| && |\n| && + | \}| && |\n| && + | if (this.getProperty("checkInit") == true) \{| && |\n| && + | return;| && |\n| && + | \}| && |\n| && + | this.setProperty("checkInit", true);| && |\n| && + | table.attachTokenUpdate(this.onTokenUpdate.bind(this));| && |\n| && + | var fnValidator = function (args) \{| && |\n| && + | var text = args.text;| && |\n| && + | return new Token(\{| && |\n| && + | key: text,| && |\n| && + | text: text| && |\n| && + | \});| && |\n| && + | \};| && |\n| && + | table.addValidator(fnValidator);| && |\n| && + | \},| && |\n| && + | renderer(oRM, oControl) \{ \}| && |\n| && + | \});| && |\n| && + |\}| && |\n| && + |);| && |\n| && + || && |\n| && + |sap.ui.define("z2ui5/UITableExt", ["sap/ui/core/Control"], (Control) => \{| && |\n| && + | "use strict";| && |\n| && + || && |\n| && + | return Control.extend("z2ui5.UITableExt", \{| && |\n| && + | metadata: \{| && |\n| && + | properties: \{| && |\n| && + | tableId: \{| && |\n| && + | type: "String"| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + || && |\n| && + | init() \{| && |\n| && + | z2ui5.onBeforeRoundtrip.push(this.readFilter.bind(this));| && |\n| && + | z2ui5.onAfterRoundtrip.push(this.setFilter.bind(this));| && |\n| && + | \},| && |\n| && + || && |\n| && + | readFilter() \{| && |\n| && + | try \{| && |\n| && + | let id = this.getProperty("tableId");| && |\n| && + | let oTable = z2ui5.oView.byId(id);| && |\n| && + | this.aFilters = oTable.getBinding().aFilters;| && |\n| && + | \} catch (e) \{ \}| && |\n| && + | ;| && |\n| && + | \},| && |\n| && + || && |\n| && + | setFilter() \{| && |\n| && + | try \{| && |\n| && + | setTimeout((aFilters) => \{| && |\n| && + | let id = this.getProperty("tableId");| && |\n| && + | let oTable = z2ui5.oView.byId(id);| && |\n| && + | oTable.getBinding().filter(aFilters);| && |\n| && + | \}| && |\n| && + | , 100, this.aFilters);| && |\n| && + | \} catch (e) \{ \}| && |\n| && + | ;| && |\n| && + | \},| && |\n| && + || && |\n| && + | renderer(oRM, oControl) \{ \}| && |\n| && + | \});| && |\n| && + |\}| && |\n| && + |);| && |\n| && + || && |\n| && + |sap.ui.define("z2ui5/Util", [], () => \{| && |\n| && + | "use strict";| && |\n| && + | return \{| && |\n| && + | DateCreateObject: (s) => new Date(s),| && |\n| && + | DateAbapTimestampToDate: (sTimestamp) => new sap.gantt.misc.Format.abapTimestampToDate(sTimestamp),| && |\n| && + | DateAbapDateToDateObject: (d) => new Date(d.slice(0, 4), parseInt(d.slice(4, 6)) - 1, d.slice(6, 8)),| && |\n| && + | DateAbapDateTimeToDateObject: (d, t = '000000') => new Date(d.slice(0, 4), parseInt(d.slice(4, 6)) - 1, d.slice(6, 8), t.slice(0, 2), t.slice(2, 4), t.slice(4, 6)),| && |\n| && + | \};| && |\n| && + |\}| && |\n| && + |);| && |\n| && + |sap.ui.require(["z2ui5/Util"], (Util) => \{| && |\n| && + | z2ui5.Util = Util;| && |\n| && + |\}| && |\n| && + |);| && |\n| && + || && |\n| && + |sap.ui.define("z2ui5/Favicon", ["sap/ui/core/Control"], (Control) => \{| && |\n| && + | "use strict";| && |\n| && + | return Control.extend("z2ui5.Favicon", \{| && |\n| && + | metadata: \{| && |\n| && + | properties: \{| && |\n| && + | favicon: \{| && |\n| && + | type: "string"| && |\n| && + | \},| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + | setFavicon(val) \{| && |\n| && + | this.setProperty("favicon", val);| && |\n| && + | let headTitle = document.querySelector('head');| && |\n| && + | let setFavicon = document.createElement('link');| && |\n| && + | setFavicon.setAttribute('rel', 'shortcut icon');| && |\n| && + | setFavicon.setAttribute('href', val);| && |\n| && + | headTitle.appendChild(setFavicon);| && |\n| && + | \},| && |\n| && + | renderer(oRm, oControl) \{ \}| && |\n| && + | \});| && |\n| && + |\}| && |\n| && + |);| && |\n| && + || && |\n| && + |sap.ui.define("z2ui5/Dirty", ["sap/ui/core/Control", "sap/ushell/Container"], (Control, Container) => \{| && |\n| && + | "use strict";| && |\n| && + | return Control.extend("z2ui5.Dirty", \{| && |\n| && + | metadata: \{| && |\n| && + | properties: \{| && |\n| && + | isDirty: \{| && |\n| && + | type: "string"| && |\n| && + | \},| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + | setIsDirty(val) \{| && |\n| && + | if (Container) \{| && |\n| && + | Container.setDirtyFlag(val);| && |\n| && + | \} else \{| && |\n| && + | window.onbeforeunload = function (e) \{| && |\n| && + | if (val) \{| && |\n| && + | e.preventDefault();| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + | renderer(oRm, oControl) \{ \}| && |\n| && + | \});| && |\n| && + |\}| && |\n| && + |);| && |\n| && + ||. ENDMETHOD. - ENDCLASS. diff --git a/src/01/03/z2ui5_cl_app_app_xml.clas.abap b/src/01/03/z2ui5_cl_app_app_xml.clas.abap index 3f28220f..c713443e 100644 --- a/src/01/03/z2ui5_cl_app_app_xml.clas.abap +++ b/src/01/03/z2ui5_cl_app_app_xml.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_app_app_xml DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -10,24 +9,23 @@ CLASS z2ui5_cl_app_app_xml DEFINITION VALUE(result) TYPE string. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. CLASS z2ui5_cl_app_app_xml IMPLEMENTATION. - METHOD get. - result = `` && - ` ` && - ` ` && - `` && - `` && - ``. + result = || && + | | && + | | && + || && + || && + ||. ENDMETHOD. - ENDCLASS. diff --git a/src/01/03/z2ui5_cl_app_component_js.clas.abap b/src/01/03/z2ui5_cl_app_component_js.clas.abap index cf5cadd8..6904521c 100644 --- a/src/01/03/z2ui5_cl_app_component_js.clas.abap +++ b/src/01/03/z2ui5_cl_app_component_js.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_app_component_js DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -10,77 +9,76 @@ CLASS z2ui5_cl_app_component_js DEFINITION VALUE(result) TYPE string. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. CLASS z2ui5_cl_app_component_js IMPLEMENTATION. - METHOD get. - result = `sap.ui.define(["sap/ui/core/UIComponent", "z2ui5/model/models",` && |\n| && - ` "z2ui5/cc/DebugTool","z2ui5/cc/Server", "sap/base/Log","sap/ui/VersionInfo"` && |\n| && - `` && |\n| && - ` ], function (UIComponent, models, DebugTool, Server, Log, VersionInfo) {` && |\n| && - ` return UIComponent.extend("z2ui5.Component", {` && |\n| && - ` metadata: {` && |\n| && - ` manifest: "json"` && |\n| && - ` },` && |\n| && - ` init: async function () {` && |\n| && - `` && |\n| && - ` UIComponent.prototype.init.apply(this, arguments);` && |\n| && - `` && |\n| && - ` this.getRouter().initialize();` && |\n| && - ` z2ui5.oRouter = this.getRouter();` && |\n| && - ` this.setModel(models.createDeviceModel(), "device");` && |\n| && - ` this._oLogger = Log.getLogger("abap2UI5");` && |\n| && - `` && |\n| && - ` z2ui5.oConfig = {};` && |\n| && - ` z2ui5.oConfig.ComponentData = this.getComponentData();` && |\n| && - `` && |\n| && - ` try {` && |\n| && - ` z2ui5.oLaunchpadService = await this.getService("ShellUIService");` && |\n| && - ` } catch (e) {}` && |\n| && - `` && |\n| && - ` let oVersionInfo = await VersionInfo.load();` && |\n| && - ` z2ui5.oConfig.UI5VersionInfo = {` && |\n| && - ` version : oVersionInfo.version,` && |\n| && - ` buildTimestamp : oVersionInfo.buildTimestamp,` && |\n| && - ` gav : oVersionInfo.gav,` && |\n| && - ` }` && |\n| && - `` && |\n| && - ` if (/iPad|iPhone/.test(navigator.platform)) {` && |\n| && - ` window.addEventListener("__pagehide", this.__pagehide.bind(this));` && |\n| && - ` } else {` && |\n| && - ` window.addEventListener("__beforeunload", this.__beforeunload.bind(this));` && |\n| && - ` }` && |\n| && - `` && |\n| && - ` document.addEventListener("keydown", function (zEvent) {` && |\n| && - ` if (zEvent?.key === "F12") {` && |\n| && - ` new z2ui5.cc.DebugTool().show();` && |\n| && - ` }` && |\n| && - ` });` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` __beforeunload: function () {` && |\n| && - ` window.removeEventListener("__beforeunload", this.__beforeunload.bind(this));` && |\n| && - ` this.destroy();` && |\n| && - ` },` && |\n| && - ` __pagehide: function () {` && |\n| && - ` window.removeEventListener("__pagehide", this.__pagehide.bind(this));` && |\n| && - ` this.destroy();` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` exit: function () {` && |\n| && - ` Server.endSession();` && |\n| && - ` if (UIComponent.prototype.exit)` && |\n| && - ` UIComponent.prototype.exit.apply(this, arguments);` && |\n| && - ` },` && |\n| && - ` });` && |\n| && - `});` && |\n| && - `` && |\n| && - ``. + result = |sap.ui.define(["sap/ui/core/UIComponent", "z2ui5/model/models",| && |\n| && + | "z2ui5/cc/DebugTool","z2ui5/cc/Server", "sap/base/Log","sap/ui/VersionInfo"| && |\n| && + || && |\n| && + | ], function (UIComponent, models, DebugTool, Server, Log, VersionInfo) \{| && |\n| && + | return UIComponent.extend("z2ui5.Component", \{| && |\n| && + | metadata: \{| && |\n| && + | manifest: "json"| && |\n| && + | \},| && |\n| && + | init: async function () \{| && |\n| && + || && |\n| && + | UIComponent.prototype.init.apply(this, arguments);| && |\n| && + || && |\n| && + | this.getRouter().initialize();| && |\n| && + | z2ui5.oRouter = this.getRouter();| && |\n| && + | this.setModel(models.createDeviceModel(), "device");| && |\n| && + | this._oLogger = Log.getLogger("abap2UI5");| && |\n| && + || && |\n| && + | z2ui5.oConfig = \{\};| && |\n| && + | z2ui5.oConfig.ComponentData = this.getComponentData();| && |\n| && + || && |\n| && + | try \{| && |\n| && + | z2ui5.oLaunchpadService = await this.getService("ShellUIService");| && |\n| && + | \} catch (e) \{\}| && |\n| && + || && |\n| && + | let oVersionInfo = await VersionInfo.load();| && |\n| && + | z2ui5.oConfig.UI5VersionInfo = \{| && |\n| && + | version : oVersionInfo.version,| && |\n| && + | buildTimestamp : oVersionInfo.buildTimestamp,| && |\n| && + | gav : oVersionInfo.gav,| && |\n| && + | \}| && |\n| && + || && |\n| && + | if (/iPad\|iPhone/.test(navigator.platform)) \{| && |\n| && + | window.addEventListener("__pagehide", this.__pagehide.bind(this));| && |\n| && + | \} else \{| && |\n| && + | window.addEventListener("__beforeunload", this.__beforeunload.bind(this));| && |\n| && + | \}| && |\n| && + || && |\n| && + | document.addEventListener("keydown", function (zEvent) \{| && |\n| && + | if (zEvent?.key === "F12") \{| && |\n| && + | new z2ui5.cc.DebugTool().show();| && |\n| && + | \}| && |\n| && + | \});| && |\n| && + | \},| && |\n| && + || && |\n| && + | __beforeunload: function () \{| && |\n| && + | window.removeEventListener("__beforeunload", this.__beforeunload.bind(this));| && |\n| && + | this.destroy();| && |\n| && + | \},| && |\n| && + | __pagehide: function () \{| && |\n| && + | window.removeEventListener("__pagehide", this.__pagehide.bind(this));| && |\n| && + | this.destroy();| && |\n| && + | \},| && |\n| && + || && |\n| && + | exit: function () \{| && |\n| && + | Server.endSession();| && |\n| && + | if (UIComponent.prototype.exit)| && |\n| && + | UIComponent.prototype.exit.apply(this, arguments);| && |\n| && + | \},| && |\n| && + | \});| && |\n| && + |\});| && |\n| && + || && |\n| && + ||. ENDMETHOD. - ENDCLASS. diff --git a/src/01/03/z2ui5_cl_app_debugtool_js.clas.abap b/src/01/03/z2ui5_cl_app_debugtool_js.clas.abap index 838b7c2f..8d33d08a 100644 --- a/src/01/03/z2ui5_cl_app_debugtool_js.clas.abap +++ b/src/01/03/z2ui5_cl_app_debugtool_js.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_app_debugtool_js DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -10,159 +9,158 @@ CLASS z2ui5_cl_app_debugtool_js DEFINITION VALUE(result) TYPE string. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. CLASS z2ui5_cl_app_debugtool_js IMPLEMENTATION. - METHOD get. - result = `sap.ui.define(["sap/ui/core/Control", "sap/ui/core/Fragment", "sap/ui/model/json/JSONModel"], (Control, Fragment, JSONModel) => {` && |\n| && - ` "use strict";` && |\n| && - `` && |\n| && - ` return Control.extend("z2ui5.cc.DebugTool", {` && |\n| && - `` && |\n| && - ` //printer XML` && |\n| && - ` prettifyXml: function (sourceXml) {` && |\n| && - ` const xmlDoc = new DOMParser().parseFromString(sourceXml, 'application/xml');` && |\n| && - ` var sParse = ``<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">` && |\n| && - ` <xsl:strip-space elements="*" />` && |\n| && - ` <xsl:template match="para[content-style][not(text())]">` && |\n| && - ` <xsl:value-of select="normalize-space(.)" />` && |\n| && - ` </xsl:template>` && |\n| && - ` <xsl:template match="node()|@*">` && |\n| && - ` <xsl:copy>` && |\n| && - ` <xsl:apply-templates select="node()|@*" />` && |\n| && - ` </xsl:copy>` && |\n| && - ` </xsl:template>` && |\n| && - ` <xsl:output indent="yes" />` && |\n| && - ` </xsl:stylesheet>``;` && |\n| && - ` sParse = sParse.replace(/>/g, unescape("%3E")).replace(/</g, unescape("%3C"));` && |\n| && - ` const xsltDoc = new DOMParser().parseFromString(sParse, 'application/xml');` && |\n| && - `` && |\n| && - ` const xsltProcessor = new XSLTProcessor();` && |\n| && - ` xsltProcessor.importStylesheet(xsltDoc);` && |\n| && - ` const resultDoc = xsltProcessor.transformToDocument(xmlDoc);` && |\n| && - ` const resultXml = new XMLSerializer().serializeToString(resultDoc);` && |\n| && - ` return resultXml.replace(/>/g, ">").replace(/</g, "<");` && |\n| && - ` }, onItemSelect: function (oEvent) {` && |\n| && - ` const selItem = oEvent.getSource().getSelectedKey();` && |\n| && - ` const oView = z2ui5?.oView;` && |\n| && - ` const oResponse = z2ui5?.oResponse;` && |\n| && - ` const displayEditor = this.displayEditor.bind(this);` && |\n| && - `` && |\n| && - ` switch (selItem) {` && |\n| && - ` case 'CONFIG':` && |\n| && - ` displayEditor(oEvent, JSON.stringify(z2ui5.oConfig, null, 3), 'json');` && |\n| && - ` break;` && |\n| && - ` case 'MODEL':` && |\n| && - ` displayEditor(oEvent, JSON.stringify(oView?.getModel()?.getData(), null, 3), 'json');` && |\n| && - ` break;` && |\n| && - ` case 'VIEW':` && |\n| && - ` const viewContent = oView?.mProperties?.viewContent || z2ui5.responseData.S_FRONT.PARAMS.S_VIEW.XML;` && |\n| && - ` displayEditor(oEvent, this.prettifyXml(viewContent), 'xml', this.prettifyXml(oView?._xContent.outerHTML));` && |\n| && - ` break;` && |\n| && - ` case 'PLAIN':` && |\n| && - ` displayEditor(oEvent, JSON.stringify(z2ui5.responseData, null, 3), 'json');` && |\n| && - ` break;` && |\n| && - ` case 'REQUEST':` && |\n| && - ` displayEditor(oEvent, JSON.stringify(z2ui5.oBody, null, 3), 'json');` && |\n| && - ` break;` && |\n| && - ` case 'POPUP':` && |\n| && - ` displayEditor(oEvent, this.prettifyXml(oResponse?.PARAMS?.S_POPUP?.XML), 'xml');` && |\n| && - ` break;` && |\n| && - ` case 'POPUP_MODEL':` && |\n| && - ` displayEditor(oEvent, JSON.stringify(z2ui5.oViewPopup.getModel().getData(), null, 3), 'json');` && |\n| && - ` break;` && |\n| && - ` case 'POPOVER':` && |\n| && - ` displayEditor(oEvent, oResponse?.PARAMS?.S_POPOVER?.XML, 'xml');` && |\n| && - ` break;` && |\n| && - ` case 'POPOVER_MODEL':` && |\n| && - ` displayEditor(oEvent, JSON.stringify(z2ui5?.oViewPopover?.getModel()?.getData(), null, 3), 'json');` && |\n| && - ` break;` && |\n| && - ` case 'NEST1':` && |\n| && - ` displayEditor(oEvent, this.prettifyXml(z2ui5?.oViewNest?.mProperties?.viewContent), 'xml', this.prettifyXml(z2ui5?.oViewNest?._xContent.outerHTML));` && |\n| && - ` break;` && |\n| && - ` case 'NEST1_MODEL':` && |\n| && - ` displayEditor(oEvent, JSON.stringify(z2ui5?.oViewNest?.getModel()?.getData(), null, 3), 'json');` && |\n| && - ` break;` && |\n| && - ` case 'NEST2':` && |\n| && - ` displayEditor(oEvent, this.prettifyXml(z2ui5?.oViewNest2?.mProperties?.viewContent), 'xml', this.prettifyXml(z2ui5?.oViewNest2?._xContent.outerHTML));` && |\n| && - ` break;` && |\n| && - ` case 'NEST2_MODEL':` && |\n| && - ` displayEditor(oEvent, JSON.stringify(z2ui5?.oViewNest2?.getModel()?.getData(), null, 3), 'json');` && |\n| && - ` break;` && |\n| && - ` case 'SOURCE':` && |\n| && - ` const parent = oEvent.getSource().getParent();` && |\n| && - ` const contentControl = parent.getContent()[2].getItems()[0];` && |\n| && - ` const url = ``${window.location.origin}/sap/bc/adt/oo/classes/${z2ui5.responseData.S_FRONT.APP}/source/main``;` && |\n| && - ` const content = atob('PGlmcmFtZSBpZD0idGVzdCIgc3JjPSInICsgdXJsICsgJyIgaGVpZ2h0PSI4MDBweCIgd2lkdGg9IjEyMDBweCIgLz4=').replace("' + url + '", url);` && |\n| && - ` contentControl.setProperty("content", content);` && |\n| && - ` const modelData = oEvent.getSource().getModel().oData;` && |\n| && - ` modelData.editor_visible = false;` && |\n| && - ` modelData.source_visible = true;` && |\n| && - ` oEvent.getSource().getModel().refresh();` && |\n| && - ` break;` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` displayEditor: function (oEvent, content, type, xcontent = "") {` && |\n| && - ` const modelData = oEvent.getSource().getModel().oData;` && |\n| && - ` modelData.editor_visible = true;` && |\n| && - ` modelData.source_visible = false;` && |\n| && - ` modelData.isTemplating = content.includes("xmlns:template");` && |\n| && - ` modelData.value = content;` && |\n| && - ` modelData.previousValue = content;` && |\n| && - ` modelData.xContent = xcontent;` && |\n| && - ` modelData.type = type;` && |\n| && - ` oEvent.getSource().getModel().refresh();` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` onTemplatingPress: function (oEvent) {` && |\n| && - ` const modelData = oEvent.getSource().getModel().oData;` && |\n| && - ` modelData.value = oEvent.getSource().getPressed() ? modelData.xContent : modelData.previousValue;` && |\n| && - ` oEvent.getSource().getModel().refresh();` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` onClose: function () {` && |\n| && - ` this.oDialog.close();` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` async show() {` && |\n| && - ` if (!this.oDialog) {` && |\n| && - ` this.oDialog = await Fragment.load({` && |\n| && - ` name: "z2ui5.cc.DebugTool",` && |\n| && - ` controller: this,` && |\n| && - ` });` && |\n| && - ` }` && |\n| && - `` && |\n| && - ` const value = JSON.stringify(z2ui5.responseData, null, 3);` && |\n| && - ` const oData = {` && |\n| && - ` type: 'json',` && |\n| && - ` source_visible: false,` && |\n| && - ` editor_visible: true,` && |\n| && - ` value: value,` && |\n| && - ` xContent: '',` && |\n| && - ` previousValue: value,` && |\n| && - ` isTemplating: false,` && |\n| && - ` templatingSource: false,` && |\n| && - ` activeNest1: z2ui5?.oViewNest?.mProperties?.viewContent !== undefined,` && |\n| && - ` activeNest2: z2ui5?.oViewNest2?.mProperties?.viewContent !== undefined,` && |\n| && - ` activePopup: z2ui5?.oResponse?.PARAMS?.S_POPUP?.XML !== undefined,` && |\n| && - ` activePopover: z2ui5?.oResponse?.PARAMS?.S_POPOVER?.XML !== undefined,` && |\n| && - ` };` && |\n| && - ` const oModel = new JSONModel(oData);` && |\n| && - `` && |\n| && - ` this.oDialog.addStyleClass('dbg-ltr');` && |\n| && - ` this.oDialog.setModel(oModel);` && |\n| && - ` this.oDialog.open();` && |\n| && - ` }` && |\n| && - ` });` && |\n| && - `});` && |\n| && - `` && |\n| && - ``. + result = |sap.ui.define(["sap/ui/core/Control", "sap/ui/core/Fragment", "sap/ui/model/json/JSONModel"], (Control, Fragment, JSONModel) => \{| && |\n| && + | "use strict";| && |\n| && + || && |\n| && + | return Control.extend("z2ui5.cc.DebugTool", \{| && |\n| && + || && |\n| && + | //printer XML| && |\n| && + | prettifyXml: function (sourceXml) \{| && |\n| && + | const xmlDoc = new DOMParser().parseFromString(sourceXml, 'application/xml');| && |\n| && + | var sParse = `<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">| && |\n| && + | <xsl:strip-space elements="*" />| && |\n| && + | <xsl:template match="para[content-style][not(text())]">| && |\n| && + | <xsl:value-of select="normalize-space(.)" />| && |\n| && + | </xsl:template>| && |\n| && + | <xsl:template match="node()\|@*">| && |\n| && + | <xsl:copy>| && |\n| && + | <xsl:apply-templates select="node()\|@*" />| && |\n| && + | </xsl:copy>| && |\n| && + | </xsl:template>| && |\n| && + | <xsl:output indent="yes" />| && |\n| && + | </xsl:stylesheet>`;| && |\n| && + | sParse = sParse.replace(/>/g, unescape("%3E")).replace(/</g, unescape("%3C"));| && |\n| && + | const xsltDoc = new DOMParser().parseFromString(sParse, 'application/xml');| && |\n| && + || && |\n| && + | const xsltProcessor = new XSLTProcessor();| && |\n| && + | xsltProcessor.importStylesheet(xsltDoc);| && |\n| && + | const resultDoc = xsltProcessor.transformToDocument(xmlDoc);| && |\n| && + | const resultXml = new XMLSerializer().serializeToString(resultDoc);| && |\n| && + | return resultXml.replace(/>/g, ">").replace(/</g, "<");| && |\n| && + | \}, onItemSelect: function (oEvent) \{| && |\n| && + | const selItem = oEvent.getSource().getSelectedKey();| && |\n| && + | const oView = z2ui5?.oView;| && |\n| && + | const oResponse = z2ui5?.oResponse;| && |\n| && + | const displayEditor = this.displayEditor.bind(this);| && |\n| && + || && |\n| && + | switch (selItem) \{| && |\n| && + | case 'CONFIG':| && |\n| && + | displayEditor(oEvent, JSON.stringify(z2ui5.oConfig, null, 3), 'json');| && |\n| && + | break;| && |\n| && + | case 'MODEL':| && |\n| && + | displayEditor(oEvent, JSON.stringify(oView?.getModel()?.getData(), null, 3), 'json');| && |\n| && + | break;| && |\n| && + | case 'VIEW':| && |\n| && + | const viewContent = oView?.mProperties?.viewContent \|\| z2ui5.responseData.S_FRONT.PARAMS.S_VIEW.XML;| && |\n| && + | displayEditor(oEvent, this.prettifyXml(viewContent), 'xml', this.prettifyXml(oView?._xContent.outerHTML));| && |\n| && + | break;| && |\n| && + | case 'PLAIN':| && |\n| && + | displayEditor(oEvent, JSON.stringify(z2ui5.responseData, null, 3), 'json');| && |\n| && + | break;| && |\n| && + | case 'REQUEST':| && |\n| && + | displayEditor(oEvent, JSON.stringify(z2ui5.oBody, null, 3), 'json');| && |\n| && + | break;| && |\n| && + | case 'POPUP':| && |\n| && + | displayEditor(oEvent, this.prettifyXml(oResponse?.PARAMS?.S_POPUP?.XML), 'xml');| && |\n| && + | break;| && |\n| && + | case 'POPUP_MODEL':| && |\n| && + | displayEditor(oEvent, JSON.stringify(z2ui5.oViewPopup.getModel().getData(), null, 3), 'json');| && |\n| && + | break;| && |\n| && + | case 'POPOVER':| && |\n| && + | displayEditor(oEvent, oResponse?.PARAMS?.S_POPOVER?.XML, 'xml');| && |\n| && + | break;| && |\n| && + | case 'POPOVER_MODEL':| && |\n| && + | displayEditor(oEvent, JSON.stringify(z2ui5?.oViewPopover?.getModel()?.getData(), null, 3), 'json');| && |\n| && + | break;| && |\n| && + | case 'NEST1':| && |\n| && + | displayEditor(oEvent, this.prettifyXml(z2ui5?.oViewNest?.mProperties?.viewContent), 'xml', this.prettifyXml(z2ui5?.oViewNest?._xContent.outerHTML));| && |\n| && + | break;| && |\n| && + | case 'NEST1_MODEL':| && |\n| && + | displayEditor(oEvent, JSON.stringify(z2ui5?.oViewNest?.getModel()?.getData(), null, 3), 'json');| && |\n| && + | break;| && |\n| && + | case 'NEST2':| && |\n| && + | displayEditor(oEvent, this.prettifyXml(z2ui5?.oViewNest2?.mProperties?.viewContent), 'xml', this.prettifyXml(z2ui5?.oViewNest2?._xContent.outerHTML));| && |\n| && + | break;| && |\n| && + | case 'NEST2_MODEL':| && |\n| && + | displayEditor(oEvent, JSON.stringify(z2ui5?.oViewNest2?.getModel()?.getData(), null, 3), 'json');| && |\n| && + | break;| && |\n| && + | case 'SOURCE':| && |\n| && + | const parent = oEvent.getSource().getParent();| && |\n| && + | const contentControl = parent.getContent()[2].getItems()[0];| && |\n| && + | const url = `$\{window.location.origin\}/sap/bc/adt/oo/classes/$\{z2ui5.responseData.S_FRONT.APP\}/source/main`;| && |\n| && + | const content = atob('PGlmcmFtZSBpZD0idGVzdCIgc3JjPSInICsgdXJsICsgJyIgaGVpZ2h0PSI4MDBweCIgd2lkdGg9IjEyMDBweCIgLz4=').replace("' + url + '", url);| && |\n| && + | contentControl.setProperty("content", content);| && |\n| && + | const modelData = oEvent.getSource().getModel().oData;| && |\n| && + | modelData.editor_visible = false;| && |\n| && + | modelData.source_visible = true;| && |\n| && + | oEvent.getSource().getModel().refresh();| && |\n| && + | break;| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + || && |\n| && + | displayEditor: function (oEvent, content, type, xcontent = "") \{| && |\n| && + | const modelData = oEvent.getSource().getModel().oData;| && |\n| && + | modelData.editor_visible = true;| && |\n| && + | modelData.source_visible = false;| && |\n| && + | modelData.isTemplating = content.includes("xmlns:template");| && |\n| && + | modelData.value = content;| && |\n| && + | modelData.previousValue = content;| && |\n| && + | modelData.xContent = xcontent;| && |\n| && + | modelData.type = type;| && |\n| && + | oEvent.getSource().getModel().refresh();| && |\n| && + | \},| && |\n| && + || && |\n| && + | onTemplatingPress: function (oEvent) \{| && |\n| && + | const modelData = oEvent.getSource().getModel().oData;| && |\n| && + | modelData.value = oEvent.getSource().getPressed() ? modelData.xContent : modelData.previousValue;| && |\n| && + | oEvent.getSource().getModel().refresh();| && |\n| && + | \},| && |\n| && + || && |\n| && + | onClose: function () \{| && |\n| && + | this.oDialog.close();| && |\n| && + | \},| && |\n| && + || && |\n| && + | async show() \{| && |\n| && + | if (!this.oDialog) \{| && |\n| && + | this.oDialog = await Fragment.load(\{| && |\n| && + | name: "z2ui5.cc.DebugTool",| && |\n| && + | controller: this,| && |\n| && + | \});| && |\n| && + | \}| && |\n| && + || && |\n| && + | const value = JSON.stringify(z2ui5.responseData, null, 3);| && |\n| && + | const oData = \{| && |\n| && + | type: 'json',| && |\n| && + | source_visible: false,| && |\n| && + | editor_visible: true,| && |\n| && + | value: value,| && |\n| && + | xContent: '',| && |\n| && + | previousValue: value,| && |\n| && + | isTemplating: false,| && |\n| && + | templatingSource: false,| && |\n| && + | activeNest1: z2ui5?.oViewNest?.mProperties?.viewContent !== undefined,| && |\n| && + | activeNest2: z2ui5?.oViewNest2?.mProperties?.viewContent !== undefined,| && |\n| && + | activePopup: z2ui5?.oResponse?.PARAMS?.S_POPUP?.XML !== undefined,| && |\n| && + | activePopover: z2ui5?.oResponse?.PARAMS?.S_POPOVER?.XML !== undefined,| && |\n| && + | \};| && |\n| && + | const oModel = new JSONModel(oData);| && |\n| && + || && |\n| && + | this.oDialog.addStyleClass('dbg-ltr');| && |\n| && + | this.oDialog.setModel(oModel);| && |\n| && + | this.oDialog.open();| && |\n| && + | \}| && |\n| && + | \});| && |\n| && + |\});| && |\n| && + || && |\n| && + ||. ENDMETHOD. - ENDCLASS. diff --git a/src/01/03/z2ui5_cl_app_debugtool_xml.clas.abap b/src/01/03/z2ui5_cl_app_debugtool_xml.clas.abap index 41fb4fec..b4328a46 100644 --- a/src/01/03/z2ui5_cl_app_debugtool_xml.clas.abap +++ b/src/01/03/z2ui5_cl_app_debugtool_xml.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_app_debugtool_xml DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -10,121 +9,120 @@ CLASS z2ui5_cl_app_debugtool_xml DEFINITION VALUE(result) TYPE string. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. CLASS z2ui5_cl_app_debugtool_xml IMPLEMENTATION. - METHOD get. - result = `` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - `` && - `` && - ``. + result = || && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + | | && + || && + || && + ||. ENDMETHOD. - ENDCLASS. diff --git a/src/01/03/z2ui5_cl_app_index_html.clas.abap b/src/01/03/z2ui5_cl_app_index_html.clas.abap index 38a9111e..9440072f 100644 --- a/src/01/03/z2ui5_cl_app_index_html.clas.abap +++ b/src/01/03/z2ui5_cl_app_index_html.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_app_index_html DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -10,51 +9,50 @@ CLASS z2ui5_cl_app_index_html DEFINITION VALUE(result) TYPE string. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. CLASS z2ui5_cl_app_index_html IMPLEMENTATION. - METHOD get. - result = `` && - `` && - `` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - ` ` && - `` && - `` && - ` ` && - `` && - `` && - ``. + result = || && + || && + || && + | | && + | | && + | | && + | | && + | | && + | | && + || && + || && + | | && + || && + || && + ||. ENDMETHOD. - ENDCLASS. diff --git a/src/01/03/z2ui5_cl_app_manifest_json.clas.abap b/src/01/03/z2ui5_cl_app_manifest_json.clas.abap index 475315b3..9e63a504 100644 --- a/src/01/03/z2ui5_cl_app_manifest_json.clas.abap +++ b/src/01/03/z2ui5_cl_app_manifest_json.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_app_manifest_json DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -10,160 +9,159 @@ CLASS z2ui5_cl_app_manifest_json DEFINITION VALUE(result) TYPE string. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. CLASS z2ui5_cl_app_manifest_json IMPLEMENTATION. - METHOD get. - result = `{` && - ` "_version": "1.65.0",` && - ` "sap.app": {` && - ` "id": "z2ui5",` && - ` "type": "application",` && - ` "applicationVersion": {` && - ` "version": "0.0.1"` && - ` },` && - ` "title": "{{appTitle}}",` && - ` "description": "{{appDescription}}",` && - ` "resources": "resources.json",` && - ` "sourceTemplate": {` && - ` "id": "@sap/generator-fiori:basic",` && - ` "version": "1.15.0",` && - ` "toolsId": "3a966e20-9635-4c28-8861-d1b66f79f1de"` && - ` },` && - ` "dataSources": {` && - ` "mainService": {` && - ` "uri": "/sap/bc/z2ui5",` && - ` "type": "OData",` && - ` "settings": {` && - ` "annotations": [],` && - ` "localUri": "localService/metadata.xml",` && - ` "odataVersion": "2.0"` && - ` }` && - ` }` && - ` },` && - ` "crossNavigation": {` && - ` "inbounds": {` && - ` "z2ui5-display": {` && - ` "semanticObject": "z2ui5",` && - ` "action": "display",` && - ` "title": "{{flpTitle}}",` && - ` "signature": {` && - ` "parameters": {},` && - ` "additionalParameters": "allowed"` && - ` }` && - ` }` && - ` }` && - ` }` && - ` },` && - ` "sap.ui": {` && - ` "technology": "UI5",` && - ` "icons": {` && - ` "icon": "",` && - ` "favIcon": "",` && - ` "phone": "",` && - ` "phone@2": "",` && - ` "tablet": "",` && - ` "tablet@2": ""` && - ` },` && - ` "deviceTypes": {` && - ` "desktop": true,` && - ` "tablet": true,` && - ` "phone": true` && - ` }` && - ` },` && - ` "sap.ui5": {` && - ` "flexEnabled": true,` && - ` "dependencies": {` && - ` "minUI5Version": "1.128.1",` && - ` "libs": {` && - ` "sap.m": {},` && - ` "sap.ui.core": {}` && - ` }` && - ` },` && - ` "contentDensities": {` && - ` "compact": true,` && - ` "cozy": true` && - ` },` && - ` "services": {` && - ` "ShellUIService": {` && - ` "factoryName": "sap.ushell.ui5service.ShellUIService"` && - ` }` && - ` },` && - ` "models": {` && - ` "": {` && - ` "dataSource": "mainService",` && - ` "preload": true,` && - ` "settings": {}` && - ` }` && - ` },` && - ` "resources": {` && - ` "css": [` && - ` {` && - ` "uri": "css/style.css"` && - ` }` && - ` ]` && - ` },` && - ` "routing": {` && - ` "config": {` && - ` "routerClass": "sap.m.routing.Router",` && - ` "viewType": "XML",` && - ` "async": true,` && - ` "viewPath": "z2ui5.view",` && - ` "controlAggregation": "pages",` && - ` "controlId": "app",` && - ` "clearControlAggregation": false` && - ` },` && - ` "routes": [` && - ` {` && - ` "name": "RouteView1",` && - ` "pattern": ":?query:",` && - ` "target": [` && - ` "TargetView1"` && - ` ]` && - ` },` && - ` {` && - ` "name": "RouteView2",` && - ` "pattern": ":?query:",` && - ` "target": [` && - ` "TargetView2"` && - ` ]` && - ` }` && - ` ],` && - ` "targets": {` && - ` "TargetView1": {` && - ` "viewType": "XML",` && - ` "transition": "flip",` && - ` "clearControlAggregation": false,` && - ` "viewId": "View1",` && - ` "viewName": "View1"` && - ` },` && - ` "TargetView2": {` && - ` "viewType": "XML",` && - ` "transition": "flip",` && - ` "clearControlAggregation": false,` && - ` "viewId": "View2",` && - ` "viewName": "View2"` && - ` }` && - ` }` && - ` },` && - ` "rootView": {` && - ` "viewName": "z2ui5.view.App",` && - ` "type": "XML",` && - ` "async": true,` && - ` "id": "App"` && - ` }` && - ` },` && - ` "sap.cloud": {` && - ` "public": true,` && - ` "service": "z2ui5"` && - ` }` && - `}` && - ``. + result = |\{| && + | "_version": "1.65.0",| && + | "sap.app": \{| && + | "id": "z2ui5",| && + | "type": "application",| && + | "applicationVersion": \{| && + | "version": "0.0.1"| && + | \},| && + | "title": "\{\{appTitle\}\}",| && + | "description": "\{\{appDescription\}\}",| && + | "resources": "resources.json",| && + | "sourceTemplate": \{| && + | "id": "@sap/generator-fiori:basic",| && + | "version": "1.15.0",| && + | "toolsId": "3a966e20-9635-4c28-8861-d1b66f79f1de"| && + | \},| && + | "dataSources": \{| && + | "mainService": \{| && + | "uri": "/sap/bc/z2ui5",| && + | "type": "OData",| && + | "settings": \{| && + | "annotations": [],| && + | "localUri": "localService/metadata.xml",| && + | "odataVersion": "2.0"| && + | \}| && + | \}| && + | \},| && + | "crossNavigation": \{| && + | "inbounds": \{| && + | "z2ui5-display": \{| && + | "semanticObject": "z2ui5",| && + | "action": "display",| && + | "title": "\{\{flpTitle\}\}",| && + | "signature": \{| && + | "parameters": \{\},| && + | "additionalParameters": "allowed"| && + | \}| && + | \}| && + | \}| && + | \}| && + | \},| && + | "sap.ui": \{| && + | "technology": "UI5",| && + | "icons": \{| && + | "icon": "",| && + | "favIcon": "",| && + | "phone": "",| && + | "phone@2": "",| && + | "tablet": "",| && + | "tablet@2": ""| && + | \},| && + | "deviceTypes": \{| && + | "desktop": true,| && + | "tablet": true,| && + | "phone": true| && + | \}| && + | \},| && + | "sap.ui5": \{| && + | "flexEnabled": true,| && + | "dependencies": \{| && + | "minUI5Version": "1.128.1",| && + | "libs": \{| && + | "sap.m": \{\},| && + | "sap.ui.core": \{\}| && + | \}| && + | \},| && + | "contentDensities": \{| && + | "compact": true,| && + | "cozy": true| && + | \},| && + | "services": \{| && + | "ShellUIService": \{| && + | "factoryName": "sap.ushell.ui5service.ShellUIService"| && + | \}| && + | \},| && + | "models": \{| && + | "": \{| && + | "dataSource": "mainService",| && + | "preload": true,| && + | "settings": \{\}| && + | \}| && + | \},| && + | "resources": \{| && + | "css": [| && + | \{| && + | "uri": "css/style.css"| && + | \}| && + | ]| && + | \},| && + | "routing": \{| && + | "config": \{| && + | "routerClass": "sap.m.routing.Router",| && + | "viewType": "XML",| && + | "async": true,| && + | "viewPath": "z2ui5.view",| && + | "controlAggregation": "pages",| && + | "controlId": "app",| && + | "clearControlAggregation": false| && + | \},| && + | "routes": [| && + | \{| && + | "name": "RouteView1",| && + | "pattern": ":?query:",| && + | "target": [| && + | "TargetView1"| && + | ]| && + | \},| && + | \{| && + | "name": "RouteView2",| && + | "pattern": ":?query:",| && + | "target": [| && + | "TargetView2"| && + | ]| && + | \}| && + | ],| && + | "targets": \{| && + | "TargetView1": \{| && + | "viewType": "XML",| && + | "transition": "flip",| && + | "clearControlAggregation": false,| && + | "viewId": "View1",| && + | "viewName": "View1"| && + | \},| && + | "TargetView2": \{| && + | "viewType": "XML",| && + | "transition": "flip",| && + | "clearControlAggregation": false,| && + | "viewId": "View2",| && + | "viewName": "View2"| && + | \}| && + | \}| && + | \},| && + | "rootView": \{| && + | "viewName": "z2ui5.view.App",| && + | "type": "XML",| && + | "async": true,| && + | "id": "App"| && + | \}| && + | \},| && + | "sap.cloud": \{| && + | "public": true,| && + | "service": "z2ui5"| && + | \}| && + |\}| && + ||. ENDMETHOD. - ENDCLASS. diff --git a/src/01/03/z2ui5_cl_app_models_js.clas.abap b/src/01/03/z2ui5_cl_app_models_js.clas.abap index 703f4aa8..bb1bfb43 100644 --- a/src/01/03/z2ui5_cl_app_models_js.clas.abap +++ b/src/01/03/z2ui5_cl_app_models_js.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_app_models_js DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -10,35 +9,34 @@ CLASS z2ui5_cl_app_models_js DEFINITION VALUE(result) TYPE string. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. CLASS z2ui5_cl_app_models_js IMPLEMENTATION. - METHOD get. - result = `sap.ui.define([` && |\n| && - ` "sap/ui/model/json/JSONModel",` && |\n| && - ` "sap/ui/Device"` && |\n| && - `],` && |\n| && - `function (JSONModel, Device) {` && |\n| && - ` "use strict";` && |\n| && - `` && |\n| && - ` return {` && |\n| && - ` /**` && |\n| && - ` * Provides runtime info for the device the UI5 app is running on as JSONModel` && |\n| && - ` */` && |\n| && - ` createDeviceModel: function () {` && |\n| && - ` var oModel = new JSONModel(Device);` && |\n| && - ` oModel.setDefaultBindingMode("OneWay");` && |\n| && - ` return oModel;` && |\n| && - ` }` && |\n| && - ` };` && |\n| && - `` && |\n| && - `});` && |\n| && - ``. + result = |sap.ui.define([| && |\n| && + | "sap/ui/model/json/JSONModel",| && |\n| && + | "sap/ui/Device"| && |\n| && + |],| && |\n| && + |function (JSONModel, Device) \{| && |\n| && + | "use strict";| && |\n| && + || && |\n| && + | return \{| && |\n| && + | /**| && |\n| && + | * Provides runtime info for the device the UI5 app is running on as JSONModel| && |\n| && + | */| && |\n| && + | createDeviceModel: function () \{| && |\n| && + | var oModel = new JSONModel(Device);| && |\n| && + | oModel.setDefaultBindingMode("OneWay");| && |\n| && + | return oModel;| && |\n| && + | \}| && |\n| && + | \};| && |\n| && + || && |\n| && + |\});| && |\n| && + ||. ENDMETHOD. - ENDCLASS. diff --git a/src/01/03/z2ui5_cl_app_server_js.clas.abap b/src/01/03/z2ui5_cl_app_server_js.clas.abap index b2b9e6f2..0087511d 100644 --- a/src/01/03/z2ui5_cl_app_server_js.clas.abap +++ b/src/01/03/z2ui5_cl_app_server_js.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_app_server_js DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -10,163 +9,162 @@ CLASS z2ui5_cl_app_server_js DEFINITION VALUE(result) TYPE string. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. CLASS z2ui5_cl_app_server_js IMPLEMENTATION. - METHOD get. - result = `sap.ui.define(["sap/ui/core/BusyIndicator", "sap/m/MessageBox"` && |\n| && - `],` && |\n| && - ` function (BusyIndicator, MessageBox) {` && |\n| && - ` "use strict";` && |\n| && - `` && |\n| && - ` return {` && |\n| && - `` && |\n| && - ` endSession: function () {` && |\n| && - `` && |\n| && - ` if (z2ui5.contextId) {` && |\n| && - ` fetch(z2ui5.oConfig.pathname, {` && |\n| && - ` method: 'HEAD',` && |\n| && - ` keepalive: true,` && |\n| && - ` headers: {` && |\n| && - ` 'sap-terminate': 'session',` && |\n| && - ` 'sap-contextid': z2ui5.contextId,` && |\n| && - ` 'sap-contextid-accept': 'header'` && |\n| && - ` }` && |\n| && - ` });` && |\n| && - ` delete z2ui5.contextId;` && |\n| && - ` }` && |\n| && - `` && |\n| && - ` },` && |\n| && - ` Roundtrip() {` && |\n| && - ` z2ui5.checkTimerActive = false;` && |\n| && - ` z2ui5.checkNestAfter = false;` && |\n| && - ` z2ui5.checkNestAfter2 = false;` && |\n| && - ` let event = (args) => {` && |\n| && - ` if (args != undefined) {` && |\n| && - ` return args[0][0];` && |\n| && - ` }` && |\n| && - ` };` && |\n| && - `` && |\n| && - ` z2ui5.oBody ??= {};` && |\n| && - ` z2ui5.oBody.S_FRONT = {` && |\n| && - ` ID: z2ui5?.oBody?.ID,` && |\n| && - ` CONFIG: z2ui5.oConfig,` && |\n| && - ` XX: z2ui5?.oBody?.XX,` && |\n| && - ` ORIGIN: window.location.origin,` && |\n| && - ` PATHNAME: window.location.pathname,` && |\n| && - ` SEARCH: (z2ui5.search) ? z2ui5.search : window.location.search,` && |\n| && - ` VIEW: z2ui5.oBody?.VIEWNAME,` && |\n| && - ` EVENT: event(z2ui5.oBody?.ARGUMENTS),` && |\n| && - ` HASH: window.location.hash,` && |\n| && - ` };` && |\n| && - ` if (z2ui5.oBody?.ARGUMENTS != undefined) {` && |\n| && - ` if (z2ui5.oBody?.ARGUMENTS.length > 0) {` && |\n| && - ` z2ui5.oBody?.ARGUMENTS.shift();` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` z2ui5.oBody.S_FRONT.T_EVENT_ARG = z2ui5.oBody?.ARGUMENTS;` && |\n| && - ` delete z2ui5.oBody.ID;` && |\n| && - ` delete z2ui5.oBody?.VIEWNAME;` && |\n| && - ` delete z2ui5.oBody?.S_FRONT.XX;` && |\n| && - ` delete z2ui5.oBody?.ARGUMENTS;` && |\n| && - ` if (!z2ui5.oBody.S_FRONT.T_EVENT_ARG) {` && |\n| && - ` delete z2ui5.oBody.S_FRONT.T_EVENT_ARG;` && |\n| && - ` }` && |\n| && - ` if (z2ui5.oBody.S_FRONT.T_EVENT_ARG) {` && |\n| && - ` if (z2ui5.oBody.S_FRONT.T_EVENT_ARG.length == 0) {` && |\n| && - ` delete z2ui5.oBody.S_FRONT.T_EVENT_ARG;` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` if (z2ui5.oBody.S_FRONT.T_STARTUP_PARAMETERS == undefined) {` && |\n| && - ` delete z2ui5.oBody.S_FRONT.T_STARTUP_PARAMETERS;` && |\n| && - ` }` && |\n| && - ` if (z2ui5.oBody.S_FRONT.SEARCH == '') {` && |\n| && - ` delete z2ui5.oBody.S_FRONT.SEARCH;` && |\n| && - ` }` && |\n| && - ` if (!z2ui5.oBody.XX) {` && |\n| && - ` delete z2ui5.oBody.XX;` && |\n| && - ` }` && |\n| && - ` this.readHttp();` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` async readHttp() {` && |\n| && - ` const response = await fetch(z2ui5.oConfig.pathname, {` && |\n| && - ` method: 'POST',` && |\n| && - ` headers: {` && |\n| && - ` 'Content-Type': 'application/json',` && |\n| && - ` 'sap-contextid-accept': 'header',` && |\n| && - ` 'sap-contextid': z2ui5.contextId` && |\n| && - ` },` && |\n| && - ` body: JSON.stringify(z2ui5.oBody)` && |\n| && - ` });` && |\n| && - ` z2ui5.contextId = response.headers.get("sap-contextid");` && |\n| && - ` if (!response.ok) {` && |\n| && - ` const responseText = await response.text();` && |\n| && - ` this.responseError(responseText);` && |\n| && - ` } else {` && |\n| && - ` const responseData = await response.json();` && |\n| && - ` z2ui5.responseData = responseData;` && |\n| && - ` this.responseSuccess({` && |\n| && - ` ID: responseData.S_FRONT.ID,` && |\n| && - ` PARAMS: responseData.S_FRONT.PARAMS,` && |\n| && - ` OVIEWMODEL: responseData.MODEL,` && |\n| && - ` });` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` async responseSuccess(response) {` && |\n| && - ` try {` && |\n| && - ` z2ui5.oResponse = response;` && |\n| && - ` if (z2ui5.oResponse.PARAMS?.S_VIEW?.CHECK_DESTROY) {` && |\n| && - ` z2ui5.oController.ViewDestroy();` && |\n| && - ` }` && |\n| && - ` ; if (z2ui5.oResponse.PARAMS?.S_FOLLOW_UP_ACTION?.CUSTOM_JS) {` && |\n| && - ` setTimeout(() => {` && |\n| && - ` let mParams = z2ui5.oResponse?.PARAMS.S_FOLLOW_UP_ACTION.CUSTOM_JS.split("'");` && |\n| && - ` let mParamsEF = mParams.filter((val, index) => index % 2)` && |\n| && - ` if (mParamsEF.length) {` && |\n| && - ` z2ui5.oController.eF.apply(undefined, mParamsEF);` && |\n| && - ` } else {` && |\n| && - ` Function("return " + mParams[0])();` && |\n| && - ` }` && |\n| && - ` }, 100);` && |\n| && - ` };` && |\n| && - ` z2ui5.oController.showMessage('S_MSG_TOAST', z2ui5.oResponse.PARAMS);` && |\n| && - ` z2ui5.oController.showMessage('S_MSG_BOX', z2ui5.oResponse.PARAMS);` && |\n| && - ` if (z2ui5.oResponse.PARAMS?.S_VIEW?.XML) {` && |\n| && - ` if (z2ui5.oResponse.PARAMS?.S_VIEW?.XML !== '') {` && |\n| && - ` z2ui5.oController.ViewDestroy();` && |\n| && - ` await z2ui5.oController.displayView(z2ui5.oResponse.PARAMS.S_VIEW.XML, z2ui5.oResponse.OVIEWMODEL);` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` z2ui5.oController.updateModelIfRequired('S_VIEW', z2ui5.oView);` && |\n| && - ` z2ui5.oController.updateModelIfRequired('S_VIEW_NEST', z2ui5.oViewNest);` && |\n| && - ` z2ui5.oController.updateModelIfRequired('S_VIEW_NEST2', z2ui5.oViewNest2);` && |\n| && - ` z2ui5.oController.updateModelIfRequired('S_POPUP', z2ui5.oViewPopup);` && |\n| && - ` z2ui5.oController.updateModelIfRequired('S_POPOVER', z2ui5.oViewPopover);` && |\n| && - ` z2ui5.oController.onAfterRendering();` && |\n| && - ` } catch (e) {` && |\n| && - ` BusyIndicator.hide();` && |\n| && - ` if (e.message.includes("openui5")) {` && |\n| && - ` if (e.message.includes("script load error")) {` && |\n| && - ` z2ui5.oController.checkSDKcompatibility(e)` && |\n| && - ` }` && |\n| && - ` } else {` && |\n| && - ` MessageBox.error(e.toLocaleString());` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` responseError(response) {` && |\n| && - ` document.write(response);` && |\n| && - ` },` && |\n| && - ` };` && |\n| && - ` });` && |\n| && - ``. + result = |sap.ui.define(["sap/ui/core/BusyIndicator", "sap/m/MessageBox"| && |\n| && + |],| && |\n| && + | function (BusyIndicator, MessageBox) \{| && |\n| && + | "use strict";| && |\n| && + || && |\n| && + | return \{| && |\n| && + || && |\n| && + | endSession: function () \{| && |\n| && + || && |\n| && + | if (z2ui5.contextId) \{| && |\n| && + | fetch(z2ui5.oConfig.pathname, \{| && |\n| && + | method: 'HEAD',| && |\n| && + | keepalive: true,| && |\n| && + | headers: \{| && |\n| && + | 'sap-terminate': 'session',| && |\n| && + | 'sap-contextid': z2ui5.contextId,| && |\n| && + | 'sap-contextid-accept': 'header'| && |\n| && + | \}| && |\n| && + | \});| && |\n| && + | delete z2ui5.contextId;| && |\n| && + | \}| && |\n| && + || && |\n| && + | \},| && |\n| && + | Roundtrip() \{| && |\n| && + | z2ui5.checkTimerActive = false;| && |\n| && + | z2ui5.checkNestAfter = false;| && |\n| && + | z2ui5.checkNestAfter2 = false;| && |\n| && + | let event = (args) => \{| && |\n| && + | if (args != undefined) \{| && |\n| && + | return args[0][0];| && |\n| && + | \}| && |\n| && + | \};| && |\n| && + || && |\n| && + | z2ui5.oBody ??= \{\};| && |\n| && + | z2ui5.oBody.S_FRONT = \{| && |\n| && + | ID: z2ui5?.oBody?.ID,| && |\n| && + | CONFIG: z2ui5.oConfig,| && |\n| && + | XX: z2ui5?.oBody?.XX,| && |\n| && + | ORIGIN: window.location.origin,| && |\n| && + | PATHNAME: window.location.pathname,| && |\n| && + | SEARCH: (z2ui5.search) ? z2ui5.search : window.location.search,| && |\n| && + | VIEW: z2ui5.oBody?.VIEWNAME,| && |\n| && + | EVENT: event(z2ui5.oBody?.ARGUMENTS),| && |\n| && + | HASH: window.location.hash,| && |\n| && + | \};| && |\n| && + | if (z2ui5.oBody?.ARGUMENTS != undefined) \{| && |\n| && + | if (z2ui5.oBody?.ARGUMENTS.length > 0) \{| && |\n| && + | z2ui5.oBody?.ARGUMENTS.shift();| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | z2ui5.oBody.S_FRONT.T_EVENT_ARG = z2ui5.oBody?.ARGUMENTS;| && |\n| && + | delete z2ui5.oBody.ID;| && |\n| && + | delete z2ui5.oBody?.VIEWNAME;| && |\n| && + | delete z2ui5.oBody?.S_FRONT.XX;| && |\n| && + | delete z2ui5.oBody?.ARGUMENTS;| && |\n| && + | if (!z2ui5.oBody.S_FRONT.T_EVENT_ARG) \{| && |\n| && + | delete z2ui5.oBody.S_FRONT.T_EVENT_ARG;| && |\n| && + | \}| && |\n| && + | if (z2ui5.oBody.S_FRONT.T_EVENT_ARG) \{| && |\n| && + | if (z2ui5.oBody.S_FRONT.T_EVENT_ARG.length == 0) \{| && |\n| && + | delete z2ui5.oBody.S_FRONT.T_EVENT_ARG;| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | if (z2ui5.oBody.S_FRONT.T_STARTUP_PARAMETERS == undefined) \{| && |\n| && + | delete z2ui5.oBody.S_FRONT.T_STARTUP_PARAMETERS;| && |\n| && + | \}| && |\n| && + | if (z2ui5.oBody.S_FRONT.SEARCH == '') \{| && |\n| && + | delete z2ui5.oBody.S_FRONT.SEARCH;| && |\n| && + | \}| && |\n| && + | if (!z2ui5.oBody.XX) \{| && |\n| && + | delete z2ui5.oBody.XX;| && |\n| && + | \}| && |\n| && + | this.readHttp();| && |\n| && + | \},| && |\n| && + || && |\n| && + | async readHttp() \{| && |\n| && + | const response = await fetch(z2ui5.oConfig.pathname, \{| && |\n| && + | method: 'POST',| && |\n| && + | headers: \{| && |\n| && + | 'Content-Type': 'application/json',| && |\n| && + | 'sap-contextid-accept': 'header',| && |\n| && + | 'sap-contextid': z2ui5.contextId| && |\n| && + | \},| && |\n| && + | body: JSON.stringify(z2ui5.oBody)| && |\n| && + | \});| && |\n| && + | z2ui5.contextId = response.headers.get("sap-contextid");| && |\n| && + | if (!response.ok) \{| && |\n| && + | const responseText = await response.text();| && |\n| && + | this.responseError(responseText);| && |\n| && + | \} else \{| && |\n| && + | const responseData = await response.json();| && |\n| && + | z2ui5.responseData = responseData;| && |\n| && + | this.responseSuccess(\{| && |\n| && + | ID: responseData.S_FRONT.ID,| && |\n| && + | PARAMS: responseData.S_FRONT.PARAMS,| && |\n| && + | OVIEWMODEL: responseData.MODEL,| && |\n| && + | \});| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + | async responseSuccess(response) \{| && |\n| && + | try \{| && |\n| && + | z2ui5.oResponse = response;| && |\n| && + | if (z2ui5.oResponse.PARAMS?.S_VIEW?.CHECK_DESTROY) \{| && |\n| && + | z2ui5.oController.ViewDestroy();| && |\n| && + | \}| && |\n| && + | ; if (z2ui5.oResponse.PARAMS?.S_FOLLOW_UP_ACTION?.CUSTOM_JS) \{| && |\n| && + | setTimeout(() => \{| && |\n| && + | let mParams = z2ui5.oResponse?.PARAMS.S_FOLLOW_UP_ACTION.CUSTOM_JS.split("'");| && |\n| && + | let mParamsEF = mParams.filter((val, index) => index % 2)| && |\n| && + | if (mParamsEF.length) \{| && |\n| && + | z2ui5.oController.eF.apply(undefined, mParamsEF);| && |\n| && + | \} else \{| && |\n| && + | Function("return " + mParams[0])();| && |\n| && + | \}| && |\n| && + | \}, 100);| && |\n| && + | \};| && |\n| && + | z2ui5.oController.showMessage('S_MSG_TOAST', z2ui5.oResponse.PARAMS);| && |\n| && + | z2ui5.oController.showMessage('S_MSG_BOX', z2ui5.oResponse.PARAMS);| && |\n| && + | if (z2ui5.oResponse.PARAMS?.S_VIEW?.XML) \{| && |\n| && + | if (z2ui5.oResponse.PARAMS?.S_VIEW?.XML !== '') \{| && |\n| && + | z2ui5.oController.ViewDestroy();| && |\n| && + | await z2ui5.oController.displayView(z2ui5.oResponse.PARAMS.S_VIEW.XML, z2ui5.oResponse.OVIEWMODEL);| && |\n| && + | return;| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | z2ui5.oController.updateModelIfRequired('S_VIEW', z2ui5.oView);| && |\n| && + | z2ui5.oController.updateModelIfRequired('S_VIEW_NEST', z2ui5.oViewNest);| && |\n| && + | z2ui5.oController.updateModelIfRequired('S_VIEW_NEST2', z2ui5.oViewNest2);| && |\n| && + | z2ui5.oController.updateModelIfRequired('S_POPUP', z2ui5.oViewPopup);| && |\n| && + | z2ui5.oController.updateModelIfRequired('S_POPOVER', z2ui5.oViewPopover);| && |\n| && + | z2ui5.oController.onAfterRendering();| && |\n| && + | \} catch (e) \{| && |\n| && + | BusyIndicator.hide();| && |\n| && + | if (e.message.includes("openui5")) \{| && |\n| && + | if (e.message.includes("script load error")) \{| && |\n| && + | z2ui5.oController.checkSDKcompatibility(e)| && |\n| && + | \}| && |\n| && + | \} else \{| && |\n| && + | MessageBox.error(e.toLocaleString());| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + | responseError(response) \{| && |\n| && + | document.write(response);| && |\n| && + | \},| && |\n| && + | \};| && |\n| && + | \});| && |\n| && + ||. ENDMETHOD. - ENDCLASS. diff --git a/src/01/03/z2ui5_cl_app_style_css.clas.abap b/src/01/03/z2ui5_cl_app_style_css.clas.abap index a907df62..96fc8264 100644 --- a/src/01/03/z2ui5_cl_app_style_css.clas.abap +++ b/src/01/03/z2ui5_cl_app_style_css.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_app_style_css DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -10,17 +9,16 @@ CLASS z2ui5_cl_app_style_css DEFINITION VALUE(result) TYPE string. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. CLASS z2ui5_cl_app_style_css IMPLEMENTATION. - METHOD get. - result = `/* Enter your custom styles here */` && - ``. + result = |/* Enter your custom styles here */| && + ||. ENDMETHOD. - ENDCLASS. diff --git a/src/01/03/z2ui5_cl_app_view1_js.clas.abap b/src/01/03/z2ui5_cl_app_view1_js.clas.abap index 7bcb72f0..43ab0432 100644 --- a/src/01/03/z2ui5_cl_app_view1_js.clas.abap +++ b/src/01/03/z2ui5_cl_app_view1_js.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_app_view1_js DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -10,509 +9,510 @@ CLASS z2ui5_cl_app_view1_js DEFINITION VALUE(result) TYPE string. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. CLASS z2ui5_cl_app_view1_js IMPLEMENTATION. - METHOD get. - result = `sap.ui.define(["sap/ui/core/mvc/Controller", "sap/ui/core/mvc/XMLView", "sap/ui/model/json/JSONModel",` && |\n| && - ` "sap/ui/core/BusyIndicator", "sap/m/MessageBox", "sap/m/MessageToast", "sap/ui/core/Fragment", "sap/m/BusyDialog",` && |\n| && - ` "sap/ui/VersionInfo", "z2ui5/cc/Server",` && |\n| && - `],` && |\n| && - ` function (Controller, XMLView, JSONModel, BusyIndicator, MessageBox, MessageToast, Fragment, mBusyDialog, VersionInfo,` && |\n| && - ` Server) {` && |\n| && - ` "use strict";` && |\n| && - ` return Controller.extend("z2ui5.controller.View1", {` && |\n| && - `` && |\n| && - ` onInit() {` && |\n| && - `` && |\n| && - ` z2ui5.oRouter.attachRouteMatched(function (oEvent) {` && |\n| && - ` z2ui5.checkInit = true;` && |\n| && - ` Server.Roundtrip();` && |\n| && - ` }, this);` && |\n| && - `` && |\n| && - ` },` && |\n| && - ` async onAfterRendering() {` && |\n| && - `` && |\n| && - ` if (!z2ui5.oResponse) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - `` && |\n| && - ` try {` && |\n| && - ` if (!z2ui5.oResponse.PARAMS) {` && |\n| && - ` BusyIndicator.hide();` && |\n| && - ` z2ui5.isBusy = false;` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` const { S_POPUP, S_VIEW_NEST, S_VIEW_NEST2, S_POPOVER } = z2ui5.oResponse.PARAMS;` && |\n| && - ` if (S_POPUP?.CHECK_DESTROY) {` && |\n| && - ` z2ui5.oController.PopupDestroy();` && |\n| && - ` }` && |\n| && - ` if (S_POPOVER?.CHECK_DESTROY) {` && |\n| && - ` z2ui5.oController.PopoverDestroy();` && |\n| && - ` }` && |\n| && - ` if (S_POPUP?.XML) {` && |\n| && - ` z2ui5.oController.PopupDestroy();` && |\n| && - ` await this.displayFragment(S_POPUP.XML, 'oViewPopup');` && |\n| && - ` }` && |\n| && - ` if (!z2ui5.checkNestAfter) {` && |\n| && - ` if (S_VIEW_NEST?.XML) {` && |\n| && - ` z2ui5.oController.NestViewDestroy();` && |\n| && - ` await this.displayNestedView(S_VIEW_NEST.XML, 'oViewNest', 'S_VIEW_NEST');` && |\n| && - ` z2ui5.checkNestAfter = true;` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` if (!z2ui5.checkNestAfter2) {` && |\n| && - ` if (S_VIEW_NEST2?.XML) {` && |\n| && - ` z2ui5.oController.NestViewDestroy2();` && |\n| && - ` await this.displayNestedView2(S_VIEW_NEST2.XML, 'oViewNest2', 'S_VIEW_NEST2');` && |\n| && - ` z2ui5.checkNestAfter2 = true;` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` if (S_POPOVER?.XML) {` && |\n| && - ` await this.displayPopover(S_POPOVER.XML, 'oViewPopover', S_POPOVER.OPEN_BY_ID);` && |\n| && - ` }` && |\n| && - ` BusyIndicator.hide();` && |\n| && - ` z2ui5.isBusy = false;` && |\n| && - ` z2ui5.onAfterRendering.forEach(item => {` && |\n| && - ` if (item !== undefined) {` && |\n| && - ` item();` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` )` && |\n| && - ` } catch (e) {` && |\n| && - ` BusyIndicator.hide();` && |\n| && - ` z2ui5.isBusy = false;` && |\n| && - ` MessageBox.error(e.toLocaleString(), {` && |\n| && - ` title: "Unexpected Error Occured - App Terminated",` && |\n| && - ` actions: [],` && |\n| && - ` onClose: () => {` && |\n| && - ` new mBusyDialog({` && |\n| && - ` text: "Please Restart the App"` && |\n| && - ` }).open();` && |\n| && - ` }` && |\n| && - ` })` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` async displayFragment(xml, viewProp) {` && |\n| && - ` let oview_model = new JSONModel(z2ui5.oResponse.OVIEWMODEL);` && |\n| && - ` const oFragment = await Fragment.load({` && |\n| && - ` definition: xml,` && |\n| && - ` controller: z2ui5.oControllerPopup,` && |\n| && - ` id: "popupId"` && |\n| && - ` });` && |\n| && - ` oFragment.setModel(oview_model);` && |\n| && - ` z2ui5[viewProp] = oFragment;` && |\n| && - ` z2ui5[viewProp].Fragment = Fragment;` && |\n| && - ` oFragment.open();` && |\n| && - ` },` && |\n| && - ` async displayPopover(xml, viewProp, openById) {` && |\n| && - ` sap.ui.require(["sap/ui/core/Element"], async function (Element) {` && |\n| && - ` const oFragment = await Fragment.load({` && |\n| && - ` definition: xml,` && |\n| && - ` controller: z2ui5.oControllerPopover,` && |\n| && - ` id: "popoverId"` && |\n| && - ` });` && |\n| && - ` let oview_model = new JSONModel(z2ui5.oResponse.OVIEWMODEL);` && |\n| && - ` oFragment.setModel(oview_model);` && |\n| && - ` z2ui5[viewProp] = oFragment;` && |\n| && - ` z2ui5[viewProp].Fragment = Fragment;` && |\n| && - ` let oControl = {};` && |\n| && - ` if (z2ui5.oView?.byId(openById)) {` && |\n| && - ` oControl = z2ui5.oView.byId(openById);` && |\n| && - ` } else if (z2ui5.oViewPopup?.Fragment.byId('popupId', openById)) {` && |\n| && - ` oControl = z2ui5.oViewPopup.Fragment.byId('popupId', openById);` && |\n| && - ` } else if (z2ui5.oViewNest?.byId(openById)) {` && |\n| && - ` oControl = z2ui5.oViewNest.byId(openById);` && |\n| && - ` } else if (z2ui5.oViewNest2?.byId(openById)) {` && |\n| && - ` oControl = z2ui5.oViewNest2.byId(openById);` && |\n| && - ` } else {` && |\n| && - ` if (sapUiCore.byId(openById)) {` && |\n| && - ` // oControl = sapUiCore.byId(openById);` && |\n| && - ` oControl = Element.getElementById(openById);` && |\n| && - ` } else {` && |\n| && - ` oControl = null;` && |\n| && - ` }` && |\n| && - ` ;` && |\n| && - ` }` && |\n| && - ` oFragment.openBy(oControl);` && |\n| && - ` });` && |\n| && - ` },` && |\n| && - ` async displayNestedView(xml, viewProp, viewNestId) {` && |\n| && - ` let oview_model = new JSONModel(z2ui5.oResponse.OVIEWMODEL);` && |\n| && - ` const oView = await XMLView.create({` && |\n| && - ` definition: xml,` && |\n| && - ` controller: z2ui5.oControllerNest,` && |\n| && - ` preprocessors: {` && |\n| && - ` xml: {` && |\n| && - ` models: {` && |\n| && - ` template: oview_model` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` });` && |\n| && - ` oView.setModel(oview_model);` && |\n| && - ` let oParent = z2ui5.oView.byId(z2ui5.oResponse.PARAMS[viewNestId].ID);` && |\n| && - ` if (oParent) {` && |\n| && - ` try {` && |\n| && - ` oParent[z2ui5.oResponse.PARAMS[viewNestId].METHOD_DESTROY]();` && |\n| && - ` } catch { }` && |\n| && - ` oParent[z2ui5.oResponse.PARAMS[viewNestId].METHOD_INSERT](oView);` && |\n| && - ` }` && |\n| && - ` z2ui5[viewProp] = oView;` && |\n| && - ` },` && |\n| && - ` async displayNestedView2(xml, viewProp, viewNestId) {` && |\n| && - ` let oview_model = new JSONModel(z2ui5.oResponse.OVIEWMODEL);` && |\n| && - ` const oView = await XMLView.create({` && |\n| && - ` definition: xml,` && |\n| && - ` controller: z2ui5.oControllerNest2,` && |\n| && - ` preprocessors: {` && |\n| && - ` xml: {` && |\n| && - ` models: {` && |\n| && - ` template: oview_model` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` });` && |\n| && - ` oView.setModel(oview_model);` && |\n| && - ` let oParent = z2ui5.oView.byId(z2ui5.oResponse.PARAMS[viewNestId].ID);` && |\n| && - ` if (oParent) {` && |\n| && - ` try {` && |\n| && - ` oParent[z2ui5.oResponse.PARAMS[viewNestId].METHOD_DESTROY]();` && |\n| && - ` } catch { }` && |\n| && - ` oParent[z2ui5.oResponse.PARAMS[viewNestId].METHOD_INSERT](oView);` && |\n| && - ` }` && |\n| && - ` z2ui5[viewProp] = oView;` && |\n| && - ` },` && |\n| && - ` PopupDestroy() {` && |\n| && - ` if (!z2ui5.oViewPopup) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` if (z2ui5.oViewPopup.close) {` && |\n| && - ` try {` && |\n| && - ` z2ui5.oViewPopup.close();` && |\n| && - ` } catch { }` && |\n| && - ` }` && |\n| && - ` z2ui5.oViewPopup.destroy();` && |\n| && - ` },` && |\n| && - ` PopoverDestroy() {` && |\n| && - ` if (!z2ui5.oViewPopover) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` if (z2ui5.oViewPopover.close) {` && |\n| && - ` try {` && |\n| && - ` z2ui5.oViewPopover.close();` && |\n| && - ` } catch { }` && |\n| && - ` }` && |\n| && - ` z2ui5.oViewPopover.destroy();` && |\n| && - ` },` && |\n| && - ` NestViewDestroy() {` && |\n| && - ` if (!z2ui5.oViewNest) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` z2ui5.oViewNest.destroy();` && |\n| && - ` },` && |\n| && - ` NestViewDestroy2() {` && |\n| && - ` if (!z2ui5.oViewNest2) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` z2ui5.oViewNest2.destroy();` && |\n| && - ` },` && |\n| && - ` ViewDestroy() {` && |\n| && - ` if (!z2ui5.oView) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` z2ui5.oView.destroy();` && |\n| && - ` },` && |\n| && - ` eF(...args) {` && |\n| && - `` && |\n| && - ` z2ui5.onBeforeEventFrontend.forEach(item => {` && |\n| && - ` if (item !== undefined) {` && |\n| && - ` item(args);` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` )` && |\n| && - ` let oCrossAppNavigator;` && |\n| && - ` switch (args[0]) {` && |\n| && - ` case 'SET_SIZE_LIMIT':` && |\n| && - ` switch (args[2]) {` && |\n| && - ` case 'MAIN':` && |\n| && - ` z2ui5.oView.getModel().setSizeLimit(parseInt(args[1]));` && |\n| && - ` z2ui5.oView.getModel().refresh(true);` && |\n| && - ` break;` && |\n| && - ` case 'NEST':` && |\n| && - ` z2ui5.oViewNest.getModel().setSizeLimit(parseInt(args[1]));` && |\n| && - ` z2ui5.oViewNest.getModel().refresh(true);` && |\n| && - ` break;` && |\n| && - ` case 'NEST2':` && |\n| && - ` z2ui5.oViewNest2.getModel().setSizeLimit(parseInt(args[1]));` && |\n| && - ` z2ui5.oViewNest2.getModel().refresh(true);` && |\n| && - ` break;` && |\n| && - ` case 'POPUP':` && |\n| && - ` z2ui5.oPopup.getModel().setSizeLimit(parseInt(args[1]));` && |\n| && - ` z2ui5.oPopup.getModel().refresh(true);` && |\n| && - ` break;` && |\n| && - ` case 'POPOVER':` && |\n| && - ` z2ui5.oPopover.getModel().setSizeLimit(parseInt(args[1]));` && |\n| && - ` z2ui5.oPopover.getModel().refresh(true);` && |\n| && - ` break;` && |\n| && - ` }` && |\n| && - ` break;` && |\n| && - ` case 'DOWNLOAD_B64_FILE':` && |\n| && - ` var a = document.createElement("a");` && |\n| && - ` a.href = args[1];` && |\n| && - ` a.download = args[2];` && |\n| && - ` a.click();` && |\n| && - ` break;` && |\n| && - ` case 'CROSS_APP_NAV_TO_PREV_APP':` && |\n| && - ` // oCrossAppNavigator = Container.getService("CrossApplicationNavigation");` && |\n| && - ` oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");` && |\n| && - ` oCrossAppNavigator.backToPreviousApp();` && |\n| && - ` break;` && |\n| && - ` case 'CROSS_APP_NAV_TO_EXT':` && |\n| && - ` // oCrossAppNavigator = Container.getService("CrossApplicationNavigation");` && |\n| && - ` oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");` && |\n| && - ` const hash = (oCrossAppNavigator.hrefForExternal({` && |\n| && - ` target: args[1],` && |\n| && - ` params: args[2]` && |\n| && - ` })) || "";` && |\n| && - ` if (args[3] === 'EXT') {` && |\n| && - ` let url = window.location.href.split('#')[0] + hash;` && |\n| && - ` //todo` && |\n| && - ` //URLHelper.redirect(url, true);` && |\n| && - ` } else {` && |\n| && - ` oCrossAppNavigator.toExternal({` && |\n| && - ` target: {` && |\n| && - ` shellHash: hash` && |\n| && - ` }` && |\n| && - ` });` && |\n| && - ` }` && |\n| && - ` break;` && |\n| && - ` case 'LOCATION_RELOAD':` && |\n| && - ` window.location = args[1];` && |\n| && - ` break;` && |\n| && - ` case 'OPEN_NEW_TAB':` && |\n| && - ` window.open(args[1], '_blank');` && |\n| && - ` break;` && |\n| && - ` case 'POPUP_CLOSE':` && |\n| && - ` z2ui5.oController.PopupDestroy();` && |\n| && - ` break;` && |\n| && - ` case 'POPOVER_CLOSE':` && |\n| && - ` z2ui5.oController.PopoverDestroy();` && |\n| && - ` break;` && |\n| && - ` case 'NAV_CONTAINER_TO':` && |\n| && - ` var navCon = z2ui5.oView.byId(args[1]);` && |\n| && - ` var navConTo = z2ui5.oView.byId(args[2]);` && |\n| && - ` navCon.to(navConTo);` && |\n| && - ` break;` && |\n| && - ` case 'NEST_NAV_CONTAINER_TO':` && |\n| && - ` navCon = z2ui5.oViewNest.byId(args[1]);` && |\n| && - ` navConTo = z2ui5.oViewNest.byId(args[2]);` && |\n| && - ` navCon.to(navConTo);` && |\n| && - ` break;` && |\n| && - ` case 'NEST2_NAV_CONTAINER_TO':` && |\n| && - ` navCon = z2ui5.oViewNest2.byId(args[1]);` && |\n| && - ` navConTo = z2ui5.oViewNest2.byId(args[2]);` && |\n| && - ` navCon.to(navConTo);` && |\n| && - ` break;` && |\n| && - ` case 'POPUP_NAV_CONTAINER_TO':` && |\n| && - ` navCon = Fragment.byId("popupId", args[1]);` && |\n| && - ` navConTo = Fragment.byId("popupId", args[2]);` && |\n| && - ` navCon.to(navConTo);` && |\n| && - ` break;` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` eB(...args) {` && |\n| && - `` && |\n| && - ` if (!window.navigator.onLine) {` && |\n| && - ` MessageBox.alert('No internet connection! Please reconnect to the server and try again.');` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` if (z2ui5.isBusy == true) {` && |\n| && - ` if (!args[0][2]) {` && |\n| && - ` let oBusyDialog = new mBusyDialog();` && |\n| && - ` oBusyDialog.open();` && |\n| && - ` setTimeout((oBusyDialog) => {` && |\n| && - ` oBusyDialog.close()` && |\n| && - ` }` && |\n| && - ` , 100, oBusyDialog);` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` z2ui5.isBusy = true;` && |\n| && - ` BusyIndicator.show();` && |\n| && - ` z2ui5.oBody = {};` && |\n| && - ` if (args[0][3]) {` && |\n| && - ` z2ui5.oBody.XX = z2ui5.oView.getModel().getData().XX;` && |\n| && - ` z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| && - ` } else if (z2ui5.oController == this) {` && |\n| && - ` z2ui5.oBody.XX = z2ui5.oView.getModel().getData().XX;` && |\n| && - ` z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| && - ` } else if (z2ui5.oControllerPopup == this) {` && |\n| && - ` if (z2ui5.oViewPopup) {` && |\n| && - ` z2ui5.oBody.XX = z2ui5.oViewPopup.getModel().getData().XX;` && |\n| && - ` }` && |\n| && - ` z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| && - ` } else if (z2ui5.oControllerPopover == this) {` && |\n| && - ` z2ui5.oBody.XX = z2ui5.oViewPopover.getModel().getData().XX;` && |\n| && - ` z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| && - ` } else if (z2ui5.oControllerNest == this) {` && |\n| && - ` z2ui5.oBody.XX = z2ui5.oViewNest.getModel().getData().XX;` && |\n| && - ` z2ui5.oBody.VIEWNAME = 'NEST';` && |\n| && - ` } else if (z2ui5.oControllerNest2 == this) {` && |\n| && - ` z2ui5.oBody.XX = z2ui5.oViewNest2.getModel().getData().XX;` && |\n| && - ` z2ui5.oBody.VIEWNAME = 'NEST2';` && |\n| && - ` }` && |\n| && - ` z2ui5.onBeforeRoundtrip.forEach(item => {` && |\n| && - ` if (item !== undefined) {` && |\n| && - ` item();` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` )` && |\n| && - ` // if (args[0][1]) {` && |\n| && - ` // z2ui5.oController.ViewDestroy();` && |\n| && - ` // }` && |\n| && - ` z2ui5.oBody.ID = z2ui5.oResponse.ID;` && |\n| && - ` z2ui5.oBody.ARGUMENTS = args;` && |\n| && - ` z2ui5.oBody.ARGUMENTS.forEach((item, i) => {` && |\n| && - ` if (i == 0) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` if (typeof item === 'object') {` && |\n| && - ` z2ui5.oBody.ARGUMENTS[i] = JSON.stringify(item);` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` );` && |\n| && - ` z2ui5.oResponseOld = z2ui5.oResponse;` && |\n| && - ` Server.Roundtrip();` && |\n| && - `` && |\n| && - ` },` && |\n| && - `` && |\n| && - ` updateModelIfRequired(paramKey, oView) {` && |\n| && - ` if (z2ui5.oResponse.PARAMS == undefined) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` if (z2ui5.oResponse.PARAMS[paramKey]?.CHECK_UPDATE_MODEL) {` && |\n| && - ` let model = new JSONModel(z2ui5.oResponse.OVIEWMODEL);` && |\n| && - ` if (oView) {` && |\n| && - ` oView.setModel(model);` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` async checkSDKcompatibility(err) {` && |\n| && - ` let oCurrentVersionInfo = await VersionInfo.load();` && |\n| && - ` var ui5_sdk = oCurrentVersionInfo.gav.includes('com.sap.ui5') ? true : false;` && |\n| && - ` if (!ui5_sdk) {` && |\n| && - ` if (err) {` && |\n| && - ` MessageBox.error("openui5 SDK is loaded, module: " + err._modules + " is not availabe in openui5");` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` ;` && |\n| && - ` }` && |\n| && - ` ; MessageBox.error(err.toLocaleString());` && |\n| && - ` },` && |\n| && - ` showMessage(msgType, params) {` && |\n| && - ` if (params == undefined) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` if (params[msgType]?.TEXT !== undefined) {` && |\n| && - ` if (msgType === 'S_MSG_TOAST') {` && |\n| && - ` MessageToast.show(params[msgType].TEXT, {` && |\n| && - ` duration: params[msgType].DURATION ? parseInt(params[msgType].DURATION) : 3000,` && |\n| && - ` width: params[msgType].WIDTH ? params[msgType].WIDTH : '15em',` && |\n| && - ` onClose: params[msgType].ONCLOSE ? params[msgType].ONCLOSE : null,` && |\n| && - ` autoClose: params[msgType].AUTOCLOSE ? true : false,` && |\n| && - ` animationTimingFunction: params[msgType].ANIMATIONTIMINGFUNCTION ? params[msgType].ANIMATIONTIMINGFUNCTION : 'ease',` && |\n| && - ` animationDuration: params[msgType].ANIMATIONDURATION ? parseInt(params[msgType].ANIMATIONDURATION) : 1000,` && |\n| && - ` closeonBrowserNavigation: params[msgType].CLOSEONBROWSERNAVIGATION ? true : false` && |\n| && - ` });` && |\n| && - ` if (params[msgType].CLASS) {` && |\n| && - ` let mtoast = {};` && |\n| && - ` mtoast = document.getElementsByClassName("sapMMessageToast")[0];` && |\n| && - ` if (mtoast) {` && |\n| && - ` mtoast.classList.add(params[msgType].CLASS);` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` ;` && |\n| && - ` } else if (msgType === 'S_MSG_BOX') {` && |\n| && - `` && |\n| && - ` let oParams = {` && |\n| && - ` styleClass: params[msgType].STYLECLASS ? params[msgType].STYLECLASS : '',` && |\n| && - ` title: params[msgType].TITLE ? params[msgType].TITLE : '',` && |\n| && - ` onClose: params[msgType].ONCLOSE ? Function("sAction", "return " + params[msgType].ONCLOSE) : null,` && |\n| && - ` actions: params[msgType].ACTIONS ? params[msgType].ACTIONS : 'OK',` && |\n| && - ` emphasizedAction: params[msgType].EMPHASIZEDACTION ? params[msgType].EMPHASIZEDACTION : 'OK',` && |\n| && - ` initialFocus: params[msgType].INITIALFOCUS ? params[msgType].INITIALFOCUS : null,` && |\n| && - ` textDirection: params[msgType].TEXTDIRECTION ? params[msgType].TEXTDIRECTION : 'Inherit',` && |\n| && - ` icon: params[msgType].ICON ? params[msgType].ICON : 'NONE',` && |\n| && - ` details: params[msgType].DETAILS ? params[msgType].DETAILS : '',` && |\n| && - ` closeOnNavigation: params[msgType].CLOSEONNAVIGATION ? true : false` && |\n| && - ` };` && |\n| && - ` if ( oParams.icon = 'None' ) { delete oParams.icon };` && |\n| && - ` MessageBox[params[msgType].TYPE](params[msgType].TEXT, oParams);` && |\n| && - ` return;` && |\n| && - `` && |\n| && - ` switch (params[msgType].TYPE) {` && |\n| && - ` case 'error':` && |\n| && - ` MessageBox.error(params[msgType].TEXT, oParams);` && |\n| && - ` break;` && |\n| && - ` case 'warning':` && |\n| && - ` MessageBox.error(params[msgType].TEXT, oParams);` && |\n| && - ` break;` && |\n| && - ` default:` && |\n| && - ` MessageBox.shwo(params[msgType].TEXT, oParams);` && |\n| && - ` break;` && |\n| && - ` }` && |\n| && - ` return;` && |\n| && - `` && |\n| && - ` if (params[msgType].TYPE) {` && |\n| && - ` MessageBox[params[msgType].TYPE](params[msgType].TEXT);` && |\n| && - ` } else {` && |\n| && - ` MessageBox.show(params[msgType].TEXT, {` && |\n| && - ` styleClass: params[msgType].STYLECLASS ? params[msgType].STYLECLASS : '',` && |\n| && - ` title: params[msgType].TITLE ? params[msgType].TITLE : '',` && |\n| && - ` onClose: params[msgType].ONCLOSE ? Function("sAction", "return " + params[msgType].ONCLOSE) : null,` && |\n| && - ` actions: params[msgType].ACTIONS ? params[msgType].ACTIONS : 'OK',` && |\n| && - ` emphasizedAction: params[msgType].EMPHASIZEDACTION ? params[msgType].EMPHASIZEDACTION : 'OK',` && |\n| && - ` initialFocus: params[msgType].INITIALFOCUS ? params[msgType].INITIALFOCUS : null,` && |\n| && - ` textDirection: params[msgType].TEXTDIRECTION ? params[msgType].TEXTDIRECTION : 'Inherit',` && |\n| && - ` icon: params[msgType].ICON ? params[msgType].ICON : 'NONE',` && |\n| && - ` details: params[msgType].DETAILS ? params[msgType].DETAILS : '',` && |\n| && - ` closeOnNavigation: params[msgType].CLOSEONNAVIGATION ? true : false` && |\n| && - ` })` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` setApp(oApp) {` && |\n| && - ` this._oApp = oApp;` && |\n| && - ` },` && |\n| && - ` async displayView(xml, viewModel) {` && |\n| && - ` let oview_model = new JSONModel(viewModel);` && |\n| && - ` z2ui5.oView = await XMLView.create({` && |\n| && - ` definition: xml,` && |\n| && - ` models: oview_model,` && |\n| && - ` controller: z2ui5.oController,` && |\n| && - ` id: 'mainView',` && |\n| && - ` preprocessors: {` && |\n| && - ` xml: {` && |\n| && - ` models: {` && |\n| && - ` template: oview_model` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` });` && |\n| && - ` z2ui5.oView.setModel(z2ui5.oDeviceModel, "device");` && |\n| && - ` this._oApp.removeAllPages();` && |\n| && - ` this._oApp.insertPage(z2ui5.oView);` && |\n| && - ` },` && |\n| && - ` })` && |\n| && - ` });` && |\n| && - ``. + result = |sap.ui.define(["sap/ui/core/mvc/Controller", "sap/ui/core/mvc/XMLView", "sap/ui/model/json/JSONModel",| && |\n| && + | "sap/ui/core/BusyIndicator", "sap/m/MessageBox", "sap/m/MessageToast", "sap/ui/core/Fragment", "sap/m/BusyDialog",| && |\n| && + | "sap/ui/VersionInfo", "z2ui5/cc/Server",| && |\n| && + |],| && |\n| && + | function (Controller, XMLView, JSONModel, BusyIndicator, MessageBox, MessageToast, Fragment, mBusyDialog, VersionInfo,| && |\n| && + | Server) \{| && |\n| && + | "use strict";| && |\n| && + | return Controller.extend("z2ui5.controller.View1", \{| && |\n| && + || && |\n| && + | onInit() \{| && |\n| && + || && |\n| && + | z2ui5.oRouter.attachRouteMatched(function (oEvent) \{| && |\n| && + | z2ui5.checkInit = true;| && |\n| && + | Server.Roundtrip();| && |\n| && + | \}, this);| && |\n| && + || && |\n| && + | \},| && |\n| && + | async onAfterRendering() \{| && |\n| && + || && |\n| && + | if (!z2ui5.oResponse) \{| && |\n| && + | return;| && |\n| && + | \}| && |\n| && + || && |\n| && + | try \{| && |\n| && + | if (!z2ui5.oResponse.PARAMS) \{| && |\n| && + | BusyIndicator.hide();| && |\n| && + | z2ui5.isBusy = false;| && |\n| && + | return;| && |\n| && + | \}| && |\n| && + | const \{ S_POPUP, S_VIEW_NEST, S_VIEW_NEST2, S_POPOVER \} = z2ui5.oResponse.PARAMS;| && |\n| && + | if (S_POPUP?.CHECK_DESTROY) \{| && |\n| && + | z2ui5.oController.PopupDestroy();| && |\n| && + | \}| && |\n| && + | if (S_POPOVER?.CHECK_DESTROY) \{| && |\n| && + | z2ui5.oController.PopoverDestroy();| && |\n| && + | \}| && |\n| && + | if (S_POPUP?.XML) \{| && |\n| && + | z2ui5.oController.PopupDestroy();| && |\n| && + | await this.displayFragment(S_POPUP.XML, 'oViewPopup');| && |\n| && + | \}| && |\n| && + | if (!z2ui5.checkNestAfter) \{| && |\n| && + | if (S_VIEW_NEST?.XML) \{| && |\n| && + | z2ui5.oController.NestViewDestroy();| && |\n| && + | await this.displayNestedView(S_VIEW_NEST.XML, 'oViewNest', 'S_VIEW_NEST');| && |\n| && + | z2ui5.checkNestAfter = true;| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | if (!z2ui5.checkNestAfter2) \{| && |\n| && + | if (S_VIEW_NEST2?.XML) \{| && |\n| && + | z2ui5.oController.NestViewDestroy2();| && |\n| && + | await this.displayNestedView2(S_VIEW_NEST2.XML, 'oViewNest2', 'S_VIEW_NEST2');| && |\n| && + | z2ui5.checkNestAfter2 = true;| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | if (S_POPOVER?.XML) \{| && |\n| && + | await this.displayPopover(S_POPOVER.XML, 'oViewPopover', S_POPOVER.OPEN_BY_ID);| && |\n| && + | \}| && |\n| && + | BusyIndicator.hide();| && |\n| && + | z2ui5.isBusy = false;| && |\n| && + | z2ui5.onAfterRendering.forEach(item => \{| && |\n| && + | if (item !== undefined) \{| && |\n| && + | item();| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | )| && |\n| && + | \} catch (e) \{| && |\n| && + | BusyIndicator.hide();| && |\n| && + | z2ui5.isBusy = false;| && |\n| && + | MessageBox.error(e.toLocaleString(), \{| && |\n| && + " TODO: check spelling: Occured (typo) -> Occurred (ABAP cleaner) + | title: "Unexpected Error Occured - App Terminated",| && |\n| && + | actions: [],| && |\n| && + | onClose: () => \{| && |\n| && + | new mBusyDialog(\{| && |\n| && + | text: "Please Restart the App"| && |\n| && + | \}).open();| && |\n| && + | \}| && |\n| && + | \})| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + | async displayFragment(xml, viewProp) \{| && |\n| && + | let oview_model = new JSONModel(z2ui5.oResponse.OVIEWMODEL);| && |\n| && + | const oFragment = await Fragment.load(\{| && |\n| && + | definition: xml,| && |\n| && + | controller: z2ui5.oControllerPopup,| && |\n| && + | id: "popupId"| && |\n| && + | \});| && |\n| && + | oFragment.setModel(oview_model);| && |\n| && + | z2ui5[viewProp] = oFragment;| && |\n| && + | z2ui5[viewProp].Fragment = Fragment;| && |\n| && + | oFragment.open();| && |\n| && + | \},| && |\n| && + | async displayPopover(xml, viewProp, openById) \{| && |\n| && + | sap.ui.require(["sap/ui/core/Element"], async function (Element) \{| && |\n| && + | const oFragment = await Fragment.load(\{| && |\n| && + | definition: xml,| && |\n| && + | controller: z2ui5.oControllerPopover,| && |\n| && + | id: "popoverId"| && |\n| && + | \});| && |\n| && + | let oview_model = new JSONModel(z2ui5.oResponse.OVIEWMODEL);| && |\n| && + | oFragment.setModel(oview_model);| && |\n| && + | z2ui5[viewProp] = oFragment;| && |\n| && + | z2ui5[viewProp].Fragment = Fragment;| && |\n| && + | let oControl = \{\};| && |\n| && + | if (z2ui5.oView?.byId(openById)) \{| && |\n| && + | oControl = z2ui5.oView.byId(openById);| && |\n| && + | \} else if (z2ui5.oViewPopup?.Fragment.byId('popupId', openById)) \{| && |\n| && + | oControl = z2ui5.oViewPopup.Fragment.byId('popupId', openById);| && |\n| && + | \} else if (z2ui5.oViewNest?.byId(openById)) \{| && |\n| && + | oControl = z2ui5.oViewNest.byId(openById);| && |\n| && + | \} else if (z2ui5.oViewNest2?.byId(openById)) \{| && |\n| && + | oControl = z2ui5.oViewNest2.byId(openById);| && |\n| && + | \} else \{| && |\n| && + | if (sapUiCore.byId(openById)) \{| && |\n| && + | // oControl = sapUiCore.byId(openById);| && |\n| && + | oControl = Element.getElementById(openById);| && |\n| && + | \} else \{| && |\n| && + | oControl = null;| && |\n| && + | \}| && |\n| && + | ;| && |\n| && + | \}| && |\n| && + | oFragment.openBy(oControl);| && |\n| && + | \});| && |\n| && + | \},| && |\n| && + | async displayNestedView(xml, viewProp, viewNestId) \{| && |\n| && + | let oview_model = new JSONModel(z2ui5.oResponse.OVIEWMODEL);| && |\n| && + | const oView = await XMLView.create(\{| && |\n| && + | definition: xml,| && |\n| && + | controller: z2ui5.oControllerNest,| && |\n| && + | preprocessors: \{| && |\n| && + | xml: \{| && |\n| && + | models: \{| && |\n| && + | template: oview_model| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | \});| && |\n| && + | oView.setModel(oview_model);| && |\n| && + | let oParent = z2ui5.oView.byId(z2ui5.oResponse.PARAMS[viewNestId].ID);| && |\n| && + | if (oParent) \{| && |\n| && + | try \{| && |\n| && + | oParent[z2ui5.oResponse.PARAMS[viewNestId].METHOD_DESTROY]();| && |\n| && + | \} catch \{ \}| && |\n| && + | oParent[z2ui5.oResponse.PARAMS[viewNestId].METHOD_INSERT](oView);| && |\n| && + | \}| && |\n| && + | z2ui5[viewProp] = oView;| && |\n| && + | \},| && |\n| && + | async displayNestedView2(xml, viewProp, viewNestId) \{| && |\n| && + | let oview_model = new JSONModel(z2ui5.oResponse.OVIEWMODEL);| && |\n| && + | const oView = await XMLView.create(\{| && |\n| && + | definition: xml,| && |\n| && + | controller: z2ui5.oControllerNest2,| && |\n| && + | preprocessors: \{| && |\n| && + | xml: \{| && |\n| && + | models: \{| && |\n| && + | template: oview_model| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | \});| && |\n| && + | oView.setModel(oview_model);| && |\n| && + | let oParent = z2ui5.oView.byId(z2ui5.oResponse.PARAMS[viewNestId].ID);| && |\n| && + | if (oParent) \{| && |\n| && + | try \{| && |\n| && + | oParent[z2ui5.oResponse.PARAMS[viewNestId].METHOD_DESTROY]();| && |\n| && + | \} catch \{ \}| && |\n| && + | oParent[z2ui5.oResponse.PARAMS[viewNestId].METHOD_INSERT](oView);| && |\n| && + | \}| && |\n| && + | z2ui5[viewProp] = oView;| && |\n| && + | \},| && |\n| && + | PopupDestroy() \{| && |\n| && + | if (!z2ui5.oViewPopup) \{| && |\n| && + | return;| && |\n| && + | \}| && |\n| && + | if (z2ui5.oViewPopup.close) \{| && |\n| && + | try \{| && |\n| && + | z2ui5.oViewPopup.close();| && |\n| && + | \} catch \{ \}| && |\n| && + | \}| && |\n| && + | z2ui5.oViewPopup.destroy();| && |\n| && + | \},| && |\n| && + | PopoverDestroy() \{| && |\n| && + | if (!z2ui5.oViewPopover) \{| && |\n| && + | return;| && |\n| && + | \}| && |\n| && + | if (z2ui5.oViewPopover.close) \{| && |\n| && + | try \{| && |\n| && + | z2ui5.oViewPopover.close();| && |\n| && + | \} catch \{ \}| && |\n| && + | \}| && |\n| && + | z2ui5.oViewPopover.destroy();| && |\n| && + | \},| && |\n| && + | NestViewDestroy() \{| && |\n| && + | if (!z2ui5.oViewNest) \{| && |\n| && + | return;| && |\n| && + | \}| && |\n| && + | z2ui5.oViewNest.destroy();| && |\n| && + | \},| && |\n| && + | NestViewDestroy2() \{| && |\n| && + | if (!z2ui5.oViewNest2) \{| && |\n| && + | return;| && |\n| && + | \}| && |\n| && + | z2ui5.oViewNest2.destroy();| && |\n| && + | \},| && |\n| && + | ViewDestroy() \{| && |\n| && + | if (!z2ui5.oView) \{| && |\n| && + | return;| && |\n| && + | \}| && |\n| && + | z2ui5.oView.destroy();| && |\n| && + | \},| && |\n| && + | eF(...args) \{| && |\n| && + || && |\n| && + | z2ui5.onBeforeEventFrontend.forEach(item => \{| && |\n| && + | if (item !== undefined) \{| && |\n| && + | item(args);| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | )| && |\n| && + | let oCrossAppNavigator;| && |\n| && + | switch (args[0]) \{| && |\n| && + | case 'SET_SIZE_LIMIT':| && |\n| && + | switch (args[2]) \{| && |\n| && + | case 'MAIN':| && |\n| && + | z2ui5.oView.getModel().setSizeLimit(parseInt(args[1]));| && |\n| && + | z2ui5.oView.getModel().refresh(true);| && |\n| && + | break;| && |\n| && + | case 'NEST':| && |\n| && + | z2ui5.oViewNest.getModel().setSizeLimit(parseInt(args[1]));| && |\n| && + | z2ui5.oViewNest.getModel().refresh(true);| && |\n| && + | break;| && |\n| && + | case 'NEST2':| && |\n| && + | z2ui5.oViewNest2.getModel().setSizeLimit(parseInt(args[1]));| && |\n| && + | z2ui5.oViewNest2.getModel().refresh(true);| && |\n| && + | break;| && |\n| && + | case 'POPUP':| && |\n| && + | z2ui5.oPopup.getModel().setSizeLimit(parseInt(args[1]));| && |\n| && + | z2ui5.oPopup.getModel().refresh(true);| && |\n| && + | break;| && |\n| && + | case 'POPOVER':| && |\n| && + | z2ui5.oPopover.getModel().setSizeLimit(parseInt(args[1]));| && |\n| && + | z2ui5.oPopover.getModel().refresh(true);| && |\n| && + | break;| && |\n| && + | \}| && |\n| && + | break;| && |\n| && + | case 'DOWNLOAD_B64_FILE':| && |\n| && + | var a = document.createElement("a");| && |\n| && + | a.href = args[1];| && |\n| && + | a.download = args[2];| && |\n| && + | a.click();| && |\n| && + | break;| && |\n| && + | case 'CROSS_APP_NAV_TO_PREV_APP':| && |\n| && + | // oCrossAppNavigator = Container.getService("CrossApplicationNavigation");| && |\n| && + | oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");| && |\n| && + | oCrossAppNavigator.backToPreviousApp();| && |\n| && + | break;| && |\n| && + | case 'CROSS_APP_NAV_TO_EXT':| && |\n| && + | // oCrossAppNavigator = Container.getService("CrossApplicationNavigation");| && |\n| && + | oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");| && |\n| && + | const hash = (oCrossAppNavigator.hrefForExternal(\{| && |\n| && + | target: args[1],| && |\n| && + | params: args[2]| && |\n| && + | \})) \|\| "";| && |\n| && + | if (args[3] === 'EXT') \{| && |\n| && + | let url = window.location.href.split('#')[0] + hash;| && |\n| && + | //todo| && |\n| && + | //URLHelper.redirect(url, true);| && |\n| && + | \} else \{| && |\n| && + | oCrossAppNavigator.toExternal(\{| && |\n| && + | target: \{| && |\n| && + | shellHash: hash| && |\n| && + | \}| && |\n| && + | \});| && |\n| && + | \}| && |\n| && + | break;| && |\n| && + | case 'LOCATION_RELOAD':| && |\n| && + | window.location = args[1];| && |\n| && + | break;| && |\n| && + | case 'OPEN_NEW_TAB':| && |\n| && + | window.open(args[1], '_blank');| && |\n| && + | break;| && |\n| && + | case 'POPUP_CLOSE':| && |\n| && + | z2ui5.oController.PopupDestroy();| && |\n| && + | break;| && |\n| && + | case 'POPOVER_CLOSE':| && |\n| && + | z2ui5.oController.PopoverDestroy();| && |\n| && + | break;| && |\n| && + | case 'NAV_CONTAINER_TO':| && |\n| && + | var navCon = z2ui5.oView.byId(args[1]);| && |\n| && + | var navConTo = z2ui5.oView.byId(args[2]);| && |\n| && + | navCon.to(navConTo);| && |\n| && + | break;| && |\n| && + | case 'NEST_NAV_CONTAINER_TO':| && |\n| && + | navCon = z2ui5.oViewNest.byId(args[1]);| && |\n| && + | navConTo = z2ui5.oViewNest.byId(args[2]);| && |\n| && + | navCon.to(navConTo);| && |\n| && + | break;| && |\n| && + | case 'NEST2_NAV_CONTAINER_TO':| && |\n| && + | navCon = z2ui5.oViewNest2.byId(args[1]);| && |\n| && + | navConTo = z2ui5.oViewNest2.byId(args[2]);| && |\n| && + | navCon.to(navConTo);| && |\n| && + | break;| && |\n| && + | case 'POPUP_NAV_CONTAINER_TO':| && |\n| && + | navCon = Fragment.byId("popupId", args[1]);| && |\n| && + | navConTo = Fragment.byId("popupId", args[2]);| && |\n| && + | navCon.to(navConTo);| && |\n| && + | break;| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + | eB(...args) \{| && |\n| && + || && |\n| && + | if (!window.navigator.onLine) \{| && |\n| && + | MessageBox.alert('No internet connection! Please reconnect to the server and try again.');| && |\n| && + | return;| && |\n| && + | \}| && |\n| && + | if (z2ui5.isBusy == true) \{| && |\n| && + | if (!args[0][2]) \{| && |\n| && + | let oBusyDialog = new mBusyDialog();| && |\n| && + | oBusyDialog.open();| && |\n| && + | setTimeout((oBusyDialog) => \{| && |\n| && + | oBusyDialog.close()| && |\n| && + | \}| && |\n| && + | , 100, oBusyDialog);| && |\n| && + | return;| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | z2ui5.isBusy = true;| && |\n| && + | BusyIndicator.show();| && |\n| && + | z2ui5.oBody = \{\};| && |\n| && + | if (args[0][3]) \{| && |\n| && + | z2ui5.oBody.XX = z2ui5.oView.getModel().getData().XX;| && |\n| && + | z2ui5.oBody.VIEWNAME = 'MAIN';| && |\n| && + | \} else if (z2ui5.oController == this) \{| && |\n| && + | z2ui5.oBody.XX = z2ui5.oView.getModel().getData().XX;| && |\n| && + | z2ui5.oBody.VIEWNAME = 'MAIN';| && |\n| && + | \} else if (z2ui5.oControllerPopup == this) \{| && |\n| && + | if (z2ui5.oViewPopup) \{| && |\n| && + | z2ui5.oBody.XX = z2ui5.oViewPopup.getModel().getData().XX;| && |\n| && + | \}| && |\n| && + | z2ui5.oBody.VIEWNAME = 'MAIN';| && |\n| && + | \} else if (z2ui5.oControllerPopover == this) \{| && |\n| && + | z2ui5.oBody.XX = z2ui5.oViewPopover.getModel().getData().XX;| && |\n| && + | z2ui5.oBody.VIEWNAME = 'MAIN';| && |\n| && + | \} else if (z2ui5.oControllerNest == this) \{| && |\n| && + | z2ui5.oBody.XX = z2ui5.oViewNest.getModel().getData().XX;| && |\n| && + | z2ui5.oBody.VIEWNAME = 'NEST';| && |\n| && + | \} else if (z2ui5.oControllerNest2 == this) \{| && |\n| && + | z2ui5.oBody.XX = z2ui5.oViewNest2.getModel().getData().XX;| && |\n| && + | z2ui5.oBody.VIEWNAME = 'NEST2';| && |\n| && + | \}| && |\n| && + | z2ui5.onBeforeRoundtrip.forEach(item => \{| && |\n| && + | if (item !== undefined) \{| && |\n| && + | item();| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | )| && |\n| && + | // if (args[0][1]) \{| && |\n| && + | // z2ui5.oController.ViewDestroy();| && |\n| && + | // \}| && |\n| && + | z2ui5.oBody.ID = z2ui5.oResponse.ID;| && |\n| && + | z2ui5.oBody.ARGUMENTS = args;| && |\n| && + | z2ui5.oBody.ARGUMENTS.forEach((item, i) => \{| && |\n| && + | if (i == 0) \{| && |\n| && + | return;| && |\n| && + | \}| && |\n| && + | if (typeof item === 'object') \{| && |\n| && + | z2ui5.oBody.ARGUMENTS[i] = JSON.stringify(item);| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | );| && |\n| && + | z2ui5.oResponseOld = z2ui5.oResponse;| && |\n| && + | Server.Roundtrip();| && |\n| && + || && |\n| && + | \},| && |\n| && + || && |\n| && + | updateModelIfRequired(paramKey, oView) \{| && |\n| && + | if (z2ui5.oResponse.PARAMS == undefined) \{| && |\n| && + | return;| && |\n| && + | \}| && |\n| && + | if (z2ui5.oResponse.PARAMS[paramKey]?.CHECK_UPDATE_MODEL) \{| && |\n| && + | let model = new JSONModel(z2ui5.oResponse.OVIEWMODEL);| && |\n| && + | if (oView) \{| && |\n| && + | oView.setModel(model);| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + | async checkSDKcompatibility(err) \{| && |\n| && + | let oCurrentVersionInfo = await VersionInfo.load();| && |\n| && + | var ui5_sdk = oCurrentVersionInfo.gav.includes('com.sap.ui5') ? true : false;| && |\n| && + | if (!ui5_sdk) \{| && |\n| && + | if (err) \{| && |\n| && + " TODO: check spelling: availabe (typo) -> available (ABAP cleaner) + | MessageBox.error("openui5 SDK is loaded, module: " + err._modules + " is not availabe in openui5");| && |\n| && + | return;| && |\n| && + | \}| && |\n| && + | ;| && |\n| && + | \}| && |\n| && + | ; MessageBox.error(err.toLocaleString());| && |\n| && + | \},| && |\n| && + | showMessage(msgType, params) \{| && |\n| && + | if (params == undefined) \{| && |\n| && + | return;| && |\n| && + | \}| && |\n| && + | if (params[msgType]?.TEXT !== undefined) \{| && |\n| && + | if (msgType === 'S_MSG_TOAST') \{| && |\n| && + | MessageToast.show(params[msgType].TEXT, \{| && |\n| && + | duration: params[msgType].DURATION ? parseInt(params[msgType].DURATION) : 3000,| && |\n| && + | width: params[msgType].WIDTH ? params[msgType].WIDTH : '15em',| && |\n| && + | onClose: params[msgType].ONCLOSE ? params[msgType].ONCLOSE : null,| && |\n| && + | autoClose: params[msgType].AUTOCLOSE ? true : false,| && |\n| && + | animationTimingFunction: params[msgType].ANIMATIONTIMINGFUNCTION ? params[msgType].ANIMATIONTIMINGFUNCTION : 'ease',| && |\n| && + | animationDuration: params[msgType].ANIMATIONDURATION ? parseInt(params[msgType].ANIMATIONDURATION) : 1000,| && |\n| && + | closeonBrowserNavigation: params[msgType].CLOSEONBROWSERNAVIGATION ? true : false| && |\n| && + | \});| && |\n| && + | if (params[msgType].CLASS) \{| && |\n| && + | let mtoast = \{\};| && |\n| && + | mtoast = document.getElementsByClassName("sapMMessageToast")[0];| && |\n| && + | if (mtoast) \{| && |\n| && + | mtoast.classList.add(params[msgType].CLASS);| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | ;| && |\n| && + | \} else if (msgType === 'S_MSG_BOX') \{| && |\n| && + || && |\n| && + | let oParams = \{| && |\n| && + | styleClass: params[msgType].STYLECLASS ? params[msgType].STYLECLASS : '',| && |\n| && + | title: params[msgType].TITLE ? params[msgType].TITLE : '',| && |\n| && + | onClose: params[msgType].ONCLOSE ? Function("sAction", "return " + params[msgType].ONCLOSE) : null,| && |\n| && + | actions: params[msgType].ACTIONS ? params[msgType].ACTIONS : 'OK',| && |\n| && + | emphasizedAction: params[msgType].EMPHASIZEDACTION ? params[msgType].EMPHASIZEDACTION : 'OK',| && |\n| && + | initialFocus: params[msgType].INITIALFOCUS ? params[msgType].INITIALFOCUS : null,| && |\n| && + | textDirection: params[msgType].TEXTDIRECTION ? params[msgType].TEXTDIRECTION : 'Inherit',| && |\n| && + | icon: params[msgType].ICON ? params[msgType].ICON : 'NONE',| && |\n| && + | details: params[msgType].DETAILS ? params[msgType].DETAILS : '',| && |\n| && + | closeOnNavigation: params[msgType].CLOSEONNAVIGATION ? true : false| && |\n| && + | \};| && |\n| && + | if ( oParams.icon = 'None' ) \{ delete oParams.icon \};| && |\n| && + | MessageBox[params[msgType].TYPE](params[msgType].TEXT, oParams);| && |\n| && + | return;| && |\n| && + || && |\n| && + | switch (params[msgType].TYPE) \{| && |\n| && + | case 'error':| && |\n| && + | MessageBox.error(params[msgType].TEXT, oParams);| && |\n| && + | break;| && |\n| && + | case 'warning':| && |\n| && + | MessageBox.error(params[msgType].TEXT, oParams);| && |\n| && + | break;| && |\n| && + | default:| && |\n| && + | MessageBox.shwo(params[msgType].TEXT, oParams);| && |\n| && + | break;| && |\n| && + | \}| && |\n| && + | return;| && |\n| && + || && |\n| && + | if (params[msgType].TYPE) \{| && |\n| && + | MessageBox[params[msgType].TYPE](params[msgType].TEXT);| && |\n| && + | \} else \{| && |\n| && + | MessageBox.show(params[msgType].TEXT, \{| && |\n| && + | styleClass: params[msgType].STYLECLASS ? params[msgType].STYLECLASS : '',| && |\n| && + | title: params[msgType].TITLE ? params[msgType].TITLE : '',| && |\n| && + | onClose: params[msgType].ONCLOSE ? Function("sAction", "return " + params[msgType].ONCLOSE) : null,| && |\n| && + | actions: params[msgType].ACTIONS ? params[msgType].ACTIONS : 'OK',| && |\n| && + | emphasizedAction: params[msgType].EMPHASIZEDACTION ? params[msgType].EMPHASIZEDACTION : 'OK',| && |\n| && + | initialFocus: params[msgType].INITIALFOCUS ? params[msgType].INITIALFOCUS : null,| && |\n| && + | textDirection: params[msgType].TEXTDIRECTION ? params[msgType].TEXTDIRECTION : 'Inherit',| && |\n| && + | icon: params[msgType].ICON ? params[msgType].ICON : 'NONE',| && |\n| && + | details: params[msgType].DETAILS ? params[msgType].DETAILS : '',| && |\n| && + | closeOnNavigation: params[msgType].CLOSEONNAVIGATION ? true : false| && |\n| && + | \})| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | \},| && |\n| && + | setApp(oApp) \{| && |\n| && + | this._oApp = oApp;| && |\n| && + | \},| && |\n| && + | async displayView(xml, viewModel) \{| && |\n| && + | let oview_model = new JSONModel(viewModel);| && |\n| && + | z2ui5.oView = await XMLView.create(\{| && |\n| && + | definition: xml,| && |\n| && + | models: oview_model,| && |\n| && + | controller: z2ui5.oController,| && |\n| && + | id: 'mainView',| && |\n| && + | preprocessors: \{| && |\n| && + | xml: \{| && |\n| && + | models: \{| && |\n| && + | template: oview_model| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | \}| && |\n| && + | \});| && |\n| && + | z2ui5.oView.setModel(z2ui5.oDeviceModel, "device");| && |\n| && + | this._oApp.removeAllPages();| && |\n| && + | this._oApp.insertPage(z2ui5.oView);| && |\n| && + | \},| && |\n| && + | \})| && |\n| && + | \});| && |\n| && + ||. ENDMETHOD. - ENDCLASS. diff --git a/src/01/03/z2ui5_cl_app_view1_xml.clas.abap b/src/01/03/z2ui5_cl_app_view1_xml.clas.abap index bfdc435d..1ac83ecf 100644 --- a/src/01/03/z2ui5_cl_app_view1_xml.clas.abap +++ b/src/01/03/z2ui5_cl_app_view1_xml.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_app_view1_xml DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -10,21 +9,20 @@ CLASS z2ui5_cl_app_view1_xml DEFINITION VALUE(result) TYPE string. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. CLASS z2ui5_cl_app_view1_xml IMPLEMENTATION. - METHOD get. - result = `` && - `` && - `` && - ``. + result = || && + || && + || && + ||. ENDMETHOD. - ENDCLASS. diff --git a/src/02/01/z2ui5_cl_pop_error.clas.abap b/src/02/01/z2ui5_cl_pop_error.clas.abap index cde8ad19..988a9344 100644 --- a/src/02/01/z2ui5_cl_pop_error.clas.abap +++ b/src/02/01/z2ui5_cl_pop_error.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_pop_error DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -14,18 +13,17 @@ CLASS z2ui5_cl_pop_error DEFINITION VALUE(r_result) TYPE REF TO z2ui5_cl_pop_error. PROTECTED SECTION. - DATA client TYPE REF TO z2ui5_if_client. - DATA error TYPE REF TO cx_root. + DATA client TYPE REF TO z2ui5_if_client. + DATA error TYPE REF TO cx_root. DATA check_initialized TYPE abap_bool. + METHODS view_display. PRIVATE SECTION. ENDCLASS. - CLASS z2ui5_cl_pop_error IMPLEMENTATION. - METHOD factory. r_result = NEW #( ). @@ -33,27 +31,23 @@ CLASS z2ui5_cl_pop_error IMPLEMENTATION. ENDMETHOD. - METHOD view_display. - DATA(popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( - title = `Error View` - afterclose = client->_event( 'BUTTON_CONFIRM' ) + DATA(popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( title = `Error View` + afterclose = client->_event( 'BUTTON_CONFIRM' ) )->content( )->vbox( 'sapUiMediumMargin' )->text( error->get_text( ) )->get_parent( )->get_parent( )->buttons( - )->button( - text = `OK` - press = client->_event( 'BUTTON_CONFIRM' ) - type = 'Emphasized' ). + )->button( text = `OK` + press = client->_event( 'BUTTON_CONFIRM' ) + type = 'Emphasized' ). client->popup_display( popup->stringify( ) ). ENDMETHOD. - METHOD z2ui5_if_app~main. me->client = client. diff --git a/src/02/01/z2ui5_cl_pop_file_dl.clas.abap b/src/02/01/z2ui5_cl_pop_file_dl.clas.abap index 8e338114..02922f21 100644 --- a/src/02/01/z2ui5_cl_pop_file_dl.clas.abap +++ b/src/02/01/z2ui5_cl_pop_file_dl.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_pop_file_dl DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -18,10 +17,10 @@ CLASS z2ui5_cl_pop_file_dl DEFINITION RETURNING VALUE(r_result) TYPE REF TO z2ui5_cl_pop_file_dl. - DATA mv_name TYPE string. - DATA mv_type TYPE string. - DATA mv_size TYPE string. - DATA mv_value TYPE string. + DATA mv_name TYPE string. + DATA mv_type TYPE string. + DATA mv_size TYPE string. + DATA mv_value TYPE string. DATA mv_check_download TYPE abap_bool. METHODS result @@ -29,51 +28,47 @@ CLASS z2ui5_cl_pop_file_dl DEFINITION VALUE(result) TYPE abap_bool. PROTECTED SECTION. - DATA check_confirmed TYPE abap_bool. - DATA client TYPE REF TO z2ui5_if_client. - DATA title TYPE string. - DATA icon TYPE string. - DATA question_text TYPE string. + DATA check_confirmed TYPE abap_bool. + DATA client TYPE REF TO z2ui5_if_client. + DATA title TYPE string. + DATA icon TYPE string. + DATA question_text TYPE string. DATA button_text_confirm TYPE string. - DATA button_text_cancel TYPE string. - DATA check_initialized TYPE abap_bool. + DATA button_text_cancel TYPE string. + DATA check_initialized TYPE abap_bool. + METHODS view_display. + PRIVATE SECTION. ENDCLASS. - -CLASS Z2UI5_CL_POP_FILE_DL IMPLEMENTATION. - - +CLASS z2ui5_cl_pop_file_dl IMPLEMENTATION. METHOD factory. r_result = NEW #( ). - r_result->title = i_title. + r_result->title = i_title. - r_result->question_text = i_text. + r_result->question_text = i_text. r_result->button_text_confirm = i_button_text_confirm. - r_result->button_text_cancel = i_button_text_cancel. - r_result->mv_type = i_type. - r_result->mv_value = i_file. - r_result->mv_size = strlen( i_file ) / 1000. + r_result->button_text_cancel = i_button_text_cancel. + r_result->mv_type = i_type. + r_result->mv_value = i_file. + r_result->mv_size = strlen( i_file ) / 1000. ENDMETHOD. - METHOD result. result = check_confirmed. ENDMETHOD. - METHOD view_display. - DATA(popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( - title = title - icon = icon - afterclose = client->_event( 'BUTTON_CANCEL' ) + DATA(popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( title = title + icon = icon + afterclose = client->_event( 'BUTTON_CANCEL' ) )->content( ). IF mv_check_download = abap_true. @@ -81,7 +76,8 @@ CLASS Z2UI5_CL_POP_FILE_DL IMPLEMENTATION. DATA(lv_base64) = z2ui5_cl_util=>conv_encode_x_base64( lv_csv_x ). popup->_generic( ns = `html` name = `iframe` - t_prop = VALUE #( ( n = `src` v = mv_type && lv_base64 ) ( n = `hidden` v = `hidden` ) ) ). + t_prop = VALUE #( ( n = `src` v = mv_type && lv_base64 ) + ( n = `hidden` v = `hidden` ) ) ). popup->_z2ui5( )->timer( client->_event( `CALLBACK_DOWNLOAD` ) ). @@ -99,19 +95,16 @@ CLASS Z2UI5_CL_POP_FILE_DL IMPLEMENTATION. enabled = abap_false )->get_parent( )->get_parent( )->buttons( - )->button( - text = button_text_cancel - press = client->_event( 'BUTTON_CANCEL' ) - )->button( - text = `Download` - press = client->_event( 'BUTTON_CONFIRM' ) - type = 'Emphasized' ). + )->button( text = button_text_cancel + press = client->_event( 'BUTTON_CANCEL' ) + )->button( text = `Download` + press = client->_event( 'BUTTON_CONFIRM' ) + type = 'Emphasized' ). client->popup_display( popup->stringify( ) ). ENDMETHOD. - METHOD z2ui5_if_app~main. me->client = client. diff --git a/src/02/01/z2ui5_cl_pop_file_ul.clas.abap b/src/02/01/z2ui5_cl_pop_file_ul.clas.abap index 8d517358..74273c47 100644 --- a/src/02/01/z2ui5_cl_pop_file_ul.clas.abap +++ b/src/02/01/z2ui5_cl_pop_file_ul.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_pop_file_ul DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -22,9 +21,10 @@ CLASS z2ui5_cl_pop_file_ul DEFINITION value TYPE string, check_confirmed TYPE abap_bool, END OF ty_s_result. - DATA ms_result TYPE ty_s_result. - DATA mv_path TYPE string. - DATA mv_value TYPE string. + + DATA ms_result TYPE ty_s_result. + DATA mv_path TYPE string. + DATA mv_value TYPE string. DATA check_confirm_enabled TYPE abap_bool. METHODS result @@ -32,72 +32,64 @@ CLASS z2ui5_cl_pop_file_ul DEFINITION VALUE(result) TYPE ty_s_result. PROTECTED SECTION. - DATA client TYPE REF TO z2ui5_if_client. - DATA title TYPE string. - DATA icon TYPE string. - DATA question_text TYPE string. + DATA client TYPE REF TO z2ui5_if_client. + DATA title TYPE string. + DATA icon TYPE string. + DATA question_text TYPE string. DATA button_text_confirm TYPE string. - DATA button_text_cancel TYPE string. - DATA check_initialized TYPE abap_bool. + DATA button_text_cancel TYPE string. + DATA check_initialized TYPE abap_bool. + METHODS view_display. + PRIVATE SECTION. ENDCLASS. - CLASS z2ui5_cl_pop_file_ul IMPLEMENTATION. - - METHOD factory. r_result = NEW #( ). - r_result->title = i_title. + r_result->title = i_title. - r_result->question_text = i_text. + r_result->question_text = i_text. r_result->button_text_confirm = i_button_text_confirm. - r_result->button_text_cancel = i_button_text_cancel. - r_result->mv_path = i_path. + r_result->button_text_cancel = i_button_text_cancel. + r_result->mv_path = i_path. ENDMETHOD. - METHOD result. result = ms_result. ENDMETHOD. - METHOD view_display. - DATA(popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( - title = title - icon = icon - afterclose = client->_event( 'BUTTON_CANCEL' ) + DATA(popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( title = title + icon = icon + afterclose = client->_event( 'BUTTON_CANCEL' ) )->content( )->vbox( 'sapUiMediumMargin' )->label( question_text - )->_z2ui5( )->file_uploader( - value = client->_bind_edit( mv_value ) - path = client->_bind_edit( mv_path ) - placeholder = 'filepath here...' - upload = client->_event( 'UPLOAD' ) + )->_z2ui5( )->file_uploader( value = client->_bind_edit( mv_value ) + path = client->_bind_edit( mv_path ) + placeholder = 'filepath here...' + upload = client->_event( 'UPLOAD' ) )->get_parent( )->get_parent( )->buttons( - )->button( - text = button_text_cancel - press = client->_event( 'BUTTON_CANCEL' ) - )->button( - text = button_text_confirm - press = client->_event( 'BUTTON_CONFIRM' ) - enabled = client->_bind( check_confirm_enabled ) - type = 'Emphasized' ). + )->button( text = button_text_cancel + press = client->_event( 'BUTTON_CANCEL' ) + )->button( text = button_text_confirm + press = client->_event( 'BUTTON_CONFIRM' ) + enabled = client->_bind( check_confirm_enabled ) + type = 'Emphasized' ). client->popup_display( popup->stringify( ) ). ENDMETHOD. - METHOD z2ui5_if_app~main. me->client = client. diff --git a/src/02/01/z2ui5_cl_pop_get_range.clas.abap b/src/02/01/z2ui5_cl_pop_get_range.clas.abap index 6fc6071c..52f81ffe 100644 --- a/src/02/01/z2ui5_cl_pop_get_range.clas.abap +++ b/src/02/01/z2ui5_cl_pop_get_range.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_pop_get_range DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. INTERFACES z2ui5_if_app. @@ -13,6 +12,7 @@ CLASS z2ui5_cl_pop_get_range DEFINITION high TYPE string, key TYPE string, END OF ty_s_filter_pop. + DATA mt_filter TYPE STANDARD TABLE OF ty_s_filter_pop WITH EMPTY KEY. CLASS-METHODS factory @@ -26,6 +26,7 @@ CLASS z2ui5_cl_pop_get_range DEFINITION t_range TYPE z2ui5_cl_util=>ty_t_range, check_confirmed TYPE abap_bool, END OF ty_s_result. + DATA ms_result TYPE ty_s_result. METHODS result @@ -33,70 +34,60 @@ CLASS z2ui5_cl_pop_get_range DEFINITION VALUE(result) TYPE ty_s_result. DATA mt_mapping TYPE z2ui5_if_types=>ty_t_name_value. + PROTECTED SECTION. - DATA client TYPE REF TO z2ui5_if_client. + DATA client TYPE REF TO z2ui5_if_client. DATA check_initialized TYPE abap_bool. + METHODS view_display. + PRIVATE SECTION. ENDCLASS. - -CLASS Z2UI5_CL_POP_GET_RANGE IMPLEMENTATION. - - +CLASS z2ui5_cl_pop_get_range IMPLEMENTATION. METHOD factory. r_result = NEW #( ). - z2ui5_cl_util=>itab_corresponding( - EXPORTING - val = t_range - CHANGING - tab = r_result->ms_result-t_range + z2ui5_cl_util=>itab_corresponding( EXPORTING val = t_range + CHANGING tab = r_result->ms_result-t_range ). INSERT VALUE #( ) INTO TABLE r_result->ms_result-t_range. ENDMETHOD. - METHOD result. result = ms_result. ENDMETHOD. - METHOD view_display. - DATA(lo_popup) = z2ui5_cl_xml_view=>factory_popup( ). - lo_popup = lo_popup->dialog( - afterclose = client->_event( 'BUTTON_CANCEL' ) - contentheight = `50%` - contentwidth = `50%` - title = 'Define Filter Conditons' ). + lo_popup = lo_popup->dialog( afterclose = client->_event( 'BUTTON_CANCEL' ) + contentheight = `50%` + contentwidth = `50%` + title = 'Define Filter Conditons' ). DATA(vbox) = lo_popup->vbox( height = `100%` justifycontent = 'SpaceBetween' ). - DATA(item) = vbox->list( - nodata = `no conditions defined` - items = client->_bind_edit( mt_filter ) - selectionchange = client->_event( 'SELCHANGE' ) + DATA(item) = vbox->list( nodata = `no conditions defined` + items = client->_bind_edit( mt_filter ) + selectionchange = client->_event( 'SELCHANGE' ) )->custom_list_item( ). DATA(grid) = item->grid( ). - grid->combobox( - selectedkey = `{OPTION}` - items = client->_bind( mt_mapping ) - )->item( - key = '{N}' - text = '{N}' + grid->combobox( selectedkey = `{OPTION}` + items = client->_bind( mt_mapping ) + )->item( key = '{N}' + text = '{N}' )->get_parent( )->input( value = `{LOW}` submit = client->_event( 'BUTTON_CONFIRM' ) @@ -105,7 +96,8 @@ CLASS Z2UI5_CL_POP_GET_RANGE IMPLEMENTATION. submit = client->_event( 'BUTTON_CONFIRM' ) )->button( icon = 'sap-icon://decline' type = `Transparent` - press = client->_event( val = `POPUP_DELETE` t_arg = VALUE #( ( `${KEY}` ) ) ) ). + press = client->_event( val = `POPUP_DELETE` + t_arg = VALUE #( ( `${KEY}` ) ) ) ). lo_popup->buttons( )->button( text = `Delete All` @@ -115,19 +107,16 @@ CLASS Z2UI5_CL_POP_GET_RANGE IMPLEMENTATION. )->button( text = `Add Item` icon = `sap-icon://add` press = client->_event( val = `POPUP_ADD` ) - )->button( - text = 'Cancel' - press = client->_event( 'BUTTON_CANCEL' ) - )->button( - text = 'OK' - press = client->_event( 'BUTTON_CONFIRM' ) - type = 'Emphasized' ). + )->button( text = 'Cancel' + press = client->_event( 'BUTTON_CANCEL' ) + )->button( text = 'OK' + press = client->_event( 'BUTTON_CONFIRM' ) + type = 'Emphasized' ). client->popup_display( lo_popup->stringify( ) ). ENDMETHOD. - METHOD z2ui5_if_app~main. me->client = client. @@ -139,11 +128,10 @@ CLASS Z2UI5_CL_POP_GET_RANGE IMPLEMENTATION. CLEAR mt_filter. LOOP AT ms_result-t_range REFERENCE INTO DATA(lr_product). - INSERT VALUE #( - low = lr_product->low - high = lr_product->high - option = lr_product->option - key = z2ui5_cl_util=>uuid_get_c32( ) + INSERT VALUE #( low = lr_product->low + high = lr_product->high + option = lr_product->option + key = z2ui5_cl_util=>uuid_get_c32( ) ) INTO TABLE mt_filter. ENDLOOP. @@ -160,11 +148,10 @@ CLASS Z2UI5_CL_POP_GET_RANGE IMPLEMENTATION. IF lr_filter->low IS INITIAL AND lr_filter->high IS INITIAL. CONTINUE. ENDIF. - INSERT VALUE #( - sign = `I` - option = lr_filter->option - low = lr_filter->low - high = lr_filter->high + INSERT VALUE #( sign = `I` + option = lr_filter->option + low = lr_filter->low + high = lr_filter->high ) INTO TABLE ms_result-t_range. ENDLOOP. diff --git a/src/02/01/z2ui5_cl_pop_get_range_m.clas.abap b/src/02/01/z2ui5_cl_pop_get_range_m.clas.abap index d08c1144..85c907df 100644 --- a/src/02/01/z2ui5_cl_pop_get_range_m.clas.abap +++ b/src/02/01/z2ui5_cl_pop_get_range_m.clas.abap @@ -24,9 +24,10 @@ CLASS z2ui5_cl_pop_get_range_m DEFINITION VALUE(result) TYPE ty_s_result. PROTECTED SECTION. - DATA client TYPE REF TO z2ui5_if_client. - DATA check_initialized TYPE abap_bool. - DATA mv_popup_name TYPE LINE OF string_table. + DATA client TYPE REF TO z2ui5_if_client. + DATA check_initialized TYPE abap_bool. + DATA mv_popup_name TYPE LINE OF string_table. + METHODS popup_display. METHODS init. @@ -35,9 +36,7 @@ CLASS z2ui5_cl_pop_get_range_m DEFINITION ENDCLASS. - -CLASS Z2UI5_CL_POP_GET_RANGE_M IMPLEMENTATION. - +CLASS z2ui5_cl_pop_get_range_m IMPLEMENTATION. METHOD factory. r_result = NEW #( ). @@ -45,14 +44,12 @@ CLASS Z2UI5_CL_POP_GET_RANGE_M IMPLEMENTATION. ENDMETHOD. - METHOD init. popup_display( ). ENDMETHOD. - METHOD popup_display. DATA(lo_popup) = z2ui5_cl_xml_view=>factory_popup( ). @@ -72,9 +69,10 @@ CLASS Z2UI5_CL_POP_GET_RANGE_M IMPLEMENTATION. DATA(grid) = item->grid( class = `sapUiSmallMarginTop sapUiSmallMarginBottom sapUiSmallMarginBegin` ). grid->text( `{NAME}` ). - grid->multi_input( tokens = `{T_TOKEN}` - enabled = abap_false - valuehelprequest = client->_event( val = `LIST_OPEN` t_arg = VALUE #( ( `${NAME}` ) ) ) + grid->multi_input( tokens = `{T_TOKEN}` + enabled = abap_false + valuehelprequest = client->_event( val = `LIST_OPEN` + t_arg = VALUE #( ( `${NAME}` ) ) ) )->tokens( )->token( key = `{KEY}` text = `{TEXT}` @@ -83,11 +81,13 @@ CLASS Z2UI5_CL_POP_GET_RANGE_M IMPLEMENTATION. editable = `{EDITABLE}` ). grid->button( text = `Select` - press = client->_event( val = `LIST_OPEN` t_arg = VALUE #( ( `${NAME}` ) ) ) ). + press = client->_event( val = `LIST_OPEN` + t_arg = VALUE #( ( `${NAME}` ) ) ) ). grid->button( icon = 'sap-icon://delete' type = `Transparent` text = `Clear` - press = client->_event( val = `LIST_DELETE` t_arg = VALUE #( ( `${NAME}` ) ) ) ). + press = client->_event( val = `LIST_DELETE` + t_arg = VALUE #( ( `${NAME}` ) ) ) ). lo_popup->buttons( )->button( text = `Clear All` diff --git a/src/02/01/z2ui5_cl_pop_html.clas.abap b/src/02/01/z2ui5_cl_pop_html.clas.abap index a5efdf68..9291737f 100644 --- a/src/02/01/z2ui5_cl_pop_html.clas.abap +++ b/src/02/01/z2ui5_cl_pop_html.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_pop_html DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -17,53 +16,48 @@ CLASS z2ui5_cl_pop_html DEFINITION VALUE(r_result) TYPE REF TO z2ui5_cl_pop_html. PROTECTED SECTION. - DATA client TYPE REF TO z2ui5_if_client. - DATA title TYPE string. - DATA icon TYPE string. - DATA html TYPE string. + DATA client TYPE REF TO z2ui5_if_client. + DATA title TYPE string. + DATA icon TYPE string. + DATA html TYPE string. DATA button_text_confirm TYPE string. - DATA check_initialized TYPE abap_bool. + DATA check_initialized TYPE abap_bool. + METHODS view_display. + PRIVATE SECTION. ENDCLASS. - -CLASS Z2UI5_CL_POP_HTML IMPLEMENTATION. - - +CLASS z2ui5_cl_pop_html IMPLEMENTATION. METHOD factory. r_result = NEW #( ). - r_result->title = i_title. - r_result->icon = i_icon. - r_result->html = i_html. + r_result->title = i_title. + r_result->icon = i_icon. + r_result->html = i_html. r_result->button_text_confirm = i_button_text. ENDMETHOD. - METHOD view_display. - DATA(popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( - title = title - icon = icon - afterclose = client->_event( 'BUTTON_CONFIRM' ) + DATA(popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( title = title + icon = icon + afterclose = client->_event( 'BUTTON_CONFIRM' ) )->content( )->vbox( 'sapUiMediumMargin' )->html( html )->get_parent( )->get_parent( )->get_parent( )->buttons( - )->button( - text = button_text_confirm - press = client->_event( 'BUTTON_CONFIRM' ) - type = 'Emphasized' ). + )->button( text = button_text_confirm + press = client->_event( 'BUTTON_CONFIRM' ) + type = 'Emphasized' ). client->popup_display( popup->stringify( ) ). ENDMETHOD. - METHOD z2ui5_if_app~main. me->client = client. diff --git a/src/02/01/z2ui5_cl_pop_input_val.clas.abap b/src/02/01/z2ui5_cl_pop_input_val.clas.abap index 2ef689ba..367f361a 100644 --- a/src/02/01/z2ui5_cl_pop_input_val.clas.abap +++ b/src/02/01/z2ui5_cl_pop_input_val.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_pop_input_val DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -9,9 +8,9 @@ CLASS z2ui5_cl_pop_input_val DEFINITION CLASS-METHODS factory IMPORTING - text TYPE string DEFAULT `Enter New Value` + !text TYPE string DEFAULT `Enter New Value` val TYPE string OPTIONAL - title TYPE string DEFAULT `Popup Input Value` + !title TYPE string DEFAULT `Popup Input Value` button_text_confirm TYPE string DEFAULT `OK` button_text_cancel TYPE string DEFAULT `Cancel` PREFERRED PARAMETER val @@ -23,6 +22,7 @@ CLASS z2ui5_cl_pop_input_val DEFINITION value TYPE string, check_confirmed TYPE abap_bool, END OF ty_s_result. + DATA ms_result TYPE ty_s_result. METHODS result @@ -30,70 +30,62 @@ CLASS z2ui5_cl_pop_input_val DEFINITION VALUE(result) TYPE ty_s_result. PROTECTED SECTION. - DATA client TYPE REF TO z2ui5_if_client. - DATA title TYPE string. - DATA icon TYPE string. - DATA question_text TYPE string. - DATA button_text_confirm TYPE string. - DATA button_text_cancel TYPE string. - DATA check_initialized TYPE abap_bool. + DATA client TYPE REF TO z2ui5_if_client. + DATA title TYPE string. + DATA icon TYPE string. + DATA question_text TYPE string. + DATA button_text_confirm TYPE string. + DATA button_text_cancel TYPE string. + DATA check_initialized TYPE abap_bool. DATA check_result_confirmed TYPE abap_bool. + METHODS view_display. + PRIVATE SECTION. ENDCLASS. - -CLASS Z2UI5_CL_POP_INPUT_VAL IMPLEMENTATION. - - +CLASS z2ui5_cl_pop_input_val IMPLEMENTATION. METHOD factory. r_result = NEW #( ). - r_result->title = title. + r_result->title = title. - r_result->question_text = text. + r_result->question_text = text. r_result->button_text_confirm = button_text_confirm. - r_result->button_text_cancel = button_text_cancel. + r_result->button_text_cancel = button_text_cancel. r_result->ms_result-value = val. ENDMETHOD. - METHOD result. result = ms_result. ENDMETHOD. - METHOD view_display. - DATA(popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( - title = title - icon = icon - afterclose = client->_event( 'BUTTON_CANCEL' ) + DATA(popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( title = title + icon = icon + afterclose = client->_event( 'BUTTON_CANCEL' ) )->content( )->vbox( 'sapUiMediumMargin' )->label( question_text - )->input( - value = client->_bind_edit( ms_result-value ) - submit = client->_event( 'BUTTON_CONFIRM' ) + )->input( value = client->_bind_edit( ms_result-value ) + submit = client->_event( 'BUTTON_CONFIRM' ) )->get_parent( )->get_parent( )->buttons( - )->button( - text = button_text_cancel - press = client->_event( 'BUTTON_CANCEL' ) - )->button( - text = button_text_confirm - press = client->_event( 'BUTTON_CONFIRM' ) - type = 'Emphasized' ). + )->button( text = button_text_cancel + press = client->_event( 'BUTTON_CANCEL' ) + )->button( text = button_text_confirm + press = client->_event( 'BUTTON_CONFIRM' ) + type = 'Emphasized' ). client->popup_display( popup->stringify( ) ). ENDMETHOD. - METHOD z2ui5_if_app~main. me->client = client. diff --git a/src/02/01/z2ui5_cl_pop_itab_json_dl.clas.abap b/src/02/01/z2ui5_cl_pop_itab_json_dl.clas.abap index 93a84136..c9185fe0 100644 --- a/src/02/01/z2ui5_cl_pop_itab_json_dl.clas.abap +++ b/src/02/01/z2ui5_cl_pop_itab_json_dl.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_pop_itab_json_dl DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -24,13 +23,13 @@ CLASS z2ui5_cl_pop_itab_json_dl DEFINITION DATA mr_itab TYPE REF TO data. PROTECTED SECTION. - DATA client TYPE REF TO z2ui5_if_client. + DATA client TYPE REF TO z2ui5_if_client. - DATA title TYPE string. - DATA icon TYPE string. + DATA title TYPE string. + DATA icon TYPE string. - DATA button_text_confirm TYPE string. - DATA button_text_cancel TYPE string. + DATA button_text_confirm TYPE string. + DATA button_text_cancel TYPE string. DATA check_result_confirmed TYPE abap_bool. @@ -38,31 +37,26 @@ CLASS z2ui5_cl_pop_itab_json_dl DEFINITION ENDCLASS. - -CLASS Z2UI5_CL_POP_ITAB_JSON_DL IMPLEMENTATION. - - +CLASS z2ui5_cl_pop_itab_json_dl IMPLEMENTATION. METHOD factory. r_result = NEW #( ). - r_result->mr_itab = z2ui5_cl_util=>conv_copy_ref_data( itab ). + r_result->mr_itab = z2ui5_cl_util=>conv_copy_ref_data( itab ). - r_result->title = i_title. - r_result->icon = i_icon. + r_result->title = i_title. + r_result->icon = i_icon. r_result->button_text_confirm = i_button_text_confirm. - r_result->button_text_cancel = i_button_text_cancel. + r_result->button_text_cancel = i_button_text_cancel. ENDMETHOD. - METHOD result. result = check_result_confirmed. ENDMETHOD. - METHOD z2ui5_if_app~main. DATA app TYPE REF TO object. @@ -73,8 +67,8 @@ CLASS Z2UI5_CL_POP_ITAB_JSON_DL IMPLEMENTATION. IF z2ui5_cl_util=>rtti_check_class_exists( `z2ui5_dbt_cl_app_03` ) = abap_false. DATA(lv_link) = `https://github.com/oblomov-dev/a2UI5-db_table_loader`. - DATA(lv_text) = `

Please install the open-source project a2UI5-db_table_loader and try again: (link)

`. + DATA(lv_text) = |

Please install the open-source project a2UI5-db_table_loader and try again: (link)

|. DATA(lx) = NEW z2ui5_cx_util_error( val = lv_text ). client->nav_app_leave( z2ui5_cl_pop_error=>factory( lx ) ). @@ -83,10 +77,8 @@ CLASS Z2UI5_CL_POP_ITAB_JSON_DL IMPLEMENTATION. DATA(lv_classname) = `Z2UI5_DBT_CL_APP_03`. CALL METHOD (lv_classname)=>('FACTORY_POPUP_BY_ITAB') - EXPORTING - itab = mr_itab - RECEIVING - result = app. + EXPORTING itab = mr_itab + RECEIVING result = app. client->nav_app_leave( CAST #( app ) ). diff --git a/src/02/01/z2ui5_cl_pop_js_loader.clas.abap b/src/02/01/z2ui5_cl_pop_js_loader.clas.abap index 0ee5d339..0b17bd3e 100644 --- a/src/02/01/z2ui5_cl_pop_js_loader.clas.abap +++ b/src/02/01/z2ui5_cl_pop_js_loader.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_pop_js_loader DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -23,15 +22,14 @@ CLASS z2ui5_cl_pop_js_loader DEFINITION VALUE(result3) TYPE string. DATA mv_is_open_ui5 TYPE abap_bool. - DATA ui5_gav TYPE string. + DATA ui5_gav TYPE string. PROTECTED SECTION. DATA check_initialized TYPE abap_bool. - DATA client TYPE REF TO z2ui5_if_client. - DATA js TYPE string. - DATA user_command TYPE string. - DATA check_open_ui5 TYPE abap_bool. - + DATA client TYPE REF TO z2ui5_if_client. + DATA js TYPE string. + DATA user_command TYPE string. + DATA check_open_ui5 TYPE abap_bool. METHODS view_display. @@ -39,54 +37,46 @@ CLASS z2ui5_cl_pop_js_loader DEFINITION ENDCLASS. - CLASS z2ui5_cl_pop_js_loader IMPLEMENTATION. - - METHOD factory. r_result = NEW #( ). - r_result->js = i_js. + r_result->js = i_js. r_result->user_command = i_result. ENDMETHOD. - METHOD factory_check_open_ui5. r_result = NEW #( ). r_result->check_open_ui5 = abap_true. ENDMETHOD. - METHOD result. result3 = user_command. ENDMETHOD. - METHOD view_display. - DATA(popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( `Setup UI...` )->content( ). IF js IS NOT INITIAL. popup->_z2ui5( )->timer( client->_event( 'TIMER_FINISHED' ) - )->_generic( ns = `html` name = `script` )->_cc_plain_xml( js ). + )->_generic( ns = `html` + name = `script` )->_cc_plain_xml( js ). ENDIF. IF check_open_ui5 = abap_true. - popup->_z2ui5( )->info_frontend( - finished = client->_event( `INFO_FINISHED` ) - ui5_gav = client->_bind_edit( ui5_gav ) ). + popup->_z2ui5( )->info_frontend( finished = client->_event( `INFO_FINISHED` ) + ui5_gav = client->_bind_edit( ui5_gav ) ). ENDIF. client->popup_display( popup->stringify( ) ). ENDMETHOD. - METHOD z2ui5_if_app~main. me->client = client. diff --git a/src/02/01/z2ui5_cl_pop_messages.clas.abap b/src/02/01/z2ui5_cl_pop_messages.clas.abap index ce62d348..993ac7ea 100644 --- a/src/02/01/z2ui5_cl_pop_messages.clas.abap +++ b/src/02/01/z2ui5_cl_pop_messages.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_pop_messages DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -22,6 +21,7 @@ CLASS z2ui5_cl_pop_messages DEFINITION group TYPE string, END OF ty_s_msg. TYPES ty_t_msg TYPE STANDARD TABLE OF ty_s_msg. + DATA mt_msg TYPE ty_t_msg. CLASS-METHODS factory @@ -32,19 +32,17 @@ CLASS z2ui5_cl_pop_messages DEFINITION VALUE(r_result) TYPE REF TO z2ui5_cl_pop_messages. PROTECTED SECTION. - DATA client TYPE REF TO z2ui5_if_client. - DATA title TYPE string. + DATA client TYPE REF TO z2ui5_if_client. + DATA title TYPE string. DATA check_initialized TYPE abap_bool. METHODS view_display. + PRIVATE SECTION. ENDCLASS. - CLASS z2ui5_cl_pop_messages IMPLEMENTATION. - - METHOD factory. r_result = NEW #( ). @@ -53,11 +51,11 @@ CLASS z2ui5_cl_pop_messages IMPLEMENTATION. LOOP AT lt_msg REFERENCE INTO DATA(lr_row). DATA(ls_row) = VALUE ty_s_msg( ). - ls_row-type = z2ui5_cl_util=>ui5_get_msg_type( lr_row->type ). - ls_row-title = lr_row->text. + ls_row-type = z2ui5_cl_util=>ui5_get_msg_type( lr_row->type ). + ls_row-title = lr_row->text. * lr_row->title = `title`. * lr_row->message = `message`. - ls_row-subtitle = lr_row->id && ` ` && lr_row->no. + ls_row-subtitle = |{ lr_row->id } { lr_row->no }|. * lr_row->group = `001`. INSERT ls_row INTO TABLE r_result->mt_msg. @@ -67,42 +65,34 @@ CLASS z2ui5_cl_pop_messages IMPLEMENTATION. ENDMETHOD. - METHOD view_display. DATA(popup) = z2ui5_cl_xml_view=>factory_popup( ). - popup = popup->dialog( - title = `Messages` - contentheight = '50%' - contentwidth = '50%' - verticalScrolling = abap_false - afterclose = client->_event( 'BUTTON_CONTINUE' ) + popup = popup->dialog( title = `Messages` + contentheight = '50%' + contentwidth = '50%' + verticalScrolling = abap_false + afterclose = client->_event( 'BUTTON_CONTINUE' ) ). - popup->message_view( - items = client->_bind( mt_msg ) -* groupitems = abap_true - )->message_item( - type = `{TYPE}` - title = `{TITLE}` - subtitle = `{SUBTITLE}` -* description = `{MESSAGE}` -* groupname = `{GROUP}` + popup->message_view( items = client->_bind( mt_msg ) +* groupitems = abap_true + )->message_item( type = `{TYPE}` + title = `{TITLE}` + subtitle = `{SUBTITLE}` +* description = `{MESSAGE}` +* groupname = `{GROUP}` ). popup->buttons( - )->button( - text = 'continue' - press = client->_event( 'BUTTON_CONTINUE' ) - type = 'Emphasized' ). - + )->button( text = 'continue' + press = client->_event( 'BUTTON_CONTINUE' ) + type = 'Emphasized' ). client->popup_display( popup->stringify( ) ). - ENDMETHOD. - METHOD z2ui5_if_app~main. me->client = client. diff --git a/src/02/01/z2ui5_cl_pop_pdf.clas.abap b/src/02/01/z2ui5_cl_pop_pdf.clas.abap index 02164f44..1e004716 100644 --- a/src/02/01/z2ui5_cl_pop_pdf.clas.abap +++ b/src/02/01/z2ui5_cl_pop_pdf.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_pop_pdf DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -21,83 +20,75 @@ CLASS z2ui5_cl_pop_pdf DEFINITION text TYPE string, check_confirmed TYPE abap_bool, END OF ty_s_result. + DATA ms_result TYPE ty_s_result. - DATA mv_pdf TYPE string. + DATA mv_pdf TYPE string. METHODS result RETURNING VALUE(result) TYPE ty_s_result. PROTECTED SECTION. - DATA client TYPE REF TO z2ui5_if_client. - DATA title TYPE string. - DATA icon TYPE string. - DATA question_text TYPE string. - DATA button_text_confirm TYPE string. - DATA button_text_cancel TYPE string. - DATA check_initialized TYPE abap_bool. + DATA client TYPE REF TO z2ui5_if_client. + DATA title TYPE string. + DATA icon TYPE string. + DATA question_text TYPE string. + DATA button_text_confirm TYPE string. + DATA button_text_cancel TYPE string. + DATA check_initialized TYPE abap_bool. DATA check_result_confirmed TYPE abap_bool. + METHODS view_display. + PRIVATE SECTION. ENDCLASS. - CLASS z2ui5_cl_pop_pdf IMPLEMENTATION. - - METHOD factory. r_result = NEW #( ). - r_result->title = i_title. + r_result->title = i_title. r_result->button_text_confirm = i_button_text_confirm. - r_result->button_text_cancel = i_button_text_cancel. - r_result->mv_pdf = i_pdf. + r_result->button_text_cancel = i_button_text_cancel. + r_result->mv_pdf = i_pdf. ENDMETHOD. - METHOD result. result = ms_result. ENDMETHOD. - METHOD view_display. - DATA(popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( - title = title - icon = icon - stretch = abap_true - afterclose = client->_event( 'BUTTON_CANCEL' ) + DATA(popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( title = title + icon = icon + stretch = abap_true + afterclose = client->_event( 'BUTTON_CANCEL' ) )->content( )->vbox( 'sapUiMediumMargin' )->label( question_text - )->_generic( - ns = `html` - name = `iframe` - t_prop = VALUE #( - ( n = `src` v = mv_pdf ) - ( n = `height` v = `800px` ) - ( n = `width` v = `99%` ) - ) + )->_generic( ns = `html` + name = `iframe` + t_prop = VALUE #( ( n = `src` v = mv_pdf ) + ( n = `height` v = `800px` ) + ( n = `width` v = `99%` ) + ) )->get_parent( )->get_parent( )->get_parent( )->buttons( - )->button( - text = button_text_cancel - press = client->_event( 'BUTTON_CANCEL' ) - )->button( - text = button_text_confirm - press = client->_event( 'BUTTON_CONFIRM' ) - type = 'Emphasized' ). + )->button( text = button_text_cancel + press = client->_event( 'BUTTON_CANCEL' ) + )->button( text = button_text_confirm + press = client->_event( 'BUTTON_CONFIRM' ) + type = 'Emphasized' ). client->popup_display( popup->stringify( ) ). ENDMETHOD. - METHOD z2ui5_if_app~main. me->client = client. diff --git a/src/02/01/z2ui5_cl_pop_table.clas.abap b/src/02/01/z2ui5_cl_pop_table.clas.abap index f691bcf1..f32e1f42 100644 --- a/src/02/01/z2ui5_cl_pop_table.clas.abap +++ b/src/02/01/z2ui5_cl_pop_table.clas.abap @@ -1,6 +1,5 @@ CLASS z2ui5_cl_pop_table DEFINITION - PUBLIC - FINAL + PUBLIC FINAL CREATE PROTECTED. PUBLIC SECTION. @@ -18,6 +17,7 @@ CLASS z2ui5_cl_pop_table DEFINITION row TYPE REF TO data, check_confirmed TYPE abap_bool, END OF ty_s_result. + DATA ms_result TYPE ty_s_result. METHODS result @@ -28,8 +28,9 @@ CLASS z2ui5_cl_pop_table DEFINITION PROTECTED SECTION. DATA check_initialized TYPE abap_bool. - DATA title TYPE string VALUE 'Table View'. - DATA client TYPE REF TO z2ui5_if_client. + DATA title TYPE string VALUE 'Table View'. + DATA client TYPE REF TO z2ui5_if_client. + METHODS on_event. METHODS display. METHODS on_event_confirm. @@ -38,24 +39,20 @@ CLASS z2ui5_cl_pop_table DEFINITION ENDCLASS. - CLASS z2ui5_cl_pop_table IMPLEMENTATION. - - METHOD display. FIELD-SYMBOLS TYPE STANDARD TABLE. + ASSIGN mr_tab->* TO . - DATA(popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( - afterclose = client->_event( 'BUTTON_CONFIRM' ) - stretch = abap_true - title = title -* icon = 'sap-icon://edit' + DATA(popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( afterclose = client->_event( 'BUTTON_CONFIRM' ) + stretch = abap_true + title = title +* icon = 'sap-icon://edit' )->content( ). - DATA(tab) = popup->table( - client->_bind( ) ). + DATA(tab) = popup->table( client->_bind( ) ). DATA(lt_comp) = z2ui5_cl_util=>rtti_get_t_attri_by_any( ). @@ -63,7 +60,7 @@ CLASS z2ui5_cl_pop_table IMPLEMENTATION. DATA(cells) = list->cells( ). LOOP AT lt_comp INTO DATA(ls_comp). - cells->text( `{` && ls_comp-name && `}` ). + cells->text( |\{{ ls_comp-name }\}| ). ENDLOOP. DATA(columns) = tab->columns( ). @@ -73,16 +70,14 @@ CLASS z2ui5_cl_pop_table IMPLEMENTATION. popup->get_parent( )->buttons( - )->button( - text = 'OK' - press = client->_event( 'BUTTON_CONFIRM' ) - type = 'Emphasized' ). + )->button( text = 'OK' + press = client->_event( 'BUTTON_CONFIRM' ) + type = 'Emphasized' ). client->popup_display( popup->stringify( ) ). ENDMETHOD. - METHOD factory. FIELD-SYMBOLS TYPE any. @@ -98,7 +93,6 @@ CLASS z2ui5_cl_pop_table IMPLEMENTATION. ENDMETHOD. - METHOD on_event. CASE client->get( )-event. @@ -111,12 +105,10 @@ CLASS z2ui5_cl_pop_table IMPLEMENTATION. client->popup_destroy( ). client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ). - ENDCASE. ENDMETHOD. - METHOD on_event_confirm. client->popup_destroy( ). @@ -124,7 +116,6 @@ CLASS z2ui5_cl_pop_table IMPLEMENTATION. ENDMETHOD. - METHOD result. result = ms_result. @@ -133,7 +124,7 @@ CLASS z2ui5_cl_pop_table IMPLEMENTATION. METHOD z2ui5_if_app~main. - me->client = client. + me->client = client. IF check_initialized = abap_false. check_initialized = abap_true. diff --git a/src/02/01/z2ui5_cl_pop_textedit.clas.abap b/src/02/01/z2ui5_cl_pop_textedit.clas.abap index 2d626541..93760e0f 100644 --- a/src/02/01/z2ui5_cl_pop_textedit.clas.abap +++ b/src/02/01/z2ui5_cl_pop_textedit.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_pop_textedit DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. INTERFACES z2ui5_if_app. @@ -9,23 +8,25 @@ CLASS z2ui5_cl_pop_textedit DEFINITION CLASS-METHODS factory IMPORTING i_stretch_active TYPE abap_bool DEFAULT abap_true - i_textarea TYPE string OPTIONAL - i_title TYPE string DEFAULT `Editor` + i_textarea TYPE string OPTIONAL + i_title TYPE string DEFAULT `Editor` i_check_editable TYPE abap_bool DEFAULT abap_false PREFERRED PARAMETER i_textarea RETURNING VALUE(r_result) TYPE REF TO z2ui5_cl_pop_textedit. - DATA client TYPE REF TO z2ui5_if_client. + DATA client TYPE REF TO z2ui5_if_client. DATA mv_stretch_active TYPE abap_bool. - DATA mv_title TYPE string. + DATA mv_title TYPE string. DATA mv_check_editable TYPE abap_bool. DATA check_initialized TYPE abap_bool. + TYPES: BEGIN OF ty_s_result, text TYPE string, check_confirmed TYPE abap_bool, END OF ty_s_result. + DATA ms_result TYPE ty_s_result. METHODS display. @@ -35,49 +36,44 @@ CLASS z2ui5_cl_pop_textedit DEFINITION VALUE(result) TYPE ty_s_result. PROTECTED SECTION. + PRIVATE SECTION. ENDCLASS. - CLASS z2ui5_cl_pop_textedit IMPLEMENTATION. - METHOD factory. r_result = NEW #( ). r_result->mv_stretch_active = i_stretch_active. r_result->ms_result-text = i_textarea. - r_result->mv_title = i_title. + r_result->mv_title = i_title. r_result->mv_check_editable = i_check_editable. ENDMETHOD. METHOD display. - DATA(popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( - afterclose = client->_event( 'BUTTON_TEXTAREA_CANCEL' ) - stretch = mv_stretch_active - title = mv_title - icon = 'sap-icon://edit' + DATA(popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( afterclose = client->_event( 'BUTTON_TEXTAREA_CANCEL' ) + stretch = mv_stretch_active + title = mv_title + icon = 'sap-icon://edit' )->content( - )->text_area( growing = abap_true - editable = mv_check_editable - value = client->_bind_edit( ms_result-text ) + )->text_area( growing = abap_true + editable = mv_check_editable + value = client->_bind_edit( ms_result-text ) )->get_parent( )->buttons( - )->button( - text = 'Cancel' - press = client->_event( 'BUTTON_TEXTAREA_CANCEL' ) - )->button( - text = 'Confirm' - press = client->_event( 'BUTTON_TEXTAREA_CONFIRM' ) - type = 'Emphasized' ). + )->button( text = 'Cancel' + press = client->_event( 'BUTTON_TEXTAREA_CANCEL' ) + )->button( text = 'Confirm' + press = client->_event( 'BUTTON_TEXTAREA_CONFIRM' ) + type = 'Emphasized' ). client->popup_display( popup->stringify( ) ). ENDMETHOD. - METHOD z2ui5_if_app~main. me->client = client. @@ -105,5 +101,4 @@ CLASS z2ui5_cl_pop_textedit IMPLEMENTATION. METHOD result. result = ms_result. ENDMETHOD. - ENDCLASS. diff --git a/src/02/01/z2ui5_cl_pop_to_confirm.clas.abap b/src/02/01/z2ui5_cl_pop_to_confirm.clas.abap index 7eac9700..2d05a4a5 100644 --- a/src/02/01/z2ui5_cl_pop_to_confirm.clas.abap +++ b/src/02/01/z2ui5_cl_pop_to_confirm.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_pop_to_confirm DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -30,73 +29,65 @@ CLASS z2ui5_cl_pop_to_confirm DEFINITION VALUE(result) TYPE abap_bool. PROTECTED SECTION. - DATA client TYPE REF TO z2ui5_if_client. + DATA client TYPE REF TO z2ui5_if_client. - DATA title TYPE string. - DATA icon TYPE string. - DATA question_text TYPE string. - DATA button_text_confirm TYPE string. - DATA button_text_cancel TYPE string. - DATA check_initialized TYPE abap_bool. + DATA title TYPE string. + DATA icon TYPE string. + DATA question_text TYPE string. + DATA button_text_confirm TYPE string. + DATA button_text_cancel TYPE string. + DATA check_initialized TYPE abap_bool. DATA check_result_confirmed TYPE abap_bool. - DATA event_confirm TYPE string. - DATA event_canceled TYPE string. + DATA event_confirm TYPE string. + DATA event_canceled TYPE string. + METHODS view_display. + PRIVATE SECTION. ENDCLASS. - CLASS z2ui5_cl_pop_to_confirm IMPLEMENTATION. - - METHOD result. result = check_result_confirmed. ENDMETHOD. - METHOD factory. r_result = NEW #( ). - r_result->title = i_title. - r_result->icon = i_icon. - r_result->question_text = i_question_text. + r_result->title = i_title. + r_result->icon = i_icon. + r_result->question_text = i_question_text. r_result->button_text_confirm = i_button_text_confirm. - r_result->button_text_cancel = i_button_text_cancel. - r_result->event_confirm = i_event_confirm. - r_result->event_canceled = i_event_cancel. - + r_result->button_text_cancel = i_button_text_cancel. + r_result->event_confirm = i_event_confirm. + r_result->event_canceled = i_event_cancel. ENDMETHOD. - METHOD view_display. - DATA(popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( - title = title - icon = icon - afterclose = client->_event( 'BUTTON_CANCEL' ) + DATA(popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( title = title + icon = icon + afterclose = client->_event( 'BUTTON_CANCEL' ) )->content( )->vbox( 'sapUiMediumMargin' )->text( question_text )->get_parent( )->get_parent( )->buttons( - )->button( - text = button_text_cancel - press = client->_event( 'BUTTON_CANCEL' ) - )->button( - text = button_text_confirm - press = client->_event( 'BUTTON_CONFIRM' ) - type = 'Emphasized' ). + )->button( text = button_text_cancel + press = client->_event( 'BUTTON_CANCEL' ) + )->button( text = button_text_confirm + press = client->_event( 'BUTTON_CONFIRM' ) + type = 'Emphasized' ). client->popup_display( popup->stringify( ) ). ENDMETHOD. - METHOD z2ui5_if_app~main. me->client = client. diff --git a/src/02/01/z2ui5_cl_pop_to_inform.clas.abap b/src/02/01/z2ui5_cl_pop_to_inform.clas.abap index 951393b6..b154ffeb 100644 --- a/src/02/01/z2ui5_cl_pop_to_inform.clas.abap +++ b/src/02/01/z2ui5_cl_pop_to_inform.clas.abap @@ -1,7 +1,6 @@ CLASS z2ui5_cl_pop_to_inform DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . + PUBLIC FINAL + CREATE PUBLIC. PUBLIC SECTION. @@ -17,52 +16,48 @@ CLASS z2ui5_cl_pop_to_inform DEFINITION VALUE(r_result) TYPE REF TO z2ui5_cl_pop_to_inform. PROTECTED SECTION. - DATA client TYPE REF TO z2ui5_if_client. - DATA title TYPE string. - DATA icon TYPE string. - DATA question_text TYPE string. + DATA client TYPE REF TO z2ui5_if_client. + DATA title TYPE string. + DATA icon TYPE string. + DATA question_text TYPE string. DATA button_text_confirm TYPE string. - DATA check_initialized TYPE abap_bool. + DATA check_initialized TYPE abap_bool. + METHODS view_display. + PRIVATE SECTION. ENDCLASS. - CLASS z2ui5_cl_pop_to_inform IMPLEMENTATION. - METHOD factory. r_result = NEW #( ). - r_result->title = i_title. - r_result->icon = i_icon. - r_result->question_text = i_text. + r_result->title = i_title. + r_result->icon = i_icon. + r_result->question_text = i_text. r_result->button_text_confirm = i_button_text. ENDMETHOD. - METHOD view_display. - DATA(popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( - title = title - icon = icon - afterclose = client->_event( 'BUTTON_CONFIRM' ) + DATA(popup) = z2ui5_cl_xml_view=>factory_popup( )->dialog( title = title + icon = icon + afterclose = client->_event( 'BUTTON_CONFIRM' ) )->content( )->vbox( 'sapUiMediumMargin' )->text( question_text )->get_parent( )->get_parent( )->buttons( - )->button( - text = button_text_confirm - press = client->_event( 'BUTTON_CONFIRM' ) - type = 'Emphasized' ). + )->button( text = button_text_confirm + press = client->_event( 'BUTTON_CONFIRM' ) + type = 'Emphasized' ). client->popup_display( popup->stringify( ) ). ENDMETHOD. - METHOD z2ui5_if_app~main. me->client = client. diff --git a/src/02/01/z2ui5_cl_pop_to_select.clas.abap b/src/02/01/z2ui5_cl_pop_to_select.clas.abap index edc64fbc..102fb54e 100644 --- a/src/02/01/z2ui5_cl_pop_to_select.clas.abap +++ b/src/02/01/z2ui5_cl_pop_to_select.clas.abap @@ -1,69 +1,67 @@ CLASS z2ui5_cl_pop_to_select DEFINITION - PUBLIC - FINAL - CREATE PROTECTED . + PUBLIC FINAL + CREATE PROTECTED. PUBLIC SECTION. - INTERFACES z2ui5_if_app . + INTERFACES z2ui5_if_app. TYPES: BEGIN OF ty_s_result, row TYPE REF TO data, table TYPE REF TO data, check_confirmed TYPE abap_bool, - END OF ty_s_result . + END OF ty_s_result. - DATA ms_result TYPE ty_s_result . - DATA mr_tab TYPE REF TO data . - DATA mr_tab_popup TYPE REF TO data ##NEEDED. - DATA mr_tab_popup_backup TYPE REF TO data ##NEEDED. + DATA ms_result TYPE ty_s_result. + DATA mr_tab TYPE REF TO data. + DATA mr_tab_popup TYPE REF TO data ##NEEDED. + DATA mr_tab_popup_backup TYPE REF TO data ##NEEDED. CLASS-METHODS factory IMPORTING - !i_tab TYPE STANDARD TABLE - !i_title TYPE clike OPTIONAL - !i_sort_field TYPE clike OPTIONAL - !i_descending TYPE abap_bool OPTIONAL - !i_contentwidth TYPE clike OPTIONAL - !i_contentheight TYPE clike OPTIONAL - !i_growingthreshold TYPE clike OPTIONAL - !i_multiselect TYPE abap_bool OPTIONAL - i_event_canceled TYPE string OPTIONAL - i_event_confirmed TYPE string OPTIONAL + i_tab TYPE STANDARD TABLE + i_title TYPE clike OPTIONAL + i_sort_field TYPE clike OPTIONAL + i_descending TYPE abap_bool OPTIONAL + i_contentwidth TYPE clike OPTIONAL + i_contentheight TYPE clike OPTIONAL + i_growingthreshold TYPE clike OPTIONAL + i_multiselect TYPE abap_bool OPTIONAL + i_event_canceled TYPE string OPTIONAL + i_event_confirmed TYPE string OPTIONAL RETURNING - VALUE(r_result) TYPE REF TO z2ui5_cl_pop_to_select . + VALUE(r_result) TYPE REF TO z2ui5_cl_pop_to_select. + METHODS result RETURNING VALUE(result) TYPE ty_s_result. PROTECTED SECTION. - DATA check_initialized TYPE abap_bool . - DATA check_table_line TYPE abap_bool . - DATA client TYPE REF TO z2ui5_if_client . - DATA title TYPE string . - DATA sort_field TYPE string . - DATA content_width TYPE string . - DATA content_height TYPE string . - DATA growing_threshold TYPE string . - DATA descending TYPE abap_bool . - DATA multiselect TYPE abap_bool. - DATA event_confirmed TYPE string. - DATA event_canceled TYPE string. + DATA check_initialized TYPE abap_bool. + DATA check_table_line TYPE abap_bool. + DATA client TYPE REF TO z2ui5_if_client. + DATA title TYPE string. + DATA sort_field TYPE string. + DATA content_width TYPE string. + DATA content_height TYPE string. + DATA growing_threshold TYPE string. + DATA descending TYPE abap_bool. + DATA multiselect TYPE abap_bool. + DATA event_confirmed TYPE string. + DATA event_canceled TYPE string. + + METHODS on_event. + METHODS display. + METHODS set_output_table. + METHODS on_event_confirm. + METHODS on_event_search. - METHODS on_event . - METHODS display . - METHODS set_output_table . - METHODS on_event_confirm . - METHODS on_event_search . PRIVATE SECTION. ENDCLASS. - CLASS z2ui5_cl_pop_to_select IMPLEMENTATION. - - METHOD factory. r_result = NEW #( ). @@ -74,43 +72,47 @@ CLASS z2ui5_cl_pop_to_select IMPLEMENTATION. ELSE `Single select` ). ENDIF. - r_result->sort_field = i_sort_field. - r_result->descending = i_descending. - r_result->content_height = i_contentheight. - r_result->content_width = i_contentwidth. + r_result->sort_field = i_sort_field. + r_result->descending = i_descending. + r_result->content_height = i_contentheight. + r_result->content_width = i_contentwidth. r_result->growing_threshold = i_growingthreshold. - r_result->multiselect = i_multiselect. - r_result->event_confirmed = i_event_confirmed. - r_result->event_canceled = i_event_canceled. + r_result->multiselect = i_multiselect. + r_result->event_confirmed = i_event_confirmed. + r_result->event_canceled = i_event_canceled. - r_result->mr_tab = z2ui5_cl_util=>conv_copy_ref_data( i_tab ). + r_result->mr_tab = z2ui5_cl_util=>conv_copy_ref_data( i_tab ). CREATE DATA r_result->ms_result-row LIKE LINE OF i_tab. CREATE DATA r_result->ms_result-table LIKE i_tab. ENDMETHOD. - METHOD display. FIELD-SYMBOLS TYPE STANDARD TABLE. + ASSIGN mr_tab_popup->* TO . DATA(popup) = z2ui5_cl_xml_view=>factory_popup( ). DATA(tab) = popup->table_select_dialog( - items = `{path:'` - && client->_bind_edit( val = path = abap_true ) - && `', sorter : { path : '` && to_upper( sort_field ) && `', descending : ` - && z2ui5_cl_util=>boolean_abap_2_json( me->descending ) - && ` } }` - cancel = client->_event( 'CANCEL' ) - search = client->_event( val = 'SEARCH' t_arg = VALUE #( ( `${$parameters>/value}` ) ( `${$parameters>/clearButtonPressed}` ) ) ) - confirm = client->_event( val = 'CONFIRM' t_arg = VALUE #( ( `${$parameters>/selectedContexts[0]/sPath}` ) ) ) - growing = abap_true - contentwidth = content_width - contentheight = content_height - growingthreshold = growing_threshold - title = title - multiselect = multiselect ). + items = |\{path:'| + && client->_bind_edit( val = + path = abap_true ) + && |', sorter : \{ path : '{ to_upper( sort_field ) }', descending : | + && z2ui5_cl_util=>boolean_abap_2_json( me->descending ) + && | \} \}| + cancel = client->_event( 'CANCEL' ) + search = client->_event( + val = 'SEARCH' + t_arg = VALUE #( ( `${$parameters>/value}` ) ( `${$parameters>/clearButtonPressed}` ) ) ) + confirm = client->_event( val = 'CONFIRM' + t_arg = VALUE #( ( `${$parameters>/selectedContexts[0]/sPath}` ) ) ) + growing = abap_true + contentwidth = content_width + contentheight = content_height + growingthreshold = growing_threshold + title = title + multiselect = multiselect ). DATA(lt_comp) = z2ui5_cl_util=>rtti_get_t_attri_by_any( ). DELETE lt_comp WHERE name = 'ZZSELKZ'. @@ -120,13 +122,15 @@ CLASS z2ui5_cl_pop_to_select IMPLEMENTATION. DATA(cells) = list->cells( ). LOOP AT lt_comp INTO DATA(ls_comp). - cells->text( `{` && ls_comp-name && `}` ). + cells->text( |\{{ ls_comp-name }\}| ). ENDLOOP. DATA(columns) = tab->columns( ). LOOP AT lt_comp INTO ls_comp. DATA(text) = COND #( - LET data_element_name = substring_after( val = CAST cl_abap_elemdescr( ls_comp-type )->absolute_name sub = '\TYPE=' ) + LET data_element_name = substring_after( + val = CAST cl_abap_elemdescr( ls_comp-type )->absolute_name + sub = '\TYPE=' ) medium_label = z2ui5_cl_util=>rtti_get_data_element_texts( data_element_name )-medium IN WHEN medium_label IS NOT INITIAL THEN medium_label @@ -138,7 +142,6 @@ CLASS z2ui5_cl_pop_to_select IMPLEMENTATION. ENDMETHOD. - METHOD z2ui5_if_app~main. me->client = client. @@ -154,7 +157,6 @@ CLASS z2ui5_cl_pop_to_select IMPLEMENTATION. ENDMETHOD. - METHOD on_event. CASE client->get( )-event. @@ -163,7 +165,6 @@ CLASS z2ui5_cl_pop_to_select IMPLEMENTATION. ms_result-check_confirmed = abap_true. on_event_confirm( ). - WHEN 'CANCEL'. client->popup_destroy( ). client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ). @@ -176,23 +177,22 @@ CLASS z2ui5_cl_pop_to_select IMPLEMENTATION. ENDMETHOD. - METHOD result. result = ms_result. ENDMETHOD. - METHOD set_output_table. - FIELD-SYMBOLS TYPE any. - FIELD-SYMBOLS TYPE any. - FIELD-SYMBOLS TYPE STANDARD TABLE. - FIELD-SYMBOLS TYPE STANDARD TABLE. + FIELD-SYMBOLS TYPE any. + FIELD-SYMBOLS TYPE any. + FIELD-SYMBOLS TYPE STANDARD TABLE. + FIELD-SYMBOLS TYPE STANDARD TABLE. FIELD-SYMBOLS TYPE STANDARD TABLE. - FIELD-SYMBOLS TYPE any. + FIELD-SYMBOLS TYPE any. DATA lr_row TYPE REF TO data. + ASSIGN mr_tab->* TO . DATA(lo_type) = cl_abap_structdescr=>describe_by_data( ). @@ -203,12 +203,14 @@ CLASS z2ui5_cl_pop_to_select IMPLEMENTATION. CATCH cx_root. check_table_line = abap_true. DATA(lo_elem) = CAST cl_abap_elemdescr( lo_table->get_table_line_type( ) ). - INSERT VALUE #( name = 'TAB_LINE' type = CAST #( lo_elem ) ) INTO TABLE lt_comp. + INSERT VALUE #( name = 'TAB_LINE' + type = CAST #( lo_elem ) ) INTO TABLE lt_comp. ENDTRY. IF NOT line_exists( lt_comp[ name = `ZZSELKZ` ] ). DATA(lo_type_bool) = cl_abap_structdescr=>describe_by_name( 'ABAP_BOOL' ). - INSERT VALUE #( name = `ZZSELKZ` type = CAST #( lo_type_bool ) ) INTO TABLE lt_comp. + INSERT VALUE #( name = `ZZSELKZ` + type = CAST #( lo_type_bool ) ) INTO TABLE lt_comp. ENDIF. DATA(lo_line_type) = cl_abap_structdescr=>create( lt_comp ). @@ -240,12 +242,13 @@ CLASS z2ui5_cl_pop_to_select IMPLEMENTATION. METHOD on_event_confirm. - FIELD-SYMBOLS TYPE STANDARD TABLE. - FIELD-SYMBOLS TYPE any. - FIELD-SYMBOLS TYPE any. - FIELD-SYMBOLS TYPE any. - FIELD-SYMBOLS TYPE ANY TABLE. + FIELD-SYMBOLS TYPE STANDARD TABLE. + FIELD-SYMBOLS TYPE any. + FIELD-SYMBOLS TYPE any. + FIELD-SYMBOLS TYPE any. + FIELD-SYMBOLS TYPE ANY TABLE. FIELD-SYMBOLS TYPE any. + ASSIGN mr_tab_popup->* TO . ASSIGN ms_result-table->* TO . @@ -277,17 +280,17 @@ CLASS z2ui5_cl_pop_to_select IMPLEMENTATION. client->popup_destroy( ). client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ). - client->follow_up_action( client->_event( val = event_confirmed r_data = ) ). + client->follow_up_action( client->_event( val = event_confirmed + r_data = ) ). ENDMETHOD. - METHOD on_event_search. - FIELD-SYMBOLS TYPE STANDARD TABLE. + FIELD-SYMBOLS TYPE STANDARD TABLE. FIELD-SYMBOLS TYPE STANDARD TABLE. - FIELD-SYMBOLS TYPE any. - FIELD-SYMBOLS TYPE any. + FIELD-SYMBOLS TYPE any. + FIELD-SYMBOLS TYPE any. DATA(lt_arg) = client->get( )-t_event_arg. READ TABLE lt_arg INTO DATA(ls_arg) INDEX 1. @@ -302,7 +305,7 @@ CLASS z2ui5_cl_pop_to_select IMPLEMENTATION. LOOP AT ASSIGNING . DATA(lv_check_continue) = abap_false. LOOP AT lt_comp INTO DATA(ls_comp). - DATA(lv_assign) = '-' && ls_comp-name. + DATA(lv_assign) = |-{ ls_comp-name }|. ASSIGN (lv_assign) TO . ASSERT sy-subrc = 0. IF to_upper( ) CS to_upper( ls_arg ). @@ -318,5 +321,4 @@ CLASS z2ui5_cl_pop_to_select IMPLEMENTATION. client->popup_model_update( ). ENDMETHOD. - ENDCLASS. diff --git a/src/02/z2ui5_cl_app_startup.clas.testclasses.abap b/src/02/z2ui5_cl_app_startup.clas.testclasses.abap index efb5713d..16808fbb 100644 --- a/src/02/z2ui5_cl_app_startup.clas.testclasses.abap +++ b/src/02/z2ui5_cl_app_startup.clas.testclasses.abap @@ -1,6 +1,5 @@ -CLASS ltcl_app_startup_test DEFINITION FINAL FOR TESTING - DURATION SHORT - RISK LEVEL DANGEROUS. +CLASS ltcl_app_startup_test DEFINITION FINAL + FOR TESTING RISK LEVEL DANGEROUS DURATION SHORT. PRIVATE SECTION. METHODS first_test FOR TESTING RAISING cx_static_check. @@ -9,11 +8,9 @@ ENDCLASS. CLASS ltcl_app_startup_test IMPLEMENTATION. - METHOD first_test. DATA(lo_app) = z2ui5_cl_app_startup=>factory( ) ##NEEDED. ENDMETHOD. - ENDCLASS. diff --git a/src/02/z2ui5_cl_xml_view.clas.testclasses.abap b/src/02/z2ui5_cl_xml_view.clas.testclasses.abap index a813318d..89f294ec 100644 --- a/src/02/z2ui5_cl_xml_view.clas.testclasses.abap +++ b/src/02/z2ui5_cl_xml_view.clas.testclasses.abap @@ -1,14 +1,13 @@ -CLASS ltcl_unit_test DEFINITION FINAL FOR TESTING - DURATION MEDIUM - RISK LEVEL DANGEROUS. +CLASS ltcl_unit_test DEFINITION FINAL + FOR TESTING RISK LEVEL DANGEROUS DURATION MEDIUM. PRIVATE SECTION. - METHODS test_create FOR TESTING RAISING cx_static_check. + METHODS test_create FOR TESTING RAISING cx_static_check. ENDCLASS. -CLASS ltcl_unit_test IMPLEMENTATION. +CLASS ltcl_unit_test IMPLEMENTATION. METHOD test_create. DATA(lo_view) = z2ui5_cl_xml_view=>factory( ). @@ -19,5 +18,4 @@ CLASS ltcl_unit_test IMPLEMENTATION. ENDIF. ENDMETHOD. - ENDCLASS. diff --git a/src/02/z2ui5_if_app.intf.abap b/src/02/z2ui5_if_app.intf.abap index 84a3b32b..ef853cf5 100644 --- a/src/02/z2ui5_if_app.intf.abap +++ b/src/02/z2ui5_if_app.intf.abap @@ -6,13 +6,13 @@ INTERFACE z2ui5_if_app PUBLIC. CONSTANTS author TYPE string VALUE 'https://github.com/oblomov-dev'. CONSTANTS license TYPE string VALUE 'MIT'. - DATA id_draft TYPE string. - DATA id_app TYPE string. + DATA id_draft TYPE string. + DATA id_app TYPE string. DATA check_initialized TYPE abap_bool. - DATA check_sticky TYPE abap_bool. + DATA check_sticky TYPE abap_bool. METHODS main IMPORTING - client TYPE REF TO z2ui5_if_client. + !client TYPE REF TO z2ui5_if_client. ENDINTERFACE. diff --git a/src/02/z2ui5_if_client.intf.abap b/src/02/z2ui5_if_client.intf.abap index beac9c8e..ab3d1fdc 100644 --- a/src/02/z2ui5_if_client.intf.abap +++ b/src/02/z2ui5_if_client.intf.abap @@ -41,7 +41,7 @@ INTERFACE z2ui5_if_client METHODS nest_view_display IMPORTING val TYPE clike - id TYPE clike + !id TYPE clike method_insert TYPE clike method_destroy TYPE clike OPTIONAL. @@ -51,7 +51,7 @@ INTERFACE z2ui5_if_client METHODS nest2_view_display IMPORTING val TYPE clike - id TYPE clike + !id TYPE clike method_insert TYPE clike method_destroy TYPE clike OPTIONAL. @@ -70,7 +70,7 @@ INTERFACE z2ui5_if_client METHODS popover_display IMPORTING - xml TYPE clike + !xml TYPE clike by_id TYPE clike. METHODS popover_destroy. @@ -87,7 +87,7 @@ INTERFACE z2ui5_if_client METHODS get_app IMPORTING - id TYPE clike OPTIONAL + !id TYPE clike OPTIONAL RETURNING VALUE(result) TYPE REF TO z2ui5_if_app. @@ -105,42 +105,42 @@ INTERFACE z2ui5_if_client METHODS message_box_display IMPORTING - text TYPE any - type TYPE clike DEFAULT `information` - title TYPE clike OPTIONAL - styleclass TYPE clike OPTIONAL - onclose TYPE clike OPTIONAL + !text TYPE any + !type TYPE clike DEFAULT `information` + !title TYPE clike OPTIONAL + styleclass TYPE clike OPTIONAL + onclose TYPE clike OPTIONAL actions TYPE string_table OPTIONAL - emphasizedaction TYPE clike OPTIONAL - initialfocus TYPE clike OPTIONAL - textdirection TYPE clike OPTIONAL - icon TYPE clike OPTIONAL - details TYPE clike OPTIONAL - closeonnavigation TYPE abap_bool DEFAULT abap_true. + emphasizedaction TYPE clike OPTIONAL + initialfocus TYPE clike OPTIONAL + textdirection TYPE clike OPTIONAL + !icon TYPE clike OPTIONAL + details TYPE clike OPTIONAL + closeonnavigation TYPE abap_bool DEFAULT abap_true. METHODS message_toast_display IMPORTING - text TYPE clike - duration TYPE clike OPTIONAL - width TYPE clike OPTIONAL - my TYPE clike OPTIONAL - at TYPE clike OPTIONAL - of TYPE clike OPTIONAL - offset TYPE clike OPTIONAL - collision TYPE clike OPTIONAL - onclose TYPE clike DEFAULT `` + !text TYPE clike + !duration TYPE clike OPTIONAL + !width TYPE clike OPTIONAL + my TYPE clike OPTIONAL + !at TYPE clike OPTIONAL + !of TYPE clike OPTIONAL + !offset TYPE clike OPTIONAL + collision TYPE clike OPTIONAL + onclose TYPE clike DEFAULT `` autoclose TYPE abap_bool DEFAULT abap_true - animationtimingfunction TYPE clike OPTIONAL - animationduration TYPE clike OPTIONAL + animationtimingfunction TYPE clike OPTIONAL + animationduration TYPE clike OPTIONAL closeonbrowsernavigation TYPE abap_bool DEFAULT abap_true - class TYPE clike OPTIONAL. + !class TYPE clike OPTIONAL. METHODS _event IMPORTING - val TYPE clike OPTIONAL - t_arg TYPE string_table OPTIONAL + val TYPE clike OPTIONAL + t_arg TYPE string_table OPTIONAL s_ctrl TYPE z2ui5_if_types=>ty_s_event_control OPTIONAL - r_data type data optional + r_data TYPE data OPTIONAL PREFERRED PARAMETER val RETURNING VALUE(result) TYPE string. @@ -155,34 +155,34 @@ INTERFACE z2ui5_if_client METHODS _bind IMPORTING val TYPE data - path TYPE abap_bool DEFAULT abap_false + !path TYPE abap_bool DEFAULT abap_false custom_mapper TYPE REF TO z2ui5_if_ajson_mapping OPTIONAL - custom_filter TYPE REF TO z2ui5_if_ajson_filter OPTIONAL - tab TYPE data OPTIONAL - tab_index TYPE i OPTIONAL + custom_filter TYPE REF TO z2ui5_if_ajson_filter OPTIONAL + !tab TYPE data OPTIONAL + tab_index TYPE i OPTIONAL RETURNING VALUE(result) TYPE string. METHODS _bind_edit IMPORTING val TYPE data - path TYPE abap_bool DEFAULT abap_false - view TYPE string DEFAULT z2ui5_if_client=>cs_view-main + !path TYPE abap_bool DEFAULT abap_false + view TYPE string DEFAULT z2ui5_if_client=>cs_view-main custom_mapper TYPE REF TO z2ui5_if_ajson_mapping OPTIONAL custom_mapper_back TYPE REF TO z2ui5_if_ajson_mapping OPTIONAL - custom_filter TYPE REF TO z2ui5_if_ajson_filter OPTIONAL - custom_filter_back TYPE REF TO z2ui5_if_ajson_filter OPTIONAL - tab TYPE data OPTIONAL - tab_index TYPE i OPTIONAL + custom_filter TYPE REF TO z2ui5_if_ajson_filter OPTIONAL + custom_filter_back TYPE REF TO z2ui5_if_ajson_filter OPTIONAL + !tab TYPE data OPTIONAL + tab_index TYPE i OPTIONAL RETURNING VALUE(result) TYPE string. METHODS _bind_local IMPORTING val TYPE data - path TYPE abap_bool DEFAULT abap_false + !path TYPE abap_bool DEFAULT abap_false custom_mapper TYPE REF TO z2ui5_if_ajson_mapping OPTIONAL - custom_filter TYPE REF TO z2ui5_if_ajson_filter OPTIONAL + custom_filter TYPE REF TO z2ui5_if_ajson_filter OPTIONAL RETURNING VALUE(result) TYPE string. @@ -192,18 +192,18 @@ INTERFACE z2ui5_if_client METHODS check_on_init RETURNING - value(result) TYPE abap_bool. + VALUE(result) TYPE abap_bool. METHODS check_app_prev_stack RETURNING - value(result) TYPE abap_bool. + VALUE(result) TYPE abap_bool. METHODS check_on_navigated RETURNING - value(result) TYPE abap_bool. + VALUE(result) TYPE abap_bool. METHODS get_app_prev RETURNING - value(result) TYPE REF TO z2ui5_if_app. + VALUE(result) TYPE REF TO z2ui5_if_app. ENDINTERFACE. diff --git a/src/02/z2ui5_if_types.intf.abap b/src/02/z2ui5_if_types.intf.abap index 39f041e7..ed509bee 100644 --- a/src/02/z2ui5_if_types.intf.abap +++ b/src/02/z2ui5_if_types.intf.abap @@ -46,7 +46,7 @@ INTERFACE z2ui5_if_types s_draft TYPE ty_s_draft, s_config TYPE ty_s_config, t_comp_params TYPE ty_t_name_value, - r_event_data type ref to data, + r_event_data TYPE REF TO data, END OF ty_s_get. TYPES: