Skip to content

Commit

Permalink
Merge branch 'main' into sbcgua/html-table2
Browse files Browse the repository at this point in the history
  • Loading branch information
mbtools authored Apr 16, 2024
2 parents 4875a51 + 97dde33 commit 5f15573
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 23 deletions.
17 changes: 5 additions & 12 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,15 @@ abapGit is a git client for ABAP developed in ABAP. It requires ABAP version 702

Latest build: <a href="https://raw.githubusercontent.com/abapGit/build/main/zabapgit_standalone.prog.abap" download>zabapgit_standalone.prog.abap</a>

For questions/comments/bugs/feature requests/wishes please create an [issue](https://github.com/abapGit/abapGit/issues).
For questions, comments, bugs, feature requests, or other wishes please create an [issue](https://github.com/abapGit/abapGit/issues).

## Security

abapGit is a tool to import and export code between ABAP systems. If a developer has a developer key to the system,
the developer can perform these actions already. abapGit enables the developer to do mass export/changes/imports but
not more than already possible to do manually.
abapGit is a tool to import and export code between ABAP systems. If a developer has a developer key to the system, the developer can perform these actions already. abapGit enables the developer to do mass export/changes/imports but not more than already possible to do manually.

Running automated security checks on the abapGit code will by design give a lot of errors, as abapGit will import, overwrite and change
ABAP artifacts in the system in ways that might not be intended. Always review all code in remote repositories before importing to the target system,
this is possible because abapGit is plain text unlike traditional transport files.
Running automated security checks on the abapGit code will by design give a lot of errors, as abapGit will import, overwrite and change ABAP artifacts in the system in ways that might not be intended. Always review all code in remote repositories before importing to the target system, this is possible because abapGit is plain text unlike traditional transport files.

That being said, abapGit is used by multiple [organizations](/user-guide/other/where-used.md), all abapGit
changes are reviewed via pull requests. And all 100+ [repository watchers](https://github.com/abapGit/abapGit/watchers) are
automatically notified for every change to the code base, so potentially all changes are looked at by more people than
traditional enterprise products.
That being said, abapGit is used by multiple [organizations](/user-guide/other/where-used.md), all abapGit changes are reviewed via pull requests. And all 100+ [repository watchers](https://github.com/abapGit/abapGit/watchers) are automatically notified for every change to the code base, so potentially all changes are looked at by more people than traditional enterprise products.

## Support

Expand All @@ -47,4 +40,4 @@ It is a community effort to support the project, recommend [watching](https://he

## Community vs. SAP Distribution of abapGit

This website is documenting the community version of abapGit (available on [GitHub](https://github.com/abapGit/abapGit)). The SAP version of abapGit available as part of SAP Business Technology Platform is documented on [help.sap.com](https://help.sap.com/docs/BTP/65de2977205c403bbc107264b8eccf4b/d62ed9d54a764c53990f25f0ab6c27f9.html). When using the SAP version, please note that there are different capabilities and supported object types (as described by SAP). If the SAP version on BTP does not work correctly, open a ticket with SAP support.
This website is documenting the community version of abapGit (available on [GitHub](https://github.com/abapGit/abapGit)). The SAP version of abapGit available that is part of SAP Business Technology Platform and SAP S/4HANA Cloud is documented on [help.sap.com](https://help.sap.com/docs/BTP/65de2977205c403bbc107264b8eccf4b/d62ed9d54a764c53990f25f0ab6c27f9.html). When using the SAP version, please note that there are different capabilities and supported object types (as described by SAP). If the SAP version does not work correctly, open a [ticket with SAP support](https://me.sap.com/servicessupport/cases).
28 changes: 17 additions & 11 deletions src/development-guide/user-interface/developing-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ order: 10
---

This documentation covers page creation, HTML rendering, and event handling.

- See also [UI - CSS and Assets](./developing-ui-css.html)
- See also [UI - JavaScript](./developing-ui-js.html)
- See also [HTML Forms](./developing-ui-forms.html)
Expand All @@ -18,6 +19,7 @@ This documentation covers page creation, HTML rendering, and event handling.
- Please, please, care about usability, content readability, and style in general :pray: ;)
- Check `ZCL_ABAPGIT_GUI_CHUNK_LIB` for some existing HTML chunks like `render_error`
- To register postponed HTML parts, scripts, and hotkeys - access corresponding methods via `gui_services` method of `zcl_abapgit_gui_component`
- See `zcl_abapgit_gui_page_template` as en example and template for new pages. Also see other page templates available in `test` sub-package. Follow the `TODO` comments in the template code.

## GUI Components

Expand Down Expand Up @@ -61,24 +63,25 @@ ENDMETHOD.
- **ADD** - adds a chunk to accumulated HTML. You can pass a string or another `ZCL_ABAPGIT_HTML` instance. In the example above `render_some_stuff` may either return a string or have the same pattern as `render_content` (retuning `ZCL_ABAPGIT_HTML` instance)
- **ADD_ICON and ICON** - renders an icon. abapGit uses web fonts to render icons (see [adding icons](./adding-icons.html)). The method accepts the icon name and a CSS class name which represents a color separated by '/'. E.g., in the example above it will render 'star' icon and assign 'error' CSS class to it which has red color in the abapGit styles. The method has its static brother `ZCL_ABAPGIT_HTML=>ICON` which is more convenient in some cases and just returns a rendered HTML string.
- **ADD_A and A** - render a link (anchor) (`A` - static method). It is strongly suggested that you use this method instead of rendering `<a>` tags directly. Params:
- `IV_TXT` - text to be rendered inside the anchor
- `IV_TYP` - the type of action done on click. 3 options:
- `zif_abapgit_html=>c_action_type-url`- direct link to an URL,
- `...-sapevent` (the default) - pass an event to sap handler,
- `...-onclick` - call a JS function,
- `...-dummy` - just render an anchor but no action
- `IV_ACT` - depending on the type should be either URL or sapevent name or JS function to call
- `IV_OPT` - `zif_abapgit_html=>c_html_opt-strong` or `...-cancel` or `...-crossout` - some semantic predefined styles to add to the link
- `IV_CLASS` - additional CSS class, if needed
- `IV_STYLE` - additional direct styles to use (generally discouraged, please use CSS classes instead)
- `IV_ID` - id of the anchor (may be needed for JS code)
- `IV_TXT` - text to be rendered inside the anchor
- `IV_TYP` - the type of action done on click. 3 options:
- `zif_abapgit_html=>c_action_type-url`- direct link to an URL,
- `...-sapevent` (the default) - pass an event to sap handler,
- `...-onclick` - call a JS function,
- `...-dummy` - just render an anchor but no action
- `IV_ACT` - depending on the type should be either URL or sapevent name or JS function to call
- `IV_OPT` - `zif_abapgit_html=>c_html_opt-strong` or `...-cancel` or `...-crossout` - some semantic predefined styles to add to the link
- `IV_CLASS` - additional CSS class, if needed
- `IV_STYLE` - additional direct styles to use (generally discouraged, please use CSS classes instead)
- `IV_ID` - id of the anchor (may be needed for JS code)
- **SET_TITLE** - the method is used for debugging purposes for postponed HTML parts. As it is not visible which class registered an HTML part, the title can be used to specify the origin.

## Renderables

Sub-classing `ZCL_ABAPGIT_GUI_PAGE` is not the only way to render the content. You may want to separate some visual component that is not a page e.g. `ZCL_ABAPGIT_GUI_VIEW_REPO` is a class like that. In essence, you have to implement `ZIF_ABAPGIT_GUI_RENDERABLE` and its method - `render`. Then you can reuse it or even pass it directly to the GUI class as a page to render.

It makes sense to also subclass your component from `ZCL_ABAPGIT_GUI_COMPONENT`. This class has a protected `gui_services` method returning the singleton instance of `ZIF_ABAPGIT_GUI_SERVICES`. The GUI services are good for:

- registering self as an event handler (`register_event_handler`). Importantly, later registered event handlers have higher priority (processing is done from bottom to top)
- accessing hotkey services (`get_hotkeys_ctl`) - to register own hotkeys for the page (hotkeys are combined from the whole component stack)
- registering postponed HTML parts (`get_html_parts`)
Expand All @@ -93,13 +96,15 @@ Components may have postponed parts, e.g. scripts or hidden forms. These chunks
iv_collection = c_html_parts-scripts
ii_part = render_my_scripts( ) ).
```

where `render_my_scripts( )` must return an instance of `ZCL_ABAPGIT_HTML`.

Currently, two collections are supported out of the box - scripts and hidden_forms (see definition of `zcl_abapgit_gui_component`). Scripts rendered after the page body. Hidden forms right before the end of the body. But this does not limit you to these categories only - you may register your own collections to exchange postponed parts between components supported by you. The collection is just a named list of `ZCL_ABAPGIT_HTML` instances.

## Router and Event Handlers

To process sapevents in abap the component (page) must implement `ZIF_ABAPGIT_GUI_EVENT_HANDLER=>on_event`. It imports `ii_event` instance which represents `sapevent` handler of `cl_gui_html_viewer`. In particular:

- `ii_event->mv_action` - sapevent code (part of URL before `?`)
- `ii_event->mv_getdata` - raw URL query (part of URL after `?`)
- `ii_event->mt_postdata` - raw post data (if present)
Expand All @@ -112,6 +117,7 @@ To process sapevents in abap the component (page) must implement `ZIF_ABAPGIT_GU
- `ii_event->form_data()` - attempts to parse post_data assuming it is set of key value pairs. Returns a string map. Otherwise behaves as `query()` above. `iv_upper_cased = false` by default.

Events can be processed on 2 levels - in page/component **or** in the router. On new event:

- the GUI goes through the event handlers stack - a list of components that registered themselves as event handlers during rendering via `gui_services`
- the processing is done from the last registered handler to the first one (stack top to bottom)
- the first event handler that returns "handled" status breaks the cycle (see below how this is indicated)
Expand Down
4 changes: 4 additions & 0 deletions src/user-guide/getting-started/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ abapGit exists in 2 flavours: _standalone_ version or _developer_ version.
* The standalone version is targeted at users. It consists of one (huge) program which contains all the needed code. You run the standalone version in transaction `SE38`, executing the program you created.
* The developer version is targeted at developers contributing to the abapGit codebase. It consists of all the ABAP programs/classes/interfaces/etc. of the abapGit project. You run the developer version with transaction `ZABAPGIT`. Only the developer version supports parallel processing, so it might be of interest to you even if you do not intend to contribute.

::: warning
There's also an SAP version of abapGit available that is part of SAP Business Technology Platform and SAP S/4HANA Cloud. It's documented on [help.sap.com](https://help.sap.com/docs/BTP/65de2977205c403bbc107264b8eccf4b/d62ed9d54a764c53990f25f0ab6c27f9.html). When using the SAP version, note that there are different capabilities and supported object types (as described by SAP). If the SAP version does not work correctly, open a [ticket with SAP support](https://me.sap.com/servicessupport/cases).
:::

## Prerequisites

abapGit requires SAP BASIS version 702 or higher.
Expand Down

0 comments on commit 5f15573

Please sign in to comment.