From 9c04f9ee5071824b93c5eacdf6af9d236a3d98f0 Mon Sep 17 00:00:00 2001 From: oblomov-dev Date: Sun, 27 Oct 2024 01:49:29 +0000 Subject: [PATCH] [create-pull-request] automated change --- src/01/00/02/z2ui6_cl_abap_api_http.clas.abap | 4 +- src/01/00/03/z2ui6_cl_util.clas.abap | 168 +++- ...abap => z2ui6_cl_core_srv_draft.clas.abap} | 4 +- ...6_cl_core_srv_draft.clas.testclasses.abap} | 2 +- ...s.xml => z2ui6_cl_core_srv_draft.clas.xml} | 2 +- src/01/02/z2ui6_cl_core_action.clas.abap | 16 +- ...z2ui6_cl_core_action.clas.testclasses.abap | 2 +- src/01/02/z2ui6_cl_core_app.clas.abap | 21 +- src/01/02/z2ui6_cl_core_app_startup.clas.abap | 54 +- src/01/02/z2ui6_cl_core_client.clas.abap | 117 ++- ...z2ui6_cl_core_client.clas.testclasses.abap | 2 +- ...s.abap => z2ui6_cl_core_handler.clas.abap} | 19 +- ...ui6_cl_core_handler.clas.testclasses.abap} | 4 +- ...las.xml => z2ui6_cl_core_handler.clas.xml} | 2 +- ...abap => z2ui6_cl_core_srv_attri.clas.abap} | 6 +- ...6_cl_core_srv_attri.clas.testclasses.abap} | 14 +- ...s.xml => z2ui6_cl_core_srv_attri.clas.xml} | 2 +- ....abap => z2ui6_cl_core_srv_bind.clas.abap} | 8 +- ...i6_cl_core_srv_bind.clas.testclasses.abap} | 26 +- ...as.xml => z2ui6_cl_core_srv_bind.clas.xml} | 2 +- ....abap => z2ui6_cl_core_srv_diss.clas.abap} | 8 +- ...i6_cl_core_srv_diss.clas.testclasses.abap} | 20 +- ...as.xml => z2ui6_cl_core_srv_diss.clas.xml} | 2 +- ...abap => z2ui6_cl_core_srv_event.clas.abap} | 12 +- ...6_cl_core_srv_event.clas.testclasses.abap} | 4 +- ...s.xml => z2ui6_cl_core_srv_event.clas.xml} | 2 +- ....abap => z2ui6_cl_core_srv_json.clas.abap} | 10 +- ...i6_cl_core_srv_json.clas.testclasses.abap} | 4 +- ...as.xml => z2ui6_cl_core_srv_json.clas.xml} | 2 +- src/01/02/z2ui6_if_core_types.intf.abap | 18 +- src/01/03/z2ui6_cl_app_app_js.clas.abap | 1 + src/01/03/z2ui6_cl_app_view1_js.clas.abap | 847 +++++++++--------- src/02/01/z2ui6_cl_pop_messages.clas.abap | 67 +- src/02/01/z2ui6_cl_pop_to_confirm.clas.abap | 20 +- src/02/01/z2ui6_cl_pop_to_select.clas.abap | 19 +- src/02/z2ui6_cl_http_handler.clas.abap | 244 +++-- src/02/z2ui6_cl_xml_view.clas.abap | 2 +- src/02/z2ui6_if_app.intf.abap | 1 + src/02/z2ui6_if_client.intf.abap | 19 +- src/02/z2ui6_if_types.intf.abap | 2 +- 40 files changed, 1088 insertions(+), 691 deletions(-) rename src/01/01/{z2ui6_cl_core_draft_srv.clas.abap => z2ui6_cl_core_srv_draft.clas.abap} (96%) rename src/01/01/{z2ui6_cl_core_draft_srv.clas.testclasses.abap => z2ui6_cl_core_srv_draft.clas.testclasses.abap} (91%) rename src/01/01/{z2ui6_cl_core_draft_srv.clas.xml => z2ui6_cl_core_srv_draft.clas.xml} (91%) rename src/01/02/{z2ui6_cl_core_http_post.clas.abap => z2ui6_cl_core_handler.clas.abap} (88%) rename src/01/02/{z2ui6_cl_core_http_post.clas.testclasses.abap => z2ui6_cl_core_handler.clas.testclasses.abap} (85%) rename src/01/02/{z2ui6_cl_core_http_post.clas.xml => z2ui6_cl_core_handler.clas.xml} (91%) rename src/01/02/{z2ui6_cl_core_attri_srv.clas.abap => z2ui6_cl_core_srv_attri.clas.abap} (97%) rename src/01/02/{z2ui6_cl_core_attri_srv.clas.testclasses.abap => z2ui6_cl_core_srv_attri.clas.testclasses.abap} (93%) rename src/01/02/{z2ui6_cl_core_attri_srv.clas.xml => z2ui6_cl_core_srv_attri.clas.xml} (91%) rename src/01/02/{z2ui6_cl_core_bind_srv.clas.abap => z2ui6_cl_core_srv_bind.clas.abap} (97%) rename src/01/02/{z2ui6_cl_core_bind_srv.clas.testclasses.abap => z2ui6_cl_core_srv_bind.clas.testclasses.abap} (92%) rename src/01/02/{z2ui6_cl_core_bind_srv.clas.xml => z2ui6_cl_core_srv_bind.clas.xml} (91%) rename src/01/02/{z2ui6_cl_core_diss_srv.clas.abap => z2ui6_cl_core_srv_diss.clas.abap} (96%) rename src/01/02/{z2ui6_cl_core_diss_srv.clas.testclasses.abap => z2ui6_cl_core_srv_diss.clas.testclasses.abap} (93%) rename src/01/02/{z2ui6_cl_core_diss_srv.clas.xml => z2ui6_cl_core_srv_diss.clas.xml} (91%) rename src/01/02/{z2ui6_cl_core_event_srv.clas.abap => z2ui6_cl_core_srv_event.clas.abap} (82%) rename src/01/02/{z2ui6_cl_core_event_srv.clas.testclasses.abap => z2ui6_cl_core_srv_event.clas.testclasses.abap} (86%) rename src/01/02/{z2ui6_cl_core_event_srv.clas.xml => z2ui6_cl_core_srv_event.clas.xml} (91%) rename src/01/02/{z2ui6_cl_core_json_srv.clas.abap => z2ui6_cl_core_srv_json.clas.abap} (95%) rename src/01/02/{z2ui6_cl_core_json_srv.clas.testclasses.abap => z2ui6_cl_core_srv_json.clas.testclasses.abap} (90%) rename src/01/02/{z2ui6_cl_core_json_srv.clas.xml => z2ui6_cl_core_srv_json.clas.xml} (91%) diff --git a/src/01/00/02/z2ui6_cl_abap_api_http.clas.abap b/src/01/00/02/z2ui6_cl_abap_api_http.clas.abap index cf354596..845f7eb0 100644 --- a/src/01/00/02/z2ui6_cl_abap_api_http.clas.abap +++ b/src/01/00/02/z2ui6_cl_abap_api_http.clas.abap @@ -58,12 +58,10 @@ CLASS z2ui6_cl_abap_api_http DEFINITION PUBLIC. v TYPE clike. DATA mo_server_onprem TYPE REF TO object. - - PROTECTED SECTION. - DATA mo_request_cloud TYPE REF TO object. DATA mo_response_cloud TYPE REF TO object. + PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. diff --git a/src/01/00/03/z2ui6_cl_util.clas.abap b/src/01/00/03/z2ui6_cl_util.clas.abap index 2b4566f9..442efda4 100644 --- a/src/01/00/03/z2ui6_cl_util.clas.abap +++ b/src/01/00/03/z2ui6_cl_util.clas.abap @@ -58,6 +58,31 @@ CLASS z2ui6_cl_util DEFINITION t_filter TYPE ty_t_filter_multi, END OF ty_s_sql. + TYPES: + BEGIN OF ty_S_msg, + text TYPE string, + id TYPE string, + no TYPE string, + type TYPE string, + v1 TYPE string, + v2 TYPE string, + v3 TYPE string, + v4 TYPE string, + END OF ty_s_msg, + ty_T_msg TYPE STANDARD TABLE OF ty_S_msg WITH EMPTY KEY. + + CLASS-METHODS ui5_get_msg_type + IMPORTING + val TYPE clike + RETURNING + VALUE(result) TYPE string. + + CLASS-METHODS msg_get + IMPORTING + val TYPE any + RETURNING + VALUE(result) TYPE ty_T_msg. + CLASS-METHODS rtti_get_t_attri_by_include IMPORTING type TYPE REF TO cl_abap_datadescr @@ -425,6 +450,11 @@ CLASS z2ui6_cl_util DEFINITION VALUE(result) TYPE string. CLASS-METHODS check_raise_srtti_installed. + CLASS-METHODS rtti_check_clike + IMPORTING + val TYPE any + RETURNING + VALUE(result) TYPE abap_bool. PROTECTED SECTION. PRIVATE SECTION. @@ -1294,10 +1324,7 @@ CLASS z2ui6_cl_util IMPLEMENTATION. IF rtti_check_class_exists( 'ZCL_SRTTI_TYPEDESCR' ) = abap_false. - DATA(lv_link) = `https://github.com/sandraros/S-RTTI`. - DATA(lv_text) = `

Please install the open-source project S-RTTI by sandraros and try again: (link)

`. - + 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 z2ui6_cx_util_error EXPORTING val = lv_text. @@ -1419,4 +1446,137 @@ CLASS z2ui6_cl_util IMPLEMENTATION. ENDMETHOD. + + METHOD msg_get. + + DATA(lv_kind) = z2ui6_cl_util=>rtti_get_type_kind( val ). + CASE lv_kind. + + WHEN cl_abap_datadescr=>typekind_table. + FIELD-SYMBOLS TYPE STANDARD TABLE. + ASSIGN val TO . + LOOP AT ASSIGNING FIELD-SYMBOL(). + DATA(lt_tab) = msg_get( ). + INSERT LINES OF lt_tab INTO TABLE result. + ENDLOOP. + + WHEN cl_abap_datadescr=>typekind_struct1 OR cl_abap_datadescr=>typekind_struct2. + + IF val IS INITIAL. + RETURN. + ENDIF. + + DATA(lt_attri) = z2ui6_cl_util=>rtti_get_t_attri_by_any( val ). + + DATA(ls_result) = VALUE ty_s_msg( ). + LOOP AT lt_attri REFERENCE INTO DATA(ls_attri). + DATA(lv_name) = 'VAL-' && ls_attri->name. + ASSIGN (lv_name) TO FIELD-SYMBOL(). + CASE ls_attri->name. + WHEN 'ID' OR 'MSGID'. + ls_result-id = . + WHEN 'NO' OR 'NUMBER' OR 'MSGNO'. + ls_result-no = . + WHEN 'MESSAGE' OR 'TEXT'. + ls_result-text = . + WHEN 'TYPE' OR 'MSGTY'. + ls_result-type = . + WHEN 'MESSAGE_V1' OR 'MSGV1' OR 'V1'. + ls_result-v1 = . + WHEN 'MESSAGE_V2' OR 'MSGV2' OR 'V2'. + ls_result-v2 = . + WHEN 'MESSAGE_V3' OR 'MSGV3' OR 'V3'. + ls_result-v3 = . + WHEN 'MESSAGE_V4' OR 'MSGV4' OR 'V4'. + ls_result-v4 = . + ENDCASE. + 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. + 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( ) + ). + + DATA(lt_attri_o) = z2ui6_cl_util=>rtti_get_t_attri_by_oref( val ). + LOOP AT lt_attri_o REFERENCE INTO DATA(ls_attri_o) + WHERE visibility = 'U'. + CASE ls_attri_o->name. + WHEN 'ID' OR 'MSGID'. + ASSIGN val->(ls_attri_o->name) TO . + ls_result-id = . + WHEN 'NO' OR 'NUMBER' OR 'MSGNO'. + ASSIGN val->(ls_attri_o->name) TO . + ls_result-no = . + WHEN 'MESSAGE'. + ASSIGN val->(ls_attri_o->name) TO . + ls_result-text = . + WHEN 'TYPE' OR 'MSGTY'. + ASSIGN val->(ls_attri_o->name) TO . + ls_result-type = . + WHEN 'MESSAGE_V1' OR 'MSGV1'. + ASSIGN val->(ls_attri_o->name) TO . + ls_result-v1 = . + WHEN 'MESSAGE_V2' OR 'MSGV2'. + ASSIGN val->(ls_attri_o->name) TO . + ls_result-v2 = . + WHEN 'MESSAGE_V3' OR 'MSGV3'. + ASSIGN val->(ls_attri_o->name) TO . + ls_result-v3 = . + WHEN 'MESSAGE_V4' OR 'MSGV4'. + ASSIGN val->(ls_attri_o->name) TO . + ls_result-v4 = . + ENDCASE. + + 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 INTO ls_result-text. +* ENDIF. + INSERT ls_result INTO TABLE result. + CATCH cx_root. + ENDTRY. + + WHEN OTHERS. + + IF rtti_check_clike( val ). + INSERT VALUE #( + text = val + ) + INTO TABLE result. + ENDIF. + ENDCASE. + + ENDMETHOD. + + + METHOD rtti_check_clike. + + DATA(lv_type) = rtti_get_type_kind( val ). + CASE lv_type. + WHEN cl_abap_datadescr=>typekind_char OR + cl_abap_datadescr=>typekind_clike OR + cl_abap_datadescr=>typekind_csequence OR + cl_abap_datadescr=>typekind_string. + result = abap_true. + ENDCASE. + + ENDMETHOD. + + METHOD ui5_get_msg_type. + + result = SWITCH #( val WHEN 'E' THEN `Error` + WHEN 'S' THEN `Success` WHEN `W` THEN `Warning` + else `Information` + ). + + ENDMETHOD. + ENDCLASS. diff --git a/src/01/01/z2ui6_cl_core_draft_srv.clas.abap b/src/01/01/z2ui6_cl_core_srv_draft.clas.abap similarity index 96% rename from src/01/01/z2ui6_cl_core_draft_srv.clas.abap rename to src/01/01/z2ui6_cl_core_srv_draft.clas.abap index ad9be9bf..1e138f05 100644 --- a/src/01/01/z2ui6_cl_core_draft_srv.clas.abap +++ b/src/01/01/z2ui6_cl_core_srv_draft.clas.abap @@ -1,4 +1,4 @@ -CLASS z2ui6_cl_core_draft_srv DEFINITION +CLASS z2ui6_cl_core_srv_draft DEFINITION PUBLIC FINAL CREATE PUBLIC . @@ -42,7 +42,7 @@ ENDCLASS. -CLASS z2ui6_cl_core_draft_srv IMPLEMENTATION. +CLASS z2ui6_cl_core_srv_draft IMPLEMENTATION. METHOD cleanup. diff --git a/src/01/01/z2ui6_cl_core_draft_srv.clas.testclasses.abap b/src/01/01/z2ui6_cl_core_srv_draft.clas.testclasses.abap similarity index 91% rename from src/01/01/z2ui6_cl_core_draft_srv.clas.testclasses.abap rename to src/01/01/z2ui6_cl_core_srv_draft.clas.testclasses.abap index 2fb9e394..47055798 100644 --- a/src/01/01/z2ui6_cl_core_draft_srv.clas.testclasses.abap +++ b/src/01/01/z2ui6_cl_core_srv_draft.clas.testclasses.abap @@ -20,7 +20,7 @@ CLASS ltcl_test IMPLEMENTATION. METHOD test_create. - DATA(lo_draft) = NEW z2ui6_cl_core_draft_srv( ). + DATA(lo_draft) = NEW z2ui6_cl_core_srv_draft( ). lo_draft->create( draft = VALUE #( id = `TEST_ID` ) diff --git a/src/01/01/z2ui6_cl_core_draft_srv.clas.xml b/src/01/01/z2ui6_cl_core_srv_draft.clas.xml similarity index 91% rename from src/01/01/z2ui6_cl_core_draft_srv.clas.xml rename to src/01/01/z2ui6_cl_core_srv_draft.clas.xml index 9bc01e8c..7b889401 100644 --- a/src/01/01/z2ui6_cl_core_draft_srv.clas.xml +++ b/src/01/01/z2ui6_cl_core_srv_draft.clas.xml @@ -3,7 +3,7 @@ - Z2UI6_CL_CORE_DRAFT_SRV + Z2UI6_CL_CORE_SRV_DRAFT E abap2UI5 - backend drafts 1 diff --git a/src/01/02/z2ui6_cl_core_action.clas.abap b/src/01/02/z2ui6_cl_core_action.clas.abap index 3b7d71de..de861d1b 100644 --- a/src/01/02/z2ui6_cl_core_action.clas.abap +++ b/src/01/02/z2ui6_cl_core_action.clas.abap @@ -5,7 +5,7 @@ CLASS z2ui6_cl_core_action DEFINITION PUBLIC SECTION. - DATA mo_http_post TYPE REF TO z2ui6_cl_core_http_post. + DATA mo_http_post TYPE REF TO z2ui6_cl_core_handler. DATA mo_app TYPE REF TO z2ui6_cl_core_app. DATA ms_actual TYPE z2ui6_if_core_types=>ty_s_actual. @@ -33,7 +33,7 @@ CLASS z2ui6_cl_core_action DEFINITION METHODS constructor IMPORTING - val TYPE REF TO z2ui6_cl_core_http_post. + val TYPE REF TO z2ui6_cl_core_handler. PROTECTED SECTION. @@ -122,7 +122,7 @@ CLASS z2ui6_cl_core_action IMPLEMENTATION. "check for new app? TRY. - DATA(lo_draft) = NEW z2ui6_cl_core_draft_srv( ). + DATA(lo_draft) = NEW z2ui6_cl_core_srv_draft( ). DATA(ls_draft) = lo_draft->read_info( ms_next-o_app_leave->id_draft ). CATCH cx_root. result->mo_app->ms_draft-id_prev_app_stack = mo_app->ms_draft-id_prev_app_stack. @@ -176,6 +176,16 @@ CLASS z2ui6_cl_core_action IMPLEMENTATION. result->ms_next-s_set-s_view_nest2-check_update_model = abap_false. 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']) + 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. + ENDIF. + result->ms_actual-r_data = ms_next-r_data. + CLEAR result->ms_next-s_set-s_msg_box. CLEAR result->ms_next-s_set-s_msg_toast. diff --git a/src/01/02/z2ui6_cl_core_action.clas.testclasses.abap b/src/01/02/z2ui6_cl_core_action.clas.testclasses.abap index 7ee115d0..899e17c9 100644 --- a/src/01/02/z2ui6_cl_core_action.clas.testclasses.abap +++ b/src/01/02/z2ui6_cl_core_action.clas.testclasses.abap @@ -13,7 +13,7 @@ CLASS ltcl_test IMPLEMENTATION. METHOD first_test. - DATA(lo_http) = NEW z2ui6_cl_core_http_post( `` ). + DATA(lo_http) = NEW z2ui6_cl_core_handler( `` ). DATA(lo_action) = NEW z2ui6_cl_core_action( lo_http ) ##NEEDED. ENDMETHOD. diff --git a/src/01/02/z2ui6_cl_core_app.clas.abap b/src/01/02/z2ui6_cl_core_app.clas.abap index 8dbce3d4..263cfb57 100644 --- a/src/01/02/z2ui6_cl_core_app.clas.abap +++ b/src/01/02/z2ui6_cl_core_app.clas.abap @@ -69,7 +69,7 @@ CLASS z2ui6_cl_core_app IMPLEMENTATION. TRY. - DATA(lo_model) = NEW z2ui6_cl_core_attri_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_attri( attri = mt_attri app = mo_app ). lo_model->attri_before_save( ). @@ -82,13 +82,13 @@ CLASS z2ui6_cl_core_app IMPLEMENTATION. CLEAR mt_attri->*. - DATA(lo_dissolver) = NEW z2ui6_cl_core_diss_srv( + DATA(lo_dissolver) = NEW z2ui6_cl_core_srv_diss( attri = mt_attri app = mo_app ). lo_dissolver->main( ). lo_dissolver->main( ). - lo_model = NEW z2ui6_cl_core_attri_srv( + lo_model = NEW z2ui6_cl_core_srv_attri( attri = mt_attri app = mo_app ). lo_model->attri_before_save( ). @@ -116,11 +116,11 @@ CLASS z2ui6_cl_core_app IMPLEMENTATION. METHOD db_load. - DATA(lo_db) = NEW z2ui6_cl_core_draft_srv( ). + DATA(lo_db) = NEW z2ui6_cl_core_srv_draft( ). DATA(ls_db) = lo_db->read_draft( id ). result = all_xml_parse( ls_db-data ). - DATA(lo_model) = NEW z2ui6_cl_core_attri_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_attri( attri = result->mt_attri app = result->mo_app ). @@ -131,13 +131,13 @@ CLASS z2ui6_cl_core_app IMPLEMENTATION. METHOD db_load_by_app. - DATA(lo_db) = NEW z2ui6_cl_core_draft_srv( ). + DATA(lo_db) = NEW z2ui6_cl_core_srv_draft( ). DATA(ls_db) = lo_db->read_draft( app->id_draft ). result = all_xml_parse( ls_db-data ). result->mo_app = app. - DATA(lo_model) = NEW z2ui6_cl_core_attri_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_attri( attri = result->mt_attri app = result->mo_app ). @@ -150,9 +150,10 @@ CLASS z2ui6_cl_core_app IMPLEMENTATION. IF mo_app IS BOUND. CAST z2ui6_if_app( mo_app )->id_draft = ms_draft-id. + CAST z2ui6_if_app( mo_app )->check_initialized = abap_true. ENDIF. - DATA(lo_db) = NEW z2ui6_cl_core_draft_srv( ). + DATA(lo_db) = NEW z2ui6_cl_core_srv_draft( ). lo_db->create( draft = ms_draft model_xml = all_xml_stringify( ) ). @@ -162,7 +163,7 @@ CLASS z2ui6_cl_core_app IMPLEMENTATION. METHOD model_json_parse. - DATA(lo_json_mapper) = NEW z2ui6_cl_core_json_srv( ). + DATA(lo_json_mapper) = NEW z2ui6_cl_core_srv_json( ). lo_json_mapper->model_front_to_back( view = iv_view t_attri = mt_attri @@ -173,7 +174,7 @@ CLASS z2ui6_cl_core_app IMPLEMENTATION. METHOD model_json_stringify. - DATA(lo_json_mapper) = NEW z2ui6_cl_core_json_srv( ). + DATA(lo_json_mapper) = NEW z2ui6_cl_core_srv_json( ). result = lo_json_mapper->model_back_to_front( mt_attri ). ENDMETHOD. diff --git a/src/01/02/z2ui6_cl_core_app_startup.clas.abap b/src/01/02/z2ui6_cl_core_app_startup.clas.abap index 257a0f08..9c33634f 100644 --- a/src/01/02/z2ui6_cl_core_app_startup.clas.abap +++ b/src/01/02/z2ui6_cl_core_app_startup.clas.abap @@ -81,11 +81,11 @@ CLASS z2ui6_cl_core_app_startup IMPLEMENTATION. METHOD view_display_start. - DATA(page2) = z2ui6_cl_xml_view=>factory( )->shell( )->page( + DATA(page) = z2ui6_cl_xml_view=>factory( )->shell( )->page( title = `abap2UI5 - Developing UI5 Apps Purely in ABAP` shownavbutton = abap_false ). - page2->header_content( + page->header_content( )->toolbar_spacer( )->button( text = `Debugging Tools` icon = `sap-icon://enablement` press = client->_event( `OPEN_DEBUG` ) @@ -93,7 +93,7 @@ CLASS z2ui6_cl_core_app_startup IMPLEMENTATION. press = client->_event( `OPEN_INFO` ) ). - DATA(simple_form2) = page2->simple_form( + DATA(simple_form) = page->simple_form( editable = abap_true layout = `ResponsiveGridLayout` labelspanxl = `4` @@ -111,8 +111,8 @@ CLASS z2ui6_cl_core_app_startup IMPLEMENTATION. singlecontainerfullsize = abap_false )->content( `form` ). - simple_form2->toolbar( )->title( `Quickstart` ). - simple_form2->label( `Step 1` + simple_form->toolbar( )->title( `Quickstart` ). + simple_form->label( `Step 1` )->text( `Create a new class in your ABAP system` )->label( `Step 2` )->text( `Add the interface: Z2UI5_IF_APP` @@ -126,7 +126,7 @@ CLASS z2ui6_cl_core_app_startup IMPLEMENTATION. IF ms_home-class_editable = abap_true. - simple_form2->input( placeholder = `fill in the class name and press 'check'` + simple_form->input( placeholder = `fill in the class name and press 'check'` enabled = client->_bind( ms_home-class_editable ) value = client->_bind_edit( ms_home-classname ) submit = client->_event( ms_home-btn_event_id ) @@ -135,15 +135,15 @@ CLASS z2ui6_cl_core_app_startup IMPLEMENTATION. width = `70%` ). ELSE. - simple_form2->text( ms_home-classname ). + simple_form->text( ms_home-classname ). ENDIF. - simple_form2->label( ). - simple_form2->button( press = client->_event( ms_home-btn_event_id ) + simple_form->label( ). + simple_form->button( press = client->_event( ms_home-btn_event_id ) text = client->_bind( ms_home-btn_text ) icon = client->_bind( ms_home-btn_icon ) width = `70%` ). - simple_form2->label( `Step 5` + simple_form->label( `Step 5` )->link( text = `Link to the Application` target = `_blank` href = client->_bind( ms_home-url ) @@ -154,49 +154,49 @@ CLASS z2ui6_cl_core_app_startup IMPLEMENTATION. client = client classname = 'z2ui5_cl_demo_app_000' ). - simple_form2->toolbar( )->title( `What's next?` ). + simple_form->toolbar( )->title( `What's next?` ). IF z2ui6_cl_util=>rtti_check_class_exists( `z2ui5_cl_demo_app_000` ). - simple_form2->label( `Start Developing` ). - simple_form2->button( + simple_form->label( `Start Developing` ). + simple_form->button( text = `Explore Code Samples` press = client->_event_client( val = client->cs_event-open_new_tab t_arg = VALUE #( ( lv_url_samples2 ) ) ) width = `70%` ). ELSE. - simple_form2->label( `Install the sample repository` ). - simple_form2->link( text = `And explore more than 100 demo apps...` + simple_form->label( `Install the sample repository` ). + simple_form->link( text = `And explore more than 200 sample apps...` target = `_blank` href = `https://github.com/abap2UI5/abap2UI5-samples` ). ENDIF. - simple_form2->toolbar( )->title( `Contribution` ). + simple_form->toolbar( )->title( `Contribution` ). - simple_form2->label( `Open an issue` ). - simple_form2->link( text = `You have problems, comments or wishes?` + simple_form->label( `Open an issue` ). + simple_form->link( text = `You have problems, comments or wishes?` target = `_blank` href = `https://github.com/abap2UI5/abap2UI5/issues` ). - simple_form2->label( `Open a Pull Request` ). - simple_form2->link( text = `You added a new feature or fixed a bug?` + simple_form->label( `Open a Pull Request` ). + simple_form->link( text = `You added a new feature or fixed a bug?` target = `_blank` href = `https://github.com/abap2UI5/abap2UI5/pulls` ). - simple_form2->toolbar( )->title( `Social Media` ). + simple_form->toolbar( )->title( `Social Media` ). - simple_form2->label( ). - simple_form2->link( text = `Follow us on LinkedIn` + simple_form->label( ). + simple_form->link( text = `Follow us on LinkedIn` target = `_blank` href = `https://www.linkedin.com/company/abap2ui5` ). - simple_form2->label( ). - simple_form2->link( text = `www.abap2UI5.org` + simple_form->label( ). + simple_form->link( text = `www.abap2UI5.org` target = `_blank` href = `http://www.abap2UI5.org` ). - client->view_display( page2->stringify( ) ). + client->view_display( page->stringify( ) ). ENDMETHOD. @@ -272,7 +272,7 @@ CLASS z2ui6_cl_core_app_startup IMPLEMENTATION. simple_form2->label( `ABAP for Cloud` ). simple_form2->checkbox( enabled = abap_false selected = z2ui6_cl_util=>context_check_abap_cloud( ) ). - DATA(lv_count) = CONV string( NEW z2ui6_cl_core_draft_srv( )->count_entries( ) ). + DATA(lv_count) = CONV string( NEW z2ui6_cl_core_srv_draft( )->count_entries( ) ). simple_form2->toolbar( )->title( `abap2UI5` ). simple_form2->label( `Version ` ). simple_form2->text( z2ui6_if_app=>version ). diff --git a/src/01/02/z2ui6_cl_core_client.clas.abap b/src/01/02/z2ui6_cl_core_client.clas.abap index b23660f7..c0238151 100644 --- a/src/01/02/z2ui6_cl_core_client.clas.abap +++ b/src/01/02/z2ui6_cl_core_client.clas.abap @@ -44,6 +44,7 @@ CLASS z2ui6_cl_core_client IMPLEMENTATION. 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. @@ -87,20 +88,66 @@ CLASS z2ui6_cl_core_client IMPLEMENTATION. METHOD z2ui6_if_client~message_box_display. + IF z2ui6_cl_util=>rtti_check_clike( text ) = abap_false. + DATA(lt_msg) = z2ui6_cl_util=>msg_get( text ). + IF lines( lt_msg ) = 1. + DATA(lv_text) = lt_msg[ 1 ]-text. + + DATA(lv_type) = z2ui6_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` ). + + + 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 && |
  • |. + ENDLOOP. + 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` ). + ENDIF. + lv_type = z2ui6_cl_util=>ui5_get_msg_type( lt_msg[ 1 ]-type ). + ELSE. + RETURN. + ENDIF. + ELSE. + lv_text = text. + lv_type = type. + lv_title = title. + lv_details = details. + + IF lv_type = 'information'. + lv_type = 'show'. + IF lv_title IS INITIAL. + lv_title = 'Information'. + ENDIF. + ENDIF. + ENDIF. + + IF lv_type = ''. + lv_type = 'show'. + ENDIF. + mo_action->ms_next-s_set-s_msg_box = VALUE #( - text = text - type = type - title = title - styleclass = styleclass - onclose = onclose - actions = actions - emphasizedaction = emphasizedaction - initialfocus = initialfocus - textdirection = textdirection - icon = icon - details = details - closeonnavigation = closeonnavigation - ). + 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. @@ -278,7 +325,7 @@ CLASS z2ui6_cl_core_client IMPLEMENTATION. METHOD z2ui6_if_client~_bind. - DATA(lo_bind) = NEW z2ui6_cl_core_bind_srv( mo_action->mo_app ). + DATA(lo_bind) = NEW z2ui6_cl_core_srv_bind( mo_action->mo_app ). result = lo_bind->main( val = z2ui6_cl_util=>conv_get_as_data_ref( val ) type = z2ui6_if_core_types=>cs_bind_type-one_way @@ -294,7 +341,7 @@ CLASS z2ui6_cl_core_client IMPLEMENTATION. METHOD z2ui6_if_client~_bind_edit. - DATA(lo_bind) = NEW z2ui6_cl_core_bind_srv( mo_action->mo_app ). + DATA(lo_bind) = NEW z2ui6_cl_core_srv_bind( mo_action->mo_app ). result = lo_bind->main( val = z2ui6_cl_util=>conv_get_as_data_ref( val ) type = z2ui6_if_core_types=>cs_bind_type-two_way @@ -312,7 +359,7 @@ CLASS z2ui6_cl_core_client IMPLEMENTATION. METHOD z2ui6_if_client~_bind_local. - DATA(lo_bind) = NEW z2ui6_cl_core_bind_srv( mo_action->mo_app ). + DATA(lo_bind) = NEW z2ui6_cl_core_srv_bind( mo_action->mo_app ). result = lo_bind->main_local( val = val config = VALUE #( @@ -325,18 +372,23 @@ CLASS z2ui6_cl_core_client IMPLEMENTATION. METHOD z2ui6_if_client~_event. - DATA(lo_ui5) = NEW z2ui6_cl_core_event_srv( ). + DATA(lo_ui5) = NEW z2ui6_cl_core_srv_event( ). 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. + mo_action->ms_next-r_data = z2ui6_cl_util=>conv_copy_ref_data( r_data ). + ENDIF. + ENDMETHOD. METHOD z2ui6_if_client~_event_client. - DATA(lo_ui5) = NEW z2ui6_cl_core_event_srv( ). + DATA(lo_ui5) = NEW z2ui6_cl_core_srv_event( ). result = lo_ui5->get_event_client( val = val t_arg = t_arg ). @@ -353,7 +405,6 @@ CLASS z2ui6_cl_core_client IMPLEMENTATION. val = `STATEFUL_ALREADY_ACTIVATED_ERROR`. ENDIF. IF stateful = abap_true. -* mo_action->ms_next-s_set-handler_attrs- mo_action->ms_next-s_set-s_stateful-active = 1. CAST z2ui6_if_app( mo_action->mo_app->mo_app )->check_sticky = abap_true. ELSE. @@ -363,4 +414,32 @@ CLASS z2ui6_cl_core_client IMPLEMENTATION. mo_action->ms_next-s_set-s_stateful-switched = abap_true. ENDMETHOD. + + METHOD z2ui6_if_client~check_app_prev_stack. + + DATA(ls_get) = z2ui6_if_client~get( ). + result = xsdbool( ls_get-s_draft-id_prev_app_stack IS NOT INITIAL ). + + ENDMETHOD. + + METHOD z2ui6_if_client~check_on_init. + + result = xsdbool( CAST z2ui6_if_app( mo_action->mo_app->mo_app )->check_initialized = abap_false ). + + ENDMETHOD. + + METHOD z2ui6_if_client~check_on_navigated. + + DATA(ls_get) = z2ui6_if_client~get( ). + result = ls_get-check_on_navigated. + + ENDMETHOD. + + METHOD z2ui6_if_client~get_app_prev. + + DATA(ls_get) = z2ui6_if_client~get( ). + result = z2ui6_if_client~get_app( ls_get-s_draft-id_prev_app ). + + ENDMETHOD. + ENDCLASS. diff --git a/src/01/02/z2ui6_cl_core_client.clas.testclasses.abap b/src/01/02/z2ui6_cl_core_client.clas.testclasses.abap index 8ba42289..e037da8d 100644 --- a/src/01/02/z2ui6_cl_core_client.clas.testclasses.abap +++ b/src/01/02/z2ui6_cl_core_client.clas.testclasses.abap @@ -12,7 +12,7 @@ CLASS ltcl_test_client IMPLEMENTATION. METHOD first_test. - DATA(lo_http) = NEW z2ui6_cl_core_http_post( `` ). + DATA(lo_http) = NEW z2ui6_cl_core_handler( `` ). DATA(lo_action) = NEW z2ui6_cl_core_action( lo_http ). DATA(lo_client) = NEW z2ui6_cl_core_client( lo_action ) ##NEEDED. diff --git a/src/01/02/z2ui6_cl_core_http_post.clas.abap b/src/01/02/z2ui6_cl_core_handler.clas.abap similarity index 88% rename from src/01/02/z2ui6_cl_core_http_post.clas.abap rename to src/01/02/z2ui6_cl_core_handler.clas.abap index 51d1819b..676b2252 100644 --- a/src/01/02/z2ui6_cl_core_http_post.clas.abap +++ b/src/01/02/z2ui6_cl_core_handler.clas.abap @@ -1,4 +1,4 @@ -CLASS z2ui6_cl_core_http_post DEFINITION +CLASS z2ui6_cl_core_handler DEFINITION PUBLIC FINAL CREATE PUBLIC . @@ -7,8 +7,8 @@ CLASS z2ui6_cl_core_http_post DEFINITION DATA mo_action TYPE REF TO z2ui6_cl_core_action. DATA mv_request_json TYPE string. - DATA ms_request TYPE z2ui6_if_core_types=>ty_s_http_request_post. - DATA ms_response TYPE z2ui6_if_core_types=>ty_s_http_response_post. + DATA ms_request TYPE z2ui6_if_core_types=>ty_s_request. + DATA ms_response TYPE z2ui6_if_core_types=>ty_s_response. DATA mv_response TYPE string. METHODS constructor @@ -34,7 +34,7 @@ ENDCLASS. -CLASS z2ui6_cl_core_http_post IMPLEMENTATION. +CLASS z2ui6_cl_core_handler IMPLEMENTATION. METHOD constructor. @@ -46,7 +46,6 @@ CLASS z2ui6_cl_core_http_post IMPLEMENTATION. METHOD main. -* CLEAR attributes. main_begin( ). DO. @@ -58,7 +57,7 @@ CLASS z2ui6_cl_core_http_post IMPLEMENTATION. result = VALUE #( body = mv_response s_stateful = ms_response-s_front-params-s_stateful - ). + ). ENDMETHOD. @@ -66,14 +65,14 @@ CLASS z2ui6_cl_core_http_post IMPLEMENTATION. METHOD main_begin. TRY. - DATA(lo_json_mapper) = NEW z2ui6_cl_core_json_srv( ). + DATA(lo_json_mapper) = NEW z2ui6_cl_core_srv_json( ). ms_request = lo_json_mapper->request_json_to_abap( mv_request_json ). IF ms_request-s_front-id IS NOT INITIAL. mo_action = mo_action->factory_by_frontend( ). ELSEIF ms_request-s_control-app_start IS NOT INITIAL. - NEW z2ui6_cl_core_draft_srv( )->cleanup( ). + NEW z2ui6_cl_core_srv_draft( )->cleanup( ). mo_action = mo_action->factory_first_start( ). ELSE. @@ -105,7 +104,7 @@ CLASS z2ui6_cl_core_http_post IMPLEMENTATION. 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 z2ui6_cl_core_attri_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_attri( attri = mo_action->mo_app->mt_attri app = mo_action->mo_app->mo_app ). lo_model->attri_refs_update( ). @@ -115,7 +114,7 @@ CLASS z2ui6_cl_core_http_post IMPLEMENTATION. ms_response-model = `{}`. ENDIF. - DATA(lo_json_mapper) = NEW z2ui6_cl_core_json_srv( ). + DATA(lo_json_mapper) = NEW z2ui6_cl_core_srv_json( ). mv_response = lo_json_mapper->response_abap_to_json( ms_response ). CLEAR mo_action->ms_next. diff --git a/src/01/02/z2ui6_cl_core_http_post.clas.testclasses.abap b/src/01/02/z2ui6_cl_core_handler.clas.testclasses.abap similarity index 85% rename from src/01/02/z2ui6_cl_core_http_post.clas.testclasses.abap rename to src/01/02/z2ui6_cl_core_handler.clas.testclasses.abap index 4246391a..7d195cec 100644 --- a/src/01/02/z2ui6_cl_core_http_post.clas.testclasses.abap +++ b/src/01/02/z2ui6_cl_core_handler.clas.testclasses.abap @@ -8,7 +8,7 @@ CLASS ltcl_test_handler_post DEFINITION FINAL FOR TESTING load_startup_app FOR TESTING RAISING cx_static_check. ENDCLASS. -CLASS z2ui6_cl_core_http_post DEFINITION LOCAL FRIENDS ltcl_test_handler_post. +CLASS z2ui6_cl_core_handler DEFINITION LOCAL FRIENDS ltcl_test_handler_post. CLASS ltcl_test_handler_post IMPLEMENTATION. @@ -19,7 +19,7 @@ CLASS ltcl_test_handler_post IMPLEMENTATION. ENDIF. DATA(lv_payload) = `{"S_FRONT":{"ORIGIN":"ORIGIN","PATHNAME":"PATHNAME","SEARCH":""}}`. - DATA(lo_post) = NEW z2ui6_cl_core_http_post( lv_payload ). + DATA(lo_post) = NEW z2ui6_cl_core_handler( lv_payload ). lo_post->main_begin( ). cl_abap_unit_assert=>assert_bound( lo_post->mo_action ). diff --git a/src/01/02/z2ui6_cl_core_http_post.clas.xml b/src/01/02/z2ui6_cl_core_handler.clas.xml similarity index 91% rename from src/01/02/z2ui6_cl_core_http_post.clas.xml rename to src/01/02/z2ui6_cl_core_handler.clas.xml index ab7a0765..30b6e142 100644 --- a/src/01/02/z2ui6_cl_core_http_post.clas.xml +++ b/src/01/02/z2ui6_cl_core_handler.clas.xml @@ -3,7 +3,7 @@ - Z2UI6_CL_CORE_HTTP_POST + Z2UI6_CL_CORE_HANDLER E abap2UI5 - http post handler 1 diff --git a/src/01/02/z2ui6_cl_core_attri_srv.clas.abap b/src/01/02/z2ui6_cl_core_srv_attri.clas.abap similarity index 97% rename from src/01/02/z2ui6_cl_core_attri_srv.clas.abap rename to src/01/02/z2ui6_cl_core_srv_attri.clas.abap index b74f64a6..726a2ef3 100644 --- a/src/01/02/z2ui6_cl_core_attri_srv.clas.abap +++ b/src/01/02/z2ui6_cl_core_srv_attri.clas.abap @@ -1,4 +1,4 @@ -CLASS z2ui6_cl_core_attri_srv DEFINITION +CLASS z2ui6_cl_core_srv_attri DEFINITION PUBLIC FINAL CREATE PUBLIC. @@ -40,7 +40,7 @@ CLASS z2ui6_cl_core_attri_srv DEFINITION ENDCLASS. -CLASS z2ui6_cl_core_attri_srv IMPLEMENTATION. +CLASS z2ui6_cl_core_srv_attri IMPLEMENTATION. METHOD attri_after_load. @@ -104,7 +104,7 @@ CLASS z2ui6_cl_core_attri_srv IMPLEMENTATION. RETURN. ENDIF. - DATA(lo_dissolve) = NEW z2ui6_cl_core_diss_srv( + DATA(lo_dissolve) = NEW z2ui6_cl_core_srv_diss( attri = mt_attri app = mo_app ). diff --git a/src/01/02/z2ui6_cl_core_attri_srv.clas.testclasses.abap b/src/01/02/z2ui6_cl_core_srv_attri.clas.testclasses.abap similarity index 93% rename from src/01/02/z2ui6_cl_core_attri_srv.clas.testclasses.abap rename to src/01/02/z2ui6_cl_core_srv_attri.clas.testclasses.abap index e3adc6ea..8327d5d3 100644 --- a/src/01/02/z2ui6_cl_core_attri_srv.clas.testclasses.abap +++ b/src/01/02/z2ui6_cl_core_srv_attri.clas.testclasses.abap @@ -35,7 +35,7 @@ CLASS ltcl_test_search_attri DEFINITION FINAL FOR TESTING ENDCLASS. -CLASS z2ui6_cl_core_attri_srv DEFINITION LOCAL FRIENDS ltcl_test_search_attri. +CLASS z2ui6_cl_core_srv_attri DEFINITION LOCAL FRIENDS ltcl_test_search_attri. CLASS ltcl_test_search_attri IMPLEMENTATION. @@ -50,7 +50,7 @@ CLASS ltcl_test_search_attri IMPLEMENTATION. o_typedescr = cl_abap_datadescr=>describe_by_data_ref( lr_value ) ) ). - DATA(lo_model) = NEW z2ui6_cl_core_attri_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_attri( attri = REF #( lt_attri ) app = lo_app_client ). @@ -73,7 +73,7 @@ CLASS ltcl_test_search_attri IMPLEMENTATION. o_typedescr = cl_abap_datadescr=>describe_by_data_ref( lr_value ) ) ). - DATA(lo_model) = NEW z2ui6_cl_core_attri_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_attri( attri = REF #( lt_attri ) app = lo_app_client ). @@ -174,7 +174,7 @@ CLASS ltcl_test_get_attri IMPLEMENTATION. DATA(lt_attri) = VALUE z2ui6_if_core_types=>ty_t_attri( ). - DATA(lo_model) = NEW z2ui6_cl_core_attri_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_attri( attri = REF #( lt_attri ) app = lo_app_client ). @@ -192,7 +192,7 @@ CLASS ltcl_test_get_attri IMPLEMENTATION. CREATE DATA lo_app_client->mr_value. DATA(lt_attri) = VALUE z2ui6_if_core_types=>ty_t_attri( ). - DATA(lo_model) = NEW z2ui6_cl_core_attri_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_attri( attri = REF #( lt_attri ) app = lo_app_client ). @@ -209,7 +209,7 @@ CLASS ltcl_test_get_attri IMPLEMENTATION. DATA(lo_app_client) = NEW ltcl_test_app3( ). DATA(lt_attri) = VALUE z2ui6_if_core_types=>ty_t_attri( ). - DATA(lo_model) = NEW z2ui6_cl_core_attri_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_attri( attri = REF #( lt_attri ) app = lo_app_client ). @@ -227,7 +227,7 @@ CLASS ltcl_test_get_attri IMPLEMENTATION. CREATE DATA lo_app_client->mo_app->mr_value. DATA(lt_attri) = VALUE z2ui6_if_core_types=>ty_t_attri( ). - DATA(lo_model) = NEW z2ui6_cl_core_attri_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_attri( attri = REF #( lt_attri ) app = lo_app_client ). diff --git a/src/01/02/z2ui6_cl_core_attri_srv.clas.xml b/src/01/02/z2ui6_cl_core_srv_attri.clas.xml similarity index 91% rename from src/01/02/z2ui6_cl_core_attri_srv.clas.xml rename to src/01/02/z2ui6_cl_core_srv_attri.clas.xml index 7dd524a8..095b3eee 100644 --- a/src/01/02/z2ui6_cl_core_attri_srv.clas.xml +++ b/src/01/02/z2ui6_cl_core_srv_attri.clas.xml @@ -3,7 +3,7 @@ - Z2UI6_CL_CORE_ATTRI_SRV + Z2UI6_CL_CORE_SRV_ATTRI E abap2UI5 - backend attributes 1 diff --git a/src/01/02/z2ui6_cl_core_bind_srv.clas.abap b/src/01/02/z2ui6_cl_core_srv_bind.clas.abap similarity index 97% rename from src/01/02/z2ui6_cl_core_bind_srv.clas.abap rename to src/01/02/z2ui6_cl_core_srv_bind.clas.abap index 3b5d1641..aadf16b0 100644 --- a/src/01/02/z2ui6_cl_core_bind_srv.clas.abap +++ b/src/01/02/z2ui6_cl_core_srv_bind.clas.abap @@ -1,4 +1,4 @@ -CLASS z2ui6_cl_core_bind_srv DEFINITION +CLASS z2ui6_cl_core_srv_bind DEFINITION PUBLIC FINAL CREATE PUBLIC . @@ -63,7 +63,7 @@ ENDCLASS. -CLASS z2ui6_cl_core_bind_srv IMPLEMENTATION. +CLASS z2ui6_cl_core_srv_bind IMPLEMENTATION. METHOD bind_tab_cell. @@ -211,7 +211,7 @@ CLASS z2ui6_cl_core_bind_srv IMPLEMENTATION. ms_config = config. mv_type = type. - DATA(lo_model) = NEW z2ui6_cl_core_attri_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_attri( attri = mo_app->mt_attri app = mo_app->mo_app ). @@ -246,7 +246,7 @@ CLASS z2ui6_cl_core_bind_srv IMPLEMENTATION. ms_config = config. mv_type = type. - DATA(lo_bind) = NEW z2ui6_cl_core_bind_srv( mo_app ). + DATA(lo_bind) = NEW z2ui6_cl_core_srv_bind( mo_app ). result = lo_bind->main( val = config-tab type = type config = VALUE #( path_only = abap_true ) ). result = bind_tab_cell( diff --git a/src/01/02/z2ui6_cl_core_bind_srv.clas.testclasses.abap b/src/01/02/z2ui6_cl_core_srv_bind.clas.testclasses.abap similarity index 92% rename from src/01/02/z2ui6_cl_core_bind_srv.clas.testclasses.abap rename to src/01/02/z2ui6_cl_core_srv_bind.clas.testclasses.abap index a76d06bf..404d9c20 100644 --- a/src/01/02/z2ui6_cl_core_bind_srv.clas.testclasses.abap +++ b/src/01/02/z2ui6_cl_core_srv_bind.clas.testclasses.abap @@ -1,6 +1,6 @@ CLASS ltcl_test_bind DEFINITION DEFERRED. -CLASS z2ui6_cl_core_bind_srv DEFINITION LOCAL FRIENDS ltcl_test_bind. +CLASS z2ui6_cl_core_srv_bind DEFINITION LOCAL FRIENDS ltcl_test_bind. CLASS ltcl_test_app DEFINITION FINAL FOR TESTING DURATION MEDIUM @@ -64,7 +64,7 @@ CLASS ltcl_test_bind IMPLEMENTATION. DATA(lo_app) = NEW z2ui6_cl_core_app( ). lo_app->mo_app = lo_app_client. - DATA(lo_bind) = NEW z2ui6_cl_core_bind_srv( lo_app ). + DATA(lo_bind) = NEW z2ui6_cl_core_srv_bind( lo_app ). TRY. lo_bind->main( @@ -84,7 +84,7 @@ CLASS ltcl_test_bind IMPLEMENTATION. DATA(lo_app) = NEW z2ui6_cl_core_app( ). lo_app->mo_app = lo_app_client. - DATA(lo_bind) = NEW z2ui6_cl_core_bind_srv( lo_app ). + DATA(lo_bind) = NEW z2ui6_cl_core_srv_bind( lo_app ). DATA(lv_bind) = lo_bind->main( val = REF #( lo_app_client->mv_value ) @@ -102,7 +102,7 @@ CLASS ltcl_test_bind IMPLEMENTATION. DATA(lo_app) = NEW z2ui6_cl_core_app( ). lo_app->mo_app = lo_app_client. - DATA(lo_bind) = NEW z2ui6_cl_core_bind_srv( lo_app ). + DATA(lo_bind) = NEW z2ui6_cl_core_srv_bind( lo_app ). lo_bind->main( val = REF #( lo_app_client->mv_value ) @@ -131,7 +131,7 @@ CLASS ltcl_test_bind IMPLEMENTATION. DATA(lo_app) = NEW z2ui6_cl_core_app( ). lo_app->mo_app = lo_app_client. - DATA(lo_bind) = NEW z2ui6_cl_core_bind_srv( lo_app ). + DATA(lo_bind) = NEW z2ui6_cl_core_srv_bind( lo_app ). DATA(lv_bind) = lo_bind->main( val = REF #( lo_app_client->mv_value ) @@ -155,7 +155,7 @@ CLASS ltcl_test_bind IMPLEMENTATION. DATA(lo_app) = NEW z2ui6_cl_core_app( ). lo_app->mo_app = lo_app_client. - DATA(lo_bind) = NEW z2ui6_cl_core_bind_srv( lo_app ). + DATA(lo_bind) = NEW z2ui6_cl_core_srv_bind( lo_app ). DATA(lv_bind) = lo_bind->main_local( lo_app_client->mv_value ). @@ -169,7 +169,7 @@ CLASS ltcl_test_bind IMPLEMENTATION. DATA(lo_app) = NEW z2ui6_cl_core_app( ). lo_app->mo_app = lo_app_client. - DATA(lo_bind) = NEW z2ui6_cl_core_bind_srv( lo_app ). + DATA(lo_bind) = NEW z2ui6_cl_core_srv_bind( lo_app ). DATA(lv_bind) = lo_bind->main_local( lo_app_client->mv_value ). @@ -226,7 +226,7 @@ CLASS ltcl_test_main_structure IMPLEMENTATION. DATA(lo_app) = NEW z2ui6_cl_core_app( ). lo_app->mo_app = lo_test_app. - DATA(lo_bind) = NEW z2ui6_cl_core_bind_srv( lo_app ). + DATA(lo_bind) = NEW z2ui6_cl_core_srv_bind( lo_app ). DATA(lv_result) = lo_bind->main( val = REF #( lo_test_app->ms_struc-input ) type = z2ui6_if_core_types=>cs_bind_type-one_way ). @@ -252,7 +252,7 @@ CLASS ltcl_test_main_structure IMPLEMENTATION. DATA(lo_app) = NEW z2ui6_cl_core_app( ). lo_app->mo_app = lo_test_app. - DATA(lo_bind) = NEW z2ui6_cl_core_bind_srv( lo_app ). + DATA(lo_bind) = NEW z2ui6_cl_core_srv_bind( lo_app ). DATA(lv_result) = lo_bind->main( val = REF #( lo_test_app->ms_struc-s_02-input ) type = z2ui6_if_core_types=>cs_bind_type-one_way ). @@ -269,7 +269,7 @@ CLASS ltcl_test_main_structure IMPLEMENTATION. DATA(lo_app) = NEW z2ui6_cl_core_app( ). lo_app->mo_app = lo_test_app. - DATA(lo_bind) = NEW z2ui6_cl_core_bind_srv( lo_app ). + DATA(lo_bind) = NEW z2ui6_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 = z2ui6_if_core_types=>cs_bind_type-one_way ). @@ -286,7 +286,7 @@ CLASS ltcl_test_main_structure IMPLEMENTATION. DATA(lo_app) = NEW z2ui6_cl_core_app( ). lo_app->mo_app = lo_test_app. - DATA(lo_bind) = NEW z2ui6_cl_core_bind_srv( lo_app ). + DATA(lo_bind) = NEW z2ui6_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 = z2ui6_if_core_types=>cs_bind_type-one_way ). @@ -343,7 +343,7 @@ CLASS ltcl_test_main_object IMPLEMENTATION. DATA(lo_app) = NEW z2ui6_cl_core_app( ). lo_app->mo_app = lo_test_app. - DATA(lo_bind) = NEW z2ui6_cl_core_bind_srv( lo_app ). + DATA(lo_bind) = NEW z2ui6_cl_core_srv_bind( lo_app ). DATA(lv_result) = lo_bind->main( val = REF #( lo_test_app->mo_obj->mv_value ) type = z2ui6_if_core_types=>cs_bind_type-one_way ). @@ -361,7 +361,7 @@ CLASS ltcl_test_main_object IMPLEMENTATION. DATA(lo_app) = NEW z2ui6_cl_core_app( ). lo_app->mo_app = lo_test_app. - DATA(lo_bind) = NEW z2ui6_cl_core_bind_srv( lo_app ). + DATA(lo_bind) = NEW z2ui6_cl_core_srv_bind( lo_app ). DATA(lv_result) = lo_bind->main( val = REF #( lo_test_app->mo_obj->ms_struc-input ) type = z2ui6_if_core_types=>cs_bind_type-one_way ). diff --git a/src/01/02/z2ui6_cl_core_bind_srv.clas.xml b/src/01/02/z2ui6_cl_core_srv_bind.clas.xml similarity index 91% rename from src/01/02/z2ui6_cl_core_bind_srv.clas.xml rename to src/01/02/z2ui6_cl_core_srv_bind.clas.xml index 07bbe275..197e2e6e 100644 --- a/src/01/02/z2ui6_cl_core_bind_srv.clas.xml +++ b/src/01/02/z2ui6_cl_core_srv_bind.clas.xml @@ -3,7 +3,7 @@ - Z2UI6_CL_CORE_BIND_SRV + Z2UI6_CL_CORE_SRV_BIND E abap2UI5 - frontend data binding 1 diff --git a/src/01/02/z2ui6_cl_core_diss_srv.clas.abap b/src/01/02/z2ui6_cl_core_srv_diss.clas.abap similarity index 96% rename from src/01/02/z2ui6_cl_core_diss_srv.clas.abap rename to src/01/02/z2ui6_cl_core_srv_diss.clas.abap index 083baa0b..1aa4544e 100644 --- a/src/01/02/z2ui6_cl_core_diss_srv.clas.abap +++ b/src/01/02/z2ui6_cl_core_srv_diss.clas.abap @@ -1,4 +1,4 @@ -CLASS z2ui6_cl_core_diss_srv DEFINITION +CLASS z2ui6_cl_core_srv_diss DEFINITION PUBLIC FINAL CREATE PUBLIC . @@ -46,7 +46,7 @@ ENDCLASS. -CLASS z2ui6_cl_core_diss_srv IMPLEMENTATION. +CLASS z2ui6_cl_core_srv_diss IMPLEMENTATION. METHOD constructor. @@ -61,7 +61,7 @@ CLASS z2ui6_cl_core_diss_srv IMPLEMENTATION. result = VALUE z2ui6_if_core_types=>ty_s_attri( ). result-name = name. - DATA(lo_model) = NEW z2ui6_cl_core_attri_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_attri( attri = mt_attri app = mo_app ). result-r_ref = lo_model->attri_get_val_ref( name ). @@ -93,7 +93,7 @@ CLASS z2ui6_cl_core_diss_srv IMPLEMENTATION. WHEN OTHERS. ls_attri2-name = ir_attri->name && `->*`. - DATA(lo_model) = NEW z2ui6_cl_core_attri_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_attri( attri = mt_attri app = mo_app ). ls_attri2-r_ref = lo_model->attri_get_val_ref( ls_attri2-name ). diff --git a/src/01/02/z2ui6_cl_core_diss_srv.clas.testclasses.abap b/src/01/02/z2ui6_cl_core_srv_diss.clas.testclasses.abap similarity index 93% rename from src/01/02/z2ui6_cl_core_diss_srv.clas.testclasses.abap rename to src/01/02/z2ui6_cl_core_srv_diss.clas.testclasses.abap index d4e88c5b..9d5e4eb6 100644 --- a/src/01/02/z2ui6_cl_core_diss_srv.clas.testclasses.abap +++ b/src/01/02/z2ui6_cl_core_srv_diss.clas.testclasses.abap @@ -1,5 +1,5 @@ CLASS ltcl_test_dissolve DEFINITION DEFERRED. -CLASS z2ui6_cl_core_diss_srv DEFINITION LOCAL FRIENDS ltcl_test_dissolve. +CLASS z2ui6_cl_core_srv_diss DEFINITION LOCAL FRIENDS ltcl_test_dissolve. CLASS ltcl_test_dissolve DEFINITION FINAL FOR TESTING DURATION SHORT @@ -56,7 +56,7 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. DATA(lo_app) = NEW ltcl_test_dissolve( ). DATA lt_attri TYPE z2ui6_if_core_types=>ty_t_attri. - DATA(lo_model) = NEW z2ui6_cl_core_diss_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_diss( attri = REF #( lt_attri ) app = lo_app ). @@ -76,7 +76,7 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. DATA(lo_app) = NEW ltcl_test_dissolve( ). DATA lt_attri TYPE z2ui6_if_core_types=>ty_t_attri. - DATA(lo_model) = NEW z2ui6_cl_core_diss_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_diss( attri = REF #( lt_attri ) app = lo_app ). @@ -98,7 +98,7 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. CREATE DATA lo_app->mr_value TYPE string. DATA lt_attri TYPE z2ui6_if_core_types=>ty_t_attri. - DATA(lo_model) = NEW z2ui6_cl_core_diss_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_diss( attri = REF #( lt_attri ) app = lo_app ). @@ -120,7 +120,7 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. CREATE DATA lo_app->mo_app->mr_value TYPE string. DATA lt_attri TYPE z2ui6_if_core_types=>ty_t_attri. - DATA(lo_model) = NEW z2ui6_cl_core_diss_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_diss( attri = REF #( lt_attri ) app = lo_app2 ). @@ -139,7 +139,7 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. DATA(lo_app) = NEW ltcl_test_dissolve( ). DATA lt_attri TYPE z2ui6_if_core_types=>ty_t_attri. - DATA(lo_model) = NEW z2ui6_cl_core_diss_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_diss( attri = REF #( lt_attri ) app = lo_app ). @@ -165,7 +165,7 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. CREATE DATA lo_app->mr_struc. DATA lt_attri TYPE z2ui6_if_core_types=>ty_t_attri. - DATA(lo_model) = NEW z2ui6_cl_core_diss_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_diss( attri = REF #( lt_attri ) app = lo_app ). @@ -189,7 +189,7 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. CREATE DATA lo_app2->mr_value TYPE string. DATA lt_attri TYPE z2ui6_if_core_types=>ty_t_attri. - DATA(lo_model) = NEW z2ui6_cl_core_diss_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_diss( attri = REF #( lt_attri ) app = lo_app ). @@ -211,7 +211,7 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. CREATE DATA lo_app->mo_app->mr_struc. DATA lt_attri TYPE z2ui6_if_core_types=>ty_t_attri. - DATA(lo_model) = NEW z2ui6_cl_core_diss_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_diss( attri = REF #( lt_attri ) app = lo_app ). @@ -234,7 +234,7 @@ CLASS ltcl_test_dissolve IMPLEMENTATION. CREATE DATA lo_app->mo_app->ms_struc2-r_ref TYPE string. DATA lt_attri TYPE z2ui6_if_core_types=>ty_t_attri. - DATA(lo_model) = NEW z2ui6_cl_core_diss_srv( + DATA(lo_model) = NEW z2ui6_cl_core_srv_diss( attri = REF #( lt_attri ) app = lo_app ). diff --git a/src/01/02/z2ui6_cl_core_diss_srv.clas.xml b/src/01/02/z2ui6_cl_core_srv_diss.clas.xml similarity index 91% rename from src/01/02/z2ui6_cl_core_diss_srv.clas.xml rename to src/01/02/z2ui6_cl_core_srv_diss.clas.xml index 48eecdb2..785770b6 100644 --- a/src/01/02/z2ui6_cl_core_diss_srv.clas.xml +++ b/src/01/02/z2ui6_cl_core_srv_diss.clas.xml @@ -3,7 +3,7 @@ - Z2UI6_CL_CORE_DISS_SRV + Z2UI6_CL_CORE_SRV_DISS E abap2UI5 - backend attri dissolver 1 diff --git a/src/01/02/z2ui6_cl_core_event_srv.clas.abap b/src/01/02/z2ui6_cl_core_srv_event.clas.abap similarity index 82% rename from src/01/02/z2ui6_cl_core_event_srv.clas.abap rename to src/01/02/z2ui6_cl_core_srv_event.clas.abap index e303c8f6..3cf419f5 100644 --- a/src/01/02/z2ui6_cl_core_event_srv.clas.abap +++ b/src/01/02/z2ui6_cl_core_srv_event.clas.abap @@ -1,4 +1,4 @@ -CLASS z2ui6_cl_core_event_srv DEFINITION +CLASS z2ui6_cl_core_srv_event DEFINITION PUBLIC FINAL CREATE PUBLIC . @@ -33,20 +33,14 @@ CLASS z2ui6_cl_core_event_srv DEFINITION ENDCLASS. -CLASS z2ui6_cl_core_event_srv IMPLEMENTATION. +CLASS z2ui6_cl_core_srv_event IMPLEMENTATION. METHOD get_event. result = |{ z2ui6_if_core_types=>cs_ui5-event_backend_function }(['{ val }'|. IF s_cnt-check_allow_multi_req = abap_true. - IF s_cnt-check_view_destroy = abap_true. - result = result && `,true,true`. - ELSE. - result = result && `,false,true`. - ENDIF. - ELSEIF s_cnt-check_view_destroy = abap_true. - result = result && `,true`. + result = result && `,false,true`. ENDIF. result = result && `]` && get_t_arg( t_arg ). diff --git a/src/01/02/z2ui6_cl_core_event_srv.clas.testclasses.abap b/src/01/02/z2ui6_cl_core_srv_event.clas.testclasses.abap similarity index 86% rename from src/01/02/z2ui6_cl_core_event_srv.clas.testclasses.abap rename to src/01/02/z2ui6_cl_core_srv_event.clas.testclasses.abap index 6f55d2f1..d3e1bc9d 100644 --- a/src/01/02/z2ui6_cl_core_event_srv.clas.testclasses.abap +++ b/src/01/02/z2ui6_cl_core_srv_event.clas.testclasses.abap @@ -14,7 +14,7 @@ CLASS ltcl_test IMPLEMENTATION. METHOD event. - DATA(lo_event) = NEW z2ui6_cl_core_event_srv( ). + DATA(lo_event) = NEW z2ui6_cl_core_srv_event( ). DATA(lv_event) = lo_event->get_event( `POST` ). cl_abap_unit_assert=>assert_equals( @@ -25,7 +25,7 @@ CLASS ltcl_test IMPLEMENTATION. METHOD event_backend. - DATA(lo_event) = NEW z2ui6_cl_core_event_srv( ). + DATA(lo_event) = NEW z2ui6_cl_core_srv_event( ). DATA(lv_event) = lo_event->get_event_client( z2ui6_if_client=>cs_event-popover_close ). cl_abap_unit_assert=>assert_equals( diff --git a/src/01/02/z2ui6_cl_core_event_srv.clas.xml b/src/01/02/z2ui6_cl_core_srv_event.clas.xml similarity index 91% rename from src/01/02/z2ui6_cl_core_event_srv.clas.xml rename to src/01/02/z2ui6_cl_core_srv_event.clas.xml index d64a43c8..836f108b 100644 --- a/src/01/02/z2ui6_cl_core_event_srv.clas.xml +++ b/src/01/02/z2ui6_cl_core_srv_event.clas.xml @@ -3,7 +3,7 @@ - Z2UI6_CL_CORE_EVENT_SRV + Z2UI6_CL_CORE_SRV_EVENT E abap2UI5 - frontend event 1 diff --git a/src/01/02/z2ui6_cl_core_json_srv.clas.abap b/src/01/02/z2ui6_cl_core_srv_json.clas.abap similarity index 95% rename from src/01/02/z2ui6_cl_core_json_srv.clas.abap rename to src/01/02/z2ui6_cl_core_srv_json.clas.abap index c41c61aa..4f08de61 100644 --- a/src/01/02/z2ui6_cl_core_json_srv.clas.abap +++ b/src/01/02/z2ui6_cl_core_srv_json.clas.abap @@ -1,4 +1,4 @@ -CLASS z2ui6_cl_core_json_srv DEFINITION +CLASS z2ui6_cl_core_srv_json DEFINITION PUBLIC FINAL CREATE PUBLIC . @@ -11,11 +11,11 @@ CLASS z2ui6_cl_core_json_srv DEFINITION IMPORTING val TYPE string RETURNING - VALUE(result) TYPE z2ui6_if_core_types=>ty_s_http_request_post . + VALUE(result) TYPE z2ui6_if_core_types=>ty_s_request . METHODS response_abap_to_json IMPORTING - val TYPE z2ui6_if_core_types=>ty_s_http_response_post + val TYPE z2ui6_if_core_types=>ty_s_response RETURNING VALUE(result) TYPE string . @@ -37,7 +37,7 @@ ENDCLASS. -CLASS z2ui6_cl_core_json_srv IMPLEMENTATION. +CLASS z2ui6_cl_core_srv_json IMPLEMENTATION. METHOD model_front_to_back. @@ -192,7 +192,7 @@ CLASS z2ui6_cl_core_json_srv IMPLEMENTATION. ii_custom_mapping = z2ui6_cl_ajson_mapping=>create_upper_case( ) ) ). ajson_result->set( iv_path = `/` iv_val = val-s_front ). - ajson_result = ajson_result->filter( NEW z2ui6_cl_core_json_srv( ) ). + ajson_result = ajson_result->filter( NEW z2ui6_cl_core_srv_json( ) ). DATA(lv_frontend) = ajson_result->stringify( ). result = `{` && diff --git a/src/01/02/z2ui6_cl_core_json_srv.clas.testclasses.abap b/src/01/02/z2ui6_cl_core_srv_json.clas.testclasses.abap similarity index 90% rename from src/01/02/z2ui6_cl_core_json_srv.clas.testclasses.abap rename to src/01/02/z2ui6_cl_core_srv_json.clas.testclasses.abap index b0c8671c..8a2688a6 100644 --- a/src/01/02/z2ui6_cl_core_json_srv.clas.testclasses.abap +++ b/src/01/02/z2ui6_cl_core_srv_json.clas.testclasses.abap @@ -15,10 +15,10 @@ CLASS ltcl_test IMPLEMENTATION. 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 z2ui6_cl_core_json_srv( ). + DATA(lo_mapper) = NEW z2ui6_cl_core_srv_json( ). DATA(ls_result) = lo_mapper->request_json_to_abap( lv_payload ). - DATA(ls_exp) = VALUE z2ui6_if_core_types=>ty_s_http_request_post( + DATA(ls_exp) = VALUE z2ui6_if_core_types=>ty_s_request( s_front = VALUE #( id = `ID_NR` view = `MAIN` diff --git a/src/01/02/z2ui6_cl_core_json_srv.clas.xml b/src/01/02/z2ui6_cl_core_srv_json.clas.xml similarity index 91% rename from src/01/02/z2ui6_cl_core_json_srv.clas.xml rename to src/01/02/z2ui6_cl_core_srv_json.clas.xml index 96bc8b4c..164c6cd0 100644 --- a/src/01/02/z2ui6_cl_core_json_srv.clas.xml +++ b/src/01/02/z2ui6_cl_core_srv_json.clas.xml @@ -3,7 +3,7 @@ - Z2UI6_CL_CORE_JSON_SRV + Z2UI6_CL_CORE_SRV_JSON E abap2UI5 - json mapper 1 diff --git a/src/01/02/z2ui6_if_core_types.intf.abap b/src/01/02/z2ui6_if_core_types.intf.abap index d2686983..8ab5430c 100644 --- a/src/01/02/z2ui6_if_core_types.intf.abap +++ b/src/01/02/z2ui6_if_core_types.intf.abap @@ -33,14 +33,6 @@ INTERFACE z2ui6_if_core_types END OF s_stateful, END OF ty_s_http_res. -* TYPES: -* BEGIN OF ty_s_http_handler_attributes, -* BEGIN OF stateful, -* active TYPE i, -* switched TYPE abap_bool, -* END OF stateful, -* END OF ty_s_http_handler_attributes. - TYPES: BEGIN OF ty_s_bind_config, path_only TYPE abap_bool, @@ -149,10 +141,11 @@ INTERFACE z2ui6_if_core_types o_app_call TYPE REF TO z2ui6_if_app, o_app_leave TYPE REF TO z2ui6_if_app, s_set TYPE ty_s_next_frontend, + r_data TYPE REF TO data, END OF ty_s_next. TYPES: - BEGIN OF ty_s_http_response_post, + BEGIN OF ty_s_response, BEGIN OF s_front, params TYPE ty_s_next_frontend, id TYPE string, @@ -160,10 +153,10 @@ INTERFACE z2ui6_if_core_types app TYPE string, END OF s_front, model TYPE string, - END OF ty_s_http_response_post. + END OF ty_s_response. TYPES: - BEGIN OF ty_s_http_request_post, + BEGIN OF ty_s_request, o_model TYPE REF TO z2ui6_if_ajson, BEGIN OF s_front, id TYPE string, @@ -180,7 +173,7 @@ INTERFACE z2ui6_if_core_types check_launchpad TYPE abap_bool, app_start TYPE string, END OF s_control, - END OF ty_s_http_request_post. + END OF ty_s_request. TYPES: BEGIN OF ty_s_draft, @@ -207,6 +200,7 @@ INTERFACE z2ui6_if_core_types view TYPE string, s_draft TYPE ty_s_draft, s_config TYPE ty_s_config, + r_data TYPE REF TO data, END OF ty_s_actual. TYPES ty_s_db TYPE z2ui6_t_01. diff --git a/src/01/03/z2ui6_cl_app_app_js.clas.abap b/src/01/03/z2ui6_cl_app_app_js.clas.abap index ded22eea..138cc443 100644 --- a/src/01/03/z2ui6_cl_app_app_js.clas.abap +++ b/src/01/03/z2ui6_cl_app_app_js.clas.abap @@ -329,6 +329,7 @@ CLASS z2ui6_cl_app_app_js IMPLEMENTATION. `` && |\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| && diff --git a/src/01/03/z2ui6_cl_app_view1_js.clas.abap b/src/01/03/z2ui6_cl_app_view1_js.clas.abap index 7770db37..c6a70c8f 100644 --- a/src/01/03/z2ui6_cl_app_view1_js.clas.abap +++ b/src/01/03/z2ui6_cl_app_view1_js.clas.abap @@ -20,433 +20,426 @@ CLASS z2ui6_cl_app_view1_js IMPLEMENTATION. 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| && + ` "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| && + ` onInit() {` && |\n| && `` && |\n| && - ` z2ui5.oRouter.attachRouteMatched(function(oEvent) {` && |\n| && - ` z2ui5.checkInit = true;` && |\n| && - ` Server.Roundtrip();` && |\n| && - ` }, this);` && |\n| && - `` && |\n| && - ` },` && |\n| && - ` async onAfterRendering() {` && |\n| && + ` z2ui5.oRouter.attachRouteMatched(function (oEvent) {` && |\n| && + ` z2ui5.checkInit = true;` && |\n| && + ` Server.Roundtrip();` && |\n| && + ` }, this);` && |\n| && `` && |\n| && - ` if (!z2ui5.oResponse){` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && + ` },` && |\n| && + ` async onAfterRendering() {` && |\n| && `` && |\n| && - ` try {` && |\n| && - ` if (!z2ui5.oResponse.PARAMS) {` && |\n| && - ` BusyIndicator.hide();` && |\n| && - ` z2ui5.isBusy = false;` && |\n| && + ` if (!z2ui5.oResponse) {` && |\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| && + ` try {` && |\n| && + ` if (!z2ui5.oResponse.PARAMS) {` && |\n| && + ` BusyIndicator.hide();` && |\n| && + ` z2ui5.isBusy = false;` && |\n| && + ` return;` && |\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| && + ` 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| && - ` }` && |\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| && + ` if (S_POPOVER?.CHECK_DESTROY) {` && |\n| && + ` z2ui5.oController.PopoverDestroy();` && |\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| && + ` 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| && - ` }` && |\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| && + ` )` && |\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.oControllerPopover,` && |\n| && - ` id: "popoverId"` && |\n| && + ` controller: z2ui5.oControllerPopup,` && |\n| && + ` id: "popupId"` && |\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| && + ` 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| && - ` oControl = null;` && |\n| && + ` if (sapUiCore.byId(openById)) {` && |\n| && + ` // oControl = sapUiCore.byId(openById);` && |\n| && + ` oControl = Element.getElementById(openById);` && |\n| && + ` } else {` && |\n| && + ` oControl = null;` && |\n| && + ` }` && |\n| && + ` ;` && |\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| && + ` 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| && - ` });` && |\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| && + ` 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| && - ` });` && |\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| && + ` z2ui5[viewProp] = oView;` && |\n| && + ` },` && |\n| && + ` PopupDestroy() {` && |\n| && + ` if (!z2ui5.oViewPopup) {` && |\n| && + ` return;` && |\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| && + ` if (z2ui5.oViewPopup.close) {` && |\n| && + ` try {` && |\n| && + ` z2ui5.oViewPopup.close();` && |\n| && + ` } catch { }` && |\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| && + ` z2ui5.oViewPopup.destroy();` && |\n| && + ` },` && |\n| && + ` PopoverDestroy() {` && |\n| && + ` if (!z2ui5.oViewPopover) {` && |\n| && + ` return;` && |\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| && - ` // var oRouter = sap.ui.core.UIComponent.getRouterFor(this);` && |\n| && - ` //debugger;` && |\n| && - ` // z2ui5.oRouter.navTo("RouteView2");` && |\n| && - ` // return;` && |\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| && - ` 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| && + ` z2ui5.onBeforeEventFrontend.forEach(item => {` && |\n| && + ` if (item !== undefined) {` && |\n| && + ` item(args);` && |\n| && ` }` && |\n| && - ` , 100, oBusyDialog);` && |\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| && - ` }` && |\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| && + ` 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.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| && + ` 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| && - ` }` && |\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| && + ` z2ui5.onBeforeRoundtrip.forEach(item => {` && |\n| && + ` if (item !== undefined) {` && |\n| && + ` item();` && |\n| && + ` }` && |\n| && ` }` && |\n| && - ` if (typeof item === 'object') {` && |\n| && - ` z2ui5.oBody.ARGUMENTS[i] = JSON.stringify(item);` && |\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| && - ` );` && |\n| && - ` z2ui5.oResponseOld = z2ui5.oResponse;` && |\n| && - ` Server.Roundtrip();` && |\n| && + ` );` && |\n| && + ` z2ui5.oResponseOld = z2ui5.oResponse;` && |\n| && + ` Server.Roundtrip();` && |\n| && `` && |\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| && + ` updateModelIfRequired(paramKey, oView) {` && |\n| && + ` if (z2ui5.oResponse.PARAMS == undefined) {` && |\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| && + ` 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| && - ` } else if (msgType === 'S_MSG_BOX') {` && |\n| && - ` if (params[msgType].TYPE) {` && |\n| && - ` MessageBox[params[msgType].TYPE](params[msgType].TEXT);` && |\n| && - ` } else {` && |\n| && - ` MessageBox.show(params[msgType].TEXT, {` && |\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| && @@ -457,35 +450,67 @@ CLASS z2ui6_cl_app_view1_js IMPLEMENTATION. ` 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| && + ` 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| && - ` },` && |\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| && + ` 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| && - ` });` && |\n| && - ` z2ui5.oView.setModel(z2ui5.oDeviceModel, "device");` && |\n| && - ` this._oApp.removeAllPages();` && |\n| && - ` this._oApp.insertPage(z2ui5.oView);` && |\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. diff --git a/src/02/01/z2ui6_cl_pop_messages.clas.abap b/src/02/01/z2ui6_cl_pop_messages.clas.abap index 2a6d2a14..5771813e 100644 --- a/src/02/01/z2ui6_cl_pop_messages.clas.abap +++ b/src/02/01/z2ui6_cl_pop_messages.clas.abap @@ -11,19 +11,22 @@ CLASS z2ui6_cl_pop_messages DEFINITION BEGIN OF ty_s_msg, type TYPE string, id TYPE string, + title TYPE string, + subtitle TYPE string, number TYPE string, message TYPE string, message_v1 TYPE string, message_v2 TYPE string, message_v3 TYPE string, message_v4 TYPE string, + 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 IMPORTING - i_messages TYPE ty_t_msg + i_messages TYPE STANDARD TABLE i_title TYPE string DEFAULT `abap2UI5 - Message Popup` RETURNING VALUE(r_result) TYPE REF TO z2ui6_cl_pop_messages. @@ -45,7 +48,21 @@ CLASS z2ui6_cl_pop_messages IMPLEMENTATION. METHOD factory. r_result = NEW #( ). - r_result->mt_msg = i_messages. + DATA(lt_msg) = z2ui6_cl_util=>msg_get( i_messages ). + + LOOP AT lt_msg REFERENCE INTO DATA(lr_row). + + DATA(ls_row) = VALUE ty_s_msg( ). + ls_row-type = z2ui6_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. +* lr_row->group = `001`. + + INSERT ls_row INTO TABLE r_result->mt_msg. + ENDLOOP. + r_result->title = i_title. ENDMETHOD. @@ -53,32 +70,36 @@ CLASS z2ui6_cl_pop_messages IMPLEMENTATION. METHOD view_display. - DATA(popup) = z2ui6_cl_xml_view=>factory_popup( )->dialog( - title = title - afterclose = client->_event( 'BUTTON_CONTINUE' ) - )->table( - client->_bind_edit( mt_msg ) - )->columns( - )->column( )->text( 'Title' )->get_parent( - )->column( )->text( 'Color' )->get_parent( - )->column( )->text( 'Info' )->get_parent( - )->column( )->text( 'Description' )->get_parent( - )->get_parent( - )->items( )->column_list_item( - )->cells( - )->text( '{TYPE}' - )->text( '{ID}' - )->text( '{NUMBER}' - )->text( '{MESSAGE}' - )->get_parent( )->get_parent( )->get_parent( )->get_parent( - )->buttons( - )->button( + DATA(popup) = z2ui6_cl_xml_view=>factory_popup( ). + 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->buttons( + )->button( text = 'continue' press = client->_event( 'BUTTON_CONTINUE' ) type = 'Emphasized' ). + client->popup_display( popup->stringify( ) ). + ENDMETHOD. @@ -95,7 +116,7 @@ CLASS z2ui6_cl_pop_messages IMPLEMENTATION. CASE client->get( )-event. WHEN `BUTTON_CONTINUE`. client->popup_destroy( ). - client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ). + client->nav_app_leave( ). WHEN OTHERS. ENDCASE. diff --git a/src/02/01/z2ui6_cl_pop_to_confirm.clas.abap b/src/02/01/z2ui6_cl_pop_to_confirm.clas.abap index be35966b..7124a276 100644 --- a/src/02/01/z2ui6_cl_pop_to_confirm.clas.abap +++ b/src/02/01/z2ui6_cl_pop_to_confirm.clas.abap @@ -7,6 +7,12 @@ CLASS z2ui6_cl_pop_to_confirm DEFINITION INTERFACES z2ui6_if_app. + CONSTANTS: + BEGIN OF CS_event, + confirmed TYPE string VALUE 'z2ui5_cl_pop_to_confirm_confirmed', + canceled TYPE string VALUE 'z2ui5_cl_pop_to_confirm_canceled', + END OF cs_event. + CLASS-METHODS factory IMPORTING i_question_text TYPE string @@ -14,6 +20,8 @@ CLASS z2ui6_cl_pop_to_confirm DEFINITION i_icon TYPE string DEFAULT 'sap-icon://question-mark' i_button_text_confirm TYPE string DEFAULT `OK` i_button_text_cancel TYPE string DEFAULT `Cancel` + i_event_confirm TYPE string DEFAULT CS_event-confirmed + i_event_cancel TYPE string DEFAULT CS_event-canceled RETURNING VALUE(r_result) TYPE REF TO z2ui6_cl_pop_to_confirm. @@ -31,6 +39,8 @@ CLASS z2ui6_cl_pop_to_confirm DEFINITION 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. METHODS view_display. PRIVATE SECTION. ENDCLASS. @@ -56,6 +66,9 @@ CLASS z2ui6_cl_pop_to_confirm IMPLEMENTATION. 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. + ENDMETHOD. @@ -98,11 +111,14 @@ CLASS z2ui6_cl_pop_to_confirm IMPLEMENTATION. WHEN `BUTTON_CONFIRM`. check_result_confirmed = abap_true. client->popup_destroy( ). - client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ). + client->nav_app_leave( client->get_app_prev( ) ). + client->follow_up_action( client->_event( event_confirm ) ). + WHEN `BUTTON_CANCEL`. + client->follow_up_action( client->_event( event_canceled ) ). check_result_confirmed = abap_false. client->popup_destroy( ). - client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ). + client->nav_app_leave( client->get_app_prev( ) ). ENDCASE. ENDMETHOD. diff --git a/src/02/01/z2ui6_cl_pop_to_select.clas.abap b/src/02/01/z2ui6_cl_pop_to_select.clas.abap index 3cfd0b63..1c4f213f 100644 --- a/src/02/01/z2ui6_cl_pop_to_select.clas.abap +++ b/src/02/01/z2ui6_cl_pop_to_select.clas.abap @@ -28,6 +28,8 @@ CLASS z2ui6_cl_pop_to_select DEFINITION !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 z2ui6_cl_pop_to_select . METHODS result @@ -46,6 +48,8 @@ CLASS z2ui6_cl_pop_to_select DEFINITION 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 . @@ -63,13 +67,21 @@ CLASS z2ui6_cl_pop_to_select IMPLEMENTATION. METHOD factory. r_result = NEW #( ). - r_result->title = i_title. + IF i_title IS INITIAL. + r_result->title = COND #( + WHEN i_multiselect = abap_true + THEN `Multi select` + 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->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->mr_tab = z2ui6_cl_util=>conv_copy_ref_data( i_tab ). CREATE DATA r_result->ms_result-row LIKE LINE OF i_tab. @@ -151,9 +163,11 @@ CLASS z2ui6_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 ) ). + client->follow_up_action( client->_event( event_canceled ) ). WHEN 'SEARCH'. on_event_search( ). @@ -252,10 +266,10 @@ CLASS z2ui6_cl_pop_to_select IMPLEMENTATION. = CORRESPONDING #( ). ENDIF. + INSERT INTO TABLE . IF multiselect = abap_false. EXIT. ELSE. - INSERT INTO TABLE . CLEAR . ENDIF. @@ -263,6 +277,7 @@ CLASS z2ui6_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 = ) ). ENDMETHOD. diff --git a/src/02/z2ui6_cl_http_handler.clas.abap b/src/02/z2ui6_cl_http_handler.clas.abap index 7015b1fc..e9539ff0 100644 --- a/src/02/z2ui6_cl_http_handler.clas.abap +++ b/src/02/z2ui6_cl_http_handler.clas.abap @@ -28,35 +28,57 @@ CLASS z2ui6_cl_http_handler DEFINITION RETURNING VALUE(result) TYPE REF TO z2ui6_cl_http_handler. + CLASS-METHODS _http_post + IMPORTING + is_req TYPE z2ui6_if_core_types=>ty_s_http_req + RETURNING + VALUE(result) TYPE z2ui6_if_core_types=>ty_s_http_res. + + CLASS-METHODS _http_get + IMPORTING + VALUE(is_config) TYPE z2ui6_if_types=>ty_s_http_config + RETURNING + VALUE(result) TYPE string. + METHODS main IMPORTING s_config TYPE z2ui6_if_types=>ty_s_http_config OPTIONAL. + CLASS-METHODS _main + IMPORTING + is_config TYPE z2ui6_if_types=>ty_s_http_config + is_req TYPE z2ui6_if_core_types=>ty_s_http_req + RETURNING + VALUE(result) TYPE z2ui6_if_core_types=>ty_s_http_res. + + CLASS-METHODS get_request + IMPORTING + server TYPE REF TO object OPTIONAL + req TYPE REF TO object OPTIONAL + res TYPE REF TO object OPTIONAL + PREFERRED PARAMETER server + RETURNING + VALUE(result) TYPE z2ui6_if_core_types=>ty_s_http_req. + + CLASS-METHODS get_response + IMPORTING + server TYPE REF TO object OPTIONAL + req TYPE REF TO object OPTIONAL + res TYPE REF TO object OPTIONAL + is_res TYPE z2ui6_if_core_types=>ty_s_http_res. + PROTECTED SECTION. - CLASS-DATA so_sticky_handler TYPE REF TO z2ui6_cl_core_http_post. + CLASS-DATA so_sticky_handler TYPE REF TO z2ui6_cl_core_handler. DATA mo_server TYPE REF TO z2ui6_cl_abap_api_http. -* DATA ms_session_attributes TYPE z2ui5_if_core_types=>ty_s_http_handler_attributes. DATA ms_req TYPE z2ui6_if_core_types=>ty_s_http_req. DATA ms_res TYPE z2ui6_if_core_types=>ty_s_http_res. DATA ms_config TYPE z2ui6_if_types=>ty_s_http_config. - METHODS http_get. - METHODS http_post. - - METHODS session_handling. -* IMPORTING -* attributes TYPE z2ui5_if_core_types=>ty_s_http_handler_attributes. - - METHODS get_index_html - RETURNING - VALUE(result) TYPE string - ##CALLED. METHODS set_request. - METHODS set_response. PRIVATE SECTION. @@ -72,20 +94,18 @@ CLASS z2ui6_cl_http_handler IMPLEMENTATION. METHOD main. ms_config = s_config. + set_request( ). CASE ms_req-method. - WHEN `GET`. - http_get( ). - WHEN `POST`. - http_post( ). WHEN `HEAD`. mo_server->set_session_stateful( 0 ). RETURN. + WHEN OTHERS. + ms_res = _main( is_req = ms_req is_config = ms_config ). ENDCASE. set_response( ). - session_handling( ). ENDMETHOD. @@ -112,97 +132,43 @@ CLASS z2ui6_cl_http_handler IMPLEMENTATION. ENDMETHOD. - METHOD http_get. - - ms_res-body = get_index_html( ). - - ENDMETHOD. - - - METHOD http_post. - - IF so_sticky_handler IS NOT BOUND. - DATA(lo_post) = NEW z2ui6_cl_core_http_post( ms_req-body ). - ELSE. - lo_post = so_sticky_handler. - lo_post->mv_request_json = ms_req-body. - ENDIF. - - ms_res = lo_post->main( ). - - TRY. - IF lo_post IS BOUND. - DATA(li_app) = CAST z2ui6_if_app( lo_post->mo_action->mo_app->mo_app ). - IF li_app->check_sticky = abap_true. - so_sticky_handler = lo_post. - ELSE. - CLEAR so_sticky_handler. - ENDIF. - ENDIF. - CATCH cx_root. - ENDTRY. - - ENDMETHOD. - - - METHOD session_handling. - - "transform cookie to header based contextid handling - IF ms_res-s_stateful-switched = abap_true. - mo_server->set_session_stateful( ms_res-s_stateful-active ). - IF mo_server->get_header_field( 'sap-contextid-accept' ) = 'header'. - DATA(lv_contextid) = mo_server->get_response_cookie( 'sap-contextid' ). - IF lv_contextid IS NOT INITIAL. - mo_server->delete_response_cookie( 'sap-contextid' ). - mo_server->set_header_field( n = 'sap-contextid' v = lv_contextid ). - ENDIF. - ENDIF. - ELSE. - lv_contextid = mo_server->get_header_field( 'sap-contextid' ). - IF lv_contextid IS NOT INITIAL. - mo_server->set_header_field( n = 'sap-contextid' v = lv_contextid ). - ENDIF. - ENDIF. - - ENDMETHOD. - - METHOD get_index_html. + METHOD _http_get. - IF ms_config-title IS INITIAL. - ms_config-title = `abap2UI5`. + IF is_config-title IS INITIAL. + is_config-title = `abap2UI5`. ENDIF. - IF ms_config-theme IS INITIAL. - ms_config-theme = `sap_horizon`. + IF is_config-theme IS INITIAL. + is_config-theme = `sap_horizon`. ENDIF. - IF ms_config-src IS INITIAL. - ms_config-src = `https://sdk.openui5.org/resources/sap-ui-cachebuster/sap-ui-core.js`. + IF is_config-src IS INITIAL. + is_config-src = `https://sdk.openui5.org/resources/sap-ui-cachebuster/sap-ui-core.js`. * ms_req_config-src = `https://sdk.openui5.org/1.71.67/resources/sap-ui-core.js`. * ms_req_config-src = `https://sdk.openui5.org/nightly/2/resources/sap-ui-core.js`. ENDIF. - IF ms_config-content_security_policy IS INITIAL. - ms_config-content_security_policy = ``. ENDIF. - IF ms_config-styles_css IS INITIAL. + IF is_config-styles_css IS INITIAL. DATA(lv_style_css) = z2ui6_cl_app_style_css=>get( ). ELSE. - lv_style_css = ms_config-styles_css. + lv_style_css = is_config-styles_css. ENDIF. result = `` && |\n| && `` && |\n| && `` && |\n| && - ms_config-content_security_policy && |\n| && + is_config-content_security_policy && |\n| && ` ` && |\n| && ` ` && |\n| && ` ` && |\n| && - | { ms_config-title } \n| && + | { is_config-title } \n| && | \n| && @@ -210,7 +176,7 @@ CLASS z2ui6_cl_http_handler IMPLEMENTATION. ` function onInitComponent(){` && |\n| && ` sap.ui.require.preload({` && |\n| && ` "z2ui5/manifest.json": '` && z2ui6_cl_app_manifest_json=>get( ) && `',` && |\n| && - ` "z2ui5/Component.js": function(){` && z2ui6_cl_app_component_js=>get( ) && ms_config-custom_js && `},` && |\n| && + ` "z2ui5/Component.js": function(){` && z2ui6_cl_app_component_js=>get( ) && is_config-custom_js && `},` && |\n| && ` "z2ui5/css/style.css": '` && lv_style_css && `',` && |\n| && ` "z2ui5/model/models.js": function(){` && z2ui6_cl_app_models_js=>get( ) && `},` && |\n| && ` "z2ui5/view/App.view.xml": '` && z2ui6_cl_app_app_xml=>get( ) && `',` && |\n| && @@ -228,9 +194,9 @@ CLASS z2ui6_cl_http_handler IMPLEMENTATION. `` && |\n| && `