mirror of
https://github.com/abap2UI5/abap2UI5.git
synced 2025-04-29 22:04:38 +08:00
parent
e1312ed7df
commit
a31f1cbc39
|
@ -43,8 +43,8 @@ CLASS z2ui5_cl_core_json_srv IMPLEMENTATION.
|
|||
METHOD model_front_to_back.
|
||||
|
||||
LOOP AT t_attri->* REFERENCE INTO DATA(lr_attri)
|
||||
WHERE bind_type = z2ui5_if_core_types=>cs_bind_type-two_way
|
||||
AND view = view.
|
||||
WHERE bind_type = z2ui5_if_core_types=>cs_bind_type-two_way
|
||||
AND view = view.
|
||||
TRY.
|
||||
|
||||
DATA(lo_val_front) = model->slice( lr_attri->name_client ).
|
||||
|
@ -70,6 +70,7 @@ CLASS z2ui5_cl_core_json_srv IMPLEMENTATION.
|
|||
ENDTRY.
|
||||
ENDLOOP.
|
||||
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
|
@ -80,15 +81,21 @@ CLASS z2ui5_cl_core_json_srv IMPLEMENTATION.
|
|||
|
||||
LOOP AT t_attri REFERENCE INTO DATA(lr_attri) WHERE bind_type <> ``.
|
||||
|
||||
DATA(ajson) = CAST z2ui5_if_ajson( z2ui5_cl_ajson=>new( ) ).
|
||||
"(1) set pretty mode
|
||||
IF lr_attri->custom_mapper IS BOUND.
|
||||
DATA(ajson) = CAST z2ui5_if_ajson( z2ui5_cl_ajson=>create_empty( ii_custom_mapping = lr_attri->custom_mapper ) ).
|
||||
ELSE.
|
||||
ajson = CAST z2ui5_if_ajson( z2ui5_cl_ajson=>create_empty( ii_custom_mapping = z2ui5_cl_ajson_mapping=>create_upper_case( ) ) ).
|
||||
ENDIF.
|
||||
|
||||
"(2) read attribute of end-user app & write to json
|
||||
CASE lr_attri->bind_type.
|
||||
WHEN z2ui5_if_core_types=>cs_bind_type-one_way
|
||||
OR z2ui5_if_core_types=>cs_bind_type-two_way.
|
||||
OR z2ui5_if_core_types=>cs_bind_type-two_way.
|
||||
|
||||
ASSIGN lr_attri->r_ref->* TO FIELD-SYMBOL(<attribute>).
|
||||
ASSERT sy-subrc = 0.
|
||||
ajson->set( iv_ignore_empty = abap_false iv_path = `/` iv_val = <attribute> ).
|
||||
ajson->set( iv_ignore_empty = abap_false iv_path = `/` iv_val = <attribute> ).
|
||||
|
||||
WHEN z2ui5_if_core_types=>cs_bind_type-one_time.
|
||||
ajson->set( iv_ignore_empty = abap_false iv_path = `/` iv_val = lr_attri->json_bind_local ).
|
||||
|
@ -97,18 +104,16 @@ CLASS z2ui5_cl_core_json_srv IMPLEMENTATION.
|
|||
ASSERT `` = `ERROR_UNKNOWN_BIND_MODE`.
|
||||
ENDCASE.
|
||||
|
||||
IF lr_attri->custom_mapper IS BOUND.
|
||||
ajson = ajson->map( lr_attri->custom_mapper ).
|
||||
ELSE.
|
||||
ajson = ajson->map( z2ui5_cl_ajson_mapping=>create_upper_case( ) ).
|
||||
ENDIF.
|
||||
|
||||
"(4) set compress mode
|
||||
"todo performance - add and filter in a single loop
|
||||
IF lr_attri->custom_filter IS BOUND.
|
||||
ajson = ajson->filter( lr_attri->custom_filter ).
|
||||
ELSE.
|
||||
ajson = ajson->filter( z2ui5_cl_ajson_filter_lib=>create_empty_filter( ) ).
|
||||
ENDIF.
|
||||
|
||||
"(5) write into result
|
||||
"todo performance - write directly into result
|
||||
ajson_result->set( iv_path = lr_attri->name_client iv_val = ajson ).
|
||||
ENDLOOP.
|
||||
|
||||
|
|
|
@ -272,6 +272,22 @@ CLASS z2ui5_cl_app_search_apps IMPLEMENTATION.
|
|||
|
||||
mt_git_repos = NEW lcl_github( )->get_repositories( ).
|
||||
|
||||
LOOP AT mt_git_repos REFERENCE INTO DATA(lr_repo).
|
||||
|
||||
LOOP AT lr_repo->t_app REFERENCE INTO DATA(lr_app2).
|
||||
|
||||
IF z2ui5_cl_util=>rtti_check_class_exists( lr_app2->classname ).
|
||||
lr_repo->check_installed = abap_true.
|
||||
ENDIF.
|
||||
EXIT.
|
||||
ENDLOOP.
|
||||
|
||||
lr_repo->number_of_app = lines( lr_repo->t_app ).
|
||||
lr_repo->author_name = shift_left( val = lr_repo->author_link
|
||||
sub = `https://github.com/` ).
|
||||
ENDLOOP.
|
||||
|
||||
|
||||
|
||||
DATA(item) = page_online->list(
|
||||
" headertext = `Product`
|
||||
|
|
|
@ -11,7 +11,6 @@ CLASS lcl_github DEFINITION.
|
|||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
PUBLIC SECTION.
|
||||
|
||||
METHODS get_repositories
|
||||
RETURNING
|
||||
VALUE(result) TYPE z2ui5_cl_app_search_apps=>ty_t_repo.
|
||||
|
@ -23,6 +22,34 @@ CLASS lcl_github IMPLEMENTATION.
|
|||
METHOD get_repositories.
|
||||
|
||||
result = VALUE #(
|
||||
(
|
||||
name = `The Quest`
|
||||
descr = `A wizard's adventure game based on a fork of the AXAGE game engine (ABAP teXt Adventure Game Engine) and abap2UI5.`
|
||||
check_abap_for_cloud = abap_true
|
||||
check_standard_abap = abap_true
|
||||
link = `https://github.com/nomssi/axage`
|
||||
author_link = `https://github.com/nomssi`
|
||||
author_name = `Nomssi`
|
||||
t_app = VALUE #(
|
||||
(
|
||||
name = `The Quest - Start the Adventure`
|
||||
descr = `Adventure Game: The Wizard&apos;s Aspirant Quest`
|
||||
classname = `zcl_axage_wizard_ui.clas.abap`
|
||||
) ) )
|
||||
(
|
||||
name = `Advent of Code`
|
||||
descr = `Template for the Advent of Code 2023 in ABAP`
|
||||
author_link = `https://github.com/joltdx`
|
||||
author_name = `joltdx`
|
||||
link = `https://github.com/joltdx/abap-advent-2023-template`
|
||||
check_abap_for_cloud = abap_true
|
||||
check_standard_abap = abap_true
|
||||
t_app = VALUE #(
|
||||
(
|
||||
name = `Advent of Code 2023 in ABAP`
|
||||
descr = `Advent of Code 2023 - ABAP2UI5 app`
|
||||
classname = `zcl_advent_2023_a2ui5.clas.abap`
|
||||
) ) )
|
||||
(
|
||||
name = `Table Loader`
|
||||
descr = `Upload, Edit & Download Table Content (CSV, JSON)`
|
||||
|
@ -41,54 +68,8 @@ CLASS lcl_github IMPLEMENTATION.
|
|||
name = `Download (CSV, JSON)`
|
||||
descr = `Download DB Table as JSON and CSV`
|
||||
classname = `z2ui5_dbl_cl_app_01`
|
||||
)
|
||||
) )
|
||||
(
|
||||
name = `The Quest`
|
||||
descr = `A wizard's adventure game based on a fork of the AXAGE game engine (ABAP teXt Adventure Game Engine) and abap2UI5.`
|
||||
check_abap_for_cloud = abap_true
|
||||
check_standard_abap = abap_true
|
||||
link = `https://github.com/nomssi/axage`
|
||||
author_link = `https://github.com/nomssi`
|
||||
author_name = `Nomssi`
|
||||
t_app = VALUE #(
|
||||
(
|
||||
name = `The Quest - Start the Adventure`
|
||||
descr = `Adventure Game: The Wizard&apos;s Aspirant Quest`
|
||||
classname = `zcl_axage_wizard_ui.clas.abap`
|
||||
)
|
||||
) )
|
||||
(
|
||||
name = `Advent of Code`
|
||||
descr = `Template for the Advent of Code 2023 in ABAP`
|
||||
author_link = `https://github.com/joltdx`
|
||||
author_name = `joltdx`
|
||||
link = `https://github.com/joltdx/abap-advent-2023-template`
|
||||
check_abap_for_cloud = abap_true
|
||||
check_standard_abap = abap_true
|
||||
t_app = VALUE #(
|
||||
(
|
||||
name = `Advent of Code 2023 in ABAP`
|
||||
descr = `Advent of Code 2023 - ABAP2UI5 app`
|
||||
classname = `zcl_advent_2023_a2ui5.clas.abap`
|
||||
)
|
||||
) ) ).
|
||||
|
||||
|
||||
LOOP AT result REFERENCE INTO DATA(lr_repo).
|
||||
|
||||
LOOP AT lr_repo->t_app REFERENCE INTO DATA(lr_app).
|
||||
|
||||
IF z2ui5_cl_util=>rtti_check_class_exists( lr_app->classname ).
|
||||
lr_repo->check_installed = abap_true.
|
||||
ENDIF.
|
||||
EXIT.
|
||||
ENDLOOP.
|
||||
|
||||
lr_repo->number_of_app = lines( lr_repo->t_app ).
|
||||
lr_repo->author_name = shift_left( val = lr_repo->author_link
|
||||
sub = `https://github.com/` ).
|
||||
ENDLOOP.
|
||||
) ) )
|
||||
).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user