From e7f1ae439d4e5f2561eda380f3d6d8f34af63fb2 Mon Sep 17 00:00:00 2001
From: oblomov <102328295+oblomov-dev@users.noreply.github.com>
Date: Thu, 8 Feb 2024 19:46:24 +0100
Subject: [PATCH] Refactoring (#877)
* refactoring
* refactoring
* update
* update
* update
* update
* update
* Update changelog.txt
---
.abapgit.xml | 3 +-
changelog.txt | 7 +
.../02/01/z2ui5_cl_core_draft_srv.clas.abap | 23 ++-
src/01/02/z2ui5_cl_core_action.clas.abap | 5 +-
src/01/02/z2ui5_cl_core_http_get.clas.abap | 60 ++------
...ui5_cl_core_http_get.clas.testclasses.abap | 23 ++-
src/01/02/z2ui5_if_core_types.intf.abap | 2 +-
...w_01.tabl.xml => z2ui5_t_core_01.tabl.xml} | 4 +-
src/01/03/z2ui5_cl_core_app_info.clas.abap | 140 ++++++++++++++++++
...ui5_cl_core_app_info.clas.testclasses.abap | 19 +++
src/01/03/z2ui5_cl_core_app_info.clas.xml | 17 +++
src/01/03/z2ui5_cl_core_app_startup.clas.abap | 40 ++---
...est_integration_test.clas.testclasses.abap | 38 +++++
src/02/01/01/z2ui5_cl_xml_view.clas.abap | 3 +
14 files changed, 305 insertions(+), 79 deletions(-)
rename src/01/02/{z2ui5_t_fw_01.tabl.xml => z2ui5_t_core_01.tabl.xml} (96%)
create mode 100644 src/01/03/z2ui5_cl_core_app_info.clas.abap
create mode 100644 src/01/03/z2ui5_cl_core_app_info.clas.testclasses.abap
create mode 100644 src/01/03/z2ui5_cl_core_app_info.clas.xml
diff --git a/.abapgit.xml b/.abapgit.xml
index d73b5df5..b91cfd15 100644
--- a/.abapgit.xml
+++ b/.abapgit.xml
@@ -14,7 +14,8 @@
- /.gitlab-ci.yml
- /abaplint.json
- /azure-pipelines.yml
- - /resources
+ - /src/01/z2ui5_cl_fw_font_awsome_icons.clas.abap
+ - /src/01/z2ui5_cl_fw_font_awsome_icons.clas.xml
Z2UI5_IF_APP=>VERSION
diff --git a/changelog.txt b/changelog.txt
index 83543c2d..26b5d9e5 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -9,6 +9,13 @@ Legend
- : removed
+2024-02-08 v1.118.0
+-------------------
+
+! /ui2/cl_json replaced with aJson
+* Compatibility Fixes for Low Releases
+
+
2024-02-02 v1.117.0
-------------------
diff --git a/src/01/02/01/z2ui5_cl_core_draft_srv.clas.abap b/src/01/02/01/z2ui5_cl_core_draft_srv.clas.abap
index b23ea42d..9b445b70 100644
--- a/src/01/02/01/z2ui5_cl_core_draft_srv.clas.abap
+++ b/src/01/02/01/z2ui5_cl_core_draft_srv.clas.abap
@@ -5,6 +5,10 @@ CLASS z2ui5_cl_core_draft_srv DEFINITION
PUBLIC SECTION.
+ METHODS count
+ RETURNING
+ VALUE(result) TYPE i.
+
METHODS create
IMPORTING
!draft TYPE z2ui5_if_types=>ty_s_draft
@@ -47,7 +51,7 @@ CLASS z2ui5_cl_core_draft_srv IMPLEMENTATION.
time = z2ui5_cl_util=>time_get_timestampl( )
seconds = 60 * 60 * 4 ).
- DELETE FROM z2ui5_t_fw_01 WHERE timestampl < @lv_four_hours_ago.
+ DELETE FROM z2ui5_t_core_01 WHERE timestampl < @lv_four_hours_ago.
COMMIT WORK.
ENDMETHOD.
@@ -55,7 +59,7 @@ CLASS z2ui5_cl_core_draft_srv IMPLEMENTATION.
METHOD create.
- DATA(ls_db) = VALUE z2ui5_t_fw_01(
+ DATA(ls_db) = VALUE z2ui5_if_core_types=>ty_s_db(
id = draft-id
id_prev = draft-id_prev
id_prev_app = draft-id_prev_app
@@ -65,7 +69,7 @@ CLASS z2ui5_cl_core_draft_srv IMPLEMENTATION.
data = model_xml
).
- MODIFY z2ui5_t_fw_01 FROM @ls_db.
+ MODIFY z2ui5_t_core_01 FROM @ls_db.
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE z2ui5_cx_util_error
EXPORTING
@@ -81,14 +85,14 @@ CLASS z2ui5_cl_core_draft_srv IMPLEMENTATION.
IF check_load_app = abap_true.
SELECT SINGLE *
- FROM z2ui5_t_fw_01
+ FROM z2ui5_t_core_01
WHERE id = @id
INTO @result.
ELSE.
SELECT SINGLE id, id_prev, id_prev_app, id_prev_app_stack
- FROM z2ui5_t_fw_01
+ FROM z2ui5_t_core_01
WHERE id = @id
INTO CORRESPONDING FIELDS OF @result.
@@ -120,4 +124,13 @@ CLASS z2ui5_cl_core_draft_srv IMPLEMENTATION.
result = CORRESPONDING #( ls_db ).
ENDMETHOD.
+ METHOD count.
+
+ SELECT
+ COUNT( * )
+ FROM z2ui5_t_core_01
+ INTO @result.
+
+ ENDMETHOD.
+
ENDCLASS.
diff --git a/src/01/02/z2ui5_cl_core_action.clas.abap b/src/01/02/z2ui5_cl_core_action.clas.abap
index 77dda24c..2e7df93a 100644
--- a/src/01/02/z2ui5_cl_core_action.clas.abap
+++ b/src/01/02/z2ui5_cl_core_action.clas.abap
@@ -91,10 +91,11 @@ CLASS z2ui5_cl_core_action IMPLEMENTATION.
result->ms_actual-check_on_navigated = abap_true.
- CATCH cx_root.
+ CATCH cx_root into data(x).
RAISE EXCEPTION TYPE z2ui5_cx_util_error
EXPORTING
- val = `App with name ` && mo_http_post->ms_request-s_control-app_start && ` not found...`.
+ val = `App with name ` && mo_http_post->ms_request-s_control-app_start && ` not found...`
+ previous = x.
ENDTRY.
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 c3211a14..43ac2d67 100644
--- a/src/01/02/z2ui5_cl_core_http_get.clas.abap
+++ b/src/01/02/z2ui5_cl_core_http_get.clas.abap
@@ -49,7 +49,7 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` async onAfterRendering() {` && |\n| &&
` try{` && |\n| &&
` if (!sap.z2ui5.oResponse.PARAMS) {` && |\n| &&
- ` BusyIndicator.hide();` && |\n| &&
+ ` BusyIndicator.hide();` && |\n| &&
` if (sap.z2ui5.isBusy) {` && |\n| &&
` sap.z2ui5.isBusy = false;` && |\n| &&
` }` && |\n| &&
@@ -112,7 +112,7 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` let oview_model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
` oFragment.setModel(oview_model);` && |\n| &&
- ` let oControl = openById ? this.getControlById(openById) : null;` && |\n| &&
+ ` let oControl = openById ? sap.z2ui5.oView.byId(openById) : null;` && |\n| &&
` if (oControl) {` && |\n| &&
` oFragment.openBy(oControl);` && |\n| &&
` } else {` && |\n| &&
@@ -129,7 +129,7 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` let oview_model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
` oFragment.setModel(oview_model);` && |\n| &&
- ` let oControl = openById ? this.getControlById(openById) : null;` && |\n| &&
+ ` let oControl = openById ? sap.z2ui5.oView.byId(openById) : null;` && |\n| &&
` if (oControl) {` && |\n| &&
` oFragment.openBy(oControl);` && |\n| &&
` } else {` && |\n| &&
@@ -145,7 +145,6 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` let oview_model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
` oView.setModel(oview_model);` && |\n| &&
- |\n| &&
` let oParent = sap.z2ui5.oView.byId(sap.z2ui5.oResponse.PARAMS[viewNestId].ID);` && |\n| &&
` if (oParent) {` && |\n| &&
` try {` && |\n| &&
@@ -163,7 +162,6 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` let oview_model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
` oView.setModel(oview_model);` && |\n| &&
- |\n| &&
` let oParent = sap.z2ui5.oView.byId(sap.z2ui5.oResponse.PARAMS[viewNestId].ID);` && |\n| &&
` if (oParent) {` && |\n| &&
` try {` && |\n| &&
@@ -173,18 +171,6 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` }` && |\n| &&
` sap.z2ui5[viewProp] = oView;` && |\n| &&
` },` && |\n| &&
- ` getControlById(id) {` && |\n| &&
- ` let oControl = sap.z2ui5.oView.byId(id);` && |\n| &&
- ` if (!oControl) {` && |\n| &&
- ` oControl = sap.ui.getCore().byId(id);` && |\n| &&
-* ` debugger;` && |\n| &&
- ` }` && |\n| &&
- ` if (!oControl) {` && |\n| &&
- ` oControl = sap.z2ui5.oViewNest.byId(id) || sap.z2ui5.oViewNest2.byId(id);` && |\n| &&
- ` }` && |\n| &&
- ` return oControl;` && |\n| &&
- ` },` && |\n| &&
- |\n| &&
` PopupDestroy() {` && |\n| &&
` if (!sap.z2ui5.oViewPopup) {` && |\n| &&
` return;` && |\n| &&
@@ -226,14 +212,12 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` sap.z2ui5.oView.destroy();` && |\n| &&
` },` && |\n| &&
` onEventFrontend(...args) {` && |\n| &&
- |\n| &&
` sap.z2ui5.onBeforeEventFrontend.forEach(item => {` && |\n| &&
` if (item !== undefined) {` && |\n| &&
` item(args);` && |\n| &&
` }` && |\n| &&
` }` && |\n| &&
` )` && |\n| &&
- |\n| &&
` let oCrossAppNavigator;` && |\n| &&
` switch (args[0].EVENT) {` && |\n| &&
` case 'CROSS_APP_NAV_TO_PREV_APP':` && |\n| &&
@@ -338,7 +322,6 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` }` && |\n| &&
` sap.z2ui5.oBody.ID = sap.z2ui5.oResponse.ID;` && |\n| &&
` sap.z2ui5.oBody.ARGUMENTS = args;` && |\n| &&
- |\n| &&
` sap.z2ui5.oResponseOld = sap.z2ui5.oResponse;` && |\n| &&
` sap.z2ui5.oResponse = {};` && |\n| &&
` sap.z2ui5.oController.Roundtrip();` && |\n| &&
@@ -354,14 +337,12 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` oView.setModel(model);` && |\n| &&
` }` && |\n| &&
` },` && |\n| &&
- ` async responseSuccess(response) {` && |\n| &&
+ ` async responseSuccess(response) {` && |\n| &&
` try{` && |\n| &&
` sap.z2ui5.oResponse = response;` && |\n| &&
- |\n| &&
` if (sap.z2ui5.oResponse.PARAMS?.S_VIEW?.CHECK_DESTROY) {` && |\n| &&
` sap.z2ui5.oController.ViewDestroy();` && |\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| &&
@@ -374,7 +355,7 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` 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(); MessageBox.error(e.toLocaleString()); }` && |\n| &&
+ ` }catch(e){ BusyIndicator.hide(); MessageBox.error(e.toLocaleString()); }` && |\n| &&
` },` && |\n| &&
` showMessage(msgType, params) {` && |\n| &&
` if (params == undefined) { return; }` && |\n| &&
@@ -390,11 +371,11 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` const oView = await XMLView.create({` && |\n| &&
` definition: xml,` && |\n| &&
` controller: sap.z2ui5.oController,` && |\n| &&
+ ` id: 'mainView',` && |\n| &&
` });` && |\n| &&
` let oview_model = new JSONModel(viewModel);` && |\n| &&
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
` oView.setModel(oview_model);` && |\n| &&
- |\n| &&
` if (sap.z2ui5.oParent) {` && |\n| &&
` sap.z2ui5.oParent.removeAllPages();` && |\n| &&
` sap.z2ui5.oParent.insertPage(oView);` && |\n| &&
@@ -411,54 +392,37 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` },` && |\n| &&
` body: JSON.stringify(sap.z2ui5.oBody)` && |\n| &&
` });` && |\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| &&
-* ` debugger;` && |\n| &&
` sap.z2ui5.oController.responseSuccess({` && |\n| &&
` ID : responseData.S_FRONTEND.ID,` && |\n| &&
` PARAMS : responseData.S_FRONTEND.PARAMS,` && |\n| &&
` OVIEWMODEL : responseData.MODEL,` && |\n| &&
` });` && |\n| &&
` }` && |\n| &&
- |\n| &&
` },` && |\n| &&
- |\n| &&
` Roundtrip() {` && |\n| &&
- |\n| &&
` sap.z2ui5.checkTimerActive = false;` && |\n| &&
` sap.z2ui5.checkNestAfter = false;` && |\n| &&
` sap.z2ui5.checkNestAfter2 = false;` && |\n| &&
- |\n| &&
- ` sap.z2ui5.oBody.OLOCATION = {` && |\n| &&
- ` ORIGIN: window.location.origin,` && |\n| &&
- ` PATHNAME: sap.z2ui5.pathname,` && |\n| &&
- ` SEARCH: window.location.search,` && |\n| &&
- ` // VERSION: sap.ui.getVersionInfo().gav,` && |\n| &&
- ` T_STARTUP_PARAMETERS: sap.z2ui5.startupParameters,` && |\n| &&
- ` };` && |\n| &&
- ` if (sap.z2ui5.search) {` && |\n| &&
- ` sap.z2ui5.oBody.OLOCATION.SEARCH = sap.z2ui5.search;` && |\n| &&
- ` }` && |\n| &&
` let event = (args) => { if ( args != undefined ) { return args[ 0 ].EVENT; } };` && |\n| &&
` sap.z2ui5.oBody.S_FRONTEND = {` && |\n| &&
` ID: sap.z2ui5?.oBody?.ID,` && |\n| &&
` APP_START: sap.z2ui5?.oBody?.APP_START,` && |\n| &&
` EDIT: sap.z2ui5?.oBody?.EDIT,` && |\n| &&
- ` ORIGIN: sap.z2ui5.oBody.OLOCATION.ORIGIN,` && |\n| &&
- ` PATHNAME: sap.z2ui5.oBody.OLOCATION.PATHNAME,` && |\n| &&
- ` SEARCH: sap.z2ui5.oBody.OLOCATION.SEARCH,` && |\n| &&
+ ` ORIGIN: window.location.origin,` && |\n| &&
+ ` 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.oBody.OLOCATION.T_STARTUP_PARAMETERS,` && |\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_FRONTEND.T_EVENT_ARG = sap.z2ui5.oBody?.ARGUMENTS;` && |\n| &&
` delete sap.z2ui5.oBody.ID;` && |\n| &&
- ` delete sap.z2ui5.oBody?.OLOCATION;` && |\n| &&
` delete sap.z2ui5.oBody?.VIEWNAME;` && |\n| &&
` delete sap.z2ui5.oBody?.APP_START;` && |\n| &&
` sap.z2ui5.oController.readHttp();` && |\n| &&
@@ -518,8 +482,8 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
IF lt_config IS INITIAL.
lt_config = VALUE #(
* ( n = `src` v = `https://sdk.openui5.org/nightly/2/resources/sap-ui-core.js` )
-* ( n = `src` v = `https://sdk.openui5.org/resources/sap-ui-cachebuster/sap-ui-core.js` )
- ( n = `src` v = `https://ui5.sap.com/1.120.0/resources/sap-ui-core.js` )
+ ( n = `src` v = `https://sdk.openui5.org/resources/sap-ui-cachebuster/sap-ui-core.js` )
+* ( n = `src` v = `https://ui5.sap.com/1.120.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` )
diff --git a/src/01/02/z2ui5_cl_core_http_get.clas.testclasses.abap b/src/01/02/z2ui5_cl_core_http_get.clas.testclasses.abap
index fc02672f..9efb437c 100644
--- a/src/01/02/z2ui5_cl_core_http_get.clas.testclasses.abap
+++ b/src/01/02/z2ui5_cl_core_http_get.clas.testclasses.abap
@@ -13,6 +13,7 @@ CLASS ltcl_test_http_get DEFINITION FINAL FOR TESTING
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 bootstrap_with_open_ui5 FOR TESTING RAISING cx_static_check.
METHODS js_no_jquery FOR TESTING RAISING cx_static_check.
ENDCLASS.
@@ -70,9 +71,9 @@ CLASS ltcl_test_http_get IMPLEMENTATION.
DATA(lo_get) = NEW z2ui5_cl_core_http_get( ).
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.
+ IF lv_index_html CS `SAP.UI.GETCORE`.
+ cl_abap_unit_assert=>fail( 'sap.ui.get.core not allowed' ).
+ ENDIF.
ENDMETHOD.
@@ -106,4 +107,20 @@ CLASS ltcl_test_http_get IMPLEMENTATION.
ENDMETHOD.
+ METHOD bootstrap_with_open_ui5.
+
+ DATA(lo_get) = NEW z2ui5_cl_core_http_get( ).
+ 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.
+
ENDCLASS.
diff --git a/src/01/02/z2ui5_if_core_types.intf.abap b/src/01/02/z2ui5_if_core_types.intf.abap
index 5aaefa2c..cd9c89be 100644
--- a/src/01/02/z2ui5_if_core_types.intf.abap
+++ b/src/01/02/z2ui5_if_core_types.intf.abap
@@ -152,6 +152,6 @@ INTERFACE z2ui5_if_core_types
s_config TYPE ty_s_config,
END OF ty_s_actual.
- TYPES ty_s_db TYPE z2ui5_t_fw_01.
+ TYPES ty_s_db TYPE z2ui5_t_core_01.
ENDINTERFACE.
diff --git a/src/01/02/z2ui5_t_fw_01.tabl.xml b/src/01/02/z2ui5_t_core_01.tabl.xml
similarity index 96%
rename from src/01/02/z2ui5_t_fw_01.tabl.xml
rename to src/01/02/z2ui5_t_core_01.tabl.xml
index 8249f76c..c6348150 100644
--- a/src/01/02/z2ui5_t_fw_01.tabl.xml
+++ b/src/01/02/z2ui5_t_core_01.tabl.xml
@@ -3,7 +3,7 @@
- Z2UI5_T_FW_01
+ Z2UI5_T_CORE_01
E
TRANSP
X
@@ -12,7 +12,7 @@
1
- Z2UI5_T_FW_01
+ Z2UI5_T_CORE_01
A
0
APPL0
diff --git a/src/01/03/z2ui5_cl_core_app_info.clas.abap b/src/01/03/z2ui5_cl_core_app_info.clas.abap
new file mode 100644
index 00000000..7e184c0d
--- /dev/null
+++ b/src/01/03/z2ui5_cl_core_app_info.clas.abap
@@ -0,0 +1,140 @@
+CLASS z2ui5_cl_core_app_info DEFINITION
+ PUBLIC
+ FINAL
+ CREATE PUBLIC.
+
+ PUBLIC SECTION.
+
+ INTERFACES z2ui5_if_app.
+
+ DATA client TYPE REF TO z2ui5_if_client.
+ DATA mv_check_initialized TYPE abap_bool.
+
+ DATA mv_ui5_version TYPE string.
+* DATA mv_device TYPE string.
+* DATA mv_device_type TYPE string.
+* DATA mv_theme TYPE string.
+* DATA mv_device_browser TYPE string.
+* DATA mv_device_theme TYPE string.
+* DATA mv_device_gav TYPE string.
+
+ CLASS-METHODS factory
+ RETURNING
+ VALUE(result) TYPE REF TO z2ui5_cl_core_app_info.
+
+ METHODS z2ui5_on_init.
+ METHODS z2ui5_on_event.
+ METHODS view_display_start.
+ PROTECTED SECTION.
+ PRIVATE SECTION.
+ENDCLASS.
+
+
+
+CLASS z2ui5_cl_core_app_info IMPLEMENTATION.
+
+
+ METHOD factory.
+
+ result = NEW #( ).
+
+ ENDMETHOD.
+
+
+ METHOD view_display_start.
+
+ DATA(page2) = z2ui5_cl_xml_view=>factory( )->shell( )->page(
+ shownavbutton = abap_false ).
+
+ page2->header_content( )->text( )->title( `abap2UI5 - System Information` )->toolbar_spacer( ).
+
+ page2->_z2ui5( )->info_frontend(
+* device_browser = client->_bind( mv_device_browser )
+* device_systemtype = client->_bind( mv_device_type )
+* ui5_gav = client->_bind( mv_device_gav )
+* ui5_theme = client->_bind( mv_device_theme )
+ ui5_version = client->_bind( mv_ui5_version ) ).
+
+ DATA(simple_form2) = page2->simple_form(
+ editable = abap_true
+ layout = `ResponsiveGridLayout`
+ labelspanxl = `4`
+ labelspanl = `3`
+ labelspanm = `4`
+ labelspans = `12`
+ adjustlabelspan = abap_false
+ emptyspanxl = `0`
+ emptyspanl = `4`
+ emptyspanm = `0`
+ emptyspans = `0`
+ columnsxl = `1`
+ columnsl = `1`
+ columnsm = `1`
+ singlecontainerfullsize = abap_false
+ )->content( `form` ).
+
+ simple_form2->toolbar( )->title( `Frontend` ).
+
+ simple_form2->label( `UI5 Version`).
+ simple_form2->text( client->_bind( mv_ui5_version ) ).
+ simple_form2->label( `Launchpad active` ).
+ simple_form2->checkbox( enabled = abap_false selected = client->get( )-check_launchpad_active ).
+* simple_form2->label( `Browser` ).
+* simple_form2->text( client->_bind( mv_device_browser ) ).
+* simple_form2->label( `Bootstrap` ).
+* simple_form2->text( client->_bind( mv_device_gav ) ).
+* simple_form2->label( `Theme` ).
+* simple_form2->text( client->_bind( mv_device_theme ) ).
+* simple_form2->label( `Type` ).
+* simple_form2->text( client->_bind( mv_device_type ) ).
+
+ simple_form2->toolbar( )->title( `Backend` ).
+
+ simple_form2->label( `ABAP for Cloud` ).
+ simple_form2->checkbox( enabled = abap_false selected = z2ui5_cl_util=>rtti_check_lang_version_cloud( ) ).
+
+ data(lv_count) = conv string( new z2ui5_cl_core_draft_srv( )->count( ) ).
+ simple_form2->toolbar( )->title( `abap2UI5` ).
+ simple_form2->label( `Version ` ).
+ simple_form2->text( z2ui5_if_app=>version ).
+ simple_form2->label( `Draft Entries ` ).
+ simple_form2->text( lv_count ).
+
+ client->view_display( page2->stringify( ) ).
+
+ ENDMETHOD.
+
+
+ METHOD z2ui5_if_app~main.
+
+ me->client = client.
+
+ IF mv_check_initialized = abap_false.
+ mv_check_initialized = abap_true.
+ z2ui5_on_init( ).
+ view_display_start( ).
+ RETURN.
+ ENDIF.
+
+ IF client->get( )-check_on_navigated = abap_true.
+ view_display_start( ).
+ RETURN.
+ ENDIF.
+
+ z2ui5_on_event( ).
+ view_display_start( ).
+
+ ENDMETHOD.
+
+
+ METHOD z2ui5_on_event.
+
+
+ ENDMETHOD.
+
+
+ METHOD z2ui5_on_init.
+
+ ENDMETHOD.
+
+ENDCLASS.
diff --git a/src/01/03/z2ui5_cl_core_app_info.clas.testclasses.abap b/src/01/03/z2ui5_cl_core_app_info.clas.testclasses.abap
new file mode 100644
index 00000000..7132a26d
--- /dev/null
+++ b/src/01/03/z2ui5_cl_core_app_info.clas.testclasses.abap
@@ -0,0 +1,19 @@
+CLASS ltcl_app_startup_test DEFINITION FINAL FOR TESTING
+ DURATION SHORT
+ RISK LEVEL DANGEROUS.
+
+ PRIVATE SECTION.
+ METHODS first_test FOR TESTING RAISING cx_static_check.
+
+ENDCLASS.
+
+
+CLASS ltcl_app_startup_test IMPLEMENTATION.
+
+ METHOD first_test.
+
+ DATA(lo_app) = z2ui5_cl_core_app_info=>factory( ) ##NEEDED.
+
+ ENDMETHOD.
+
+ENDCLASS.
diff --git a/src/01/03/z2ui5_cl_core_app_info.clas.xml b/src/01/03/z2ui5_cl_core_app_info.clas.xml
new file mode 100644
index 00000000..2770110d
--- /dev/null
+++ b/src/01/03/z2ui5_cl_core_app_info.clas.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+ Z2UI5_CL_CORE_APP_INFO
+ E
+ abap2UI5 - system info
+ 1
+ X
+ X
+ X
+ X
+
+
+
+
diff --git a/src/01/03/z2ui5_cl_core_app_startup.clas.abap b/src/01/03/z2ui5_cl_core_app_startup.clas.abap
index 9629546b..6ed0361f 100644
--- a/src/01/03/z2ui5_cl_core_app_startup.clas.abap
+++ b/src/01/03/z2ui5_cl_core_app_startup.clas.abap
@@ -19,9 +19,7 @@ CLASS z2ui5_cl_core_app_startup DEFINITION
END OF ms_home .
DATA client TYPE REF TO z2ui5_if_client.
DATA mv_check_initialized TYPE abap_bool.
- DATA mv_check_demo TYPE abap_bool.
- DATA mv_ui5_version TYPE string.
CLASS-METHODS factory
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_core_app_startup.
@@ -81,9 +79,18 @@ CLASS Z2UI5_CL_CORE_APP_STARTUP IMPLEMENTATION.
DATA(page2) = z2ui5_cl_xml_view=>factory( )->shell( )->page(
shownavbutton = abap_false ).
- page2->header_content( )->title( `abap2UI5 - Developing UI5 Apps Purely in ABAP` )->toolbar_spacer( ).
- page2->_z2ui5( )->info_frontend( ui5_version = client->_bind( mv_ui5_version ) ).
+ DATA(lv_url_info) = z2ui5_cl_util=>app_get_url(
+ client = client
+ classname = 'z2ui5_cl_core_app_info' ).
+
+ page2->header_content(
+ )->text(
+ )->title( `abap2UI5 - Developing UI5 Apps Purely in ABAP`
+ )->toolbar_spacer(
+ )->button( text = `System` icon = `sap-icon://information`
+ press = client->_event_client( val = client->cs_event-open_new_tab
+ t_arg = VALUE #( ( lv_url_info ) ) ) ).
DATA(simple_form2) = page2->simple_form(
editable = abap_true
@@ -141,17 +148,17 @@ CLASS Z2UI5_CL_CORE_APP_STARTUP IMPLEMENTATION.
href = lv_url
enabled = z2ui5_cl_util=>boolean_abap_2_json( xsdbool( ms_home-class_editable = abap_false ) ) ).
-
- simple_form2->toolbar( )->title( `System Information` ).
-* simple_form2->label( `abap2UI5 Version` ).
- simple_form2->label( `abap2UI5 Version ` ).
- simple_form2->text( z2ui5_if_app=>version ).
- simple_form2->label( `UI5 Version`).
- simple_form2->text( client->_bind( mv_ui5_version ) ).
- simple_form2->label( `ABAP for Cloud` ).
- simple_form2->checkbox( enabled = abap_false selected = z2ui5_cl_util=>rtti_check_lang_version_cloud( ) ).
- simple_form2->label( `Launchpad active` ).
- simple_form2->checkbox( enabled = abap_false selected = client->get( )-check_launchpad_active ).
+*
+* simple_form2->toolbar( )->title( `System Information` ).
+** simple_form2->label( `abap2UI5 Version` ).
+* simple_form2->label( `abap2UI5 Version ` ).
+* simple_form2->text( z2ui5_if_app=>version ).
+* simple_form2->label( `UI5 Version`).
+* simple_form2->text( client->_bind( mv_ui5_version ) ).
+* simple_form2->label( `ABAP for Cloud` ).
+* simple_form2->checkbox( enabled = abap_false selected = z2ui5_cl_util=>rtti_check_lang_version_cloud( ) ).
+* simple_form2->label( `Launchpad active` ).
+* simple_form2->checkbox( enabled = abap_false selected = client->get( )-check_launchpad_active ).
DATA(lv_url_samples2) = z2ui5_cl_util=>app_get_url(
client = client
@@ -168,7 +175,7 @@ CLASS Z2UI5_CL_CORE_APP_STARTUP IMPLEMENTATION.
simple_form2->button(
text = `Check out the samples`
press = client->_event_client( val = client->cs_event-open_new_tab
- t_arg = VALUE #( ( `$` && client->_bind_local( lv_url_samples2 ) ) ) )
+ t_arg = VALUE #( ( lv_url_samples2 ) ) )
width = `70%` ).
else.
@@ -276,7 +283,6 @@ CLASS Z2UI5_CL_CORE_APP_STARTUP IMPLEMENTATION.
ms_home-class_editable = abap_true.
ms_home-btn_icon = `sap-icon://validate`.
ms_home-classname = `Z2UI5_CL_APP_HELLO_WORLD`.
- mv_check_demo = abap_true.
ENDMETHOD.
ENDCLASS.
diff --git a/src/01/90/z2ui5_cl_test_integration_test.clas.testclasses.abap b/src/01/90/z2ui5_cl_test_integration_test.clas.testclasses.abap
index 1de5fc2c..ae5b838a 100644
--- a/src/01/90/z2ui5_cl_test_integration_test.clas.testclasses.abap
+++ b/src/01/90/z2ui5_cl_test_integration_test.clas.testclasses.abap
@@ -1,3 +1,41 @@
+CLASS ltcl_unit_test DEFINITION FINAL FOR TESTING
+ DURATION SHORT
+ RISK LEVEL HARMLESS.
+
+ PRIVATE SECTION.
+ METHODS:
+ first_test FOR TESTING RAISING cx_static_check.
+ENDCLASS.
+
+
+CLASS ltcl_unit_test IMPLEMENTATION.
+
+ METHOD first_test.
+
+* DATA test TYPE /ui2/cl_json=>bool ##NEEDED.
+* DATA test_const TYPE string VALUE /ui2/cl_json=>pretty_mode-extended ##NEEDED.
+
+* DATA text TYPE char10.
+* DATA text2 TYPE text100.
+* DATA text3 TYPE text10.
+* DATA text4 TYPE text10.
+*
+* DATA stringtab TYPE stringtab.
+*
+* DATA test1 TYPE text1.
+* DATA test2 TYPE text10.
+* DATA test3 TYPE text11.
+* DATA test4 TYPE text12.
+* DATA test5 TYPE text120.
+* DATA test6 TYPE text128.
+* DATA test7 TYPE text132.
+* DATA test8 TYPE text140.
+
+ ENDMETHOD.
+
+ENDCLASS.
+
+
*CLASS ltcl_integration_test DEFINITION FINAL FOR TESTING
* DURATION LONG
* RISK LEVEL HARMLESS.
diff --git a/src/02/01/01/z2ui5_cl_xml_view.clas.abap b/src/02/01/01/z2ui5_cl_xml_view.clas.abap
index 9882bb52..49620408 100644
--- a/src/02/01/01/z2ui5_cl_xml_view.clas.abap
+++ b/src/02/01/01/z2ui5_cl_xml_view.clas.abap
@@ -649,8 +649,10 @@ CLASS z2ui5_cl_xml_view DEFINITION
!hideonnodata TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
+
METHODS column_list_item
IMPORTING
+ !id TYPE clike OPTIONAL
!valign TYPE clike OPTIONAL
!selected TYPE clike OPTIONAL
!type TYPE clike OPTIONAL
@@ -3865,6 +3867,7 @@ CLASS Z2UI5_CL_XML_VIEW IMPLEMENTATION.
METHOD column_list_item.
result = _generic( name = `ColumnListItem`
t_prop = VALUE #( ( n = `vAlign` v = valign )
+ ( n = `id` v = id )
( n = `selected` v = z2ui5_cl_util=>boolean_abap_2_json( selected ) )
( n = `unread` v = z2ui5_cl_util=>boolean_abap_2_json( unread ) )
( n = `visible` v = z2ui5_cl_util=>boolean_abap_2_json( visible ) )