Refactoring (#1519)

* refactoring

* update

* update

* update

* update

* update
This commit is contained in:
oblomov-dev 2024-10-27 15:11:09 +01:00 committed by GitHub
parent c7be9a4508
commit a0df28a4ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 6337 additions and 4905 deletions

36
.github/workflows/clean_up.yaml vendored Normal file
View File

@ -0,0 +1,36 @@
name: Clean-up ABAP Files
on:
push:
branches: ["main"]
# pull_request:
# branches: ["main"]
workflow_dispatch:
jobs:
Code-Cleanup:
runs-on: ubuntu-latest
steps:
- run: git config --global core.autocrlf true
- name: Checkout
uses: actions/checkout@v3
- name: Download ABAP Cleaner (latest version)
run: |
mkdir .cleanup
cd .cleanup
wget -q -c https://github.com/SAP/abap-cleaner/releases/latest/download/com.sap.adt.abapcleaner.app-linux.gtk.x86_64.tar.gz -O - | tar -xz
cd ..
- name: Clean-up files in /src
run: ./.cleanup/abapcleaner/abap-cleaner --sourcedir src --recursive --overwrite --profile cleaner-profile.cfj --release 750 --stats --usedrules
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: "style: code cleanup with ABAP cleaner"
add: "src"

1143
cleaner-profile.cfj Normal file

File diff suppressed because it is too large Load Diff

View File

@ -143,7 +143,7 @@ CLASS z2ui5_cl_core_action IMPLEMENTATION.
result->mo_app->ms_draft-id = z2ui5_cl_util=>uuid_get_c32( ).
result->ms_actual-check_on_navigated = abap_true.
result->mo_app->mo_app = z2ui5_cl_core_app_startup=>factory( ).
result->mo_app->mo_app = z2ui5_cl_app_startup=>factory( ).
DATA(li_app) = CAST z2ui5_if_app( result->mo_app->mo_app ).
li_app->id_draft = result->mo_app->ms_draft-id.

View File

@ -1,341 +0,0 @@
CLASS z2ui5_cl_core_app_startup DEFINITION
PUBLIC
FINAL
CREATE PROTECTED .
PUBLIC SECTION.
INTERFACES z2ui5_if_app.
DATA:
BEGIN OF ms_home,
url TYPE string,
btn_text TYPE string,
btn_event_id TYPE string,
btn_icon TYPE string,
classname TYPE string,
class_value_state TYPE string,
class_value_state_text TYPE string,
class_editable TYPE abap_bool VALUE abap_true,
END OF ms_home.
DATA mv_ui5_version TYPE string .
DATA client TYPE REF TO z2ui5_if_client.
DATA mv_check_initialized TYPE abap_bool.
CLASS-METHODS factory
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_core_app_startup.
METHODS z2ui5_on_init.
METHODS z2ui5_on_event.
METHODS view_display_start.
METHODS on_event_check.
METHODS view_display_popup.
PROTECTED SECTION.
DATA mt_classes TYPE z2ui5_cl_util=>ty_t_classes.
PRIVATE SECTION.
ENDCLASS.
CLASS z2ui5_cl_core_app_startup IMPLEMENTATION.
METHOD factory.
result = NEW #( ).
ENDMETHOD.
METHOD on_event_check.
DATA li_app_test TYPE REF TO z2ui5_if_app.
TRY.
ms_home-classname = z2ui5_cl_util=>c_trim_upper( ms_home-classname ).
CREATE OBJECT li_app_test TYPE (ms_home-classname).
client->message_toast_display( `App is ready to start!` ).
ms_home-btn_text = `edit`.
ms_home-btn_event_id = `BUTTON_CHANGE`.
ms_home-btn_icon = `sap-icon://edit`.
ms_home-class_value_state = `Success`.
ms_home-class_editable = abap_false.
ms_home-url = z2ui5_cl_core_util_srv=>app_get_url(
client = client
classname = ms_home-classname ).
CATCH cx_root INTO DATA(lx) ##CATCH_ALL.
ms_home-class_value_state_text = lx->get_text( ).
ms_home-class_value_state = `Warning`.
client->message_box_display( text = ms_home-class_value_state_text
type = `error` ).
ENDTRY.
ENDMETHOD.
METHOD view_display_start.
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell( )->page(
title = `abap2UI5 - Developing UI5 Apps Purely in ABAP`
shownavbutton = abap_false ).
page->header_content(
)->toolbar_spacer(
)->button( text = `Debugging Tools` icon = `sap-icon://enablement`
press = client->_event( `OPEN_DEBUG` )
)->button( text = `System` icon = `sap-icon://information`
press = client->_event( `OPEN_INFO` )
).
DATA(simple_form) = page->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_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`
)->label( `Step 3`
)->text( `Define the view, implement behaviour`
)->label(
)->link( text = `(Example)`
target = `_blank`
href = `https://github.com/abap2UI5/abap2UI5/blob/main/src/02/z2ui5_cl_hello_world.clas.abap`
)->label( `Step 4` ).
IF ms_home-class_editable = abap_true.
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 )
valuehelprequest = client->_event( 'VALUE_HELP' )
showvaluehelp = abap_true
width = `70%` ).
ELSE.
simple_form->text( ms_home-classname ).
ENDIF.
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_form->label( `Step 5`
)->link( text = `Link to the Application`
target = `_blank`
href = client->_bind( ms_home-url )
enabled = `{= $` && client->_bind( val = ms_home-class_editable ) && ` === false }` ).
DATA(lv_url_samples2) = z2ui5_cl_core_util_srv=>app_get_url(
client = client
classname = 'z2ui5_cl_demo_app_000' ).
simple_form->toolbar( )->title( `What's next?` ).
IF z2ui5_cl_util=>rtti_check_class_exists( `z2ui5_cl_demo_app_000` ).
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_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_form->toolbar( )->title( `Contribution` ).
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_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_form->toolbar( )->title( `Social Media` ).
simple_form->label( ).
simple_form->link( text = `Follow us on LinkedIn`
target = `_blank`
href = `https://www.linkedin.com/company/abap2ui5` ).
simple_form->label( ).
simple_form->link( text = `www.abap2UI5.org`
target = `_blank`
href = `http://www.abap2UI5.org` ).
client->view_display( page->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.
TRY.
DATA(lo_f4) = CAST z2ui5_cl_pop_to_select( client->get_app( client->get( )-s_draft-id_prev_app ) ).
DATA(ls_result) = lo_f4->result( ).
IF ls_result-check_confirmed = abap_true.
ASSIGN ls_result-row->* TO FIELD-SYMBOL(<class>).
ms_home = CORRESPONDING #( BASE ( ms_home ) <class> ).
view_display_start( ).
RETURN.
ENDIF.
CATCH cx_root.
ENDTRY.
ENDIF.
z2ui5_on_event( ).
ENDMETHOD.
METHOD view_display_popup.
DATA(page2) = z2ui5_cl_xml_view=>factory_popup(
)->dialog(
title = `abap2UI5 - System Information`
afterclose = client->_event( `CLOSE` ) ).
DATA(content) = page2->content( ).
content->_z2ui5( )->info_frontend( ui5_version = client->_bind( mv_ui5_version ) ).
DATA(simple_form2) = content->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->toolbar( )->title( `Backend` ).
simple_form2->label( `ABAP for Cloud` ).
simple_form2->checkbox( enabled = abap_false selected = z2ui5_cl_util=>context_check_abap_cloud( ) ).
DATA(lv_count) = CONV string( NEW z2ui5_cl_core_srv_draft( )->count_entries( ) ).
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 ).
page2->end_button( )->button(
text = 'close'
press = client->_event( 'CLOSE' )
type = 'Emphasized' ).
client->popup_display( page2->stringify( ) ).
ENDMETHOD.
METHOD z2ui5_on_event.
DATA li_app TYPE REF TO z2ui5_if_app.
CASE client->get( )-event.
WHEN `CLOSE`.
client->popup_destroy( ).
WHEN `OPEN_DEBUG`.
client->message_box_display( `Press CTRL+F12 to open the debugging tools` ).
WHEN `OPEN_INFO`.
view_display_popup( ).
* client->nav_app_call( z2ui5_cl_core_app_info=>factory( ) ).
RETURN.
WHEN `BUTTON_CHECK`.
IF ms_home-class_editable = abap_false.
ms_home-btn_text = `check`.
ms_home-btn_event_id = `BUTTON_CHECK`.
ms_home-btn_icon = `sap-icon://validate`.
ms_home-class_editable = abap_true.
ELSE.
on_event_check( ).
ENDIF.
client->view_model_update( ).
WHEN 'VALUE_HELP'.
TRY.
mt_classes = z2ui5_cl_util=>rtti_get_classes_impl_intf( z2ui5_cl_util=>rtti_get_intfname_by_ref( li_app ) ).
CATCH cx_root.
client->message_box_display( `Unfortunately the value help is not available on your ABAP release!` ).
RETURN.
ENDTRY.
client->nav_app_call( z2ui5_cl_pop_to_select=>factory( mt_classes ) ).
ENDCASE.
ENDMETHOD.
METHOD z2ui5_on_init.
ms_home-btn_text = `check`.
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_util=>rtti_get_classname_by_ref( NEW z2ui5_cl_hello_world( ) ).
ENDMETHOD.
ENDCLASS.

View File

@ -32,7 +32,7 @@ CLASS ltcl_test_handler_post IMPLEMENTATION.
act = lo_post->ms_request-s_front-pathname
exp = `PATHNAME` ).
DATA(lo_startup) = CAST z2ui5_cl_core_app_startup( lo_post->mo_action->mo_app->mo_app ) ##NEEDED.
DATA(lo_startup) = CAST z2ui5_cl_app_startup( lo_post->mo_action->mo_app->mo_app ) ##NEEDED.
ENDMETHOD.

View File

@ -1,4 +1,4 @@
CLASS z2ui5_cl_core_util_srv DEFINITION
CLASS z2ui5_cl_core_srv_util DEFINITION
PUBLIC
INHERITING FROM z2ui5_cl_util
CREATE PUBLIC .
@ -24,7 +24,7 @@ ENDCLASS.
CLASS z2ui5_cl_core_util_srv IMPLEMENTATION.
CLASS z2ui5_cl_core_srv_util IMPLEMENTATION.
METHOD app_get_url.

View File

@ -3,7 +3,7 @@
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_CORE_UTIL_SRV</CLSNAME>
<CLSNAME>Z2UI5_CL_CORE_SRV_UTIL</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>abap2UI5 - utility functions</DESCRIPT>
<STATE>1</STATE>

View File

@ -1,22 +1,20 @@
CLASS z2ui5_cl_hello_world DEFINITION
CLASS z2ui5_cl_app_hello_world DEFINITION
PUBLIC
CREATE PUBLIC .
CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.
DATA name TYPE string.
DATA check_initialized TYPE abap_bool.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS z2ui5_cl_hello_world IMPLEMENTATION.
CLASS z2ui5_cl_app_hello_world IMPLEMENTATION.
METHOD z2ui5_if_app~main.
IF check_initialized = abap_false.
@ -30,7 +28,8 @@ CLASS z2ui5_cl_hello_world IMPLEMENTATION.
)->title( 'Make an input here and send it to the server...'
)->label( 'Name'
)->input( client->_bind_edit( name )
)->button( text = 'post' press = client->_event( 'BUTTON_POST' )
)->button( text = 'post'
press = client->_event( 'BUTTON_POST' )
)->stringify( ) ).
ENDIF.
@ -42,5 +41,4 @@ CLASS z2ui5_cl_hello_world IMPLEMENTATION.
ENDCASE.
ENDMETHOD.
ENDCLASS.

View File

@ -3,7 +3,7 @@
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_HELLO_WORLD</CLSNAME>
<CLSNAME>Z2UI5_CL_APP_HELLO_WORLD</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>abap2UI5 - hello world app</DESCRIPT>
<STATE>1</STATE>

View File

@ -0,0 +1,328 @@
CLASS z2ui5_cl_app_startup DEFINITION
PUBLIC FINAL
CREATE PROTECTED.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.
DATA:
BEGIN OF ms_home,
url TYPE string,
btn_text TYPE string,
btn_event_id TYPE string,
btn_icon TYPE string,
classname TYPE string,
class_value_state TYPE string,
class_value_state_text TYPE string,
class_editable TYPE abap_bool VALUE abap_true,
END OF ms_home.
DATA mv_ui5_version TYPE string.
DATA client TYPE REF TO z2ui5_if_client.
DATA mv_check_initialized TYPE abap_bool.
CLASS-METHODS factory
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_app_startup.
METHODS z2ui5_on_init.
METHODS z2ui5_on_event.
METHODS view_display_start.
METHODS on_event_check.
METHODS view_display_popup.
PROTECTED SECTION.
DATA mt_classes TYPE z2ui5_cl_util=>ty_t_classes.
PRIVATE SECTION.
ENDCLASS.
CLASS z2ui5_cl_app_startup IMPLEMENTATION.
METHOD factory.
result = NEW #( ).
ENDMETHOD.
METHOD on_event_check.
" TODO: variable is assigned but never used (ABAP cleaner)
DATA li_app_test TYPE REF TO z2ui5_if_app.
TRY.
ms_home-classname = z2ui5_cl_util=>c_trim_upper( ms_home-classname ).
CREATE OBJECT li_app_test TYPE (ms_home-classname).
client->message_toast_display( `App is ready to start!` ).
ms_home-btn_text = `edit`.
ms_home-btn_event_id = `BUTTON_CHANGE`.
ms_home-btn_icon = `sap-icon://edit`.
ms_home-class_value_state = `Success`.
ms_home-class_editable = abap_false.
ms_home-url = z2ui5_cl_core_srv_util=>app_get_url( client = client
classname = ms_home-classname ).
CATCH cx_root INTO DATA(lx) ##CATCH_ALL.
ms_home-class_value_state_text = lx->get_text( ).
ms_home-class_value_state = `Warning`.
client->message_box_display( text = ms_home-class_value_state_text
type = `error` ).
ENDTRY.
ENDMETHOD.
METHOD view_display_start.
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell( )->page(
title = `abap2UI5 - Developing UI5 Apps Purely in ABAP`
shownavbutton = abap_false ).
page->header_content(
)->toolbar_spacer(
)->button( text = `Debugging Tools`
icon = `sap-icon://enablement`
press = client->_event( `OPEN_DEBUG` )
)->button( text = `System`
icon = `sap-icon://information`
press = client->_event( `OPEN_INFO` ) ).
DATA(simple_form) = page->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_form->toolbar( )->title( `Quickstart` ).
" TODO: check spelling: behaviour (BE) -> behavior (ABAP cleaner)
simple_form->label( `Step 1`
)->text( `Create a new class in your ABAP system`
)->label( `Step 2`
)->text( `Add the interface: Z2UI5_IF_APP`
)->label( `Step 3`
)->text( `Define the view, implement behaviour`
)->label(
)->link( text = `(Example)`
target = `_blank`
href = `https://github.com/abap2UI5/abap2UI5/blob/main/src/02/z2ui5_cl_app_hello_world.clas.abap`
)->label( `Step 4` ).
IF ms_home-class_editable = abap_true.
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 )
valuehelprequest = client->_event( 'VALUE_HELP' )
showvaluehelp = abap_true
width = `70%` ).
ELSE.
simple_form->text( ms_home-classname ).
ENDIF.
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_form->label( `Step 5`
)->link( text = `Link to the Application`
target = `_blank`
href = client->_bind( ms_home-url )
enabled = |\{= ${ client->_bind( val = ms_home-class_editable ) } === false \}| ).
DATA(lv_url_samples2) = z2ui5_cl_core_srv_util=>app_get_url( client = client
classname = 'z2ui5_cl_demo_app_000' ).
simple_form->toolbar( )->title( `What's next?` ).
IF z2ui5_cl_util=>rtti_check_class_exists( `z2ui5_cl_demo_app_000` ).
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_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_form->toolbar( )->title( `Contribution` ).
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_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_form->toolbar( )->title( `Social Media` ).
simple_form->label( ).
simple_form->link( text = `Follow us on LinkedIn`
target = `_blank`
href = `https://www.linkedin.com/company/abap2ui5` ).
simple_form->label( ).
simple_form->link( text = `www.abap2UI5.org`
target = `_blank`
href = `http://www.abap2UI5.org` ).
client->view_display( page->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.
TRY.
DATA(lo_f4) = CAST z2ui5_cl_pop_to_select( client->get_app( client->get( )-s_draft-id_prev_app ) ).
DATA(ls_result) = lo_f4->result( ).
IF ls_result-check_confirmed = abap_true.
ASSIGN ls_result-row->* TO FIELD-SYMBOL(<class>).
ms_home = CORRESPONDING #( BASE ( ms_home ) <class> ).
view_display_start( ).
RETURN.
ENDIF.
CATCH cx_root.
ENDTRY.
ENDIF.
z2ui5_on_event( ).
ENDMETHOD.
METHOD view_display_popup.
DATA(page2) = z2ui5_cl_xml_view=>factory_popup(
)->dialog( title = `abap2UI5 - System Information`
afterclose = client->_event( `CLOSE` ) ).
DATA(content) = page2->content( ).
content->_z2ui5( )->info_frontend( ui5_version = client->_bind( mv_ui5_version ) ).
DATA(simple_form2) = content->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->toolbar( )->title( `Backend` ).
simple_form2->label( `ABAP for Cloud` ).
simple_form2->checkbox( enabled = abap_false
selected = z2ui5_cl_util=>context_check_abap_cloud( ) ).
DATA(lv_count) = CONV string( NEW z2ui5_cl_core_srv_draft( )->count_entries( ) ).
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 ).
page2->end_button( )->button( text = 'close'
press = client->_event( 'CLOSE' )
type = 'Emphasized' ).
client->popup_display( page2->stringify( ) ).
ENDMETHOD.
METHOD z2ui5_on_event.
DATA li_app TYPE REF TO z2ui5_if_app.
CASE client->get( )-event.
WHEN `CLOSE`.
client->popup_destroy( ).
WHEN `OPEN_DEBUG`.
client->message_box_display( `Press CTRL+F12 to open the debugging tools` ).
WHEN `OPEN_INFO`.
view_display_popup( ).
* client->nav_app_call( z2ui5_cl_core_app_info=>factory( ) ).
RETURN.
WHEN `BUTTON_CHECK`.
IF ms_home-class_editable = abap_false.
ms_home-btn_text = `check`.
ms_home-btn_event_id = `BUTTON_CHECK`.
ms_home-btn_icon = `sap-icon://validate`.
ms_home-class_editable = abap_true.
ELSE.
on_event_check( ).
ENDIF.
client->view_model_update( ).
WHEN 'VALUE_HELP'.
TRY.
mt_classes = z2ui5_cl_util=>rtti_get_classes_impl_intf( z2ui5_cl_util=>rtti_get_intfname_by_ref( li_app ) ).
CATCH cx_root.
client->message_box_display( `Unfortunately the value help is not available on your ABAP release!` ).
RETURN.
ENDTRY.
client->nav_app_call( z2ui5_cl_pop_to_select=>factory( mt_classes ) ).
ENDCASE.
ENDMETHOD.
METHOD z2ui5_on_init.
ms_home-btn_text = `check`.
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_util=>rtti_get_classname_by_ref( NEW z2ui5_cl_app_hello_world( ) ).
ENDMETHOD.
ENDCLASS.

View File

@ -12,7 +12,7 @@ CLASS ltcl_app_startup_test IMPLEMENTATION.
METHOD first_test.
DATA(lo_app) = z2ui5_cl_core_app_startup=>factory( ) ##NEEDED.
DATA(lo_app) = z2ui5_cl_app_startup=>factory( ) ##NEEDED.
ENDMETHOD.

View File

@ -3,7 +3,7 @@
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_CORE_APP_STARTUP</CLSNAME>
<CLSNAME>Z2UI5_CL_APP_STARTUP</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>abap2UI5 - startup app</DESCRIPT>
<STATE>1</STATE>

View File

@ -3,7 +3,6 @@ CLASS z2ui5_cl_http_handler DEFINITION
CREATE PROTECTED.
PUBLIC SECTION.
CLASS-METHODS run
IMPORTING
server TYPE REF TO object OPTIONAL
@ -68,29 +67,23 @@ CLASS z2ui5_cl_http_handler DEFINITION
is_res TYPE z2ui5_if_core_types=>ty_s_http_res.
PROTECTED SECTION.
CLASS-DATA so_sticky_handler TYPE REF TO z2ui5_cl_core_handler.
DATA mo_server TYPE REF TO z2ui5_cl_abap_api_http.
DATA ms_req TYPE z2ui5_if_core_types=>ty_s_http_req.
DATA ms_res TYPE z2ui5_if_core_types=>ty_s_http_res.
DATA ms_config TYPE z2ui5_if_types=>ty_s_http_config.
METHODS set_request.
METHODS set_response.
PRIVATE SECTION.
ENDCLASS.
CLASS z2ui5_cl_http_handler IMPLEMENTATION.
METHOD main.
ms_config = s_config.
@ -102,7 +95,8 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION.
mo_server->set_session_stateful( 0 ).
RETURN.
WHEN OTHERS.
ms_res = _main( is_req = ms_req is_config = ms_config ).
ms_res = _main( is_req = ms_req
is_config = ms_config ).
ENDCASE.
set_response( ).
@ -116,7 +110,8 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION.
IF server IS BOUND.
result->mo_server = z2ui5_cl_abap_api_http=>factory( server ).
ELSEIF req IS BOUND AND res IS BOUND.
result = factory_cloud( req = req res = res ).
result = factory_cloud( req = req
res = res ).
ELSE.
ASSERT 1 = `EMPTY_HTTP_HANDLER_CALL_ERROR`.
ENDIF.
@ -126,13 +121,11 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION.
METHOD factory_cloud.
result = NEW #( ).
result->mo_server = z2ui5_cl_abap_api_http=>factory_cloud(
req = req
result->mo_server = z2ui5_cl_abap_api_http=>factory_cloud( req = req
res = res ).
ENDMETHOD.
METHOD _http_get.
IF is_config-title IS INITIAL.
@ -150,9 +143,9 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION.
ENDIF.
IF is_config-content_security_policy IS INITIAL.
is_config-content_security_policy = `<meta http-equiv="Content-Security-Policy" content="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"/>`.
is_config-content_security_policy = |<meta http-equiv="Content-Security-Policy" content="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"/>|.
ENDIF.
IF is_config-styles_css IS INITIAL.
@ -161,57 +154,56 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION.
lv_style_css = is_config-styles_css.
ENDIF.
result = `<!DOCTYPE html>` && |\n| &&
`<html lang="en">` && |\n| &&
`<head>` && |\n| &&
is_config-content_security_policy && |\n| &&
` <meta charset="UTF-8">` && |\n| &&
` <meta name="viewport" content="width=device-width, initial-scale=1.0">` && |\n| &&
` <meta http-equiv="X-UA-Compatible" content="IE=edge">` && |\n| &&
result = |<!DOCTYPE html>| && |\n| &&
|<html lang="en">| && |\n| &&
|<head>| && |\n| &&
|{ is_config-content_security_policy }\n| &&
| <meta charset="UTF-8">| && |\n| &&
| <meta name="viewport" content="width=device-width, initial-scale=1.0">| && |\n| &&
| <meta http-equiv="X-UA-Compatible" content="IE=edge">| && |\n| &&
| <title> { is_config-title }</title> \n| &&
| <style> html, body, body > div, #container, #container-uiarea \{\n| &
| height: 100%;\n| &
| \}</style> \n| &&
`<script>` && |\n| &&
` function onInitComponent(){` && |\n| &&
` sap.ui.require.preload({` && |\n| &&
` "z2ui5/manifest.json": '` && z2ui5_cl_app_manifest_json=>get( ) && `',` && |\n| &&
` "z2ui5/Component.js": function(){` && z2ui5_cl_app_component_js=>get( ) && is_config-custom_js && `},` && |\n| &&
` "z2ui5/css/style.css": '` && lv_style_css && `',` && |\n| &&
` "z2ui5/model/models.js": function(){` && z2ui5_cl_app_models_js=>get( ) && `},` && |\n| &&
` "z2ui5/view/App.view.xml": '` && z2ui5_cl_app_app_xml=>get( ) && `',` && |\n| &&
` "z2ui5/controller/App.controller.js": function(){` && z2ui5_cl_app_app_js=>get( ) && `},` && |\n| &&
` "z2ui5/view/View1.view.xml": '` && z2ui5_cl_app_view1_xml=>get( ) && `',` && |\n| &&
` "z2ui5/controller/View1.controller.js": function(){` && z2ui5_cl_app_view1_js=>get( ) && `},` && |\n| &&
` "z2ui5/cc/Server.js": function(){` && z2ui5_cl_app_server_js=>get( ) && `},` && |\n| &&
` "z2ui5/cc/DebugTool.fragment.xml": '` && z2ui5_cl_app_debugtool_xml=>get( ) && `',` && |\n| &&
` "z2ui5/cc/DebugTool.js": function(){` && z2ui5_cl_app_debugtool_js=>get( ) && `},` && |\n| &&
` });` && |\n| &&
` sap.ui.require(["sap/ui/core/ComponentSupport"], function(ComponentSupport){` && |\n| &&
` window.z2ui5 = { checkLocal : true }; ComponentSupport.run();` && |\n| &&
` });` && |\n| &&
` }` && |\n| &&
`</script>` && |\n| &&
`<script id="sap-ui-bootstrap" data-sap-ui-resourceroots='{ "z2ui5": "./" }' data-sap-ui-oninit="onInitComponent" ` && |\n| &&
`data-sap-ui-compatVersion="edge" data-sap-ui-async="true" data-sap-ui-frameOptions="trusted" data-sap-ui-bindingSyntax="complex"` && |\n| &&
`data-sap-ui-theme="` && is_config-theme && `" src=" ` && is_config-src && `" `.
|<script>| && |\n| &&
| function onInitComponent()\{| && |\n| &&
| sap.ui.require.preload(\{| && |\n| &&
| "z2ui5/manifest.json": '{ z2ui5_cl_app_manifest_json=>get( ) }',| && |\n| &&
| "z2ui5/Component.js": function()\{{ z2ui5_cl_app_component_js=>get( ) }{ is_config-custom_js }\},| && |\n| &&
| "z2ui5/css/style.css": '{ lv_style_css }',| && |\n| &&
| "z2ui5/model/models.js": function()\{{ z2ui5_cl_app_models_js=>get( ) }\},| && |\n| &&
| "z2ui5/view/App.view.xml": '{ z2ui5_cl_app_app_xml=>get( ) }',| && |\n| &&
| "z2ui5/controller/App.controller.js": function()\{{ z2ui5_cl_app_app_js=>get( ) }\},| && |\n| &&
| "z2ui5/view/View1.view.xml": '{ z2ui5_cl_app_view1_xml=>get( ) }',| && |\n| &&
| "z2ui5/controller/View1.controller.js": function()\{{ z2ui5_cl_app_view1_js=>get( ) }\},| && |\n| &&
| "z2ui5/cc/Server.js": function()\{{ z2ui5_cl_app_server_js=>get( ) }\},| && |\n| &&
| "z2ui5/cc/DebugTool.fragment.xml": '{ z2ui5_cl_app_debugtool_xml=>get( ) }',| && |\n| &&
| "z2ui5/cc/DebugTool.js": function()\{{ z2ui5_cl_app_debugtool_js=>get( ) }\},| && |\n| &&
| \});| && |\n| &&
| sap.ui.require(["sap/ui/core/ComponentSupport"], function(ComponentSupport)\{| && |\n| &&
| window.z2ui5 = \{ checkLocal : true \}; ComponentSupport.run();| && |\n| &&
| \});| && |\n| &&
| \}| && |\n| &&
|</script>| && |\n| &&
|<script id="sap-ui-bootstrap" data-sap-ui-resourceroots='\{ "z2ui5": "./" \}' data-sap-ui-oninit="onInitComponent" | && |\n| &&
|data-sap-ui-compatVersion="edge" data-sap-ui-async="true" data-sap-ui-frameOptions="trusted" data-sap-ui-bindingSyntax="complex"| && |\n| &&
|data-sap-ui-theme="{ is_config-theme }" src=" { is_config-src }" |.
LOOP AT is_config-t_add_config REFERENCE INTO DATA(lr_config).
result = result && | { lr_config->n }='{ lr_config->v }'|.
result = |{ result } { lr_config->n }='{ lr_config->v }'|.
ENDLOOP.
result = result &&
` ></script></head>` && |\n| &&
`<body class="sapUiBody sapUiSizeCompact" id="content">` && |\n| &&
` <div data-sap-ui-component data-name="z2ui5" data-id="container" data-settings='{"id" : "z2ui5"}' data-handle-validation="true"></div>` && |\n| &&
` </body></html>`.
| ></script></head>| && |\n| &&
|<body class="sapUiBody sapUiSizeCompact" id="content">| && |\n| &&
| <div data-sap-ui-component data-name="z2ui5" data-id="container" data-settings='\{"id" : "z2ui5"\}' data-handle-validation="true"></div>| && |\n| &&
| </body></html>|.
ENDMETHOD.
METHOD run.
DATA(lo_handler) = factory(
server = server
DATA(lo_handler) = factory( server = server
req = req
res = res
).
@ -220,7 +212,6 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION.
ENDMETHOD.
METHOD set_request.
ms_req-body = mo_server->get_cdata( ).
@ -228,33 +219,35 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION.
ENDMETHOD.
METHOD set_response.
mo_server->set_cdata( ms_res-body ).
mo_server->set_header_field( n = `cache-control` v = `no-cache` ).
mo_server->set_status( code = 200 reason = `success` ).
mo_server->set_header_field( n = `cache-control`
v = `no-cache` ).
mo_server->set_status( code = 200
reason = `success` ).
"transform cookie to header based contextid 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 ).
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 ).
mo_server->set_header_field( n = 'sap-contextid'
v = lv_contextid ).
ENDIF.
ENDIF.
ENDMETHOD.
METHOD _http_post.
IF so_sticky_handler IS NOT BOUND.
@ -280,7 +273,6 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION.
ENDMETHOD.
METHOD _main.
CASE is_req-method.
@ -294,8 +286,7 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION.
METHOD get_request.
DATA(lo_handler) = factory(
server = server
DATA(lo_handler) = factory( server = server
req = req
res = res
).
@ -303,38 +294,39 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION.
result-body = lo_handler->mo_server->get_cdata( ).
result-method = lo_handler->mo_server->get_method( ).
ENDMETHOD.
METHOD get_response.
DATA(lo_handler) = factory(
server = server
DATA(lo_handler) = factory( server = server
req = req
res = res
).
lo_handler->mo_server->set_cdata( is_res-body ).
lo_handler->mo_server->set_header_field( n = `cache-control` v = `no-cache` ).
lo_handler->mo_server->set_status( code = 200 reason = `success` ).
lo_handler->mo_server->set_header_field( n = `cache-control`
v = `no-cache` ).
lo_handler->mo_server->set_status( code = 200
reason = `success` ).
"transform cookie to header based contextid handling
" transform cookie to header based contextid handling
IF is_res-s_stateful-switched = abap_true.
lo_handler->mo_server->set_session_stateful( is_res-s_stateful-active ).
IF lo_handler->mo_server->get_header_field( 'sap-contextid-accept' ) = 'header'.
DATA(lv_contextid) = lo_handler->mo_server->get_response_cookie( 'sap-contextid' ).
IF lv_contextid IS NOT INITIAL.
lo_handler->mo_server->delete_response_cookie( 'sap-contextid' ).
lo_handler->mo_server->set_header_field( n = 'sap-contextid' v = lv_contextid ).
lo_handler->mo_server->set_header_field( n = 'sap-contextid'
v = lv_contextid ).
ENDIF.
ENDIF.
ELSE.
lv_contextid = lo_handler->mo_server->get_header_field( 'sap-contextid' ).
IF lv_contextid IS NOT INITIAL.
lo_handler->mo_server->set_header_field( n = 'sap-contextid' v = lv_contextid ).
lo_handler->mo_server->set_header_field( n = 'sap-contextid'
v = lv_contextid ).
ENDIF.
ENDIF.
ENDMETHOD.
ENDCLASS.

File diff suppressed because it is too large Load Diff

View File

@ -1,143 +1,141 @@
CLASS z2ui5_cl_xml_view_cc DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC FINAL
CREATE PUBLIC.
PUBLIC SECTION.
METHODS multiinput_ext
IMPORTING
!multiinputid TYPE clike OPTIONAL
!multiinputname TYPE clike OPTIONAL
multiinputid TYPE clike OPTIONAL
multiinputname TYPE clike OPTIONAL
!change TYPE clike OPTIONAL
!addedtokens TYPE clike OPTIONAL
!removedtokens TYPE clike OPTIONAL
addedtokens TYPE clike OPTIONAL
removedtokens TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS uitableext
IMPORTING
!tableid TYPE clike OPTIONAL
tableid TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS camera_picture
IMPORTING
!id TYPE clike OPTIONAL
!value TYPE clike OPTIONAL
!press TYPE clike OPTIONAL
!autoplay TYPE clike OPTIONAL
!onphoto TYPE clike OPTIONAL
press TYPE clike OPTIONAL
autoplay TYPE clike OPTIONAL
onphoto TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS bwip_js
IMPORTING
!bcid TYPE clike OPTIONAL
bcid TYPE clike OPTIONAL
!text TYPE clike OPTIONAL
!scale TYPE clike OPTIONAL
!height TYPE clike OPTIONAL
scale TYPE clike OPTIONAL
height TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS demo_output
IMPORTING
!val TYPE clike OPTIONAL
val TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS focus
IMPORTING
!focusid TYPE clike OPTIONAL
!selectionstart TYPE clike OPTIONAL
!selectionend TYPE clike OPTIONAL
!setupdate TYPE clike OPTIONAL
focusid TYPE clike OPTIONAL
selectionstart TYPE clike OPTIONAL
selectionend TYPE clike OPTIONAL
setupdate TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS geolocation
IMPORTING
!finished TYPE clike OPTIONAL
!longitude TYPE any OPTIONAL
!latitude TYPE any OPTIONAL
!altitude TYPE any OPTIONAL
!accuracy TYPE any OPTIONAL
!altitudeaccuracy TYPE any OPTIONAL
!speed TYPE any OPTIONAL
finished TYPE clike OPTIONAL
longitude TYPE any OPTIONAL
latitude TYPE any OPTIONAL
altitude TYPE any OPTIONAL
accuracy TYPE any OPTIONAL
altitudeaccuracy TYPE any OPTIONAL
speed TYPE any OPTIONAL
!heading TYPE any OPTIONAL
!enablehighaccuracy TYPE any OPTIONAL
!timeout TYPE any OPTIONAL
enablehighaccuracy TYPE any OPTIONAL
timeout TYPE any OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS info_frontend
IMPORTING
!finished TYPE clike OPTIONAL
!ui5_version TYPE clike OPTIONAL
!device_height TYPE clike OPTIONAL
!device_width TYPE clike OPTIONAL
!device_phone TYPE clike OPTIONAL
!device_desktop TYPE clike OPTIONAL
!device_tablet TYPE clike OPTIONAL
!device_combi TYPE clike OPTIONAL
!ui5_gav TYPE clike OPTIONAL
!ui5_theme TYPE clike OPTIONAL
!device_os TYPE clike OPTIONAL
!device_systemtype TYPE clike OPTIONAL
!device_browser TYPE clike OPTIONAL
finished TYPE clike OPTIONAL
ui5_version TYPE clike OPTIONAL
device_height TYPE clike OPTIONAL
device_width TYPE clike OPTIONAL
device_phone TYPE clike OPTIONAL
device_desktop TYPE clike OPTIONAL
device_tablet TYPE clike OPTIONAL
device_combi TYPE clike OPTIONAL
ui5_gav TYPE clike OPTIONAL
ui5_theme TYPE clike OPTIONAL
device_os TYPE clike OPTIONAL
device_systemtype TYPE clike OPTIONAL
device_browser TYPE clike OPTIONAL
PREFERRED PARAMETER finished
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS spreadsheet_export
IMPORTING
!tableid TYPE clike
tableid TYPE clike
!type TYPE clike OPTIONAL
!text TYPE clike OPTIONAL
!icon TYPE clike OPTIONAL
!tooltip TYPE clike OPTIONAL
!columnconfig TYPE clike OPTIONAL
tooltip TYPE clike OPTIONAL
columnconfig TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS file_uploader
IMPORTING
!value TYPE clike OPTIONAL
!path TYPE clike OPTIONAL
!placeholder TYPE clike OPTIONAL
!upload TYPE clike OPTIONAL
!icononly TYPE clike OPTIONAL
!buttononly TYPE clike OPTIONAL
!buttontext TYPE clike OPTIONAL
!uploadbuttontext TYPE clike OPTIONAL
!checkdirectupload TYPE clike OPTIONAL
!filetype TYPE clike OPTIONAL
placeholder TYPE clike OPTIONAL
upload TYPE clike OPTIONAL
icononly TYPE clike OPTIONAL
buttononly TYPE clike OPTIONAL
buttontext TYPE clike OPTIONAL
uploadbuttontext TYPE clike OPTIONAL
checkdirectupload TYPE clike OPTIONAL
filetype TYPE clike OPTIONAL
!icon TYPE clike OPTIONAL
!enabled TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS messaging
IMPORTING
!items TYPE clike OPTIONAL
items TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS message_manager
IMPORTING
!items TYPE clike OPTIONAL
items TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS title
IMPORTING
!title TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS dirty
IMPORTING
!isdirty TYPE clike OPTIONAL
isdirty TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
@ -145,104 +143,107 @@ CLASS z2ui5_cl_xml_view_cc DEFINITION
IMPORTING
!title TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS history
IMPORTING
!search TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS scrolling
IMPORTING
!setupdate TYPE clike OPTIONAL
!items TYPE clike OPTIONAL
setupdate TYPE clike OPTIONAL
items TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS timer
IMPORTING
!finished TYPE clike OPTIONAL
!delayms TYPE clike OPTIONAL
!checkrepeat TYPE clike OPTIONAL
!checkactive TYPE clike OPTIONAL
finished TYPE clike OPTIONAL
delayms TYPE clike OPTIONAL
checkrepeat TYPE clike OPTIONAL
checkactive TYPE clike OPTIONAL
PREFERRED PARAMETER finished
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS websocket
IMPORTING
!value TYPE clike OPTIONAL
!received TYPE clike OPTIONAL
!path TYPE clike OPTIONAL
!checkrepeat TYPE clike OPTIONAL
!checkactive TYPE clike OPTIONAL
checkrepeat TYPE clike OPTIONAL
checkactive TYPE clike OPTIONAL
PREFERRED PARAMETER received
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS binding_update
IMPORTING
!changed TYPE clike OPTIONAL
changed TYPE clike OPTIONAL
!path TYPE clike OPTIONAL
PREFERRED PARAMETER changed
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS chartjs
IMPORTING
!canvas_id TYPE clike OPTIONAL
!view TYPE clike OPTIONAL
!config TYPE clike OPTIONAL
!height TYPE clike OPTIONAL
canvas_id TYPE clike OPTIONAL
view TYPE clike OPTIONAL
config TYPE clike OPTIONAL
height TYPE clike OPTIONAL
!width TYPE clike OPTIONAL
!style TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS favicon
IMPORTING
!favicon TYPE clike OPTIONAL
favicon TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS approve_popover
IMPORTING
!placement TYPE clike OPTIONAL
placement TYPE clike OPTIONAL
!class TYPE clike OPTIONAL
!text TYPE clike OPTIONAL
!btn_txt TYPE clike OPTIONAL
!btn_type TYPE clike OPTIONAL
!btn_icon TYPE clike OPTIONAL
!btn_event TYPE clike OPTIONAL
btn_txt TYPE clike OPTIONAL
btn_type TYPE clike OPTIONAL
btn_icon TYPE clike OPTIONAL
btn_event TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS constructor
IMPORTING
!view TYPE REF TO z2ui5_cl_xml_view .
view TYPE REF TO z2ui5_cl_xml_view.
PROTECTED SECTION.
DATA mo_view TYPE REF TO z2ui5_cl_xml_view.
PRIVATE SECTION.
ENDCLASS.
CLASS z2ui5_cl_xml_view_cc IMPLEMENTATION.
METHOD approve_popover.
result = mo_view.
mo_view->popover( showheader = abap_false placement = placement class = class )->hbox( justifycontent = `Center`
)->vbox( justifycontent = `Center` alignitems = `Center`
mo_view->popover( showheader = abap_false
placement = placement
class = class )->hbox( justifycontent = `Center`
)->vbox( justifycontent = `Center`
alignitems = `Center`
)->text( text
)->button( type = btn_type text = btn_txt icon = btn_icon press = btn_event ).
)->button( type = btn_type
text = btn_txt
icon = btn_icon
press = btn_event ).
ENDMETHOD.
METHOD bwip_js.
result = mo_view.
@ -256,14 +257,12 @@ CLASS z2ui5_cl_xml_view_cc IMPLEMENTATION.
ENDMETHOD.
METHOD camera_picture.
result = mo_view.
mo_view->_generic( name = `CameraPicture`
ns = `z2ui5`
t_prop = VALUE #(
( n = `id` v = id )
t_prop = VALUE #( ( n = `id` v = id )
( n = `value` v = value )
( n = `press` v = press )
( n = `OnPhoto` v = onphoto )
@ -272,7 +271,6 @@ CLASS z2ui5_cl_xml_view_cc IMPLEMENTATION.
ENDMETHOD.
METHOD chartjs.
result = mo_view.
mo_view->_generic( name = `chartjs`
@ -286,30 +284,26 @@ CLASS z2ui5_cl_xml_view_cc IMPLEMENTATION.
) ).
ENDMETHOD.
METHOD constructor.
me->mo_view = view.
mo_view = view.
ENDMETHOD.
METHOD demo_output.
DATA lv_style TYPE string.
"make it run without syntax error also when CC are deleted (for example for downports))
" make it run without syntax error also when CC are deleted (for example for downports))
mo_view->_generic( ns = `html`
name = `style` ).
DATA(lv_class) = 'Z2UI5_CL_CC_DEMO_OUT'.
CALL METHOD (lv_class)=>('GET_STYLE')
RECEIVING
result = lv_style.
RECEIVING result = lv_style.
result = mo_view->_cc_plain_xml( lv_style )->html( val ).
ENDMETHOD.
METHOD favicon.
result = mo_view.
@ -319,11 +313,11 @@ CLASS z2ui5_cl_xml_view_cc IMPLEMENTATION.
ENDMETHOD.
METHOD file_uploader.
result = mo_view.
mo_view->_generic( name = `FileUploader`
mo_view->_generic(
name = `FileUploader`
ns = `z2ui5`
t_prop = VALUE #( ( n = `placeholder` v = placeholder )
( n = `upload` v = upload )
@ -338,17 +332,14 @@ CLASS z2ui5_cl_xml_view_cc IMPLEMENTATION.
( n = `icon` v = icon )
( n = `enabled` v = z2ui5_cl_util=>boolean_abap_2_json( enabled ) ) ) ).
ENDMETHOD.
METHOD focus.
result = mo_view.
mo_view->_generic( name = `Focus`
ns = `z2ui5`
t_prop = VALUE #(
( n = `setUpdate` v = setupdate )
t_prop = VALUE #( ( n = `setUpdate` v = setupdate )
( n = `selectionStart` v = selectionstart )
( n = `selectionEnd` v = selectionend )
( n = `focusId` v = focusid )
@ -356,7 +347,6 @@ CLASS z2ui5_cl_xml_view_cc IMPLEMENTATION.
ENDMETHOD.
METHOD geolocation.
result = mo_view.
@ -377,7 +367,6 @@ CLASS z2ui5_cl_xml_view_cc IMPLEMENTATION.
ENDMETHOD.
METHOD history.
result = mo_view.
@ -387,7 +376,6 @@ CLASS z2ui5_cl_xml_view_cc IMPLEMENTATION.
ENDMETHOD.
METHOD info_frontend.
result = mo_view.
@ -410,7 +398,6 @@ CLASS z2ui5_cl_xml_view_cc IMPLEMENTATION.
ENDMETHOD.
METHOD message_manager.
result = mo_view.
@ -421,7 +408,6 @@ CLASS z2ui5_cl_xml_view_cc IMPLEMENTATION.
ENDMETHOD.
METHOD messaging.
result = mo_view.
@ -432,14 +418,12 @@ CLASS z2ui5_cl_xml_view_cc IMPLEMENTATION.
ENDMETHOD.
METHOD multiinput_ext.
result = mo_view.
mo_view->_generic( name = `MultiInputExt`
ns = `z2ui5`
t_prop = VALUE #(
( n = `MultiInputId` v = multiinputid )
t_prop = VALUE #( ( n = `MultiInputId` v = multiinputid )
( n = `MultiInputName` v = multiinputname )
( n = `change` v = change )
( n = `addedTokens` v = addedtokens )
@ -447,20 +431,17 @@ CLASS z2ui5_cl_xml_view_cc IMPLEMENTATION.
ENDMETHOD.
METHOD scrolling.
result = mo_view.
mo_view->_generic( name = `Scrolling`
ns = `z2ui5`
t_prop = VALUE #(
( n = `setUpdate` v = setupdate )
t_prop = VALUE #( ( n = `setUpdate` v = setupdate )
( n = `items` v = items )
) ).
ENDMETHOD.
METHOD spreadsheet_export.
result = mo_view.
@ -476,7 +457,6 @@ CLASS z2ui5_cl_xml_view_cc IMPLEMENTATION.
ENDMETHOD.
METHOD timer.
result = mo_view.
@ -505,7 +485,6 @@ CLASS z2ui5_cl_xml_view_cc IMPLEMENTATION.
ENDMETHOD.
METHOD websocket.
result = mo_view.