abap_gui_boilerplate
A template for ABAP applications with an HTML UI, built on GUI classes copied from abapGitabapGitA Git client written in ABAP that runs inside the system, so objects are cloned, pulled and pushed without leaving it; with no package manager in ABAP, a cloned repository is how code is distributed.community org, abap into a contrib package of its own.
A template and framework for HTML based GUI applications like in abapGitabapGitA Git client written in ABAP that runs inside the system, so objects are cloned, pulled and pushed without leaving it; with no package manager in ABAP, a cloned repository is how code is distributed.community org, abap, as the README puts it. lcl_gui_factory is the main class, meant as a single instance, instantiated with init and started with run; init takes an asset manager and either a router or a page, the page implementing the render method that returns the HTML, and the asset manager holding assets loaded from the MIME repository or given as a base64 string. Three example programs show it in use: a pure HTML UI of two pages with a router between them, one whose HTML is rendered by abap_mustacheabap_mustacheA Mustache template engine for ABAP, rendering logic-less templates into HTML or any other text from a structure or table of any type, with partials and a separate Steampunk-compatible branch.independent, abap from a template saved as MIME binary, and one that shows an ALV first and opens an HTML page on double-click. The HTML UI classes sit in ZGUIBP_HTML_CONTRIB and are, in the maintainer's words, heavily based (90%) on abapGit code, however a bit unified; eliminating that package to base directly on abapGit classes is on the to-do list, as is making the code build into a single file with abapmerge. The README calls the state of it work in progress, all may change, however safe enough to try.
Facts
Where it sits
Who is behind it
In the atlas: maintains 5, contributes to 11@sbcguamaintainer
Before choosing this
Signals
RepositoryArchivedThe declared repository is archived
GitHub reports the repository as archived. The package may remain installable, but its source is no longer open for normal maintenance.
What it declares
Every artifact
- Type
- Sample
- Origin
- Independently maintained
As a sample
- Form
- A template or starter
Connections
Producing a web user interface from ABAP code
Mustache template engine for ABAP
Git client written in ABAP that runs inside the system
Download
README
quoted from sbcgua/abap_gui_boilerplate under MIT, readBoilerplate for ABAP applications with HTML UI and abapmerge
version: 0.1
Work in progress, all may change, however safe enough to try ;)
Main idea
A template/framework for HTML based GUI applications like in abapGit. Based on abapGit GUI classes.
The examples of usage are in:
ZGUIBP_EXAMPLE- pure HTML example, UI, 2 pages and the router to control navigation between themZGUIBP_EXAMPLE_MSTSH- HTML is rendered by abap_mustache library (needs to be installed to compile). Mustache template is saved as MIME binary.ZGUIBP_EXAMPLE_ALV- combination of ALV and HTML UI, ALV is displayed first, double click open HTML page
The examples have some common components:
ZGUIBP_EXAMPLE_COMMON- implementation of asset manager that takes care of preloaded dataZGUIBP_EXAMPLE_COMPONENT- implementation of simple HTML page for HTML UI
Also, ALV ! How could it be without ALV ?! ;)
ZGUIBP_ALV- implements a common base class for SALV with controllable toolbar (based on zevolving blogs). Well, may be of interest, though I guess everybody has ALV boilerplates of his own ...
Shortly the concept of HTML UI classes
The main class is lcl_gui_factory - supposed to be a single instance. Suppose to be instantiated with init and then run. init accepts instance of loaded zcl_abapgit_gui_asset_manager and instance of router (zif_abapgit_gui_event_handler) or page (zif_abapgit_gui_renderable) to render.
Asset manager (zcl_abapgit_gui_asset_manager) hold the assets. Asset can be loaded from MIME repository of be a base64 string.
Page (zif_abapgit_gui_renderable or zif_abapgit_gui_page) must implement render method which returns instance of zif_abapgit_html (supposed to be zcl_abapgit_html), which is a wrapper for convenient html construction.
lcl_page_hoc - a high order component to add HTML head, body and some other useful stuff. Can be reused for simple cases.
Quick pseudo code for implementation
class lcl_my_page inheriting zif_abapgit_gui_renderable.
method render.
ro_html = new zcl_abapgit_html.
ro_html->add( 'some html stuff, in-body only' ).
endmethod.
endclass.
form main.
data lo_assets type ref to zcl_abapgit_gui_asset_manager.
lo_assets = new zcl_abapgit_gui_asset_manager.
lo_assets->register_asset(
iv_url = 'css/common.css'
iv_type = 'text/css'
iv_mime_name = 'ZMY_MIME_CSS_COMMON' ).
data lo_page type ref to zif_abapgit_gui_renderable.
lo_page = lcl_page_hoc=>wrap(
iv_page_title = 'Page 2'
ii_child = new lcl_my_page ).
lcl_gui_factory=>init(
io_component = lo_page
ii_asset_man = lo_assets ).
lcl_gui_factory=>run( ).
endform.
abapGit
The HTML UI classes reside in ZGUIBP_HTML_CONTRIB and are heavily based (90%) on abapGit code. However a bit unified. Maybe will be directly based on abapGit in future.
TODO
- the code should be build-able with
abapmergeinto a working single file without dependencies - better docs
- eliminate
ZGUIBP_HTML_CONTRIB, base directly on abapGit classes (PR differences to abapGit)
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
abaplint
History in the atlas
- First seen.
For your agent
- Ref
artifact:sbcgua-abap-gui-boilerplate- JSON
- /artifacts/sbcgua-abap-gui-boilerplate.json
- MCP
- Connecting an agent