New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WDCA Web Dynpro Application Configuration #79

Open
larshp opened this Issue Jun 14, 2015 · 5 comments

Comments

2 participants
@larshp
Owner

larshp commented Jun 14, 2015

No description provided.

@larshp

This comment has been minimized.

Owner

larshp commented Aug 1, 2015

tables WDY_CONFIG_*
class CL_WDR_CFG_PERSISTENCE_APPL

@larshp

This comment has been minimized.

Owner

larshp commented Aug 11, 2015

method READ_DATA, SET_SAVE_DATA, READ_OUTLINE_DATA

larshp added a commit that referenced this issue Aug 12, 2015

@larshp

This comment has been minimized.

Owner

larshp commented Aug 15, 2015

hmm, not sure how to save the data, help wanted

@mrsimpson

This comment has been minimized.

Collaborator

mrsimpson commented Mar 2, 2016

Me stating that the current solution was working was a false positive.
Must have been drunk - or sleepless, which is more likely.

However, the SOBJ-generic-plugin should be able to handle WDCA. I'll be trying this.
That brings up the question how to deal with concurrent serializers

@larshp

This comment has been minimized.

Owner

larshp commented May 20, 2016

deleting code from report, backup below

*----------------------------------------------------------------------*
*       CLASS lcl_object_wdca DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_object_wdca DEFINITION INHERITING FROM lcl_objects_super FINAL.

  PUBLIC SECTION.
    INTERFACES lif_object.
    ALIASES mo_files FOR lif_object~mo_files.

    METHODS constructor
      IMPORTING
                is_item TYPE ty_item
      RAISING   cx_sy_create_object_error.

  PRIVATE SECTION.
    METHODS read
      EXPORTING es_outline TYPE wdy_cfg_outline_data
                et_data    TYPE wdy_cfg_persist_data_appl_tab
      RAISING   lcx_exception.

    METHODS save
      IMPORTING is_outline TYPE wdy_cfg_outline_data
                it_data    TYPE wdy_cfg_persist_data_appl_tab
                iv_package TYPE devclass
      RAISING   lcx_exception.

ENDCLASS.                    "lcl_object_wdca DEFINITION

*----------------------------------------------------------------------*
*       CLASS lcl_object_wdca IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_object_wdca IMPLEMENTATION.

  METHOD lif_object~get_metadata.
    rs_metadata = get_metadata( ).
  ENDMETHOD.                    "lif_object~get_metadata

  METHOD constructor.
    super->constructor( is_item = is_item
                        iv_language = gc_english ).
    RAISE EXCEPTION TYPE cx_sy_create_object_error.
*    This serializer is currently not yet functional.
*    Prevent instantiation in order to enable handling of WDCA by plugins
  ENDMETHOD.                    "constructor

  METHOD lif_object~exists.

    DATA: ls_outline TYPE wdy_cfg_outline_data.


    read( IMPORTING es_outline = ls_outline ).
    rv_bool = boolc( NOT ls_outline IS INITIAL ).

  ENDMETHOD.                    "lif_object~exists

  METHOD save.
    _raise 'WDCA, save not implemented'.

*   below code are ideas, does not seem to work though
*    DATA: lo_cfg       TYPE REF TO cl_wdr_cfg_persistence_appl,
*          ls_key       TYPE wdy_config_key,
*          ls_data      LIKE LINE OF it_data,
*          lv_operation TYPE i,
*          lv_name      TYPE wdy_md_object_name.
*
*
*    MOVE-CORRESPONDING is_outline TO ls_key.
*
*    TRY.
*        CREATE OBJECT lo_cfg
*          EXPORTING
*            config_key  = ls_key
*            object_name = lv_name.
*
*        READ TABLE it_data INDEX 1 INTO ls_data.
*        ASSERT sy-subrc = 0.
*
*        lo_cfg->set_save_data( ls_data ).
*
*        lv_operation = if_wdr_cfg_constants=>c_cts_operation-e_save.
*        lo_cfg->do_next_step( CHANGING c_operation = lv_operation ).
*
*      CATCH cx_wd_configuration.
*        _raise 'WDCA, save error'.
*    ENDTRY.

  ENDMETHOD.                    "save

  METHOD read.

    DATA: lo_cfg    TYPE REF TO cl_wdr_cfg_persistence_appl,
          ls_key    TYPE wdy_config_key,
          lv_exists TYPE abap_bool,
          lx_err    TYPE REF TO cx_wd_configuration,
          lv_name   TYPE wdy_md_object_name.


    CLEAR et_data.

    ls_key = ms_item-obj_name.

    TRY.
        CREATE OBJECT lo_cfg
          EXPORTING
            config_key  = ls_key
            object_name = lv_name.

        MOVE-CORRESPONDING ls_key TO es_outline.

        lo_cfg->check_config_existent(
          EXPORTING
            i_outline_data       = es_outline
            i_only_current_layer = abap_false
            i_is_original        = abap_true
          IMPORTING
            e_is_existent        = lv_exists ).
        IF lv_exists = abap_false.
          CLEAR es_outline.
          RETURN.
        ENDIF.

        es_outline = lo_cfg->read_outline_data( ).
      CATCH cx_wd_configuration INTO lx_err.
        IF lx_err->textid = cx_wd_configuration=>conf_config_not_exist.
          CLEAR es_outline.
          RETURN.
        ELSE.
          _raise 'WDCA, read error'.
        ENDIF.
    ENDTRY.

    CLEAR: es_outline-devclass,
           es_outline-author,
           es_outline-createdon,
           es_outline-changedby,
           es_outline-changedon.
    et_data = lo_cfg->read_data( ).

  ENDMETHOD.                    "read

  METHOD lif_object~serialize.

    DATA: ls_outline TYPE wdy_cfg_outline_data,
          lt_data    TYPE wdy_cfg_persist_data_appl_tab.


    read( IMPORTING es_outline = ls_outline
                    et_data    = lt_data ).
    IF ls_outline IS INITIAL.
      RETURN.
    ENDIF.

    io_xml->add( iv_name = 'OUTLINE'
                 ig_data = ls_outline ).
    io_xml->add( iv_name = 'DATA'
                 ig_data = lt_data ).

  ENDMETHOD.                    "serialize

  METHOD lif_object~deserialize.

    DATA: ls_outline TYPE wdy_cfg_outline_data,
          lt_data    TYPE wdy_cfg_persist_data_appl_tab.


    io_xml->read( EXPORTING iv_name = 'OUTLINE'
                  CHANGING cg_data = ls_outline ).
    io_xml->read( EXPORTING iv_name = 'DATA'
                  CHANGING cg_data = lt_data ).

    save( is_outline = ls_outline
          it_data    = lt_data
          iv_package = iv_package ).

  ENDMETHOD.                    "deserialize

  METHOD lif_object~delete.

    DATA: ls_key TYPE wdy_config_key.


    ls_key = ms_item-obj_name.

    cl_wdr_configuration_utils=>delete_config_4_appl( ls_key ).

  ENDMETHOD.                    "delete

  METHOD lif_object~jump.

    CALL FUNCTION 'RS_TOOL_ACCESS'
      EXPORTING
        operation     = 'SHOW'
        object_name   = ms_item-obj_name
        object_type   = ms_item-obj_type
        in_new_window = abap_true.

  ENDMETHOD.                    "jump

ENDCLASS.                    "lcl_object_wdca IMPLEMENTATION

larshp added a commit that referenced this issue May 20, 2016

remove english language limitation #189
class for WDCA removed, see #79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment