Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | CLASS lcl_aff_helper DEFINITION. PUBLIC SECTION. CLASS-METHODS: get_descriptions_compo_subco IMPORTING iv_language TYPE sy-langu iv_clif_name TYPE seoclsname RETURNING VALUE(rs_properties) TYPE zif_abapgit_aff_oo_types_v1=>ty_descriptions , get_descr_comp_subc_w_exposure IMPORTING iv_language TYPE sy-langu iv_clif_name TYPE seoclsname iv_exposure TYPE seoexpose DEFAULT seoc_exposure_public RETURNING VALUE(rs_properties) TYPE zif_abapgit_aff_oo_types_v1=>ty_descriptions , set_descriptions_compo_subco IMPORTING iv_clif_name TYPE seoclsname iv_language TYPE langu is_properties TYPE zif_abapgit_aff_oo_types_v1=>ty_descriptions . PRIVATE SECTION. TYPES: BEGIN OF ty_component, visibility TYPE seoexpose, cmpname TYPE seocmpname, descript TYPE seodescr, cmptype TYPE seocmptype, END OF ty_component, BEGIN OF ty_sub_component, cmpname TYPE seocmpname, sconame TYPE seosconame, descript TYPE seodescr, scotype TYPE seoscotype, END OF ty_sub_component, ty_compontents TYPE SORTED TABLE OF ty_component WITH UNIQUE DEFAULT KEY, ty_sub_compontents TYPE SORTED TABLE OF ty_sub_component WITH UNIQUE DEFAULT KEY. CLASS-METHODS: get_attributes IMPORTING is_components TYPE ty_compontents RETURNING VALUE(rs_result) TYPE zif_abapgit_aff_oo_types_v1=>ty_component_descriptions, get_methods IMPORTING is_components TYPE ty_compontents is_sub_components TYPE ty_sub_compontents RETURNING VALUE(rs_result) TYPE zif_abapgit_aff_oo_types_v1=>ty_methods, get_types IMPORTING is_components TYPE ty_compontents RETURNING VALUE(rs_result) TYPE zif_abapgit_aff_oo_types_v1=>ty_component_descriptions, get_events IMPORTING is_components TYPE ty_compontents is_sub_components TYPE ty_sub_compontents RETURNING VALUE(rs_result) TYPE zif_abapgit_aff_oo_types_v1=>ty_events, set_methods IMPORTING iv_clif_name TYPE seoclsname iv_language TYPE langu is_properties TYPE zif_abapgit_aff_oo_types_v1=>ty_descriptions, set_attributes IMPORTING iv_clif_name TYPE seoclsname iv_language TYPE langu is_properties TYPE zif_abapgit_aff_oo_types_v1=>ty_descriptions, set_events IMPORTING iv_clif_name TYPE seoclsname iv_language TYPE langu is_properties TYPE zif_abapgit_aff_oo_types_v1=>ty_descriptions, set_types IMPORTING iv_clif_name TYPE seoclsname iv_language TYPE langu is_properties TYPE zif_abapgit_aff_oo_types_v1=>ty_descriptions . ENDCLASS. CLASS lcl_aff_helper IMPLEMENTATION. METHOD get_descr_comp_subc_w_exposure. DATA: lt_components TYPE ty_compontents, lt_sub_components TYPE ty_sub_compontents. SELECT df~exposure AS visibility component~cmpname component_text~descript component~cmptype INTO TABLE lt_components FROM seocompo AS component LEFT OUTER JOIN seocompotx AS component_text ON component~cmpname = component_text~cmpname AND component~clsname = component_text~clsname AND component_text~langu = iv_language INNER JOIN seocompodf AS df ON component~clsname = df~clsname AND component~cmpname = df~cmpname WHERE component~clsname = iv_clif_name AND df~exposure = iv_exposure. "#EC CI_BUFFJOIN SELECT sub_component~cmpname sub_component~sconame sub_component_text~descript sub_component~scotype INTO TABLE lt_sub_components FROM seosubco AS sub_component JOIN seosubcotx AS sub_component_text ON sub_component~clsname = sub_component_text~clsname AND sub_component~cmpname = sub_component_text~cmpname AND sub_component~sconame = sub_component_text~sconame INNER JOIN seocompodf AS df ON sub_component~clsname = df~clsname AND sub_component~cmpname = df~cmpname WHERE sub_component~clsname = iv_clif_name AND df~exposure = iv_exposure AND sub_component_text~langu = iv_language AND sub_component_text~descript <> space. "#EC CI_BUFFJOIN rs_properties-attributes = get_attributes( lt_components ). rs_properties-methods = get_methods( is_components = lt_components is_sub_components = lt_sub_components ). rs_properties-events = get_events( is_components = lt_components is_sub_components = lt_sub_components ). rs_properties-types = get_types( lt_components ). ENDMETHOD. METHOD get_descriptions_compo_subco. TYPES: BEGIN OF ty_helper_type, cmpname TYPE seocmpname, descript TYPE seodescr, cmptype TYPE seocmptype, END OF ty_helper_type. DATA: lt_components TYPE STANDARD TABLE OF ty_helper_type, lt_sub_components TYPE ty_sub_compontents, lt_components_exp TYPE ty_compontents, ls_component_exp LIKE LINE OF lt_components_exp. FIELD-SYMBOLS: <ls_component> LIKE LINE OF lt_components. SELECT component~cmpname component_text~descript component~cmptype INTO TABLE lt_components FROM seocompo AS component LEFT OUTER JOIN seocompotx AS component_text ON component~cmpname = component_text~cmpname AND component~clsname = component_text~clsname AND component_text~langu = iv_language WHERE component~clsname = iv_clif_name ORDER BY component~cmpname. "#EC CI_BUFFJOIN SELECT sub_component~cmpname sub_component~sconame sub_component_text~descript sub_component~scotype INTO TABLE lt_sub_components FROM seosubco AS sub_component JOIN seosubcotx AS sub_component_text ON sub_component~clsname = sub_component_text~clsname AND sub_component~cmpname = sub_component_text~cmpname AND sub_component~sconame = sub_component_text~sconame WHERE sub_component~clsname = iv_clif_name AND sub_component_text~langu = iv_language AND sub_component_text~descript <> space. "#EC CI_BUFFJOIN LOOP AT lt_components ASSIGNING <ls_component>. CLEAR ls_component_exp. MOVE-CORRESPONDING <ls_component> TO ls_component_exp. INSERT ls_component_exp INTO TABLE lt_components_exp. ENDLOOP. rs_properties-attributes = get_attributes( lt_components_exp ). rs_properties-methods = get_methods( is_components = lt_components_exp is_sub_components = lt_sub_components ). rs_properties-events = get_events( is_components = lt_components_exp is_sub_components = lt_sub_components ). rs_properties-types = get_types( lt_components_exp ). ENDMETHOD. METHOD get_attributes. DATA: lo_component TYPE zif_abapgit_aff_oo_types_v1=>ty_component_description. FIELD-SYMBOLS <lo_attribute> TYPE ty_component. LOOP AT is_components ASSIGNING <lo_attribute> WHERE cmptype = seoo_cmptype_attribute AND descript IS NOT INITIAL. lo_component-name = <lo_attribute>-cmpname. lo_component-description = <lo_attribute>-descript. INSERT lo_component INTO TABLE rs_result. ENDLOOP. ENDMETHOD. METHOD get_methods. DATA: lo_method TYPE zif_abapgit_aff_oo_types_v1=>ty_method, lo_exception TYPE zif_abapgit_aff_oo_types_v1=>ty_component_description, lo_parameter TYPE zif_abapgit_aff_oo_types_v1=>ty_component_description. FIELD-SYMBOLS <ls_sub_component> TYPE ty_sub_component. FIELD-SYMBOLS <ls_component> TYPE ty_component. LOOP AT is_components ASSIGNING <ls_component> WHERE cmptype = seoo_cmptype_method. lo_method-name = <ls_component>-cmpname. lo_method-description = <ls_component>-descript. LOOP AT is_sub_components ASSIGNING <ls_sub_component> WHERE cmpname = <ls_component>-cmpname. CASE <ls_sub_component>-scotype. WHEN seos_scotype_parameter. lo_parameter-name = <ls_sub_component>-sconame. lo_parameter-description = <ls_sub_component>-descript. INSERT lo_parameter INTO TABLE lo_method-parameters. WHEN seos_scotype_exception. lo_exception-name = <ls_sub_component>-sconame. lo_exception-description = <ls_sub_component>-descript. INSERT lo_exception INTO TABLE lo_method-exceptions. ENDCASE. ENDLOOP. IF lo_method-description IS NOT INITIAL OR lo_method-exceptions IS NOT INITIAL OR lo_method-parameters IS NOT INITIAL. INSERT lo_method INTO TABLE rs_result. ENDIF. ENDLOOP. ENDMETHOD. METHOD get_types. DATA: lo_type TYPE zif_abapgit_aff_oo_types_v1=>ty_component_description. FIELD-SYMBOLS: <ls_types> TYPE ty_component. LOOP AT is_components ASSIGNING <ls_types> WHERE cmptype = seoo_cmptype_type AND descript IS NOT INITIAL. lo_type-name = <ls_types>-cmpname. lo_type-description = <ls_types>-descript. INSERT lo_type INTO TABLE rs_result. ENDLOOP. ENDMETHOD. METHOD get_events. DATA: lo_parameter TYPE zif_abapgit_aff_oo_types_v1=>ty_component_description, lo_event TYPE zif_abapgit_aff_oo_types_v1=>ty_event. FIELD-SYMBOLS <ls_event> TYPE ty_component. FIELD-SYMBOLS <ls_sub_component> TYPE ty_sub_component. LOOP AT is_components ASSIGNING <ls_event> WHERE cmptype = seoo_cmptype_event. lo_event-name = <ls_event>-cmpname. lo_event-description = <ls_event>-descript. LOOP AT is_sub_components ASSIGNING <ls_sub_component> WHERE cmpname = <ls_event>-cmpname. lo_parameter-name = <ls_sub_component>-sconame. lo_parameter-description = <ls_sub_component>-descript. INSERT lo_parameter INTO TABLE lo_event-parameters. ENDLOOP. IF lo_event-description IS NOT INITIAL OR lo_event-parameters IS NOT INITIAL. INSERT lo_event INTO TABLE rs_result. ENDIF. ENDLOOP. ENDMETHOD. METHOD set_attributes. DATA: lo_attribute TYPE seocompotx. FIELD-SYMBOLS: <ls_attribute> TYPE zif_abapgit_aff_oo_types_v1=>ty_component_description. LOOP AT is_properties-attributes ASSIGNING <ls_attribute>. lo_attribute-clsname = iv_clif_name. lo_attribute-cmpname = <ls_attribute>-name. lo_attribute-langu = iv_language. lo_attribute-descript = <ls_attribute>-description. MODIFY seocompotx FROM lo_attribute. ENDLOOP. ENDMETHOD. METHOD set_methods. DATA: lo_method TYPE seocompotx, lo_method_exception TYPE seosubcotx, lo_method_parameter TYPE seosubcotx. FIELD-SYMBOLS: <ls_method> TYPE zif_abapgit_aff_oo_types_v1=>ty_method, <ls_parameter> TYPE zif_abapgit_aff_oo_types_v1=>ty_component_description, <ls_exception> TYPE zif_abapgit_aff_oo_types_v1=>ty_component_description. LOOP AT is_properties-methods ASSIGNING <ls_method>. lo_method-clsname = iv_clif_name. lo_method-cmpname = <ls_method>-name. lo_method-langu = iv_language. lo_method-descript = <ls_method>-description. MODIFY seocompotx FROM lo_method. LOOP AT <ls_method>-parameters ASSIGNING <ls_parameter>. lo_method_parameter-clsname = iv_clif_name. lo_method_parameter-cmpname = <ls_method>-name. lo_method_parameter-sconame = <ls_parameter>-name. lo_method_parameter-langu = iv_language. lo_method_parameter-descript = <ls_parameter>-description. MODIFY seosubcotx FROM lo_method_parameter. ENDLOOP. LOOP AT <ls_method>-exceptions ASSIGNING <ls_exception>. lo_method_exception-clsname = iv_clif_name. lo_method_exception-cmpname = <ls_method>-name. lo_method_exception-sconame = <ls_exception>-name. lo_method_exception-langu = iv_language. lo_method_exception-descript = <ls_exception>-description. MODIFY seosubcotx FROM lo_method_exception. ENDLOOP. ENDLOOP. ENDMETHOD. METHOD set_events. DATA: lo_event_parameter TYPE seosubcotx, lo_event TYPE seocompotx. FIELD-SYMBOLS: <ls_event> TYPE zif_abapgit_aff_oo_types_v1=>ty_event, <ls_parameter> TYPE zif_abapgit_aff_oo_types_v1=>ty_component_description. LOOP AT is_properties-events ASSIGNING <ls_event>. lo_event-clsname = iv_clif_name. lo_event-cmpname = <ls_event>-name. lo_event-langu = iv_language. lo_event-descript = <ls_event>-description. MODIFY seocompotx FROM lo_event. LOOP AT <ls_event>-parameters ASSIGNING <ls_parameter>. lo_event_parameter-clsname = iv_clif_name. lo_event_parameter-cmpname = <ls_event>-name. lo_event_parameter-sconame = <ls_parameter>-name. lo_event_parameter-langu = iv_language. lo_event_parameter-descript = <ls_parameter>-description. MODIFY seosubcotx FROM lo_event_parameter. ENDLOOP. ENDLOOP. ENDMETHOD. METHOD set_types. DATA: lo_type TYPE seocompotx. FIELD-SYMBOLS: <ls_type> TYPE zif_abapgit_aff_oo_types_v1=>ty_component_description. LOOP AT is_properties-types ASSIGNING <ls_type>. lo_type-clsname = iv_clif_name. lo_type-cmpname = <ls_type>-name. lo_type-langu = iv_language. lo_type-descript = <ls_type>-description. MODIFY seocompotx FROM lo_type. ENDLOOP. ENDMETHOD. METHOD set_descriptions_compo_subco. set_attributes( is_properties = is_properties iv_clif_name = iv_clif_name iv_language = iv_language ). set_methods( is_properties = is_properties iv_clif_name = iv_clif_name iv_language = iv_language ). set_events( is_properties = is_properties iv_clif_name = iv_clif_name iv_language = iv_language ). set_types( is_properties = is_properties iv_clif_name = iv_clif_name iv_language = iv_language ). ENDMETHOD. ENDCLASS. CLASS lcl_aff_type_mapping DEFINITION. PUBLIC SECTION. INTERFACES zif_abapgit_aff_type_mapping. PRIVATE SECTION. METHODS set_abapgit_descriptions IMPORTING is_clsname TYPE seoclsname is_intf_aff TYPE zif_abapgit_aff_intf_v1=>ty_main EXPORTING et_descriptions TYPE zif_abapgit_oo_object_fnc=>ty_seocompotx_tt et_descriptions_sub TYPE zif_abapgit_oo_object_fnc=>ty_seosubcotx_tt. ENDCLASS. CLASS lcl_aff_type_mapping IMPLEMENTATION. METHOD zif_abapgit_aff_type_mapping~to_aff. DATA: ls_data_abapgit TYPE zcl_abapgit_object_intf=>ty_intf, ls_data_aff TYPE zif_abapgit_aff_intf_v1=>ty_main. ls_data_abapgit = iv_data. ls_data_aff-format_version = '1'. " get header ls_data_aff-header-description = ls_data_abapgit-vseointerf-descript. ls_data_aff-header-abap_language_version = ls_data_abapgit-vseointerf-unicode. ls_data_aff-header-original_language = ls_data_abapgit-vseointerf-langu. " get category and proxy ls_data_aff-category = ls_data_abapgit-vseointerf-category. ls_data_aff-proxy = ls_data_abapgit-vseointerf-clsproxy. " get descriptions ls_data_aff-descriptions = lcl_aff_helper=>get_descriptions_compo_subco( iv_language = ls_data_aff-header-original_language iv_clif_name = ls_data_abapgit-vseointerf-clsname ). es_data = ls_data_aff. ENDMETHOD. METHOD zif_abapgit_aff_type_mapping~to_abapgit. DATA: ls_data_abapgit TYPE zcl_abapgit_object_intf=>ty_intf, ls_data_aff TYPE zif_abapgit_aff_intf_v1=>ty_main, lv_classname TYPE seoclsname. ls_data_aff = iv_data. lv_classname = to_upper( iv_object_name ). set_abapgit_descriptions( EXPORTING is_clsname = lv_classname is_intf_aff = ls_data_aff IMPORTING et_descriptions = ls_data_abapgit-description et_descriptions_sub = ls_data_abapgit-description_sub ). ls_data_abapgit-vseointerf-clsname = lv_classname. ls_data_abapgit-vseointerf-descript = ls_data_aff-header-description. ls_data_abapgit-vseointerf-category = ls_data_aff-category. ls_data_abapgit-vseointerf-unicode = ls_data_aff-header-abap_language_version. ls_data_abapgit-vseointerf-langu = ls_data_aff-header-original_language. ls_data_abapgit-vseointerf-clsproxy = ls_data_aff-proxy. ls_data_abapgit-vseointerf-exposure = seoc_exposure_public. ls_data_abapgit-vseointerf-state = seoc_state_implemented. es_data = ls_data_abapgit. ENDMETHOD. METHOD set_abapgit_descriptions. DATA ls_description TYPE seocompotx. DATA ls_description_subco TYPE seosubcotx. FIELD-SYMBOLS <ls_description> TYPE zif_abapgit_aff_oo_types_v1=>ty_component_description. FIELD-SYMBOLS <ls_meth_description> TYPE zif_abapgit_aff_oo_types_v1=>ty_method. FIELD-SYMBOLS <ls_evt_description> TYPE zif_abapgit_aff_oo_types_v1=>ty_event. LOOP AT is_intf_aff-descriptions-types ASSIGNING <ls_description>. ls_description-clsname = is_clsname. ls_description-cmpname = <ls_description>-name. ls_description-langu = is_intf_aff-header-original_language. ls_description-descript = <ls_description>-description. APPEND ls_description TO et_descriptions. ENDLOOP. LOOP AT is_intf_aff-descriptions-attributes ASSIGNING <ls_description>. ls_description-clsname = is_clsname. ls_description-cmpname = <ls_description>-name. ls_description-langu = is_intf_aff-header-original_language. ls_description-descript = <ls_description>-description. APPEND ls_description TO et_descriptions. ENDLOOP. LOOP AT is_intf_aff-descriptions-methods ASSIGNING <ls_meth_description>. ls_description-clsname = is_clsname. ls_description-cmpname = <ls_meth_description>-name. ls_description-langu = is_intf_aff-header-original_language. ls_description-descript = <ls_meth_description>-description. APPEND ls_description TO et_descriptions. LOOP AT <ls_meth_description>-parameters ASSIGNING <ls_description>. ls_description_subco-clsname = ls_description-clsname. ls_description_subco-cmpname = ls_description-cmpname. ls_description_subco-langu = ls_description-langu. ls_description_subco-sconame = <ls_description>-name. ls_description_subco-descript = <ls_description>-description. APPEND ls_description_subco TO et_descriptions_sub. ENDLOOP. LOOP AT <ls_meth_description>-exceptions ASSIGNING <ls_description>. ls_description_subco-clsname = ls_description-clsname. ls_description_subco-cmpname = ls_description-cmpname. ls_description_subco-langu = ls_description-langu. ls_description_subco-sconame = <ls_description>-name. ls_description_subco-descript = <ls_description>-description. APPEND ls_description_subco TO et_descriptions_sub. ENDLOOP. ENDLOOP. LOOP AT is_intf_aff-descriptions-events ASSIGNING <ls_evt_description>. ls_description-clsname = is_clsname. ls_description-cmpname = <ls_evt_description>-name. ls_description-langu = is_intf_aff-header-original_language. ls_description-descript = <ls_evt_description>-description. APPEND ls_description TO et_descriptions. LOOP AT <ls_evt_description>-parameters ASSIGNING <ls_description>. ls_description_subco-clsname = ls_description-clsname. ls_description_subco-cmpname = ls_description-cmpname. ls_description_subco-langu = ls_description-langu. ls_description_subco-sconame = <ls_description>-name. ls_description_subco-descript = <ls_description>-description. APPEND ls_description_subco TO et_descriptions_sub. ENDLOOP. ENDLOOP. ENDMETHOD. ENDCLASS. CLASS lcl_aff_metadata_handler DEFINITION. PUBLIC SECTION. CLASS-METHODS serialize IMPORTING is_intf TYPE zcl_abapgit_object_intf=>ty_intf RETURNING VALUE(rv_result) TYPE xstring RAISING zcx_abapgit_exception. CLASS-METHODS serialize_translations IMPORTING is_intf TYPE zcl_abapgit_object_intf=>ty_intf it_language TYPE zif_abapgit_definitions=>ty_languages RETURNING VALUE(rt_result) TYPE zif_abapgit_i18n_file=>ty_table_of RAISING zcx_abapgit_exception. CLASS-METHODS deserialize IMPORTING iv_data TYPE string RETURNING VALUE(rv_result) TYPE zif_abapgit_aff_intf_v1=>ty_main RAISING zcx_abapgit_exception. CLASS-METHODS deserialize_translation IMPORTING io_files TYPE REF TO zcl_abapgit_objects_files is_item TYPE zif_abapgit_definitions=>ty_item EXPORTING et_description_int TYPE zcl_abapgit_object_intf=>ty_intf-description_int et_description TYPE zcl_abapgit_object_intf=>ty_intf-description et_description_sub TYPE zcl_abapgit_object_intf=>ty_intf-description_sub RAISING zcx_abapgit_exception. PRIVATE SECTION. CLASS-METHODS: "! For serialization "! @parameter rt_result | Map/table that associates ABAP values to JSON values (enums) get_mappings RETURNING VALUE(rt_result) TYPE zcl_abapgit_json_handler=>ty_enum_mappings, "! For serialization "! @parameter rt_result | Paths that will not be serialized (depending on value) get_paths_to_skip RETURNING VALUE(rt_result) TYPE zcl_abapgit_json_handler=>ty_skip_paths, fill_translation IMPORTING iv_name TYPE seoclsname iv_language TYPE laiso RETURNING VALUE(rt_result) TYPE zif_abapgit_aff_intf_v1=>ty_main. ENDCLASS. CLASS lcl_aff_metadata_handler IMPLEMENTATION. METHOD serialize. DATA: ls_data_aff TYPE zif_abapgit_aff_intf_v1=>ty_main, lx_exception TYPE REF TO cx_root, lo_aff_handler TYPE REF TO zcl_abapgit_json_handler, lo_aff_mapper TYPE REF TO zif_abapgit_aff_type_mapping, lt_enum_mappings TYPE zcl_abapgit_json_handler=>ty_enum_mappings, lt_paths_to_skip TYPE zcl_abapgit_json_handler=>ty_skip_paths. CREATE OBJECT lo_aff_mapper TYPE lcl_aff_type_mapping. lo_aff_mapper->to_aff( EXPORTING iv_data = is_intf IMPORTING es_data = ls_data_aff ). lt_enum_mappings = get_mappings( ). lt_paths_to_skip = get_paths_to_skip( ). CREATE OBJECT lo_aff_handler. TRY. rv_result = lo_aff_handler->serialize( iv_data = ls_data_aff iv_enum_mappings = lt_enum_mappings iv_skip_paths = lt_paths_to_skip ). CATCH cx_root INTO lx_exception. zcx_abapgit_exception=>raise_with_text( lx_exception ). ENDTRY. ENDMETHOD. METHOD get_mappings. DATA: ls_category_mapping TYPE zcl_abapgit_json_handler=>ty_enum_mapping, ls_json_abap_mapping TYPE zcl_abapgit_json_handler=>ty_json_abap_mapping, lt_json_abap_mappings TYPE zcl_abapgit_json_handler=>ty_json_abap_mappings. ls_json_abap_mapping-abap = zif_abapgit_aff_intf_v1=>co_category-general. ls_json_abap_mapping-json = 'standard'. APPEND ls_json_abap_mapping TO lt_json_abap_mappings. ls_json_abap_mapping-abap = zif_abapgit_aff_intf_v1=>co_category-classic_badi. ls_json_abap_mapping-json = 'classicBadi'. APPEND ls_json_abap_mapping TO lt_json_abap_mappings. ls_json_abap_mapping-abap = zif_abapgit_aff_intf_v1=>co_category-business_static_components. ls_json_abap_mapping-json = 'businessStaticComponents'. APPEND ls_json_abap_mapping TO lt_json_abap_mappings. ls_json_abap_mapping-abap = zif_abapgit_aff_intf_v1=>co_category-db_procedure_proxy. ls_json_abap_mapping-json = 'dbProcedureProxy'. APPEND ls_json_abap_mapping TO lt_json_abap_mappings. ls_json_abap_mapping-abap = zif_abapgit_aff_intf_v1=>co_category-web_dynpro_runtime. ls_json_abap_mapping-json = 'webDynproRuntime'. APPEND ls_json_abap_mapping TO lt_json_abap_mappings. ls_json_abap_mapping-abap = zif_abapgit_aff_intf_v1=>co_category-enterprise_service. ls_json_abap_mapping-json = 'enterpriseService'. APPEND ls_json_abap_mapping TO lt_json_abap_mappings. ls_category_mapping-path = '/category'. ls_category_mapping-mappings = lt_json_abap_mappings. APPEND ls_category_mapping TO rt_result. ENDMETHOD. METHOD get_paths_to_skip. DATA: ls_path_to_skipp TYPE zcl_abapgit_json_handler=>ty_path_value_pair. ls_path_to_skipp-path = '/category'. ls_path_to_skipp-value = 'standard'. APPEND ls_path_to_skipp TO rt_result. ENDMETHOD. METHOD deserialize. DATA: lo_ajson TYPE REF TO zcl_abapgit_json_handler, lx_exception TYPE REF TO cx_static_check, lt_enum_mappings TYPE zcl_abapgit_json_handler=>ty_enum_mappings, lt_default_abap_langu_version TYPE zcl_abapgit_json_handler=>ty_path_value_pair, lt_values_for_initial TYPE zcl_abapgit_json_handler=>ty_skip_paths. lt_values_for_initial = get_paths_to_skip( ). lt_default_abap_langu_version-path = '/header/abap_language_version'. lt_default_abap_langu_version-value = zif_abapgit_dot_abapgit=>c_abap_language_version-standard. APPEND lt_default_abap_langu_version TO lt_values_for_initial. lt_enum_mappings = get_mappings( ). CREATE OBJECT lo_ajson. TRY. lo_ajson->deserialize( EXPORTING iv_content = iv_data iv_defaults = lt_values_for_initial iv_enum_mappings = lt_enum_mappings IMPORTING ev_data = rv_result ). CATCH cx_static_check INTO lx_exception. zcx_abapgit_exception=>raise_with_text( lx_exception ). ENDTRY. ENDMETHOD. METHOD serialize_translations. DATA: ls_data TYPE zif_abapgit_aff_intf_v1=>ty_main, lv_langu TYPE laiso, lv_json TYPE string, lo_ajson TYPE REF TO zif_abapgit_ajson, lo_json_path TYPE REF TO zcl_abapgit_json_path, lt_translation TYPE string_table, lx_exception TYPE REF TO zcx_abapgit_ajson_error, lo_trans_file TYPE REF TO zcl_abapgit_properties_file. LOOP AT it_language INTO lv_langu. ls_data = fill_translation( iv_name = is_intf-vseointerf-clsname iv_language = lv_langu ). " convert AFF type to JSON TRY. lo_ajson = zcl_abapgit_ajson=>new( iv_keep_item_order = abap_true )->set( iv_path = '/' iv_val = ls_data )->map( zcl_abapgit_ajson_mapping=>create_to_camel_case( ) )->filter( zcl_abapgit_ajson_filter_lib=>create_empty_filter( ) ). " remove manually the non-primitive types that are initial or not relevant for translation lo_ajson->delete( '/category/' ). lo_ajson->delete( '/proxy/' ). lv_json = lo_ajson->stringify( ). CATCH zcx_abapgit_ajson_error INTO lx_exception. zcx_abapgit_exception=>raise_with_text( lx_exception ). ENDTRY. CREATE OBJECT lo_json_path. lt_translation = lo_json_path->serialize( lv_json ). CREATE OBJECT lo_trans_file EXPORTING iv_lang = lv_langu. lo_trans_file->push_text_pairs( lt_translation ). APPEND lo_trans_file TO rt_result. ENDLOOP. ENDMETHOD. METHOD fill_translation. DATA: lv_langu_sap1 TYPE sy-langu. lv_langu_sap1 = zcl_abapgit_convert=>language_sap2_to_sap1( iv_language ). rt_result-descriptions = lcl_aff_helper=>get_descriptions_compo_subco( iv_clif_name = iv_name iv_language = lv_langu_sap1 ). SELECT SINGLE descript FROM seoclasstx INTO rt_result-header-description WHERE clsname = iv_name AND langu = lv_langu_sap1. ENDMETHOD. METHOD deserialize_translation. DATA: lo_properties_file TYPE REF TO zcl_abapgit_properties_file, lt_description_int LIKE LINE OF et_description_int, lt_translation_file TYPE zif_abapgit_i18n_file=>ty_table_of, li_translation_file LIKE LINE OF lt_translation_file, ls_aff_data TYPE zif_abapgit_aff_intf_v1=>ty_main, lo_type_mapper TYPE REF TO zif_abapgit_aff_type_mapping, ls_ag_data TYPE zcl_abapgit_object_intf=>ty_intf, lv_sap1 TYPE sy-langu. lt_translation_file = io_files->read_i18n_files( ). LOOP AT lt_translation_file INTO li_translation_file. CLEAR ls_ag_data. lo_properties_file ?= li_translation_file. lo_properties_file->get_translations( IMPORTING ev_data = ls_aff_data ). lv_sap1 = zcl_abapgit_convert=>language_sap2_to_sap1( li_translation_file->lang( ) ). ls_aff_data-header-original_language = lv_sap1. CREATE OBJECT lo_type_mapper TYPE lcl_aff_type_mapping. lo_type_mapper->to_abapgit( EXPORTING iv_data = ls_aff_data iv_object_name = is_item-obj_name IMPORTING es_data = ls_ag_data ). lt_description_int-clsname = ls_ag_data-vseointerf-clsname. lt_description_int-langu = ls_ag_data-vseointerf-langu. lt_description_int-descript = ls_ag_data-vseointerf-descript. APPEND lt_description_int TO et_description_int. APPEND LINES OF ls_ag_data-description TO et_description. APPEND LINES OF ls_ag_data-description_sub TO et_description_sub. ENDLOOP. ENDMETHOD. ENDCLASS. |