You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sync AGENTS.md with the reorganized package structure and guard it in CI (#682)
The July restructurings (category consolidation, sap.ui.unified subpackage,
generated ports moved out) left AGENTS.md §1/§2/§4 describing subpackages
that no longer exist (00/08-00/13) and stale CTEXTs (01/05, 01/08, 00/02,
00/04, 00/07). Update the tree, the src/00 categorization rules and the
overview-generation examples to the actual layout, rewrite the retired
z2ui5_cl_util_xml section (§10) around _generic( ), and point the checklists
at the generator instead of hand-edited catalogs.
Add scripts/check-agents-structure.js (npm run check:agents) plus a
check_docs workflow that compares the documented tree against the actual
package.devc.xml CTEXTs on every PR, so the doc cannot drift silently again.
Also add a PR-title rule: squash-merge titles must describe the change and
never stay auto-generated branch names.
Claude-Session: https://claude.ai/code/session_01F6ZLY4zwg3tr9P7z4tiR9d
Co-authored-by: Claude <noreply@anthropic.com>
├── 01/ only non-abap-cloud on-premise-only ABAP (not ABAP Cloud ready)
39
-
├── 02/ only non-openui5 SAPUI5-only controls (sap.suite.*, sap.ui.comp.*, VizFrame, …)
51
+
├── 02/ only non-openui5 or higher UI5 1.71 SAPUI5-only controls (sap.suite.*, sap.ui.comp.*, VizFrame, …) or a control/property introduced after UI5 1.71
40
52
├── 03/ only with launchpad runs only inside the Fiori Launchpad
41
-
├── 04/ only higher UI5 1.71uses a control/property introduced after UI5 1.71
53
+
├── 04/ use of z2ui5 needs the z2ui5/Util frontend helper module in the view
42
54
├── 05/ only with javascript and css and html needs native JS / CSS / HTML
43
55
├── 06/ only testing test / scaffolding apps, not demos
44
-
├── 07/ experimental work-in-progress / not finished
-`node scripts/check-agents-structure.js` reports no drift between the §1
281
+
tree and the actual `package.devc.xml` CTEXTs.
271
282
- abapGit file format for all file types: UTF-8, LF only, final newline,
272
283
2-space indent (§6).
273
284
- Overview catalogs still mirror the folder tree (§4).
@@ -481,7 +492,9 @@ ENDMETHOD.
481
492
482
493
## 10. Building Views
483
494
484
-
Views are XML strings passed to `client->view_display()`. There are two ways to build them:
495
+
Views are XML strings passed to `client->view_display()`, built with the
496
+
`z2ui5_cl_xml_view` fluent API — typed methods where they exist, `_generic( )`
497
+
for the rest.
485
498
486
499
### 1. `z2ui5_cl_xml_view` — typed fluent API
487
500
Pre-built methods for common UI5 controls (`shell`, `page`, `simple_form`, `input`, `button`, etc.). Use this for standard layouts.
@@ -542,75 +555,33 @@ ENDMETHOD.
542
555
The hierarchy above is: `shell` → `page` → `simple_form` → `content` → (leaf elements).
543
556
`label`, `input`, `button` are siblings inside `content`, so they stay at the same indent level as `)->content(`.
544
557
545
-
### 2. `z2ui5_cl_util_xml` — generic XML builder
546
-
Builds any XML structure directly from element names, namespaces and attributes. **Look up the control in the [UI5 API Reference](https://ui5.sap.com/#/api) and translate 1:1 to ABAP** — no wrapper, no abstraction layer.
547
-
548
-
**UI5 XML:**
549
-
```xml
550
-
<form:SimpleFormtitle="T"editable="true">
551
-
<form:content>
552
-
<Labeltext="qty"/>
553
-
<Inputvalue="{...}"/>
554
-
</form:content>
555
-
</form:SimpleForm>
556
-
```
557
-
558
-
**ABAP:**
559
-
```abap
560
-
->_( n = `SimpleForm` ns = `form` p = VALUE #(
561
-
( n = `title` v = `T` )
562
-
( n = `editable` v = abap_true ) )
563
-
)->_( n = `content` ns = `form`
564
-
)->__( n = `Label` a = `text` v = `qty`
565
-
)->__( n = `Input` a = `value` v = client->_bind_edit( qty ) )
566
-
```
567
-
568
-
Key rules for `z2ui5_cl_util_xml`:
569
-
-`_( n, ns, p )` — add child element, navigate **into** it
570
-
-`__( n, ns, a, v, p )` — add child element, **stay** at current level
571
-
-`p( n, v )` — add a single attribute to current element
572
-
- Single attribute: use `a = ... v = ...` parameters directly
573
-
- Multiple attributes: use `p = VALUE #( ( n = ... v = ... ) ... )`
574
-
- Namespace declarations go on the root `mvc:View` element as regular attributes (`xmlns:form`, etc.)
575
-
- Only declare namespaces that are actually used in the view
576
-
-`stringify()` on the factory root produces the complete XML string
577
-
578
-
#### Method chaining
579
-
580
-
Each call in a chain must start on its own line — never place two `->_()` / `->__()` calls on the same line:
558
+
### 2. `_generic( )` — controls without a typed method
581
559
582
-
```abap
583
-
" Wrong
584
-
DATA(page) = root->__( `Shell` )->__( n = `Page`
585
-
586
-
" Correct
587
-
DATA(page) = root->__( `Shell`
588
-
)->__( n = `Page`
589
-
```
590
-
591
-
Chain continuations (`)->`) are indented 3 spaces relative to the statement's base indentation.
592
-
593
-
#### Parameter alignment
594
-
595
-
When `p` appears on a continuation line, align it directly under `n` — one space after the opening `(`:
560
+
When a control or aggregation has no typed wrapper method (yet), stay inside
561
+
the `z2ui5_cl_xml_view` chain and add the element generically. **Look up the
562
+
control in the [UI5 API Reference](https://ui5.sap.com/#/api) and translate
563
+
1:1** — element name, namespace and properties exactly as documented:
596
564
597
565
```abap
598
-
" Wrong — p is one space too far right
599
-
)->_( n = `Input`
600
-
p = VALUE #( ... ) ).
601
-
602
-
" Correct — p directly under n
603
-
)->_( n = `Input`
604
-
p = VALUE #( ... ) ).
566
+
header_title->_generic(
567
+
name = `breadcrumbs`
568
+
ns = `f`
569
+
)->breadcrumbs(
570
+
)->link( text = `Home` ).
605
571
```
606
572
607
-
Continuation lines inside `VALUE #( )` align with the first tuple `(`:
608
-
609
-
```abap
610
-
)->_( n = `Input`
611
-
p = VALUE #( ( n = `type` v = `Number` )
612
-
( n = `value` v = client->_bind_edit( qty ) ) ) ).
613
-
```
573
+
Key rules for `_generic( )`:
574
+
-`_generic( name = ... ns = ... t_prop = ... )` adds one element and
575
+
navigates **into** it; typed methods continue the chain below it.
576
+
- Attributes go into `t_prop = VALUE #( ( n = `...` v = `...` ) ... )`.
577
+
-`ns` is registered on the view automatically — only pass namespaces that
578
+
are actually used.
579
+
- Raw embedded content (e.g. an inline `<style>` body) goes through
580
+
`_cc_plain_xml( )`.
581
+
582
+
> The former standalone XML builder `z2ui5_cl_util_xml` is retired in the
583
+
> framework (obsolete package, no new consumers) and is no longer used by any
0 commit comments