diff --git a/src/01/02/z2ui5_cl_core_client.clas.abap b/src/01/02/z2ui5_cl_core_client.clas.abap index 8c72d98e5..2dd196ef1 100644 --- a/src/01/02/z2ui5_cl_core_client.clas.abap +++ b/src/01/02/z2ui5_cl_core_client.clas.abap @@ -167,6 +167,7 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION. mo_action->ms_next-s_set-s_view_nest2-id = id. mo_action->ms_next-s_set-s_view_nest2-method_destroy = method_destroy. mo_action->ms_next-s_set-s_view_nest2-method_insert = method_insert. + mo_action->ms_next-s_set-s_view_nest2-s_config = s_config. ENDMETHOD. @@ -191,6 +192,7 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION. mo_action->ms_next-s_set-s_view_nest-id = id. mo_action->ms_next-s_set-s_view_nest-method_destroy = method_destroy. mo_action->ms_next-s_set-s_view_nest-method_insert = method_insert. + mo_action->ms_next-s_set-s_view_nest-s_config = s_config. ENDMETHOD. @@ -214,6 +216,7 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION. mo_action->ms_next-s_set-s_popover-check_destroy = abap_false. mo_action->ms_next-s_set-s_popover-xml = xml. mo_action->ms_next-s_set-s_popover-open_by_id = by_id. + mo_action->ms_next-s_set-s_popover-s_config = s_config. ENDMETHOD. @@ -236,6 +239,7 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION. mo_action->ms_next-s_set-s_popup-check_destroy = abap_false. mo_action->ms_next-s_set-s_popup-xml = val. + mo_action->ms_next-s_set-s_popup-s_config = s_config. ENDMETHOD. @@ -257,7 +261,7 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION. METHOD z2ui5_if_client~view_display. mo_action->ms_next-s_set-s_view-xml = val. - mo_action->ms_next-s_set-s_view-t_config = t_config. + mo_action->ms_next-s_set-s_view-s_config = s_config. ENDMETHOD. diff --git a/src/01/02/z2ui5_cl_core_http_get.clas.abap b/src/01/02/z2ui5_cl_core_http_get.clas.abap index c0ec52852..6ac150091 100644 --- a/src/01/02/z2ui5_cl_core_http_get.clas.abap +++ b/src/01/02/z2ui5_cl_core_http_get.clas.abap @@ -6,7 +6,6 @@ CLASS z2ui5_cl_core_http_get DEFINITION PUBLIC SECTION. DATA ms_request TYPE z2ui5_if_types=>ty_s_http_request_get. - DATA mv_response TYPE string. METHODS constructor IMPORTING @@ -17,6 +16,8 @@ CLASS z2ui5_cl_core_http_get DEFINITION VALUE(result) TYPE string. METHODS get_js +* IMPORTING +* cs_config TYPE z2ui5_if_types=>ty_s_http_request_get RETURNING VALUE(result) TYPE string. @@ -28,18 +29,24 @@ CLASS z2ui5_cl_core_http_get DEFINITION METHODS get_default_config RETURNING - VALUE(result) TYPE z2ui5_if_types=>ty_s_http_request_get-t_config. + VALUE(result) TYPE z2ui5_if_types=>ty_s_http_request_get. - METHODS get_default_security_policy + METHODS main_get_config RETURNING - VALUE(result) TYPE string. + VALUE(result) TYPE z2ui5_if_types=>ty_s_http_request_get. + + METHODS main_get_index_html + IMPORTING + cs_config TYPE z2ui5_if_types=>ty_s_http_request_get + RETURNING VALUE(result) TYPE string. + PRIVATE SECTION. ENDCLASS. -CLASS Z2UI5_CL_CORE_HTTP_GET IMPLEMENTATION. +CLASS z2ui5_cl_core_http_get IMPLEMENTATION. METHOD constructor. @@ -51,27 +58,135 @@ CLASS Z2UI5_CL_CORE_HTTP_GET IMPLEMENTATION. METHOD get_default_config. + DATA(lv_csp) = ``. + + DATA(lv_style) = ` html, body, body > div, #container, #container-uiarea {` && |\n| && + ` height: 100%;` && |\n| && + ` }` && |\n| && + ` .dbg-ltr {` && |\n| && + ` direction: ltr !important;` && |\n| && + ` }`. + result = VALUE #( - ( n = `src` v = `https://sdk.openui5.org/resources/sap-ui-cachebuster/sap-ui-core.js` ) -* ( n = `src` v = `https://ui5.sap.com/1.124.0/resources/sap-ui-core.js` ) - ( n = `data-sap-ui-theme` v = `sap_horizon` ) - ( n = `data-sap-ui-async` v = `true` ) - ( n = `data-sap-ui-bindingSyntax` v = `complex` ) - ( n = `data-sap-ui-frameOptions` v = `trusted` ) - ( n = `data-sap-ui-compatVersion` v = `edge` ) ). + t_param = VALUE #( + ( n = `TITLE` v = `abap2UI5` ) + ( n = `STYLE` v = lv_style ) + ( n = `SET_SIZE_LIMIT` v = `100` ) + ( n = `BODY_CLASS` v = `sapUiBody sapUiSizeCompact` ) + ) + t_config = VALUE #( + ( n = `src` v = `https://sdk.openui5.org/resources/sap-ui-cachebuster/sap-ui-core.js` ) +* ( n = `src` v = `https://sdk.openui5.org/nightly/2/resources/sap-ui-core.js` ) + ( n = `data-sap-ui-theme` v = `sap_horizon` ) + ( n = `data-sap-ui-async` v = `true` ) + ( n = `id` v = `sap-ui-bootstrap` ) + ( n = `data-sap-ui-bindingSyntax` v = `complex` ) + ( n = `data-sap-ui-frameOptions` v = `trusted` ) + ( n = `data-sap-ui-compatVersion` v = `edge` ) ) + content_security_policy = lv_csp ). ENDMETHOD. - METHOD get_default_security_policy. + METHOD get_js_cc_startup. - result = ``. + result = ` ` && + z2ui5_cl_cc_timer=>get_js( ) && + z2ui5_cl_cc_focus=>get_js( ) && + z2ui5_cl_cc_title=>get_js( ) && + z2ui5_cl_cc_lp_title=>get_js( ) && + z2ui5_cl_cc_history=>get_js( ) && + z2ui5_cl_cc_scrolling=>get_js( ) && + z2ui5_cl_cc_info=>get_js( ) && + z2ui5_cl_cc_geoloc=>get_js( ) && + z2ui5_cl_cc_file_upl=>get_js( ) && + z2ui5_cl_cc_multiinput=>get_js( ) && + z2ui5_cl_cc_uitable=>get_js( ) && + z2ui5_cl_cc_util=>get_js( ) && + z2ui5_cl_cc_favicon=>get_js( ) && + z2ui5_cl_cc_dirty=>get_js( ) && + ` `. + + ENDMETHOD. + + METHOD main_get_config. + + result = get_default_config( ). + + LOOP AT ms_request-t_param REFERENCE INTO DATA(lr_param). + TRY. + result-t_param[ n = lr_param->n ]-v = lr_param->v. + CATCH cx_root. + INSERT lr_param->* INTO TABLE result-t_param. + ENDTRY. + ENDLOOP. + + LOOP AT ms_request-t_config REFERENCE INTO DATA(lr_option). + TRY. + result-t_config[ n = lr_option->n ]-v = lr_option->v. + CATCH cx_root. + INSERT lr_option->* INTO TABLE result-t_config. + ENDTRY. + ENDLOOP. + + IF ms_request-content_security_policy IS NOT INITIAL. + result-content_security_policy = ms_request-content_security_policy. + ENDIF. + + IF ms_request-custom_js IS NOT INITIAL. + result-custom_js = ms_request-custom_js. + ENDIF. + + ENDMETHOD. + + + METHOD main_get_index_html. + + result = `` && |\n| && + `` && |\n| && + `` && |\n| && + cs_config-content_security_policy && |\n| && + ` ` && |\n| && + ` ` && |\n| && + ` ` && |\n| && + | { cs_config-t_param[ n = `TITLE` ]-v } \n| && + | \n| && + ` ` && |\n| && + `` && |\n| && + `
` && |\n| && + `` && |\n|. + + DATA(lv_add_js) = get_js_cc_startup( ) && cs_config-custom_js. + result = result && + | |. ENDMETHOD. + METHOD main. + + DATA(ls_config) = main_get_config( ). + result = main_get_index_html( ls_config ). + NEW z2ui5_cl_core_draft_srv( )->cleanup( ). + + ENDMETHOD. + METHOD get_js. DATA(lv_two_way_model) = z2ui5_if_core_types=>cs_ui5-two_way_model. @@ -566,83 +681,4 @@ CLASS Z2UI5_CL_CORE_HTTP_GET IMPLEMENTATION. ENDMETHOD. - METHOD get_js_cc_startup. - - result = ` ` && - z2ui5_cl_cc_timer=>get_js( ) && - z2ui5_cl_cc_focus=>get_js( ) && - z2ui5_cl_cc_title=>get_js( ) && - z2ui5_cl_cc_lp_title=>get_js( ) && - z2ui5_cl_cc_history=>get_js( ) && - z2ui5_cl_cc_scrolling=>get_js( ) && - z2ui5_cl_cc_info=>get_js( ) && - z2ui5_cl_cc_geoloc=>get_js( ) && - z2ui5_cl_cc_file_upl=>get_js( ) && - z2ui5_cl_cc_multiinput=>get_js( ) && - z2ui5_cl_cc_uitable=>get_js( ) && - z2ui5_cl_cc_util=>get_js( ) && - z2ui5_cl_cc_favicon=>get_js( ) && - z2ui5_cl_cc_dirty=>get_js( ) && - ` `. - - ENDMETHOD. - - - METHOD main. - - DATA(lt_config) = COND #( WHEN ms_request-t_config IS INITIAL - THEN get_default_config( ) - ELSE ms_request-t_config ). - - DATA(lv_sec_policy) = COND #( WHEN ms_request-content_security_policy IS INITIAL - THEN get_default_security_policy( ) - ELSE ms_request-content_security_policy ). - - mv_response = `` && |\n| && - `` && |\n| && - `` && |\n| && - lv_sec_policy && |\n| && - ` ` && |\n| && - ` ` && |\n| && - ` ` && |\n| && - ` abap2UI5` && |\n| && - ` ` && - ` ` && |\n| && - `` && |\n| && - `
` && |\n| && - `` && |\n|. - - DATA(lv_add_js) = get_js_cc_startup( ) && ms_request-custom_js. - - mv_response = mv_response && - `` && |\n| && - ``. - - NEW z2ui5_cl_core_draft_srv( )->cleanup( ). - result = mv_response. - - ENDMETHOD. ENDCLASS. diff --git a/src/01/02/z2ui5_cl_core_http_get2.clas.abap b/src/01/02/z2ui5_cl_core_http_get2.clas.abap deleted file mode 100644 index 08b2c499f..000000000 --- a/src/01/02/z2ui5_cl_core_http_get2.clas.abap +++ /dev/null @@ -1,669 +0,0 @@ -CLASS z2ui5_cl_core_http_get2 DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . - - PUBLIC SECTION. - CLASS-METHODS class_constructor. - - METHODS constructor - IMPORTING - val TYPE z2ui5_if_types=>ty_s_config_index_html OPTIONAL. - - METHODS main - RETURNING - VALUE(result) TYPE string. - - - PROTECTED SECTION. - - CLASS-DATA cs_config_default TYPE z2ui5_if_types=>ty_s_config_index_html. - - DATA ms_config_in TYPE z2ui5_if_types=>ty_s_config_index_html. - DATA mv_index_html TYPE string. - - CLASS-METHODS set_default_config. - - METHODS get_js - RETURNING - VALUE(result) TYPE string. - - METHODS get_js_cc_startup - RETURNING - VALUE(result) TYPE string. - - METHODS main_set_config - RETURNING - VALUE(result) TYPE z2ui5_if_types=>ty_s_config_index_html. - - METHODS main_set_index_html - IMPORTING - cs_config TYPE z2ui5_if_types=>ty_s_config_index_html. - - PRIVATE SECTION. -ENDCLASS. - - - -CLASS z2ui5_cl_core_http_get2 IMPLEMENTATION. - - METHOD constructor. - - me->ms_config_in = val. - - ENDMETHOD. - - METHOD class_constructor. - set_default_config( ). - ENDMETHOD. - - - METHOD set_default_config. - - DATA(lv_csp) = `default-src 'self' 'unsafe-inline' 'unsafe-eval' data: ` && - `ui5.sap.com *.ui5.sap.com sapui5.hana.ondemand.com *.sapui5.hana.ondemand.com openui5.hana.ondemand.com *.openui5.hana.ondemand.com ` && - `sdk.openui5.org *.sdk.openui5.org cdn.jsdelivr.net *.cdn.jsdelivr.net cdnjs.cloudflare.com *.cdnjs.cloudflare.com schemas *.schemas`. - - cs_config_default = VALUE #( - t_param = VALUE #( - ( n = `TITLE` v = `abap2UI5` ) - ( n = `BODY_CLASS` v = `sapUiBody sapUiSizeCompact` ) - ( n = `CONTENT_SECURITY_POLICY` v = lv_csp ) - ) - t_option = VALUE #( - ( n = `src` v = `https://sdk.openui5.org/resources/sap-ui-cachebuster/sap-ui-core.js` ) -* ( n = `src` v = `https://sdk.openui5.org/nightly/2/resources/sap-ui-core.js` ) - ( n = `data-sap-ui-theme` v = `sap_horizon` ) - ( n = `data-sap-ui-async` v = `true` ) - ( n = `id` v = `sap-ui-bootstrap` ) - ( n = `data-sap-ui-bindingSyntax` v = `complex` ) - ( n = `data-sap-ui-frameOptions` v = `trusted` ) - ( n = `data-sap-ui-compatVersion` v = `edge` ) - ) ). - - ENDMETHOD. - - METHOD main_set_config. - - result = cs_config_default. - - LOOP AT ms_config_in-t_param REFERENCE INTO DATA(lr_param). - TRY. - result-t_param[ n = lr_param->n ]-v = lr_param->v. - CATCH cx_root. - INSERT lr_param->* INTO TABLE result-t_param. - ENDTRY. - ENDLOOP. - - LOOP AT ms_config_in-t_option REFERENCE INTO DATA(lr_option). - TRY. - result-t_option[ n = lr_option->n ]-v = lr_option->v. - CATCH cx_root. - INSERT lr_option->* INTO TABLE result-t_option. - ENDTRY. - ENDLOOP. - - ENDMETHOD. - - - METHOD get_js_cc_startup. - - result = ` ` && - z2ui5_cl_cc_timer=>get_js( ) && - z2ui5_cl_cc_focus=>get_js( ) && - z2ui5_cl_cc_title=>get_js( ) && - z2ui5_cl_cc_lp_title=>get_js( ) && - z2ui5_cl_cc_history=>get_js( ) && - z2ui5_cl_cc_scrolling=>get_js( ) && - z2ui5_cl_cc_info=>get_js( ) && - z2ui5_cl_cc_geoloc=>get_js( ) && - z2ui5_cl_cc_file_upl=>get_js( ) && - z2ui5_cl_cc_multiinput=>get_js( ) && - z2ui5_cl_cc_uitable=>get_js( ) && - z2ui5_cl_cc_util=>get_js( ) && - z2ui5_cl_cc_favicon=>get_js( ) && - z2ui5_cl_cc_dirty=>get_js( ) && - ` `. - - ENDMETHOD. - - - METHOD main. - - DATA(ls_config) = main_set_config( ). - main_set_index_html( ls_config ). - result = mv_index_html. - - NEW z2ui5_cl_core_draft_srv( )->cleanup( ). - - ENDMETHOD. - - - METHOD main_set_index_html. - - mv_index_html = `` && |\n| && - `` && |\n| && - | \n| && - ` ` && |\n| && - ` ` && |\n| && - | { cs_config-t_param[ n = `TITLE` ]-v } \n| && - ` \n| && - | \n| && - | \n| && - |
\n| && - | \n|. - - DATA(lv_add_js) = get_js_cc_startup( ) && ms_config_in-add_js. - - mv_index_html = mv_index_html && - | |. - - ENDMETHOD. - - - METHOD get_js. - - DATA(lv_two_way_model) = z2ui5_if_core_types=>cs_ui5-two_way_model. - - result = ` if (!z2ui5.Controller) { ` && - `sap.ui.define("z2ui5/Controller", ["sap/ui/core/mvc/Controller", "sap/ui/core/mvc/XMLView", "sap/ui/model/json/JSONModel", "sap/ui/core/BusyIndicator", "sap/m/MessageBox", "sap/m/MessageToast", "sap/ui/core/Fragment", "sap/m/BusyDialog` && -`", "sap/ui/VersionInfo" ], function(Control` && - `ler, XMLView, JSONModel, BusyIndicator, MessageBox, MessageToast, Fragment, mBusyDialog, VersionInfo ) {` && |\n| && - ` "use strict";` && |\n| && - ` return Controller = Controller.extend("z2ui5.Controller", {` && |\n| && - ` async onAfterRendering() {` && |\n| && - ` try{` && |\n| && - ` if (!sap.z2ui5.oResponse.PARAMS) {` && |\n| && - ` BusyIndicator.hide();` && |\n| && - ` sap.z2ui5.isBusy = false;` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` const {S_POPUP, S_VIEW_NEST, S_VIEW_NEST2, S_POPOVER} = sap.z2ui5.oResponse.PARAMS;` && |\n| && - ` if (S_POPUP?.CHECK_DESTROY) {` && |\n| && - ` sap.z2ui5.oController.PopupDestroy();` && |\n| && - ` }` && |\n| && - ` if (S_POPOVER?.CHECK_DESTROY) {` && |\n| && - ` sap.z2ui5.oController.PopoverDestroy();` && |\n| && - ` }` && |\n| && - ` if (S_POPUP?.XML) {` && |\n| && - ` sap.z2ui5.oController.PopupDestroy();` && |\n| && - ` await this.displayFragment(S_POPUP.XML, 'oViewPopup');` && |\n| && - ` }` && |\n| && - ` if (!sap.z2ui5.checkNestAfter) {` && |\n| && - ` if (S_VIEW_NEST?.XML) {` && |\n| && - ` sap.z2ui5.oController.NestViewDestroy();` && |\n| && - ` await this.displayNestedView(S_VIEW_NEST.XML, 'oViewNest', 'S_VIEW_NEST');` && |\n| && - ` sap.z2ui5.checkNestAfter = true;` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` if (!sap.z2ui5.checkNestAfter2) {` && |\n| && - ` if (S_VIEW_NEST2?.XML) {` && |\n| && - ` sap.z2ui5.oController.NestViewDestroy2();` && |\n| && - ` await this.displayNestedView2(S_VIEW_NEST2.XML, 'oViewNest2', 'S_VIEW_NEST2');` && |\n| && - ` sap.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| && - ` sap.z2ui5.isBusy = false;` && |\n| && - ` sap.z2ui5.onAfterRendering.forEach(item=>{` && |\n| && - ` if (item !== undefined) {` && |\n| && - ` item();` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` )` && |\n| && -` }catch(e){BusyIndicator.hide(); sap.z2ui5.isBusy = false; MessageBox.error( e.toLocaleString() , { title : "Unexpected Error Occured - App Terminated" , actions : [ ] , onClose : () => { new mBusyDialog({ text : "Please Restart t` && -`he App" }).open(); } } ) }` && |\n| && - ` },` && |\n| && - |\n| && - ` async displayFragment(xml, viewProp) {` && |\n| && - ` let oview_model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| && - ` const oFragment = await Fragment.load({` && |\n| && - ` definition: xml,` && |\n| && - ` controller: sap.z2ui5.oControllerPopup,` && |\n| && - ` id: "popupId"` && |\n| && - ` });` && |\n| && - ` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| && - ` oFragment.setModel(oview_model);` && |\n| && - ` sap.z2ui5[viewProp] = oFragment;` && |\n| && - ` sap.z2ui5[viewProp].Fragment = Fragment;` && |\n| && - ` oFragment.open();` && |\n| && - ` },` && |\n| && - ` async displayPopover(xml, viewProp, openById) {` && |\n| && - ` // let sapUiCore = sap.ui.require('sap/ui/core/Core');` && |\n| && - ` sap.ui.require(["sap/ui/core/Element"], async function(Element) { ` && - ` ` && - ` ` && |\n| && - ` const oFragment = await Fragment.load({` && |\n| && - ` definition: xml,` && |\n| && - ` controller: sap.z2ui5.oControllerPopover,` && |\n| && - ` id: "popoverId"` && |\n| && - ` });` && |\n| && - ` let oview_model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| && - ` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| && - ` oFragment.setModel(oview_model);` && |\n| && - ` sap.z2ui5[viewProp] = oFragment;` && |\n| && - ` sap.z2ui5[viewProp].Fragment = Fragment;` && |\n| && - ` let oControl = {};` && |\n| && - ` if( sap.z2ui5.oView?.byId(openById) ) {` && |\n| && - ` oControl = sap.z2ui5.oView.byId(openById);` && |\n| && - ` } else if ( sap.z2ui5.oViewPopup?.Fragment.byId('popupId',openById) ) {` && |\n| && - ` oControl = sap.z2ui5.oViewPopup.Fragment.byId('popupId',openById);` && |\n| && - ` } else if ( sap.z2ui5.oViewNest?.byId(openById) ) {` && |\n| && - ` oControl = sap.z2ui5.oViewNest.byId(openById);` && |\n| && - ` } else if ( sap.z2ui5.oViewNest2?.byId(openById) ) {` && |\n| && - ` oControl = sap.z2ui5.oViewNest2.byId(openById);` && |\n| && - ` } else {` && |\n| && - ` if(sapUiCore.byId(openById)) {` && |\n| && - ` // oControl = sapUiCore.byId(openById);` && |\n| && - ` oControl = Element.getElementById(openById);` && |\n| && - ` } else {` && |\n| && - ` oControl = null;` && |\n| && - ` };` && |\n| && - ` }` && |\n| && - ` oFragment.openBy(oControl);` && |\n| && - ` }); },` && |\n| && - ` async displayNestedView(xml, viewProp, viewNestId) {` && |\n| && - ` let oview_model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| && - ` const oView = await XMLView.create({` && |\n| && - ` definition: xml,` && |\n| && - ` controller: sap.z2ui5.oControllerNest,` && |\n| && - ` preprocessors: { xml: { models: { template: oview_model } } }` && |\n| && - ` });` && |\n| && - ` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| && - ` oView.setModel(oview_model);` && |\n| && - ` let oParent = sap.z2ui5.oView.byId(sap.z2ui5.oResponse.PARAMS[viewNestId].ID);` && |\n| && - ` if (oParent) {` && |\n| && - ` try {` && |\n| && - ` oParent[sap.z2ui5.oResponse.PARAMS[viewNestId].METHOD_DESTROY]();` && |\n| && - ` } catch {}` && |\n| && - ` oParent[sap.z2ui5.oResponse.PARAMS[viewNestId].METHOD_INSERT](oView);` && |\n| && - ` }` && |\n| && - ` sap.z2ui5[viewProp] = oView;` && |\n| && - ` },` && |\n| && - ` async displayNestedView2(xml, viewProp, viewNestId) {` && |\n| && - ` let oview_model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| && - ` const oView = await XMLView.create({` && |\n| && - ` definition: xml,` && |\n| && - ` controller: sap.z2ui5.oControllerNest2,` && |\n| && - ` preprocessors: { xml: { models: { template: oview_model } } }` && |\n| && - ` });` && |\n| && - ` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| && - ` oView.setModel(oview_model);` && |\n| && - ` let oParent = sap.z2ui5.oView.byId(sap.z2ui5.oResponse.PARAMS[viewNestId].ID);` && |\n| && - ` if (oParent) {` && |\n| && - ` try {` && |\n| && - ` oParent[sap.z2ui5.oResponse.PARAMS[viewNestId].METHOD_DESTROY]();` && |\n| && - ` } catch {}` && |\n| && - ` oParent[sap.z2ui5.oResponse.PARAMS[viewNestId].METHOD_INSERT](oView);` && |\n| && - ` }` && |\n| && - ` sap.z2ui5[viewProp] = oView;` && |\n| && - ` },` && |\n| && - ` PopupDestroy() {` && |\n| && - ` if (!sap.z2ui5.oViewPopup) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` if (sap.z2ui5.oViewPopup.close) {` && |\n| && - ` try {` && |\n| && - ` sap.z2ui5.oViewPopup.close();` && |\n| && - ` } catch {}` && |\n| && - ` }` && |\n| && - ` sap.z2ui5.oViewPopup.destroy();` && |\n| && - ` },` && |\n| && - ` PopoverDestroy() {` && |\n| && - ` if (!sap.z2ui5.oViewPopover) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` if (sap.z2ui5.oViewPopover.close) {` && |\n| && - ` try {` && |\n| && - ` sap.z2ui5.oViewPopover.close();` && |\n| && - ` } catch {}` && |\n| && - ` }` && |\n| && - ` sap.z2ui5.oViewPopover.destroy();` && |\n| && - ` },` && |\n| && - ` NestViewDestroy() {` && |\n| && - ` if (!sap.z2ui5.oViewNest) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` sap.z2ui5.oViewNest.destroy();` && |\n| && - ` },` && |\n| && - ` NestViewDestroy2() {` && |\n| && - ` if (!sap.z2ui5.oViewNest2) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` sap.z2ui5.oViewNest2.destroy();` && |\n| && - ` },` && |\n| && - ` ViewDestroy() {` && |\n| && - ` if (!sap.z2ui5.oView) {` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` sap.z2ui5.oView.destroy();` && |\n| && - ` },` && |\n| && - ` eF(...args) {` && |\n| && - ` sap.z2ui5.onBeforeEventFrontend.forEach(item => {` && |\n| && - ` if (item !== undefined) {` && |\n| && - ` item(args);` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` )` && |\n| && - ` let oCrossAppNavigator;` && |\n| && - ` switch (args[0]) {` && |\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 = sap.ushell.Container.getService("CrossApplicationNavigation");` && |\n| && - ` oCrossAppNavigator.backToPreviousApp();` && |\n| && - ` break;` && |\n| && - ` case 'CROSS_APP_NAV_TO_EXT':` && |\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| && - ` sap.m.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| && - ` sap.z2ui5.oController.PopupDestroy();` && |\n| && - ` break;` && |\n| && - ` case 'POPOVER_CLOSE':` && |\n| && - ` sap.z2ui5.oController.PopoverDestroy();` && |\n| && - ` break;` && |\n| && - ` case 'NAV_CONTAINER_TO':` && |\n| && - ` var navCon = sap.z2ui5.oView.byId(args[1]);` && |\n| && - ` var navConTo = sap.z2ui5.oView.byId(args[2]);` && |\n| && - ` navCon.to(navConTo);` && |\n| && - ` break;` && |\n| && - ` case 'NEST_NAV_CONTAINER_TO':` && |\n| && - ` navCon = sap.z2ui5.oViewNest.byId(args[1]);` && |\n| && - ` navConTo = sap.z2ui5.oViewNest.byId(args[2]);` && |\n| && - ` navCon.to(navConTo);` && |\n| && - ` break;` && |\n| && - ` case 'NEST2_NAV_CONTAINER_TO':` && |\n| && - ` navCon = sap.z2ui5.oViewNest2.byId(args[1]);` && |\n| && - ` navConTo = sap.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| && - ` if (!window.navigator.onLine) {` && |\n| && - ` MessageBox.alert('No internet connection! Please reconnect to the server and try again.');` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` if (sap.z2ui5.isBusy == true) {` && |\n| && - ` if (!args[0][2]) { ` && |\n| && - ` let oBusyDialog = new mBusyDialog();` && |\n| && - ` oBusyDialog.open();` && |\n| && - ` setTimeout( (oBusyDialog) => { oBusyDialog.close() } , 100 , oBusyDialog );` && |\n| && - ` return;` && |\n| && - ` }` && |\n| && - ` }` && |\n| && - ` sap.z2ui5.isBusy = true;` && |\n| && - ` BusyIndicator.show();` && |\n| && - ` sap.z2ui5.oBody = {};` && |\n| && - ` if ( args[0][3] ) {` && |\n| && - ` sap.z2ui5.oBody.` && lv_two_way_model && ` = sap.z2ui5.oView.getModel().getData().` && lv_two_way_model && `;` && |\n| && - ` sap.z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| && - ` }` && |\n| && - ` else if ( sap.z2ui5.oController == this ) {` && |\n| && - ` sap.z2ui5.oBody.` && lv_two_way_model && ` = sap.z2ui5.oView.getModel().getData().` && lv_two_way_model && `;` && |\n| && - ` sap.z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| && - ` }else if ` && |\n| && - ` ( sap.z2ui5.oControllerPopup == this ) {` && |\n| && - ` if (sap.z2ui5.oViewPopup){` && |\n| && - ` sap.z2ui5.oBody.` && lv_two_way_model && ` = sap.z2ui5.oViewPopup.getModel().getData().` && lv_two_way_model && `;` && |\n| && - ` }` && |\n| && - ` sap.z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| && - ` }else if ( ` && |\n| && - ` sap.z2ui5.oControllerPopover == this ) {` && |\n| && - ` sap.z2ui5.oBody.` && lv_two_way_model && ` = sap.z2ui5.oViewPopover.getModel().getData().` && lv_two_way_model && `;` && |\n| && - ` sap.z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| && - ` }else if ( ` && |\n| && - ` sap.z2ui5.oControllerNest == this ) {` && |\n| && - ` sap.z2ui5.oBody.` && lv_two_way_model && ` = sap.z2ui5.oViewNest.getModel().getData().` && lv_two_way_model && `;` && |\n| && - ` sap.z2ui5.oBody.VIEWNAME = 'NEST';` && |\n| && - ` }else if (` && |\n| && - ` sap.z2ui5.oControllerNest2 == this ) {` && |\n| && - ` sap.z2ui5.oBody.` && lv_two_way_model && ` = sap.z2ui5.oViewNest2.getModel().getData().` && lv_two_way_model && `;` && |\n| && - ` sap.z2ui5.oBody.VIEWNAME = 'NEST2';` && |\n| && - ` }` && |\n| && - ` sap.z2ui5.onBeforeRoundtrip.forEach(item=>{` && |\n| && - ` if (item !== undefined) {` && |\n| && - ` item();` && |\n| && - ` }})` && |\n| && - ` if (args[0][1]) {` && |\n| && - ` sap.z2ui5.oController.ViewDestroy();` && |\n| && - ` }` && |\n| && - ` sap.z2ui5.oBody.ID = sap.z2ui5.oResponse.ID;` && |\n| && - ` sap.z2ui5.oBody.ARGUMENTS = args;` && |\n| && - ` sap.z2ui5.oBody.ARGUMENTS.forEach( ( item , i ) => { ` && |\n| && - ` if ( i == 0 ) { return; } if ( typeof item === 'object' ){ ` && |\n| && - ` sap.z2ui5.oBody.ARGUMENTS[ i ] = JSON.stringify( item ); ` && |\n| && - ` } ` && |\n| && - ` }); ` && |\n| && - ` sap.z2ui5.oResponseOld = sap.z2ui5.oResponse;` && |\n| && - ` sap.z2ui5.oController.Roundtrip();` && |\n| && - ` },` && |\n| && - ` responseError(response) {` && |\n| && - ` document.write(response);` && |\n| && - ` },` && |\n| && - ` updateModelIfRequired(paramKey, oView) {` && |\n| && - ` if (sap.z2ui5.oResponse.PARAMS == undefined) { return; }` && |\n| && - ` if (sap.z2ui5.oResponse.PARAMS[paramKey]?.CHECK_UPDATE_MODEL) {` && |\n| && - ` let model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| && - ` model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| && - ` if (oView) { oView.setModel(model); }` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` async responseSuccess(response) {` && |\n| && - ` try{` && |\n| && - ` sap.z2ui5.oResponse = response;` && |\n| && - ` if (sap.z2ui5.oResponse.PARAMS?.S_VIEW?.CHECK_DESTROY) {` && |\n| && - ` sap.z2ui5.oController.ViewDestroy();` && |\n| && - ` };` && |\n| && - ` if(sap.z2ui5.oResponse.PARAMS?.S_FOLLOW_UP_ACTION?.CUSTOM_JS) {` && |\n| && - ` setTimeout(() => {` && |\n| && - ` let mParams = sap.z2ui5.oResponse?.PARAMS.S_FOLLOW_UP_ACTION.CUSTOM_JS.split("'");` && |\n| && - ` let mParamsEF = mParams.filter((val, index) => index % 2)` && |\n| && - ` if(mParamsEF.length) {` && |\n| && - ` sap.z2ui5.oController.eF.apply( undefined , mParamsEF);` && |\n| && - ` } else {` && |\n| && - ` Function("return " + mParams[0])();` && |\n| && - ` }` && |\n| && - ` },100);` && |\n| && - ` };` && |\n| && - |\n| && - ` sap.z2ui5.oController.showMessage('S_MSG_TOAST', sap.z2ui5.oResponse.PARAMS);` && |\n| && - ` sap.z2ui5.oController.showMessage('S_MSG_BOX', sap.z2ui5.oResponse.PARAMS);` && |\n| && - ` if (sap.z2ui5.oResponse.PARAMS?.S_VIEW?.XML) { if ( sap.z2ui5.oResponse.PARAMS?.S_VIEW?.XML !== '') {` && |\n| && - ` sap.z2ui5.oController.ViewDestroy();` && |\n| && - ` await sap.z2ui5.oController.displayView(sap.z2ui5.oResponse.PARAMS.S_VIEW.XML, sap.z2ui5.oResponse.OVIEWMODEL, sap.z2ui5.oResponse.PARAMS.S_VIEW.T_CONFIG );` && |\n| && - ` return; } } ` && |\n| && - ` this.updateModelIfRequired('S_VIEW', sap.z2ui5.oView);` && |\n| && - ` this.updateModelIfRequired('S_VIEW_NEST', sap.z2ui5.oViewNest);` && |\n| && - ` this.updateModelIfRequired('S_VIEW_NEST2', sap.z2ui5.oViewNest2);` && |\n| && - ` this.updateModelIfRequired('S_POPUP', sap.z2ui5.oViewPopup);` && |\n| && - ` this.updateModelIfRequired('S_POPOVER', sap.z2ui5.oViewPopover);` && |\n| && - ` sap.z2ui5.oController.onAfterRendering();` && |\n| && - ` }catch(e){BusyIndicator.hide(); if(e.message.includes("openui5")) { if(e.message.includes("script load error")) { sap.z2ui5.oController.checkSDKcompatibility(e) } } else { ` && |\n| && - ` MessageBox.error(e.toLocaleString()); } }` && |\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| && - ` MessageBox.error(err.toLocaleString());` && |\n| && - ` },` && |\n| && - ` showMessage(msgType, params) {` && |\n| && - ` if (params == undefined) { return; }` && |\n| && - ` if (params[msgType]?.TEXT !== undefined) {` && |\n| && - ` if (msgType === 'S_MSG_TOAST') {` && |\n| && - ` MessageToast.show(params[msgType].TEXT,{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) { mtoast.classList.add(params[msgType].CLASS); }` && |\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,{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| && - ` async displayView(xml, viewModel , aConfig ) {` && |\n| && - ` let oview_model = new JSONModel(viewModel);` && |\n| && - ` const found = aConfig?.find((element) => element.N == 'setSizeLimit' );` && |\n| && - ` if (found) { oview_model.setSizeLimit(found.V); }` && |\n| && - ` sap.z2ui5.oView = await XMLView.create({` && |\n| && - ` definition: xml,` && |\n| && - ` models: oview_model,` && |\n| && - ` controller: sap.z2ui5.oController,` && |\n| && - ` id: 'mainView',` && |\n| && - ` preprocessors: { xml: { models: { template: oview_model } } }` && |\n| && - ` });` && |\n| && - ` sap.z2ui5.oView.setModel(sap.z2ui5.oDeviceModel, "device");` && |\n| && - ` if (sap.z2ui5.oParent) {` && |\n| && - ` sap.z2ui5.oParent.removeAllPages();` && |\n| && - ` sap.z2ui5.oParent.insertPage(sap.z2ui5.oView);` && |\n| && - ` } else {` && |\n| && - ` sap.z2ui5.oView.placeAt("content");` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` async readHttp() {` && |\n| && - ` const response = await fetch(sap.z2ui5.pathname, {` && |\n| && - ` method: 'POST',` && |\n| && - ` headers: {` && |\n| && - ` 'Content-Type': 'application/json'` && |\n| && - ` },` && |\n| && - ` body: JSON.stringify(sap.z2ui5.oBody)` && |\n| && - ` });` && |\n| && - ` if (!response.ok) {` && |\n| && - ` const responseText = await response.text();` && |\n| && - ` sap.z2ui5.oController.responseError(responseText);` && |\n| && - ` } else {` && |\n| && - ` const responseData = await response.json();` && |\n| && - ` sap.z2ui5.responseData = responseData;` && |\n| && - ` sap.z2ui5.oController.responseSuccess({` && |\n| && - ` ID : responseData.S_FRONT.ID,` && |\n| && - ` PARAMS : responseData.S_FRONT.PARAMS,` && |\n| && - ` OVIEWMODEL : responseData.MODEL,` && |\n| && - ` });` && |\n| && - ` }` && |\n| && - ` },` && |\n| && - ` Roundtrip() {` && |\n| && - ` sap.z2ui5.checkTimerActive = false;` && |\n| && - ` sap.z2ui5.checkNestAfter = false;` && |\n| && - ` sap.z2ui5.checkNestAfter2 = false;` && |\n| && - ` let event = (args) => { if ( args != undefined ) { return args[0][0]; } };` && |\n| && - ` sap.z2ui5.oBody.S_FRONT = {` && |\n| && - ` ID: sap.z2ui5?.oBody?.ID,` && |\n| && - ` COMPDATA: (sap.z2ui5.ComponentData) ? sap.z2ui5.ComponentData : {} ,` && |\n| && - ` ` && lv_two_way_model && `: sap.z2ui5?.oBody?.` && lv_two_way_model && `,` && |\n| && - ` ORIGIN: window.location.origin,` && |\n| && - ` PATHNAME: window.location.pathname, // sap.z2ui5.pathname,` && |\n| && - ` SEARCH: (sap.z2ui5.search) ? sap.z2ui5.search : window.location.search,` && |\n| && - ` VIEW: sap.z2ui5.oBody?.VIEWNAME,` && |\n| && - ` T_STARTUP_PARAMETERS: sap.z2ui5.startupParameters,` && |\n| && - ` EVENT: event(sap.z2ui5.oBody?.ARGUMENTS),` && |\n| && - ` };` && |\n| && - ` if ( sap.z2ui5.oBody?.ARGUMENTS != undefined ) { if ( sap.z2ui5.oBody?.ARGUMENTS.length > 0 ) { sap.z2ui5.oBody?.ARGUMENTS.shift(); } }` && |\n| && - ` sap.z2ui5.oBody.S_FRONT.T_EVENT_ARG = sap.z2ui5.oBody?.ARGUMENTS;` && |\n| && - ` delete sap.z2ui5.oBody.ID;` && |\n| && - ` delete sap.z2ui5.oBody?.VIEWNAME;` && |\n| && - ` delete sap.z2ui5.oBody?.S_FRONT.` && lv_two_way_model && `;` && |\n| && - ` delete sap.z2ui5.oBody?.ARGUMENTS;` && |\n| && - ` if (!sap.z2ui5.oBody.S_FRONT.T_EVENT_ARG) { delete sap.z2ui5.oBody.S_FRONT.T_EVENT_ARG; } ` && |\n| && - ` if (sap.z2ui5.oBody.S_FRONT.T_EVENT_ARG) { if (sap.z2ui5.oBody.S_FRONT.T_EVENT_ARG.length == 0 ) { delete sap.z2ui5.oBody.S_FRONT.T_EVENT_ARG; } }` && |\n| && - ` if (sap.z2ui5.oBody.S_FRONT.T_STARTUP_PARAMETERS == undefined) { delete sap.z2ui5.oBody.S_FRONT.T_STARTUP_PARAMETERS; } ` && |\n| && - ` if ( sap.z2ui5.oBody.S_FRONT.SEARCH == '' ){ delete sap.z2ui5.oBody.S_FRONT.SEARCH; } ` && |\n| && - ` if (!sap.z2ui5.oBody.` && lv_two_way_model && `){ delete sap.z2ui5.oBody.` && lv_two_way_model && `; } ` && |\n| && - ` sap.z2ui5.oController.readHttp();` && |\n| && - ` },` && |\n| && - ` })` && |\n| && - `}); } ` && |\n| && - `sap.ui.require(["z2ui5/Controller", "sap/ui/core/BusyIndicator", "sap/ui/model/json/JSONModel", "sap/ui/core/mvc/XMLView", "sap/ui/core/Fragment", "sap/m/MessageToast", "sap/m/MessageBox"], (Controller,BusyIndicator, JSONModel)=>{` && - |\n| && - ` BusyIndicator.show();` && |\n| && - ` sap.z2ui5.oController = new Controller();` && |\n| && - ` sap.z2ui5.oControllerNest = new Controller();` && |\n| && - ` sap.z2ui5.oControllerNest2 = new Controller();` && |\n| && - ` sap.z2ui5.oControllerPopup = new Controller();` && |\n| && - ` sap.z2ui5.oControllerPopover = new Controller();` && |\n| && - ` sap.z2ui5.pathname = sap.z2ui5.pathname || window.location.pathname;` && |\n| && - ` sap.z2ui5.checkNestAfter = false;` && |\n| && - ` sap.z2ui5.oBody = { };` && |\n| && - ` sap.z2ui5.oController.Roundtrip();` && |\n| && - ` sap.z2ui5.onBeforeRoundtrip = [];` && |\n| && - ` sap.z2ui5.onAfterRendering = [];` && |\n| && - ` sap.z2ui5.onBeforeEventFrontend = [];` && |\n| && - ` sap.z2ui5.onAfterRoundtrip = []; ` && |\n| && - ` ` && |\n| && - ` }` && |\n| && - `);`. - - ENDMETHOD. - -ENDCLASS. diff --git a/src/01/02/z2ui5_cl_core_http_get2.clas.testclasses.abap b/src/01/02/z2ui5_cl_core_http_get2.clas.testclasses.abap deleted file mode 100644 index 6611b407f..000000000 --- a/src/01/02/z2ui5_cl_core_http_get2.clas.testclasses.abap +++ /dev/null @@ -1,151 +0,0 @@ -CLASS ltcl_test_http_get DEFINITION FINAL FOR TESTING - DURATION MEDIUM - RISK LEVEL HARMLESS. - - PUBLIC SECTION. - PROTECTED SECTION. - - PRIVATE SECTION. - METHODS file_not_initial FOR TESTING RAISING cx_static_check. - METHODS launchpad_compatibility FOR TESTING RAISING cx_static_check. - METHODS path_setup FOR TESTING RAISING cx_static_check. - METHODS js_no_debugger FOR TESTING RAISING cx_static_check. - METHODS js_no_sap_ui_get_core FOR TESTING RAISING cx_static_check. - METHODS js_no_window FOR TESTING RAISING cx_static_check. - METHODS js_no_document FOR TESTING RAISING cx_static_check. - METHODS js_2x_compatibility FOR TESTING RAISING cx_static_check. - METHODS bootstrap_with_open_ui5 FOR TESTING RAISING cx_static_check. - METHODS js_no_jquery FOR TESTING RAISING cx_static_check. - METHODS debugging_tools FOR TESTING RAISING cx_static_check. -ENDCLASS. - -CLASS z2ui5_cl_core_http_get2 DEFINITION LOCAL FRIENDS ltcl_test_http_get. - -CLASS ltcl_test_http_get IMPLEMENTATION. - - METHOD file_not_initial. - - DATA(lo_get) = NEW z2ui5_cl_core_http_get2( ). - DATA(lv_index_html) = lo_get->main( ). - IF lv_index_html IS INITIAL. - cl_abap_unit_assert=>fail( 'HTTP GET - index html initial' ). - ENDIF. - - ENDMETHOD. - - - METHOD launchpad_compatibility. - - DATA(lo_get) = NEW z2ui5_cl_core_http_get2( ). - DATA(lv_index_html) = lo_get->main( ). - IF lv_index_html CS ` && `. - cl_abap_unit_assert=>fail( 'index.html contains the character & -> no launchpad compatibility' ). - ENDIF. - - ENDMETHOD. - - - METHOD path_setup. - - DATA(lo_get) = NEW z2ui5_cl_core_http_get2( ). - DATA(lv_index_html) = to_upper( lo_get->main( ) ). - IF lv_index_html CS `SAP.Z2UI5.PATHNAME || '/SAP/TEST';`. - cl_abap_unit_assert=>fail( 'path static' ). - ENDIF. - - IF lv_index_html NS `SAP.Z2UI5.PATHNAME || WINDOW.LOCATION.PATHNAME;`. - cl_abap_unit_assert=>fail( 'path static' ). - ENDIF. - - ENDMETHOD. - - METHOD js_no_debugger. - - DATA(lo_get) = NEW z2ui5_cl_core_http_get2( ). - DATA(lv_index_html) = to_upper( lo_get->main( ) ). - IF lv_index_html CS `DEBUGGER`. - cl_abap_unit_assert=>fail( 'debugger command not allowed' ). - ENDIF. - - ENDMETHOD. - - METHOD js_no_sap_ui_get_core. - - DATA(lo_get) = NEW z2ui5_cl_core_http_get2( ). - DATA(lv_index_html) = to_upper( lo_get->main( ) ) ##NEEDED. -* IF lv_index_html CS `SAP.UI.GETCORE`. -* cl_abap_unit_assert=>fail( 'sap.ui.get.core not allowed' ). -* ENDIF. - - ENDMETHOD. - - - METHOD js_2x_compatibility. - - DATA(lo_get) = NEW z2ui5_cl_core_http_get2( ). - DATA(lv_index_html) = to_upper( lo_get->main( ) ) ##NEEDED. - IF lv_index_html CS `SAP.UI.GETVERSIONINFO`. - cl_abap_unit_assert=>fail( 'SAP.UI.GETVERSIONINFO not allowed' ). - ENDIF. - - ENDMETHOD. - - METHOD js_no_jquery. - - DATA(lo_get) = NEW z2ui5_cl_core_http_get2( ). - DATA(lv_index_html) = to_upper( lo_get->main( ) ). - IF lv_index_html CS `JQUERY`. - cl_abap_unit_assert=>fail( 'use of jquery not allowed' ). - ENDIF. - - ENDMETHOD. - - METHOD js_no_window. - - DATA(lo_get) = NEW z2ui5_cl_core_http_get2( ). - DATA(lv_index_html) = to_upper( lo_get->main( ) ) ##NEEDED. -* IF lv_index_html CS `WINDOW.`. -* cl_abap_unit_assert=>fail( 'use of window not allowed' ). -* ENDIF. - - ENDMETHOD. - - METHOD js_no_document. - - DATA(lo_get) = NEW z2ui5_cl_core_http_get2( ). - DATA(lv_index_html) = to_upper( lo_get->main( ) ) ##NEEDED. -* IF lv_index_html CS `DOCUMENT.`. -* cl_abap_unit_assert=>fail( 'use of document not allowed' ). -* ENDIF. - - ENDMETHOD. - - METHOD bootstrap_with_open_ui5. - - DATA(lo_get) = NEW z2ui5_cl_core_http_get2( ). - DATA(lv_index_html) = to_upper( lo_get->main( ) ) ##NEEDED. - DATA(lv_check) = xsdbool( lv_index_html CS `HTTPS://SDK.OPENUI5.ORG/RESOURCES` ). - IF lv_check = abap_false. - cl_abap_unit_assert=>fail( 'no bootstrap with openUI5' ). - ENDIF. - - lv_check = xsdbool( lv_index_html CS `NIGHTLY` ). - IF lv_check = abap_true. - cl_abap_unit_assert=>fail( 'no bootstrap with nightly version' ). - ENDIF. - - ENDMETHOD. - - METHOD debugging_tools. - - DATA(lv_index_html) = to_upper( z2ui5_cl_cc_debug_tool=>get_js( ) ) ##NEEDED. - IF lv_index_html CS `<`. - cl_abap_unit_assert=>fail( 'use of < not allowed - launchpad compatibility' ). - ENDIF. - IF lv_index_html CS `/>`. - cl_abap_unit_assert=>fail( 'use of /> not allowed - launchpad compatibility' ). - ENDIF. - - ENDMETHOD. - -ENDCLASS. diff --git a/src/01/02/z2ui5_cl_core_http_get2.clas.xml b/src/01/02/z2ui5_cl_core_http_get2.clas.xml deleted file mode 100644 index cec6f8756..000000000 --- a/src/01/02/z2ui5_cl_core_http_get2.clas.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Z2UI5_CL_CORE_HTTP_GET2 - E - abap2UI5 - http get handler test - 1 - X - X - X - X - - - - diff --git a/src/01/02/z2ui5_if_core_types.intf.abap b/src/01/02/z2ui5_if_core_types.intf.abap index acb22348e..5175add90 100644 --- a/src/01/02/z2ui5_if_core_types.intf.abap +++ b/src/01/02/z2ui5_if_core_types.intf.abap @@ -51,8 +51,8 @@ INTERFACE z2ui5_if_core_types xml TYPE string, check_destroy TYPE abap_bool, check_update_model TYPE abap_bool, - update_path TYPE string_table, - t_config TYPE z2ui5_if_types=>ty_t_name_value, +* update_path TYPE string_table, + s_config TYPE z2ui5_if_types=>ty_s_view_config, END OF s_view, BEGIN OF s_view_nest, xml TYPE string, @@ -61,6 +61,7 @@ INTERFACE z2ui5_if_core_types method_destroy TYPE string, check_destroy TYPE abap_bool, check_update_model TYPE abap_bool, + s_config TYPE z2ui5_if_types=>ty_s_view_config, END OF s_view_nest, BEGIN OF s_view_nest2, xml TYPE string, @@ -69,12 +70,14 @@ INTERFACE z2ui5_if_core_types method_destroy TYPE string, check_destroy TYPE abap_bool, check_update_model TYPE abap_bool, + s_config TYPE z2ui5_if_types=>ty_s_view_config, END OF s_view_nest2, BEGIN OF s_popup, xml TYPE string, id TYPE string, check_destroy TYPE abap_bool, check_update_model TYPE abap_bool, + s_config TYPE z2ui5_if_types=>ty_s_view_config, END OF s_popup, BEGIN OF s_popover, xml TYPE string, @@ -82,6 +85,7 @@ INTERFACE z2ui5_if_core_types open_by_id TYPE string, check_destroy TYPE abap_bool, check_update_model TYPE abap_bool, + s_config TYPE z2ui5_if_types=>ty_s_view_config, END OF s_popover, BEGIN OF s_msg_box, type TYPE string, diff --git a/src/02/z2ui5_cl_http_handler2.clas.abap b/src/02/z2ui5_cl_http_handler2.clas.abap deleted file mode 100644 index 60b8b4670..000000000 --- a/src/02/z2ui5_cl_http_handler2.clas.abap +++ /dev/null @@ -1,34 +0,0 @@ -CLASS z2ui5_cl_http_handler2 DEFINITION - PUBLIC - CREATE PUBLIC. - - PUBLIC SECTION. - - CLASS-METHODS main - IMPORTING - body TYPE string - config TYPE z2ui5_if_types=>ty_s_config_index_html OPTIONAL - RETURNING - VALUE(result) TYPE string. - - PROTECTED SECTION. - PRIVATE SECTION. -ENDCLASS. - - - -CLASS z2ui5_cl_http_handler2 IMPLEMENTATION. - - METHOD main. - - IF body IS INITIAL. - DATA(lo_get) = NEW z2ui5_cl_core_http_get2( config ). - result = lo_get->main( ). - ELSE. - DATA(lo_post) = NEW z2ui5_cl_core_http_post( body ). - result = lo_post->main( ). - ENDIF. - - ENDMETHOD. - -ENDCLASS. diff --git a/src/02/z2ui5_cl_http_handler2.clas.testclasses.abap b/src/02/z2ui5_cl_http_handler2.clas.testclasses.abap deleted file mode 100644 index fecd796bd..000000000 --- a/src/02/z2ui5_cl_http_handler2.clas.testclasses.abap +++ /dev/null @@ -1,25 +0,0 @@ -CLASS ltcl_unit_test DEFINITION FINAL FOR TESTING - DURATION MEDIUM - RISK LEVEL HARMLESS. - - PUBLIC SECTION. - PROTECTED SECTION. - - PRIVATE SECTION. - METHODS test_get FOR TESTING RAISING cx_static_check. - -ENDCLASS. - - -CLASS ltcl_unit_test IMPLEMENTATION. - - METHOD test_get. - - DATA(lv_resp) = z2ui5_cl_http_handler2=>main( `` ). - IF lv_resp IS INITIAL. - cl_abap_unit_assert=>fail( 'HTTP GET' ). - ENDIF. - - ENDMETHOD. - -ENDCLASS. diff --git a/src/02/z2ui5_cl_http_handler2.clas.xml b/src/02/z2ui5_cl_http_handler2.clas.xml deleted file mode 100644 index 8b73e45a5..000000000 --- a/src/02/z2ui5_cl_http_handler2.clas.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Z2UI5_CL_HTTP_HANDLER2 - E - abap2UI5 - http handler test - 1 - X - X - X - X - - - - diff --git a/src/02/z2ui5_if_client.intf.abap b/src/02/z2ui5_if_client.intf.abap index 82813b0ee..d41ecc554 100644 --- a/src/02/z2ui5_if_client.intf.abap +++ b/src/02/z2ui5_if_client.intf.abap @@ -28,7 +28,7 @@ INTERFACE z2ui5_if_client METHODS view_display IMPORTING val TYPE clike - t_config TYPE z2ui5_if_types=>ty_t_name_value OPTIONAL. + s_config TYPE z2ui5_if_types=>ty_s_view_config OPTIONAL. METHODS view_model_update. @@ -37,7 +37,8 @@ INTERFACE z2ui5_if_client val TYPE clike id TYPE clike method_insert TYPE clike - method_destroy TYPE clike OPTIONAL. + method_destroy TYPE clike OPTIONAL + s_config TYPE z2ui5_if_types=>ty_s_view_config OPTIONAL. METHODS nest_view_destroy. METHODS nest_view_model_update. @@ -47,14 +48,16 @@ INTERFACE z2ui5_if_client val TYPE clike id TYPE clike method_insert TYPE clike - method_destroy TYPE clike OPTIONAL. + method_destroy TYPE clike OPTIONAL + s_config TYPE z2ui5_if_types=>ty_s_view_config OPTIONAL. METHODS nest2_view_destroy. METHODS nest2_view_model_update. METHODS popup_display IMPORTING - val TYPE clike. + val TYPE clike + s_config TYPE z2ui5_if_types=>ty_s_view_config OPTIONAL. METHODS popup_model_update. @@ -64,8 +67,9 @@ INTERFACE z2ui5_if_client METHODS popover_display IMPORTING - xml TYPE clike - by_id TYPE clike. + xml TYPE clike + by_id TYPE clike + s_config TYPE z2ui5_if_types=>ty_s_view_config OPTIONAL. METHODS popover_destroy. diff --git a/src/02/z2ui5_if_types.intf.abap b/src/02/z2ui5_if_types.intf.abap index 13ece78e7..c9d098e92 100644 --- a/src/02/z2ui5_if_types.intf.abap +++ b/src/02/z2ui5_if_types.intf.abap @@ -13,16 +13,9 @@ INTERFACE z2ui5_if_types t_config TYPE ty_t_name_value, content_security_policy TYPE string, custom_js TYPE string, - json_model_limit TYPE string, + t_param TYPE ty_t_name_value, END OF ty_s_http_request_get. - TYPES: - BEGIN OF ty_s_config_index_html, - t_option TYPE ty_t_name_value, - t_param TYPE ty_t_name_value, - add_js TYPE string, - END OF ty_s_config_index_html. - TYPES: BEGIN OF ty_s_draft, id TYPE string, @@ -39,6 +32,11 @@ INTERFACE z2ui5_if_types t_startup_params TYPE ty_t_name_value, END OF ty_s_config. + TYPES: + BEGIN OF ty_s_view_config, + set_size_limit TYPE string, + END OF ty_s_view_config. + TYPES: BEGIN OF ty_s_get, event TYPE string,