-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add Label Designer & Repository Transfer #6
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bda5f90
Label maker
mbtools 611972a
Update
mbtools e3c9761
Update
mbtools 585eb8f
Update
mbtools 95bfeb1
Update
mbtools a94bc55
Downport
mbtools b3b5ac3
Downport
mbtools c678b15
Add license to code
mbtools 89d9a40
Add version constant
mbtools File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
REPORT zabapgit_label_designer. | ||
|
||
******************************************************************************** | ||
* abapGit Label Designer | ||
* | ||
* A tool for designing labels for your personal abapGit settings | ||
* Colors are based on the standard CSS colors supported by browsers | ||
* https://www.w3schools.com/cssref/css_colors.php | ||
* | ||
* https://github.com/Marc-Bernard-Tools/ABAP-Tools-for-abapGit | ||
* | ||
* Copyright 2023 Marc Bernard <https://marcbernardtools.com/> | ||
* SPDX-License-Identifier: MIT | ||
******************************************************************************** | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2023 Marc Bernard | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
******************************************************************************** | ||
|
||
CONSTANTS c_version TYPE string VALUE '1.0.0' ##NEEDED. | ||
|
||
SELECTION-SCREEN BEGIN OF SCREEN 1001. | ||
* dummy for triggering screen | ||
SELECTION-SCREEN END OF SCREEN 1001. | ||
|
||
DATA go_gui TYPE REF TO zcl_abapgit_label_designer. | ||
|
||
AT SELECTION-SCREEN ON EXIT-COMMAND. | ||
|
||
CASE sy-ucomm. | ||
WHEN 'CBAC' OR 'CCAN'. "Back & Escape | ||
IF go_gui->back( ) = abap_true. | ||
go_gui->free( ). | ||
ELSE. | ||
LEAVE TO SCREEN 1001. | ||
ENDIF. | ||
ENDCASE. | ||
|
||
START-OF-SELECTION. | ||
|
||
CREATE OBJECT go_gui. | ||
|
||
go_gui->startup( '' )->render( ). | ||
|
||
CALL SELECTION-SCREEN 1001. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0"> | ||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0"> | ||
<asx:values> | ||
<PROGDIR> | ||
<NAME>ZABAPGIT_LABEL_DESIGNER</NAME> | ||
<SUBC>1</SUBC> | ||
<RLOAD>E</RLOAD> | ||
<FIXPT>X</FIXPT> | ||
<UCCHECK>X</UCCHECK> | ||
</PROGDIR> | ||
<TPOOL> | ||
<item> | ||
<ID>R</ID> | ||
<ENTRY>abapGit Label Designer</ENTRY> | ||
<LENGTH>25</LENGTH> | ||
</item> | ||
</TPOOL> | ||
</asx:values> | ||
</asx:abap> | ||
</abapGit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,256 @@ | ||
REPORT zabapgit_repo_transfer. | ||
|
||
******************************************************************************** | ||
* abapGit Repository Transfer | ||
* | ||
* A tool for doing a mass-transfer of abapGit repositories and settings from | ||
* one system to another based on a free selection of existing repositories and | ||
* user settings. | ||
* | ||
* https://github.com/Marc-Bernard-Tools/ABAP-Tools-for-abapGit | ||
* | ||
* Copyright 2023 Marc Bernard <https://marcbernardtools.com/> | ||
* SPDX-License-Identifier: MIT | ||
******************************************************************************** | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2023 Marc Bernard | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
******************************************************************************** | ||
|
||
CONSTANTS c_version TYPE string VALUE '1.0.0' ##NEEDED. | ||
|
||
TABLES: tdevc, tdevct, usr02. | ||
|
||
SELECTION-SCREEN BEGIN OF BLOCK sc_header WITH FRAME TITLE sc_titl0. | ||
SELECTION-SCREEN: | ||
SKIP, | ||
COMMENT /1(77) sc_txt1, | ||
COMMENT /1(77) sc_txt2, | ||
COMMENT /1(77) sc_txt3. | ||
SELECTION-SCREEN END OF BLOCK sc_header. | ||
|
||
SELECTION-SCREEN SKIP. | ||
|
||
SELECTION-SCREEN BEGIN OF BLOCK sc_repo WITH FRAME TITLE sc_titl1. | ||
SELECT-OPTIONS: | ||
s_name FOR tdevct-ctext LOWER CASE, | ||
s_pack FOR tdevc-devclass, | ||
s_url FOR tdevct-ctext LOWER CASE. | ||
PARAMETERS: | ||
p_online AS CHECKBOX DEFAULT 'X', | ||
p_offlin AS CHECKBOX DEFAULT 'X', | ||
p_favor AS CHECKBOX. | ||
SELECTION-SCREEN END OF BLOCK sc_repo. | ||
|
||
SELECTION-SCREEN SKIP. | ||
|
||
SELECTION-SCREEN BEGIN OF BLOCK sc_user WITH FRAME TITLE sc_titl2. | ||
SELECT-OPTIONS: | ||
s_user FOR usr02-bname. | ||
SELECTION-SCREEN END OF BLOCK sc_user. | ||
|
||
SELECTION-SCREEN SKIP. | ||
|
||
SELECTION-SCREEN BEGIN OF BLOCK sc_act WITH FRAME TITLE sc_titl3. | ||
PARAMETERS: | ||
p_backup RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND lar, | ||
p_restor RADIOBUTTON GROUP g1. | ||
SELECTION-SCREEN END OF BLOCK sc_act. | ||
|
||
SELECTION-SCREEN BEGIN OF BLOCK sc_opt WITH FRAME TITLE sc_titl4. | ||
PARAMETERS: | ||
p_pull AS CHECKBOX MODIF ID res, | ||
p_chksum AS CHECKBOX MODIF ID res, | ||
p_global AS CHECKBOX MODIF ID res, | ||
p_user AS CHECKBOX MODIF ID res. | ||
SELECTION-SCREEN END OF BLOCK sc_opt. | ||
|
||
DATA gt_repos TYPE zif_abapgit_repo_srv=>ty_repo_list. | ||
|
||
FORM get. | ||
|
||
DATA: | ||
lo_online TYPE REF TO zcl_abapgit_repo_online, | ||
lv_name TYPE string, | ||
lv_package TYPE devclass, | ||
lv_url TYPE string, | ||
lx_error TYPE REF TO zcx_abapgit_exception. | ||
|
||
FIELD-SYMBOLS <li_repo> TYPE REF TO zif_abapgit_repo. | ||
|
||
TRY. | ||
gt_repos = zcl_abapgit_repo_srv=>get_instance( )->list( ). | ||
|
||
LOOP AT gt_repos ASSIGNING <li_repo>. | ||
lv_name = <li_repo>->get_name( ). | ||
lv_package = <li_repo>->get_package( ). | ||
|
||
IF <li_repo>->is_offline( ) = abap_false. | ||
lo_online ?= <li_repo>. | ||
lv_url = lo_online->get_url( ). | ||
ELSE. | ||
lv_url = ''. | ||
ENDIF. | ||
|
||
IF NOT ( lv_name IN s_name AND lv_package IN s_pack AND lv_url IN s_url ). | ||
DELETE gt_repos. | ||
ENDIF. | ||
ENDLOOP. | ||
CATCH zcx_abapgit_exception INTO lx_error. | ||
MESSAGE lx_error TYPE 'E'. | ||
ENDTRY. | ||
ENDFORM. | ||
|
||
FORM list. | ||
|
||
TYPES: | ||
BEGIN OF ty_alv, | ||
name TYPE string, | ||
package TYPE devclass, | ||
url TYPE string, | ||
labels TYPE string, | ||
END OF ty_alv. | ||
|
||
DATA: | ||
lo_online TYPE REF TO zcl_abapgit_repo_online, | ||
ls_settings TYPE zif_abapgit_persistence=>ty_repo-local_settings, | ||
ls_alv TYPE ty_alv, | ||
lt_alv TYPE STANDARD TABLE OF ty_alv WITH DEFAULT KEY. | ||
|
||
FIELD-SYMBOLS <li_repo> TYPE REF TO zif_abapgit_repo. | ||
|
||
LOOP AT gt_repos ASSIGNING <li_repo>. | ||
ls_settings = <li_repo>->get_local_settings( ). | ||
|
||
CLEAR ls_alv. | ||
ls_alv-name = <li_repo>->get_name( ). | ||
ls_alv-package = <li_repo>->get_package( ). | ||
IF <li_repo>->is_offline( ) = abap_false. | ||
lo_online ?= <li_repo>. | ||
ls_alv-url = lo_online->get_url( ). | ||
ENDIF. | ||
ls_alv-labels = ls_settings-labels. | ||
INSERT ls_alv INTO TABLE lt_alv. | ||
ENDLOOP. | ||
|
||
SORT lt_alv. | ||
|
||
CALL FUNCTION 'RSDU_CALL_ALV_TABLE' | ||
EXPORTING | ||
i_title = 'Repository Labels' | ||
i_ta_data = lt_alv. | ||
|
||
ENDFORM. | ||
|
||
FORM add_remove. | ||
|
||
DATA: | ||
li_repo TYPE REF TO zcl_abapgit_repo, | ||
ls_settings TYPE zif_abapgit_persistence=>ty_repo-local_settings, | ||
lx_error TYPE REF TO zcx_abapgit_exception. | ||
|
||
FIELD-SYMBOLS: | ||
<li_repo> TYPE REF TO zif_abapgit_repo. | ||
|
||
LOOP AT gt_repos ASSIGNING <li_repo>. | ||
li_repo ?= <li_repo>. | ||
|
||
ls_settings = li_repo->get_local_settings( ). | ||
|
||
* SPLIT ls_settings-labels AT ',' INTO TABLE lt_labels. | ||
* | ||
* LOOP AT s_label ASSIGNING <lv_label>. | ||
* lv_label = condense( <lv_label>-low ). | ||
* READ TABLE lt_labels TRANSPORTING NO FIELDS WITH KEY table_line = lv_label. | ||
* IF sy-subrc <> 0 AND p_add = abap_true. | ||
* INSERT lv_label INTO TABLE lt_labels. | ||
* ELSEIF sy-subrc = 0 AND p_remove = abap_true. | ||
* DELETE lt_labels WHERE table_line = lv_label. | ||
* ENDIF. | ||
* ENDLOOP. | ||
* | ||
* CONCATENATE LINES OF lt_labels INTO lv_label SEPARATED BY ','. | ||
* | ||
* ls_settings-labels = zcl_abapgit_repo_labels=>normalize( lv_label ). | ||
* | ||
* TRY. | ||
* li_repo->set_local_settings( ls_settings ). | ||
* COMMIT WORK AND WAIT. | ||
* CATCH zcx_abapgit_exception INTO lx_error. | ||
* MESSAGE lx_error TYPE 'I'. | ||
* ENDTRY. | ||
ENDLOOP. | ||
|
||
ENDFORM. | ||
|
||
FORM screen. | ||
|
||
DATA lv_input TYPE abap_bool. | ||
|
||
LOOP AT SCREEN. | ||
IF screen-group1 = 'RES'. | ||
lv_input = boolc( p_restor = abap_true ). | ||
ELSE. | ||
lv_input = abap_true. | ||
ENDIF. | ||
|
||
IF lv_input = abap_true. | ||
screen-input = '1'. | ||
ELSE. | ||
screen-input = '0'. | ||
ENDIF. | ||
|
||
MODIFY SCREEN. | ||
ENDLOOP. | ||
|
||
ENDFORM. | ||
|
||
INITIALIZATION. | ||
|
||
sc_titl0 = 'Description'. | ||
sc_txt1 = 'This is a tool for doing a mass-transfer of repositories and'. | ||
sc_txt2 = 'settings from one system to another based on a free selection of'. | ||
sc_txt3 = 'existing repositories and user settings.'. | ||
sc_titl1 = 'Repository Selection'. | ||
sc_titl2 = 'User Selection'. | ||
sc_titl3 = 'Action'. | ||
sc_titl4 = 'Restore Options'. | ||
|
||
AT SELECTION-SCREEN. | ||
|
||
PERFORM screen. | ||
|
||
AT SELECTION-SCREEN OUTPUT. | ||
|
||
PERFORM screen. | ||
|
||
START-OF-SELECTION. | ||
|
||
PERFORM get. | ||
|
||
CASE abap_true. | ||
WHEN p_backup. | ||
* PERFORM add_remove. | ||
* PERFORM list. | ||
WHEN p_restor. | ||
* PERFORM add_remove. | ||
* PERFORM list. | ||
ENDCASE. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented code
Suggest following fix,