From 33d032c2c6f33e37c6a4c5e924694c2e10035be4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=BCnter?= Date: Tue, 10 Oct 2017 12:29:42 +0000 Subject: [PATCH 1/2] Fix Issue 985 --- src/zabapgit_object_wapa.prog.abap | 117 +++++++++++++++++------------ 1 file changed, 69 insertions(+), 48 deletions(-) diff --git a/src/zabapgit_object_wapa.prog.abap b/src/zabapgit_object_wapa.prog.abap index 7aa549eaa..67945496d 100644 --- a/src/zabapgit_object_wapa.prog.abap +++ b/src/zabapgit_object_wapa.prog.abap @@ -28,7 +28,8 @@ CLASS lcl_object_wapa DEFINITION INHERITING FROM lcl_objects_super FINAL. METHODS: get_page_content IMPORTING io_page TYPE REF TO cl_o2_api_pages - RETURNING VALUE(rv_content) TYPE xstring, + RETURNING VALUE(rv_content) TYPE xstring + RAISING zcx_abapgit_exception, to_page_content IMPORTING iv_content TYPE xstring RETURNING VALUE(rt_content) TYPE o2pageline_table, @@ -174,6 +175,7 @@ CLASS lcl_object_wapa IMPLEMENTATION. lt_nodes TYPE o2applnode_table, lt_navgraph TYPE o2applgrap_table, lv_objkey TYPE seu_objkey, + lv_obj_name TYPE string, ls_item LIKE ms_item, lv_extra TYPE string, lv_content TYPE xstring, @@ -235,24 +237,30 @@ CLASS lcl_object_wapa IMPLEMENTATION. IMPORTING p_page = lo_page ). - SPLIT -attributes-pagename AT '.' INTO lv_extra lv_ext. - REPLACE ALL OCCURRENCES OF '_-' IN lv_extra WITH '/'. - lv_content = mo_files->read_raw( iv_extra = lv_extra - iv_ext = lv_ext ). - lo_page->set_page( to_page_content( lv_content ) ). + IF -attributes-pagetype <> so2_controller. - lo_page->set_event_handlers( -event_handlers ). - lo_page->set_parameters( -parameters ). - lo_page->set_type_source( -types ). + SPLIT -attributes-pagename AT '.' INTO lv_extra lv_ext. + REPLACE ALL OCCURRENCES OF '_-' IN lv_extra WITH '/'. + lv_content = mo_files->read_raw( iv_extra = lv_extra + iv_ext = lv_ext ). + lo_page->set_page( to_page_content( lv_content ) ). + + lo_page->set_event_handlers( -event_handlers ). + lo_page->set_parameters( -parameters ). + lo_page->set_type_source( -types ). + + ENDIF. lo_page->save( p_with_all_texts = abap_true ). - ls_item-obj_type = 'WAPP'. - ls_item-obj_name = cl_wb_object_type=>get_concatenated_key_from_id( + lv_obj_name = cl_wb_object_type=>get_concatenated_key_from_id( p_key_component1 = -attributes-applname p_key_component2 = -attributes-pagekey p_external_id = 'WG ' ). - lcl_objects_activation=>add_item( ls_item ). + + lcl_objects_activation=>add( iv_type = 'WAPP' + iv_name = lv_obj_name ). + ENDLOOP. ENDMETHOD. "deserialize @@ -345,50 +353,55 @@ CLASS lcl_object_wapa IMPLEMENTATION. IMPORTING p_page = lo_page ). - lo_page->get_event_handlers( - IMPORTING - p_ev_handler = rs_page-event_handlers - EXCEPTIONS - page_deleted = 1 - invalid_call = 2 ). - ASSERT sy-subrc = 0. - - lo_page->get_parameters( - IMPORTING - p_parameters = rs_page-parameters - EXCEPTIONS - page_deleted = 1 - invalid_call = 2 - OTHERS = 3 ). - ASSERT sy-subrc = 0. - - lo_page->get_type_source( - IMPORTING - p_source = rs_page-types - EXCEPTIONS - page_deleted = 1 - invalid_call = 2 - OTHERS = 3 ). - ASSERT sy-subrc = 0. - - lv_content = get_page_content( lo_page ). - SPLIT is_page-pagename AT '.' INTO lv_extra lv_ext. - REPLACE ALL OCCURRENCES OF '/' IN lv_extra WITH '_-'. - mo_files->add_raw( - iv_extra = lv_extra - iv_ext = lv_ext - iv_data = lv_content ). - lo_page->get_attrs( IMPORTING p_attrs = rs_page-attributes ). + IF rs_page-attributes-pagetype <> so2_controller. + + lo_page->get_event_handlers( + IMPORTING + p_ev_handler = rs_page-event_handlers + EXCEPTIONS + page_deleted = 1 + invalid_call = 2 ). + ASSERT sy-subrc = 0. + + lo_page->get_parameters( + IMPORTING + p_parameters = rs_page-parameters + EXCEPTIONS + page_deleted = 1 + invalid_call = 2 + OTHERS = 3 ). + ASSERT sy-subrc = 0. + + lo_page->get_type_source( + IMPORTING + p_source = rs_page-types + EXCEPTIONS + page_deleted = 1 + invalid_call = 2 + OTHERS = 3 ). + ASSERT sy-subrc = 0. + + lv_content = get_page_content( lo_page ). + SPLIT is_page-pagename AT '.' INTO lv_extra lv_ext. + REPLACE ALL OCCURRENCES OF '/' IN lv_extra WITH '_-'. + mo_files->add_raw( + iv_extra = lv_extra + iv_ext = lv_ext + iv_data = lv_content ). + + CLEAR: rs_page-attributes-implclass. + + ENDIF. + CLEAR: rs_page-attributes-author, rs_page-attributes-createdon, rs_page-attributes-changedby, rs_page-attributes-changedon, rs_page-attributes-changetime, - rs_page-attributes-implclass, rs_page-attributes-gendate, rs_page-attributes-gentime, rs_page-attributes-devclass. @@ -413,7 +426,15 @@ CLASS lcl_object_wapa IMPLEMENTATION. io_page->get_page( IMPORTING - p_content = lt_content ). + p_content = lt_content + EXCEPTIONS + invalid_call = 1 + page_deleted = 2 + OTHERS = 3 ). + + IF sy-subrc <> 0. + zcx_abapgit_exception=>raise( |WAPA - error from get_page_content| ). + ENDIF. CONCATENATE LINES OF lt_content INTO lv_string SEPARATED BY zif_abapgit_definitions=>gc_newline RESPECTING BLANKS. From a397683397e3280bf1026b00d7f4b03b4db57986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=BCnter?= Date: Tue, 10 Oct 2017 12:37:17 +0000 Subject: [PATCH 2/2] remove changes from wrong branch --- src/zabapgit_object_wapa.prog.abap | 108 ++++++++++++----------------- 1 file changed, 45 insertions(+), 63 deletions(-) diff --git a/src/zabapgit_object_wapa.prog.abap b/src/zabapgit_object_wapa.prog.abap index 67945496d..4739ee3c8 100644 --- a/src/zabapgit_object_wapa.prog.abap +++ b/src/zabapgit_object_wapa.prog.abap @@ -28,8 +28,7 @@ CLASS lcl_object_wapa DEFINITION INHERITING FROM lcl_objects_super FINAL. METHODS: get_page_content IMPORTING io_page TYPE REF TO cl_o2_api_pages - RETURNING VALUE(rv_content) TYPE xstring - RAISING zcx_abapgit_exception, + RETURNING VALUE(rv_content) TYPE xstring, to_page_content IMPORTING iv_content TYPE xstring RETURNING VALUE(rt_content) TYPE o2pageline_table, @@ -237,19 +236,15 @@ CLASS lcl_object_wapa IMPLEMENTATION. IMPORTING p_page = lo_page ). - IF -attributes-pagetype <> so2_controller. + SPLIT -attributes-pagename AT '.' INTO lv_extra lv_ext. + REPLACE ALL OCCURRENCES OF '_-' IN lv_extra WITH '/'. + lv_content = mo_files->read_raw( iv_extra = lv_extra + iv_ext = lv_ext ). + lo_page->set_page( to_page_content( lv_content ) ). - SPLIT -attributes-pagename AT '.' INTO lv_extra lv_ext. - REPLACE ALL OCCURRENCES OF '_-' IN lv_extra WITH '/'. - lv_content = mo_files->read_raw( iv_extra = lv_extra - iv_ext = lv_ext ). - lo_page->set_page( to_page_content( lv_content ) ). - - lo_page->set_event_handlers( -event_handlers ). - lo_page->set_parameters( -parameters ). - lo_page->set_type_source( -types ). - - ENDIF. + lo_page->set_event_handlers( -event_handlers ). + lo_page->set_parameters( -parameters ). + lo_page->set_type_source( -types ). lo_page->save( p_with_all_texts = abap_true ). @@ -353,55 +348,50 @@ CLASS lcl_object_wapa IMPLEMENTATION. IMPORTING p_page = lo_page ). + lo_page->get_event_handlers( + IMPORTING + p_ev_handler = rs_page-event_handlers + EXCEPTIONS + page_deleted = 1 + invalid_call = 2 ). + ASSERT sy-subrc = 0. + + lo_page->get_parameters( + IMPORTING + p_parameters = rs_page-parameters + EXCEPTIONS + page_deleted = 1 + invalid_call = 2 + OTHERS = 3 ). + ASSERT sy-subrc = 0. + + lo_page->get_type_source( + IMPORTING + p_source = rs_page-types + EXCEPTIONS + page_deleted = 1 + invalid_call = 2 + OTHERS = 3 ). + ASSERT sy-subrc = 0. + + lv_content = get_page_content( lo_page ). + SPLIT is_page-pagename AT '.' INTO lv_extra lv_ext. + REPLACE ALL OCCURRENCES OF '/' IN lv_extra WITH '_-'. + mo_files->add_raw( + iv_extra = lv_extra + iv_ext = lv_ext + iv_data = lv_content ). + lo_page->get_attrs( IMPORTING p_attrs = rs_page-attributes ). - IF rs_page-attributes-pagetype <> so2_controller. - - lo_page->get_event_handlers( - IMPORTING - p_ev_handler = rs_page-event_handlers - EXCEPTIONS - page_deleted = 1 - invalid_call = 2 ). - ASSERT sy-subrc = 0. - - lo_page->get_parameters( - IMPORTING - p_parameters = rs_page-parameters - EXCEPTIONS - page_deleted = 1 - invalid_call = 2 - OTHERS = 3 ). - ASSERT sy-subrc = 0. - - lo_page->get_type_source( - IMPORTING - p_source = rs_page-types - EXCEPTIONS - page_deleted = 1 - invalid_call = 2 - OTHERS = 3 ). - ASSERT sy-subrc = 0. - - lv_content = get_page_content( lo_page ). - SPLIT is_page-pagename AT '.' INTO lv_extra lv_ext. - REPLACE ALL OCCURRENCES OF '/' IN lv_extra WITH '_-'. - mo_files->add_raw( - iv_extra = lv_extra - iv_ext = lv_ext - iv_data = lv_content ). - - CLEAR: rs_page-attributes-implclass. - - ENDIF. - CLEAR: rs_page-attributes-author, rs_page-attributes-createdon, rs_page-attributes-changedby, rs_page-attributes-changedon, rs_page-attributes-changetime, + rs_page-attributes-implclass, rs_page-attributes-gendate, rs_page-attributes-gentime, rs_page-attributes-devclass. @@ -426,15 +416,7 @@ CLASS lcl_object_wapa IMPLEMENTATION. io_page->get_page( IMPORTING - p_content = lt_content - EXCEPTIONS - invalid_call = 1 - page_deleted = 2 - OTHERS = 3 ). - - IF sy-subrc <> 0. - zcx_abapgit_exception=>raise( |WAPA - error from get_page_content| ). - ENDIF. + p_content = lt_content ). CONCATENATE LINES OF lt_content INTO lv_string SEPARATED BY zif_abapgit_definitions=>gc_newline RESPECTING BLANKS.