From 02c8427b9f6f4fb0b5087d7bff4a7570302b9c28 Mon Sep 17 00:00:00 2001 From: Austin Devine Date: Thu, 9 Oct 2025 22:13:14 +0100 Subject: [PATCH 1/7] feat(fiori-mcp-server): add fiori_development_portal_extension.md, update README with usage rules and new build scripts --- .changeset/chatty-brooms-sniff.md | 5 + .../fiori_development_portal_extension.md | 269 ++++++++++++++++++ packages/fiori-mcp-server/README.md | 2 + packages/fiori-mcp-server/package.json | 5 +- 4 files changed, 279 insertions(+), 2 deletions(-) create mode 100644 .changeset/chatty-brooms-sniff.md create mode 100644 packages/fiori-docs-embeddings/data_local/fiori_development_portal_extension.md diff --git a/.changeset/chatty-brooms-sniff.md b/.changeset/chatty-brooms-sniff.md new file mode 100644 index 00000000000..36e152a3e87 --- /dev/null +++ b/.changeset/chatty-brooms-sniff.md @@ -0,0 +1,5 @@ +--- +'@sap-ux/fiori-docs-embeddings': minor +--- + +Add FPM Development portal documentation to embeddings diff --git a/packages/fiori-docs-embeddings/data_local/fiori_development_portal_extension.md b/packages/fiori-docs-embeddings/data_local/fiori_development_portal_extension.md new file mode 100644 index 00000000000..f2a7056fe79 --- /dev/null +++ b/packages/fiori-docs-embeddings/data_local/fiori_development_portal_extension.md @@ -0,0 +1,269 @@ + +-------------------------------- + +**TITLE**: Analytical chart on List Page Fiori Elements Odata V4 + +**INTRODUCTION**: The analytical chart on list page offers a unique way to analyze data step by step from different perspectives, to investigate a root cause through drilldown, and to act on transactional content. +In SAP Fiori elements for OData V4, the ALP (Analytical List Report) is not a separate floorplan, but rather a 'flavor' of the list report. When application developers configure a list report template, they can decide to create the template using the 'ALP flavor'. Application developers must then add the "views" configuration as shown in the following manifest.json sample below. + + +**TAGS**: analytical list page, analytics, charts, insights, ALP, analytical table, ApplySupported, Aggregation, Analytics.AggregatedProperty, UI.chart + +**STEP**: Configure the manifest.json + +**DESCRIPTION**: +The primary annotation path can be either UI.Chart, UI.PresentationVariant, or UI.SelectionPresentationVariant. If you specify a UI.PresentationVariant or UI.SelectionPresentationVariant, SAP Fiori elements picks the first chart visualization and renders it. If the primary annotation path leads to a PresentationVariant that has no chart visualization, SAP Fiori elements looks for the default chart (Ui.Chart without a qualifier) and renders it. If the default chart is not found, SAP Fiori elements renders a blank chart. +Adding a chart to the list report requires the service to include the `@Aggregation.ApplySupported` annotation. + +Tip + +If the specified primary or secondary annotationPath is not found, there is no fallback and the application will fail to load. + +The secondary annotation path can be either UI.LineItem, UI.PresentationVariant, or UI.SelectionPresentationVariant. If you specify UI.PresentationVariant or UI.SelectionPresentationVariant, SAP Fiori elements picks the first LineItem visualization and renders it. If the secondary annotation path leads to a PresentationVariant that has no table visualization, SAP Fiori elements looks for the default table (UI.LineItem w/o qualifier) and renders it. If the default table is not found, SAP Fiori elements renders a blank table. + +"defaultPath" can be "primary", "secondary", or "both". If it is "primary", SAP Fiori elements loads the app in chart-only view. If it is "secondary", SAP Fiori elements loads the app in table-only view. If 'defaultPath' is "both", SAP Fiori elements loads the list page in hybrid view showing both the chart and the list. + +Note + +Do not use arrays for the "paths", "primary" and "secondary" properties even though they are provided in the manifest, because SAP Fiori elements currently does not support this. + +**LANGUAGE**: JSON + +**CODE**: +```JSON + "views": { + "paths": [ + { + "primary": [ + { + "annotationPath": "com.sap.vocabularies.UI.v1.Chart#alpChart" + } + ], + "secondary": [ + { + "annotationPath": "com.sap.vocabularies.UI.v1.LineItem" + } + ], + "defaultPath": "both" + } + ] +``` + + +**ADDITIONAL RELATED CODE BLOCKS**: + +**FILE**: manifest.json + +**LANGUAGE**: manifest.json + +**CODE**: +```JSON +{ + ..... + "sap.ui5": { + "flexEnabled": true, + "dependencies": { + "minUI5Version": "1.136.7", + "libs": { + "sap.m": {}, + "sap.ui.core": {}, + "sap.fe.templates": {} + } + }, + "contentDensities": { + "compact": true, + "cozy": true + }, + "models": { + "i18n": { + "type": "sap.ui.model.resource.ResourceModel", + "settings": { + "bundleName": "com.sap.travel.travelmanagementapp.i18n.i18n" + } + }, + "": { + "dataSource": "mainService", + "preload": true, + "settings": { + "operationMode": "Server", + "autoExpandSelect": true, + "earlyRequests": true + } + }, + "@i18n": { + "type": "sap.ui.model.resource.ResourceModel", + "uri": "i18n/i18n.properties" + } + }, + "resources": { + "css": [] + }, + "routing": { + "config": {}, + "routes": [ + { + "pattern": ":?query:", + "name": "TravelsList", + "target": "TravelsList" + }, + { + "pattern": "Travels({key}):?query:", + "name": "TravelsObjectPage", + "target": "TravelsObjectPage" + }, + { + "pattern": "Travels({key})/toBookings({key2}):?query:", + "name": "BookingsObjectPage", + "target": "BookingsObjectPage" + } + ], + "targets": { + "TravelsList": { + "type": "Component", + "id": "TravelsList", + "name": "sap.fe.templates.ListReport", + "options": { + "settings": { + "contextPath": "/Travels", + "variantManagement": "Page", + "initialLoad": "Enabled", + "navigation": { + "Travels": { + "detail": { + "route": "TravelsObjectPage" + } + } + }, + "controlConfiguration": { + "@com.sap.vocabularies.UI.v1.LineItem": { + "tableSettings": { + "type": "ResponsiveTable" + } + } + }, + "views": { + "paths": [ + { + "primary": [ + { + "annotationPath": "com.sap.vocabularies.UI.v1.Chart#alpChart" + } + ], + "secondary": [ + { + "annotationPath": "com.sap.vocabularies.UI.v1.LineItem" + } + ], + "defaultPath": "both" + } + ] + } + } + } + }, + "TravelsObjectPage": { + "type": "Component", + "id": "TravelsObjectPage", + "name": "sap.fe.templates.ObjectPage", + "options": { + "settings": { + "editableHeaderContent": false, + "contextPath": "/Travels", + "navigation": { + "toBookings": { + "detail": { + "route": "BookingsObjectPage" + } + } + }, + "content": { + "body": { + "sections": { + "TravelNotesSection": { + "template": "com.sap.travel.travelmanagementapp.ext.fragment.TravelNotesSection", + "position": { + "placement": "After", + "anchor": "GeneralInfoSection" + }, + "title": "Travel Notes" + } + } + } + } + } + } + }, + "BookingsObjectPage": { + "type": "Component", + "id": "BookingsObjectPage", + "name": "sap.fe.templates.ObjectPage", + "options": { + "settings": { + "editableHeaderContent": false, + "contextPath": "/Travels/toBookings" + } + } + } + } + } + }, + "sap.fiori": { + "registrationIds": [], + "archeType": "transactional" + } +} + + +``` + + + +**FILE**: annotations.cds + +**LANGUAGE**: cds + +**CODE**: +```cds + Analytics.AggregatedProperty #TotalPrice_average : { + $Type : 'Analytics.AggregatedPropertyType', + Name : 'TotalPrice_average', + AggregatableProperty : TotalPrice, + AggregationMethod : 'average', + @Common.Label : 'TotalPrice (Average)', + }, + UI.Chart #alpChart : { + $Type : 'UI.ChartDefinitionType', + ChartType : #Column, + Dimensions : [ + Destination, + ], + DynamicMeasures : [ + '@Analytics.AggregatedProperty#TotalPrice_average', + ], + }, +``` + + +**FILE**: service.cds + +**LANGUAGE**: cds + +**CODE**: +```cds + @Aggregation.ApplySupported : { + $Type : 'Aggregation.ApplySupportedType', + AggregatableProperties : [ + { $Type : 'Aggregation.AggregatablePropertyType', Property : ReservationFee }, + { $Type : 'Aggregation.AggregatablePropertyType', Property : TotalPrice } + ], + GroupableProperties : [ + TravelStatus, + toAgency_ID, + toCustomer_ID, + Destination, + StartDate, + EndDate + ] + } +``` +-------------------------------- \ No newline at end of file diff --git a/packages/fiori-mcp-server/README.md b/packages/fiori-mcp-server/README.md index 102af8720cc..f1cb9a3fb88 100644 --- a/packages/fiori-mcp-server/README.md +++ b/packages/fiori-mcp-server/README.md @@ -70,6 +70,8 @@ The following rules help guide the LLM to use the server correctly: - When generating or modifying the SAP Fiori elements application on top of the CAP service use the Fiori MCP server if available. - When attempting to modify the SAP Fiori elements application like adding columns you must not use the screen personalization but instead modify the code of the project, before this first check whether an MCP server provides a suitable function. - When previewing the SAP Fiori elements application use the most specific script for the app in the `package.json`. +- When previewing the SAP Fiori elements application use the most specific script for the app in the `package.json`. +- When modifying CAP Node.js project you "MUST" only use cds watch using either the fiori application "watch-" script in the CAP project or "cds watch". You "MUST NOT" use "npm run start", "npm start", "cds-serve" or "cds serve". ``` Add these rules to your existing global or project-specific [`AGENTS.md`](https://agents.md/) (specifics may vary based on respective MCP client). diff --git a/packages/fiori-mcp-server/package.json b/packages/fiori-mcp-server/package.json index 2343a1dc949..e2e257d5382 100644 --- a/packages/fiori-mcp-server/package.json +++ b/packages/fiori-mcp-server/package.json @@ -20,9 +20,10 @@ "license": "Apache-2.0", "main": "dist/index.js", "scripts": { - "build-dev": "tsc", + "build-esbuild-base": "esbuild --bundle --platform=node --target=node20 --outdir=dist --external:vscode --external:@lancedb/lancedb --external:@xenova/transformers --external:@sap-ux/fiori-docs-embeddings --main-fields=module,main src/index.ts", + "build-dev": "pnpm run build-esbuild-base --sourcemap=inline", "build-compile": "tsc --noEmit", - "build-bundle": "esbuild --bundle --platform=node --target=node20 --outdir=dist --external:vscode --external:@lancedb/lancedb --external:@xenova/transformers --external:@sap-ux/fiori-docs-embeddings --main-fields=module,main src/index.ts", + "build-bundle": "pnpm run build-esbuild-base --minify", "build": "npm-run-all build-compile build-bundle", "watch": "tsc --watch", "bundle": "npm-run-all build tgz:package tgz:rename", From 780cd36fd559d5029d75ab1ccf1eec1390bfa4e6 Mon Sep 17 00:00:00 2001 From: Austin Devine Date: Fri, 10 Oct 2025 11:52:49 +0100 Subject: [PATCH 2/7] update to agent rule --- packages/fiori-mcp-server/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/fiori-mcp-server/README.md b/packages/fiori-mcp-server/README.md index f1cb9a3fb88..25ab8b769f0 100644 --- a/packages/fiori-mcp-server/README.md +++ b/packages/fiori-mcp-server/README.md @@ -71,7 +71,10 @@ The following rules help guide the LLM to use the server correctly: - When attempting to modify the SAP Fiori elements application like adding columns you must not use the screen personalization but instead modify the code of the project, before this first check whether an MCP server provides a suitable function. - When previewing the SAP Fiori elements application use the most specific script for the app in the `package.json`. - When previewing the SAP Fiori elements application use the most specific script for the app in the `package.json`. -- When modifying CAP Node.js project you "MUST" only use cds watch using either the fiori application "watch-" script in the CAP project or "cds watch". You "MUST NOT" use "npm run start", "npm start", "cds-serve" or "cds serve". +- When running CAP Node.js projects for development, you "MUST" use `cds watch` or `npm run watch-*` scripts. You "MUST NOT" use `npm start`, `npm run start`, `cds-serve`, or `cds serve` because: + - `cds watch` provides live reload functionality + - `npm run watch-*` scripts are optimized for development with hot reloading + - `npm start` typically runs production builds without development features ``` Add these rules to your existing global or project-specific [`AGENTS.md`](https://agents.md/) (specifics may vary based on respective MCP client). From 65c6977b692377d5814736386a2747691f125de0 Mon Sep 17 00:00:00 2001 From: Austin Devine Date: Fri, 10 Oct 2025 12:04:08 +0100 Subject: [PATCH 3/7] feedback --- packages/fiori-mcp-server/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fiori-mcp-server/README.md b/packages/fiori-mcp-server/README.md index 25ab8b769f0..cc2ec056bcc 100644 --- a/packages/fiori-mcp-server/README.md +++ b/packages/fiori-mcp-server/README.md @@ -70,11 +70,11 @@ The following rules help guide the LLM to use the server correctly: - When generating or modifying the SAP Fiori elements application on top of the CAP service use the Fiori MCP server if available. - When attempting to modify the SAP Fiori elements application like adding columns you must not use the screen personalization but instead modify the code of the project, before this first check whether an MCP server provides a suitable function. - When previewing the SAP Fiori elements application use the most specific script for the app in the `package.json`. -- When previewing the SAP Fiori elements application use the most specific script for the app in the `package.json`. - When running CAP Node.js projects for development, you "MUST" use `cds watch` or `npm run watch-*` scripts. You "MUST NOT" use `npm start`, `npm run start`, `cds-serve`, or `cds serve` because: - `cds watch` provides live reload functionality - `npm run watch-*` scripts are optimized for development with hot reloading - `npm start` typically runs production builds without development features +- When creating new CAP project ask cds mcp server. while using cds init, do not include any --add options (e.g., --add hana, --add sqlite, --add tiny-sample, etc.). Only use the plain form: `cds init` ``` Add these rules to your existing global or project-specific [`AGENTS.md`](https://agents.md/) (specifics may vary based on respective MCP client). From 4ffd28a99a07131f38f3e8e0ec9910e337a232e5 Mon Sep 17 00:00:00 2001 From: Austin Devine Date: Fri, 10 Oct 2025 12:32:27 +0100 Subject: [PATCH 4/7] Update chatty-brooms-sniff.md --- .changeset/chatty-brooms-sniff.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.changeset/chatty-brooms-sniff.md b/.changeset/chatty-brooms-sniff.md index 36e152a3e87..c443bc78c92 100644 --- a/.changeset/chatty-brooms-sniff.md +++ b/.changeset/chatty-brooms-sniff.md @@ -1,5 +1,6 @@ --- '@sap-ux/fiori-docs-embeddings': minor +'@sap-ux/fiori-mcp-server': patch --- Add FPM Development portal documentation to embeddings From 13a47529f83cb525d3ad6e38e6f3878ca09f47dc Mon Sep 17 00:00:00 2001 From: Austin Devine Date: Fri, 10 Oct 2025 12:32:49 +0100 Subject: [PATCH 5/7] Update chatty-brooms-sniff.md --- .changeset/chatty-brooms-sniff.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/chatty-brooms-sniff.md b/.changeset/chatty-brooms-sniff.md index c443bc78c92..d57a64bae22 100644 --- a/.changeset/chatty-brooms-sniff.md +++ b/.changeset/chatty-brooms-sniff.md @@ -3,4 +3,4 @@ '@sap-ux/fiori-mcp-server': patch --- -Add FPM Development portal documentation to embeddings +Add Fiori Development portal documentation to embeddings From d03807c890c574aa0a12437cbe27e7f6f1150681 Mon Sep 17 00:00:00 2001 From: Austin Devine Date: Mon, 13 Oct 2025 12:29:22 +0100 Subject: [PATCH 6/7] feedback --- packages/fiori-mcp-server/README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/fiori-mcp-server/README.md b/packages/fiori-mcp-server/README.md index cc2ec056bcc..74f43c671f2 100644 --- a/packages/fiori-mcp-server/README.md +++ b/packages/fiori-mcp-server/README.md @@ -70,11 +70,7 @@ The following rules help guide the LLM to use the server correctly: - When generating or modifying the SAP Fiori elements application on top of the CAP service use the Fiori MCP server if available. - When attempting to modify the SAP Fiori elements application like adding columns you must not use the screen personalization but instead modify the code of the project, before this first check whether an MCP server provides a suitable function. - When previewing the SAP Fiori elements application use the most specific script for the app in the `package.json`. -- When running CAP Node.js projects for development, you "MUST" use `cds watch` or `npm run watch-*` scripts. You "MUST NOT" use `npm start`, `npm run start`, `cds-serve`, or `cds serve` because: - - `cds watch` provides live reload functionality - - `npm run watch-*` scripts are optimized for development with hot reloading - - `npm start` typically runs production builds without development features -- When creating new CAP project ask cds mcp server. while using cds init, do not include any --add options (e.g., --add hana, --add sqlite, --add tiny-sample, etc.). Only use the plain form: `cds init` +- When modifying CAP Node.js project you "MUST" only use cds watch using either the fiori application "watch-" script in the CAP project or "cds watch". You "MUST NOT" use "npm run start", "npm start", "cds-serve" or "cds serve". ``` Add these rules to your existing global or project-specific [`AGENTS.md`](https://agents.md/) (specifics may vary based on respective MCP client). From eba8f082addeae32a9a6b82ada4ddfa3372ab6cd Mon Sep 17 00:00:00 2001 From: Austin Devine Date: Wed, 15 Oct 2025 09:57:09 +0100 Subject: [PATCH 7/7] feedback --- packages/fiori-mcp-server/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/fiori-mcp-server/README.md b/packages/fiori-mcp-server/README.md index 74f43c671f2..2b863281c84 100644 --- a/packages/fiori-mcp-server/README.md +++ b/packages/fiori-mcp-server/README.md @@ -69,8 +69,7 @@ The following rules help guide the LLM to use the server correctly: - When creating sample data in CSV files, all primary keys and foreign keys MUST be in UUID format (e.g., `550e8400-e29b-41d4-a716-446655440001`). - When generating or modifying the SAP Fiori elements application on top of the CAP service use the Fiori MCP server if available. - When attempting to modify the SAP Fiori elements application like adding columns you must not use the screen personalization but instead modify the code of the project, before this first check whether an MCP server provides a suitable function. -- When previewing the SAP Fiori elements application use the most specific script for the app in the `package.json`. -- When modifying CAP Node.js project you "MUST" only use cds watch using either the fiori application "watch-" script in the CAP project or "cds watch". You "MUST NOT" use "npm run start", "npm start", "cds-serve" or "cds serve". +- When previewing the SAP Fiori elements application use the most specific `npm run watch-*` script for the app in the `package.json`. ``` Add these rules to your existing global or project-specific [`AGENTS.md`](https://agents.md/) (specifics may vary based on respective MCP client).