Update z2ui5_cl_http_handler.clas.locals_imp.abap

This commit is contained in:
oblomov 2023-05-22 16:07:24 +02:00
parent 95eacdf670
commit a4aca1c426

View File

@ -1,5 +1,3 @@
Handler
CLASS z2ui5_lcl_utility DEFINITION INHERITING FROM cx_no_check.
PUBLIC SECTION.
@ -949,7 +947,6 @@ CLASS z2ui5_lcl_fw_app IMPLEMENTATION.
ms_home-btn_event_id = `BUTTON_CHECK`.
ms_home-class_editable = abap_true.
ms_home-btn_icon = `sap-icon://validate`.
ms_home-classname = `z2ui5_cl_app_hello_world`.
ELSE.
mv_view_name = 'ERROR'.
ENDIF.
@ -1056,19 +1053,16 @@ CLASS z2ui5_lcl_fw_app IMPLEMENTATION.
RETURN.
ENDIF.
TRY.
DATA(lv_url) = to_lower( z2ui5_cl_http_handler=>client-t_header[ name = `referer` ]-value ).
DATA(lv_path_info) = to_lower( z2ui5_cl_http_handler=>client-t_header[ name = `~path_info` ]-value ).
REPLACE lv_path_info IN lv_url WITH ``.
SPLIT lv_url AT '?' INTO lv_url DATA(lv_params).
DATA(lv_url) = to_lower( z2ui5_cl_http_handler=>client-t_header[ name = `referer` ]-value ).
DATA(lv_path_info) = to_lower( z2ui5_cl_http_handler=>client-t_header[ name = `~path_info` ]-value ).
REPLACE lv_path_info IN lv_url WITH ``.
SPLIT lv_url AT '?' INTO lv_url DATA(lv_params).
SHIFT lv_url RIGHT DELETING TRAILING `/`.
DATA(lv_link) = lv_url && `/` && to_lower( ms_home-classname ).
IF lv_params IS NOT INITIAL.
lv_link = lv_link && `?` && lv_params.
ENDIF.
CATCH cx_root.
ENDTRY.
SHIFT lv_url RIGHT DELETING TRAILING `/`.
DATA(lv_link) = lv_url && `/` && to_lower( ms_home-classname ).
IF lv_params IS NOT INITIAL.
lv_link = lv_link && `?` && lv_params.
ENDIF.
DATA(lv_xml_main) = `<mvc:View controllerName="z2ui5_controller" displayBlock="true" height="100%" xmlns:core="sap.ui.core" xmlns:l="sap.ui.layout" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:f="sap.ui.layout.form" xmlns:mvc="sap.ui.core.mvc` &&
`" xmlns:editor="sap.ui.codeeditor" xmlns:ui="sap.ui.table" xmlns="sap.m" xmlns:uxap="sap.uxap" xmlns:mchart="sap.suite.ui.microchart" xmlns:z2ui5="z2ui5" xmlns:webc="sap.ui.webc.main" xmlns:text="sap.ui.richtexteditor" > <Shell> <Page ` && |\n| &&
@ -1091,37 +1085,33 @@ CLASS z2ui5_lcl_fw_app IMPLEMENTATION.
` text="GitHub" ` && |\n| &&
` target="_blank" ` && |\n| &&
` href="https://github.com/oblomov-dev/abap2ui5" ` && |\n| &&
` /></headerContent>`.
lv_xml_main = lv_xml_main && ` <l:Grid ` && |\n| &&
` defaultSpan="XL7 L7 M12 S12" ` && |\n| &&
` > <l:content ` && |\n| &&
` > <f:SimpleForm ` && |\n| &&
` title="Quick Start" ` && |\n| &&
` layout="ResponsiveGridLayout" ` && |\n| &&
` editable="true" ` && |\n| &&
` > <f:content ` && |\n| &&
` > <Label ` && |\n| &&
` text="Step 1" ` && |\n| &&
` /> <Text ` && |\n| &&
` text="Create a global class in your abap system" ` && |\n| &&
` /> <Label ` && |\n| &&
` text="Step 2" ` && |\n| &&
` /> <Text ` && |\n| &&
` text="Add the interface: Z2UI5_IF_APP" ` && |\n| &&
` /> <Label ` && |\n| &&
` text="Step 3" ` && |\n| &&
` /> <Text ` && |\n| &&
` text="Define view, implement behaviour" ` && |\n| &&
` /> <Link ` && |\n| &&
` text="(Example)" ` && |\n| &&
` target="_blank" ` && |\n| &&
` href="https://github.com/oblomov-dev/ABAP2UI5/blob/main/src/z2ui5_cl_app_hello_world.clas.abap" ` && |\n| &&
` /> <Label ` && |\n| &&
` text="Step 4" ` && |\n| &&
` /> `.
` /></headerContent> <l:Grid ` && |\n| &&
` defaultSpan="XL7 L7 M12 S12" ` && |\n| &&
` > <l:content ` && |\n| &&
` > <f:SimpleForm ` && |\n| &&
` title="Quick Start" ` && |\n| &&
` layout="ResponsiveGridLayout" ` && |\n| &&
` editable="true" ` && |\n| &&
` > <f:content ` && |\n| &&
` > <Label ` && |\n| &&
` text="Step 1" ` && |\n| &&
` /> <Text ` && |\n| &&
` text="Create a global class in your abap system" ` && |\n| &&
` /> <Label ` && |\n| &&
` text="Step 2" ` && |\n| &&
` /> <Text ` && |\n| &&
` text="Add the interface: Z2UI5_IF_APP" ` && |\n| &&
` /> <Label ` && |\n| &&
` text="Step 3" ` && |\n| &&
` /> <Text ` && |\n| &&
` text="Define view, implement behaviour" ` && |\n| &&
` /> <Link ` && |\n| &&
` text="(Example)" ` && |\n| &&
` target="_blank" ` && |\n| &&
` href="https://github.com/oblomov-dev/ABAP2UI5/blob/main/src/00/z2ui5_cl_app_demo_01.clas.abap" ` && |\n| &&
` /> <Label ` && |\n| &&
` text="Step 4" ` && |\n| &&
` /> `.
IF ms_home-class_editable = abap_true.
lv_xml_main = lv_xml_main && `<Input ` && |\n| &&
@ -1135,7 +1125,6 @@ CLASS z2ui5_lcl_fw_app IMPLEMENTATION.
ENDIF.
lv_xml_main = lv_xml_main && `<Button ` && |\n| &&
` press="` && client->_event( ms_home-btn_event_id ) && `" ` && |\n| &&
` text="` && ms_home-btn_text && `" ` && |\n| &&
@ -1147,33 +1136,14 @@ CLASS z2ui5_lcl_fw_app IMPLEMENTATION.
` target="_blank" ` && |\n| &&
` href="` && escape( val = lv_link format = cl_abap_format=>e_xml_attr ) && `" ` && |\n| &&
` enabled="` && z2ui5_lcl_utility=>get_json_boolean( xsdbool( ms_home-class_editable = abap_false ) ) && `" ` && |\n| &&
` /></f:content></f:SimpleForm>`.
lv_xml_main = lv_xml_main && `<f:SimpleForm ` && |\n| &&
` title="Demo Section" ` && |\n| &&
` layout="ResponsiveGridLayout" ` && |\n| &&
` >`.
DATA li_app TYPE REF TO z2ui5_if_app.
TRY.
CREATE OBJECT li_app TYPE (`Z2UI5_CL_APP_DEMO_00`).
DATA(lv_check_demo) = abap_true.
CATCH cx_root.
lv_check_demo = abap_false.
ENDTRY.
IF lv_check_demo = abap_false.
lv_xml_main = lv_xml_main && `<MessageStrip text="Oh no! The abap2UI5 demos are not ready! Install additionally this demo repository." type="Warning" > <link> ` &&
` <Link text="(LINK)" target="_blank" href="https://github.com/oblomov-dev/abap2UI5-demos" /> ` &&
` </link> </MessageStrip>`.
ENDIF.
lv_xml_main = lv_xml_main && ` <f:content ` && |\n| &&
` > <Label/><Button ` && |\n| &&
` press="` && client->_event( `DEMOS` ) && `" ` && |\n| &&
` text="Continue..." enabled="` && COND #( WHEN lv_check_demo = abap_true THEN `true` ELSE `false` ) && |" \n| &&
` /></f:content></f:SimpleForm></l:content></l:Grid></Page></Shell></mvc:View>`.
` /></f:content></f:SimpleForm> <f:SimpleForm ` && |\n| &&
` title="Demo Section" ` && |\n| &&
` layout="ResponsiveGridLayout" ` && |\n| &&
` > <f:content ` && |\n| &&
` > <Button ` && |\n| &&
` press="` && client->_event( `DEMOS` ) && `" ` && |\n| &&
` text="Continue..." ` && |\n| &&
` /></f:content></f:SimpleForm></l:content></l:Grid></Page></Shell></mvc:View>`.
client->set_next( VALUE #( xml_main = lv_xml_main ) ).
@ -1283,6 +1253,7 @@ CLASS z2ui5_lcl_fw_handler IMPLEMENTATION.
mo_body = z2ui5_lcl_utility_tree_json=>factory( z2ui5_cl_http_handler=>client-body ).
TRY.
* DATA(lv_id_prev) = mo_body->get_attribute( `OSYSTEM` )->get_attribute( `ID` )->get_val( ).
DATA(lv_id_prev) = mo_body->get_attribute( `ID` )->get_val( ).
CATCH cx_root.
result = set_app_start( ).