diff --git a/app/admin/fiori-service.cds b/app/admin/fiori-service.cds index 4cb63190..a5d888f1 100644 --- a/app/admin/fiori-service.cds +++ b/app/admin/fiori-service.cds @@ -104,7 +104,7 @@ annotate AdminService.GenreHierarchy with @UI: { PresentationVariant #VH: { $Type : 'UI.PresentationVariantType', Visualizations : ['@UI.LineItem'], - RecursiveHierarchyQualifier: 'GenreHierarchy' + RecursiveHierarchyQualifier: 'GenreHierarchyHierarchy' }, LineItem : [{ $Type: 'UI.DataField', @@ -196,19 +196,7 @@ annotate AdminService.Books.texts { // // Annotations for hierarchy ContentsHierarchy // -annotate AdminService.ContentsHierarchy with @Aggregation.RecursiveHierarchy#ContentsHierarchy: { - $Type: 'Aggregation.RecursiveHierarchyType', - NodeProperty: ID, // identifies a node - ParentNavigationProperty: parent // navigates to a node's parent - }; - -annotate AdminService.ContentsHierarchy with @Hierarchy.RecursiveHierarchy#ContentsHierarchy: { - $Type: 'Hierarchy.RecursiveHierarchyType', - LimitedDescendantCount: LimitedDescendantCount, - DistanceFromRoot: DistanceFromRoot, - DrillState: DrillState, - LimitedRank: LimitedRank -}; +annotate AdminService.ContentsHierarchy with @hierarchy; annotate AdminService.Books actions { @( diff --git a/app/admin/webapp/manifest.json b/app/admin/webapp/manifest.json index 49d05c2c..160a8a11 100644 --- a/app/admin/webapp/manifest.json +++ b/app/admin/webapp/manifest.json @@ -124,7 +124,7 @@ "controlConfiguration": { "contents/@com.sap.vocabularies.UI.v1.LineItem": { "tableSettings": { - "hierarchyQualifier": "ContentsHierarchy", + "hierarchyQualifier": "ContentsHierarchyHierarchy", "type": "TreeTable" } } diff --git a/app/browse-genres/fiori-service.cds b/app/browse-genres/fiori-service.cds index 809df04f..e05b2ff5 100644 --- a/app/browse-genres/fiori-service.cds +++ b/app/browse-genres/fiori-service.cds @@ -5,16 +5,5 @@ using CatalogService from '../../srv/cat-service'; -annotate CatalogService.GenreHierarchy with @Aggregation.RecursiveHierarchy#GenreHierarchy: { - $Type: 'Aggregation.RecursiveHierarchyType', - NodeProperty: ID, // identifies a node - ParentNavigationProperty: parent // navigates to a node's parent - }; +annotate CatalogService.GenreHierarchy with @hierarchy; -annotate CatalogService.GenreHierarchy with @Hierarchy.RecursiveHierarchy#GenreHierarchy: { - $Type: 'Hierarchy.RecursiveHierarchyType', - LimitedDescendantCount: LimitedDescendantCount, - DistanceFromRoot: DistanceFromRoot, - DrillState: DrillState, - LimitedRank: LimitedRank -}; diff --git a/app/browse-genres/webapp/manifest.json b/app/browse-genres/webapp/manifest.json index 875c6231..3814bfa7 100644 --- a/app/browse-genres/webapp/manifest.json +++ b/app/browse-genres/webapp/manifest.json @@ -88,7 +88,7 @@ "controlConfiguration": { "@com.sap.vocabularies.UI.v1.LineItem": { "tableSettings": { - "hierarchyQualifier": "GenreHierarchy", + "hierarchyQualifier": "GenreHierarchyHierarchy", "type": "TreeTable" } } diff --git a/app/genres/fiori-service.cds b/app/genres/fiori-service.cds index 63862035..46f160c5 100644 --- a/app/genres/fiori-service.cds +++ b/app/genres/fiori-service.cds @@ -5,17 +5,4 @@ using AdminService from '../../srv/admin-service'; -annotate AdminService.GenreHierarchy with @Aggregation.RecursiveHierarchy#GenreHierarchy: { - $Type: 'Aggregation.RecursiveHierarchyType', - NodeProperty: ID, // identifies a node - ParentNavigationProperty: parent // navigates to a node's parent - }; - - annotate AdminService.GenreHierarchy with @Hierarchy.RecursiveHierarchy#GenreHierarchy: { - $Type: 'Hierarchy.RecursiveHierarchyType', - // ExternalKey : null, - LimitedDescendantCount: LimitedDescendantCount, - DistanceFromRoot: DistanceFromRoot, - DrillState: DrillState, - LimitedRank: LimitedRank -}; +annotate AdminService.GenreHierarchy with @hierarchy; diff --git a/app/genres/webapp/manifest.json b/app/genres/webapp/manifest.json index 68d48208..b7ca4b3c 100644 --- a/app/genres/webapp/manifest.json +++ b/app/genres/webapp/manifest.json @@ -93,7 +93,7 @@ "controlConfiguration": { "@com.sap.vocabularies.UI.v1.LineItem": { "tableSettings": { - "hierarchyQualifier": "GenreHierarchy", + "hierarchyQualifier": "GenreHierarchyHierarchy", "type": "TreeTable" } } diff --git a/db/books.cds b/db/books.cds index 665587af..2746b79c 100644 --- a/db/books.cds +++ b/db/books.cds @@ -3,7 +3,6 @@ namespace my.bookshop; using {Currency, sap, managed, cuid} from '@sap/cds/common'; using my.bookshop.Reviews from './reviews'; using my.bookshop.TechnicalBooleanFlag from './common'; -using {my.common.Hierarchy as Hierarchy} from './hierarchy'; @fiori.draft.enabled entity Books : cuid, managed { @@ -46,7 +45,7 @@ annotate Authors with /** * Hierarchically organized Code List for Genres */ -entity Genres : sap.common.CodeList, Hierarchy { +entity Genres : sap.common.CodeList { key ID : UUID; // move siblings siblingRank : Integer; @@ -59,7 +58,7 @@ entity Genres : sap.common.CodeList, Hierarchy { /** * Hierarchically organized entity for Contents */ -entity Contents: Hierarchy { +entity Contents { key ID : UUID; name : String; page : Integer; diff --git a/db/hierarchy.cds b/db/hierarchy.cds deleted file mode 100644 index f8ec83cb..00000000 --- a/db/hierarchy.cds +++ /dev/null @@ -1,23 +0,0 @@ -namespace my.common; - -aspect Hierarchy { - virtual LimitedDescendantCount : Integer64; - virtual DistanceFromRoot : Integer64; - virtual DrillState : String; - virtual LimitedRank : Integer64; -} - - -annotate Hierarchy with @Capabilities.FilterRestrictions.NonFilterableProperties: [ - 'LimitedDescendantCount', - 'DistanceFromRoot', - 'DrillState', - 'LimitedRank' -]; - -annotate Hierarchy with @Capabilities.SortRestrictions.NonSortableProperties: [ - 'LimitedDescendantCount', - 'DistanceFromRoot', - 'DrillState', - 'LimitedRank' -]; diff --git a/package-lock.json b/package-lock.json index bc1cb333..ff811df6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "mtx/sidecar" ], "devDependencies": { - "@sap/cds-dk": "9.6.0", + "@sap/cds-dk": "9.7.0-2026012316504290-SNAPSHOT", "@sap/cds-mtxs": "^3" } }, @@ -80,7 +80,6 @@ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.2.tgz", "integrity": "sha512-q1mjIoW1VX4IvSocvM/vbTiveKC4k9eLrajNEuSsmjymSDEbpGddtpfOoN7YGAqBK3NG+uqo8ia4PDTt8buCYA==", "license": "MIT", - "peer": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -93,6 +92,7 @@ "resolved": "https://registry.npmjs.org/@sap/cds/-/cds-9.6.2.tgz", "integrity": "sha512-BBn2k3fZFfOC8Qmgo/kC9Sjs7ClhtVjf480++LmY/vtthfuybnLA2g4SdisTbCBVePALN44JNA339wVfHCAPSw==", "license": "SEE LICENSE IN LICENSE", + "peer": true, "dependencies": { "@sap/cds-compiler": "^6.3", "@sap/cds-fiori": "^2", @@ -134,24 +134,24 @@ } }, "node_modules/@sap/cds-dk": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/@sap/cds-dk/-/cds-dk-9.6.0.tgz", - "integrity": "sha512-JaX0vSOflkhmiZJUEuO3rbN+5MRk9oVJs8TkOIOOZJ4EOxttjL1hz/lAgbepsHaTJC2bt8gc6JxUtB4W56P23A==", + "version": "9.7.0-2026012316504290-SNAPSHOT", + "resolved": "https://int.repositories.cloud.sap/artifactory/api/npm/build-snapshots-npm/@sap/cds-dk/-/@sap/cds-dk-9.7.0-2026012316504290-SNAPSHOT.tgz", + "integrity": "sha512-/sfyt4Bn6co+ef2tQ/3q9HMbOwitIZGbeD207/Yw6VzafWhnZJeQAd8Yy9yAiFIdZhPPgvhUkqF9niKd+i+5WQ==", "dev": true, "hasShrinkwrap": true, "license": "SEE LICENSE IN LICENSE", "dependencies": { - "@cap-js/asyncapi": "^1.0.0", - "@cap-js/openapi": "^1.0.0", - "@sap/cds": ">=8.3", - "@sap/cds-mtxs": ">=2", + "@cap-js/asyncapi": "1.0.3", + "@cap-js/openapi": "1.3.1", + "@sap/cds": "9.7.0-2026012314574056-SNAPSHOT", + "@sap/cds-compiler": "6.7.0", + "@sap/cds-mtxs": "3.6.2", "@sap/hdi-deploy": "^5", "axios": "^1", - "express": "^4.17.3", + "express": "^4.22.1 || ^5", "hdb": "^2.0.0", "livereload-js": "^4.0.1", "mustache": "^4.0.1", - "node-watch": ">=0.7", "ws": "^8.4.2", "xml-js": "^1.6.11", "yaml": "^2" @@ -162,7 +162,7 @@ "cds-tsx": "bin/cds-tsx.js" }, "optionalDependencies": { - "@cap-js/sqlite": ">=1" + "@cap-js/sqlite": "2.1.2" } }, "node_modules/@sap/cds-dk/node_modules/@cap-js/asyncapi": { @@ -175,8 +175,8 @@ } }, "node_modules/@sap/cds-dk/node_modules/@cap-js/db-service": { - "version": "2.8.0", - "integrity": "sha512-Ub+ywq2Nk5UmKH5pZnqZ7qC37DIRfF9IhOozjByhevjB/j7A6p9SpLkTwElSEMkhPSJnRYafILOGde1XH/wseQ==", + "version": "2.8.1", + "integrity": "sha512-p2MHv97d+yiUBJYSAI/qusZzdEtOVfv6GZH51mkfxNXLeOGpV1wjr6UhLDmZrt6h7gTfqJA6cR1WUrrVOq38Ag==", "dev": true, "license": "Apache-2.0", "optional": true, @@ -188,8 +188,8 @@ } }, "node_modules/@sap/cds-dk/node_modules/@cap-js/openapi": { - "version": "1.3.0", - "integrity": "sha512-bLb7BadSA8cqcYJLXDgZ6lrDlk8SaAb2amSZY3pi9rd02yCJI3a2Z4a3F2HFXhX0C9ioC22IRd6Yf5mE0fDAfQ==", + "version": "1.3.1", + "integrity": "sha512-2QqqZlOxfvp/DDmGgTdwbBAAMjaPrrdPCbNC4+z6wjn2jXXk40j0XX7DHNnF4BU8R9LFxaUCHt2x8/9PzE83uA==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -200,13 +200,13 @@ } }, "node_modules/@sap/cds-dk/node_modules/@cap-js/sqlite": { - "version": "2.1.1", - "integrity": "sha512-6u4A3TQLbF5/of9JrtuNEva97wp5KOl6finhE4CaD4MgOp/uCVZFBb06wF3WYRF6ZhD8rMtgQ/PGv+sWfrLrVQ==", + "version": "2.1.2", + "integrity": "sha512-q8fQuIzwCfUF+l36BoL3LP32JYw389cmsZzE0Ec3JVz7k1sL+WzZ1XIbL1Ua/we3cHrDV+U3E9iAd0FOlcFumw==", "dev": true, "license": "Apache-2.0", "optional": true, "dependencies": { - "@cap-js/db-service": "^2.8.0", + "@cap-js/db-service": "^2.8.1", "better-sqlite3": "^12.0.0" }, "peerDependencies": { @@ -218,7 +218,6 @@ "integrity": "sha512-q1mjIoW1VX4IvSocvM/vbTiveKC4k9eLrajNEuSsmjymSDEbpGddtpfOoN7YGAqBK3NG+uqo8ia4PDTt8buCYA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -227,13 +226,15 @@ } }, "node_modules/@sap/cds-dk/node_modules/@sap/cds": { - "version": "9.6.0", - "integrity": "sha512-KZdAQZl8B2hvY71eh0FlXezTMuAsFILNgPZwqcT45ibAU4GSQB1eDc51jqA3t6UnpWN+jLSZDYNOagpztBkwJg==", + "version": "9.7.0-2026012314574056-SNAPSHOT", + "integrity": "sha512-GpcwlwuO31UJsF+TD6JYUPiC5OQ5ktJb3klaVrmPJOMokaVkZ6KTWI2cBuT1R769+DdmRf15Y2NL4THj4LOK5A==", "dev": true, "license": "SEE LICENSE IN LICENSE", + "peer": true, "dependencies": { - "@sap/cds-compiler": "^6.3", + "@sap/cds-compiler": "^6.4", "@sap/cds-fiori": "^2", + "express": "^4.22.1 || ^5", "js-yaml": "^4.1.1" }, "bin": { @@ -245,21 +246,17 @@ }, "peerDependencies": { "@eslint/js": "^9", - "express": "^4", "tar": "^7" }, "peerDependenciesMeta": { - "express": { - "optional": true - }, "tar": { "optional": true } } }, "node_modules/@sap/cds-dk/node_modules/@sap/cds-compiler": { - "version": "6.6.0", - "integrity": "sha512-cttVQhuzobLsnaGjmCz6gOXdUdHRawTbUK8UsUPnOIOboAOJRvLbrX4RF/iY6VxewpupDcx+FhfDCbAupO3EwQ==", + "version": "6.7.0", + "integrity": "sha512-goZNeNIadDsLkmqLRkHJ2iACF2mZu1Q8oH4ishaiY9u8/IYlkzb5dQmgbp/M/2zC8GRu+3isgUW6Nmpre+WbJQ==", "dev": true, "license": "SEE LICENSE IN LICENSE", "bin": { @@ -282,8 +279,8 @@ } }, "node_modules/@sap/cds-dk/node_modules/@sap/cds-mtxs": { - "version": "3.6.1", - "integrity": "sha512-/iIhdlBU8cH5ki8UhBpgBUmPaWx+IeZYqLttqbY56VTj0ZoMKdFYiapdrTQjZCQu4M83baj/Y4Mv+u1a4QoBcg==", + "version": "3.6.2", + "integrity": "sha512-fcydUhtNGSGbcqB2pWeCcbJY0A1+fO550dOSl1XTNXBe5fQTHEOXHWCiOBcwNtXvH9lIvUnFnOCVD4zo3iKCLQ==", "dev": true, "license": "SEE LICENSE IN LICENSE", "dependencies": { @@ -297,6 +294,16 @@ "@sap/cds": "^9" } }, + "node_modules/@sap/cds-dk/node_modules/@sap/cds/node_modules/@sap/cds-fiori": { + "version": "2.1.1", + "integrity": "sha512-X+4v4LBAT8HIt0zr28/kJNS15nlNlcM97vAMW+agLrmK134nyBiMwUMcp8BMhxlG9B2PykrnAKH56D9O3tfoBg==", + "dev": true, + "license": "SEE LICENSE IN LICENSE", + "peerDependencies": { + "@sap/cds": ">=8", + "express": "^4" + } + }, "node_modules/@sap/cds-dk/node_modules/@sap/hdi": { "version": "4.8.0", "integrity": "sha512-tkJmY2ffm6mt4/LFwRBihlQkMxNAXa3ngvRe2N/6+qLIsUNdrH/M03S5mkygXq56K+KoVVZYuradajCusMWwsw==", @@ -322,8 +329,8 @@ } }, "node_modules/@sap/cds-dk/node_modules/@sap/hdi-deploy": { - "version": "5.6.0", - "integrity": "sha512-FVHuNB664eFVWn1yTfKIZUdo3CCur3HFV8VEblBupVDK2s8PPwgMqjSw56gCo4lLOyvy7xVi9yyWOHIxoSjz4Q==", + "version": "5.6.1", + "integrity": "sha512-+qQ7qwG8lko303L5yRj2dud/nDAVuVblV/mmzJT44oPbF0Nry18eD2LUS23hFeuxjRa7rYK5YKQ8ffGgWxVrYQ==", "dev": true, "license": "See LICENSE file", "dependencies": { @@ -443,8 +450,8 @@ "optional": true }, "node_modules/@sap/cds-dk/node_modules/better-sqlite3": { - "version": "12.5.0", - "integrity": "sha512-WwCZ/5Diz7rsF29o27o0Gcc1Du+l7Zsv7SYtVPG0X3G/uUI1LqdxrQI7c9Hs2FWpqXXERjW9hp6g3/tH7DlVKg==", + "version": "12.6.2", + "integrity": "sha512-8VYKM3MjCa9WcaSAI3hzwhmyHVlH8tiGFwf0RlTsZPWJ1I5MkzjiudCo4KC4DxOaL/53A5B1sI/IbldNFDbsKA==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -870,6 +877,7 @@ "integrity": "sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -1184,10 +1192,11 @@ } }, "node_modules/@sap/cds-dk/node_modules/hdb": { - "version": "2.26.3", - "integrity": "sha512-+fTSzgUZoThsQPlakxOYDYigkSAJfewr72y3cN8PLutGCugwym88A+7nV82+3bMYi/SaDB9JfIPPfi1Otv2iow==", + "version": "2.26.4", + "integrity": "sha512-vUm1FQSUEsm+uUfLapIENlE5YjNPHdf8KfNu6wlqy6wL0sTplzc25l1yIEWbpjrCCJX4UQYkKjNt1Z5T5zUojQ==", "dev": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "iconv-lite": "0.7.0" }, @@ -1484,8 +1493,8 @@ "license": "MIT" }, "node_modules/@sap/cds-dk/node_modules/node-abi": { - "version": "3.85.0", - "integrity": "sha512-zsFhmbkAzwhTft6nd3VxcG0cvJsT70rL+BIGHWVq5fi6MwGrHwzqKaxXE+Hl2GmnGItnDKPPkO5/LQqjVkIdFg==", + "version": "3.87.0", + "integrity": "sha512-+CGM1L1CgmtheLcBuleyYOn7NWPVu0s0EJH2C4puxgEZb9h8QpR9G2dBfZJOAUhi7VQxuBPMd0hiISWcTyiYyQ==", "dev": true, "license": "MIT", "optional": true, @@ -1508,15 +1517,6 @@ "node": ">= 8.0.0" } }, - "node_modules/@sap/cds-dk/node_modules/node-watch": { - "version": "0.7.4", - "integrity": "sha512-RinNxoz4W1cep1b928fuFhvAQ5ag/+1UlMDV7rbyGthBIgsiEouS4kvRayvvboxii4m8eolKOIBo3OjDqbc+uQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/@sap/cds-dk/node_modules/object-inspect": { "version": "1.13.4", "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", @@ -1633,8 +1633,8 @@ } }, "node_modules/@sap/cds-dk/node_modules/qs": { - "version": "6.14.0", - "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "version": "6.14.1", + "integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -1729,10 +1729,13 @@ "license": "MIT" }, "node_modules/@sap/cds-dk/node_modules/sax": { - "version": "1.4.3", - "integrity": "sha512-yqYn1JhPczigF94DMS+shiDMjDowYO6y9+wB/4WgO0Y19jWYk0lQ4tuG5KI7kj4FTp1wxPj5IFfcrz/s1c3jjQ==", + "version": "1.4.4", + "integrity": "sha512-1n3r/tGXO6b6VXMdFT54SHzT9ytu9yr7TaELowdYpMqY/Ao7EnlQGmAQ1+RatX7Tkkdm6hONI2owqNx2aZj5Sw==", "dev": true, - "license": "BlueOak-1.0.0" + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=11.0.0" + } }, "node_modules/@sap/cds-dk/node_modules/semver": { "version": "7.7.3", @@ -2116,8 +2119,8 @@ "optional": true }, "node_modules/@sap/cds-dk/node_modules/ws": { - "version": "8.18.3", - "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", + "version": "8.19.0", + "integrity": "sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index bb2b7e79..5f6de8e8 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "Generated by cds-services-archetype", "devDependencies": { - "@sap/cds-dk": "9.6.0", + "@sap/cds-dk": "9.7.0-2026012316504290-SNAPSHOT", "@sap/cds-mtxs": "^3" }, "workspaces": [ diff --git a/srv/src/test/java/my/bookshop/GenreHierarchyTest.java b/srv/src/test/java/my/bookshop/GenreHierarchyTest.java index d6d374bb..7b17b97c 100644 --- a/srv/src/test/java/my/bookshop/GenreHierarchyTest.java +++ b/srv/src/test/java/my/bookshop/GenreHierarchyTest.java @@ -45,7 +45,7 @@ void startOneLevel() throws Exception { genresURI + "?$select=DrillState,ID,name,DistanceFromRoot" + "&$apply=orderby(name)/" - + "com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchy',NodeProperty='ID',Levels=1)" + + "com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchyHierarchy',NodeProperty='ID',Levels=1)" + "&$count=true")) .andExpect(status().isOk()) .andExpect(jsonPath("$.value[0].ID").value("8bbf14c6-b378-4e35-9b4f-05a9c8878001")) @@ -68,7 +68,7 @@ void startTwoLevels() throws Exception { genresURI + "?$select=DrillState,ID,name,DistanceFromRoot" + "&$apply=orderby(name)/" - + "com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchy',NodeProperty='ID',Levels=2)" + + "com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchyHierarchy',NodeProperty='ID',Levels=2)" + "&$count=true")) .andExpect(status().isOk()) .andExpect(jsonPath("$.value[0].name").value("Fiction")) @@ -107,7 +107,7 @@ void collapseAll() throws Exception { get( genresURI + "?$select=DrillState,ID,name" - + "&$apply=orderby(name)/com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchy',NodeProperty='ID',Levels=1)" + + "&$apply=orderby(name)/com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchyHierarchy',NodeProperty='ID',Levels=1)" + "&$count=true&$skip=0&$top=238")) .andExpect(status().isOk()) .andExpect(jsonPath("$.value[0].name").value("Fiction")) @@ -123,7 +123,7 @@ void expandAllTop100() throws Exception { String url = genresURI + "?$select=DistanceFromRoot,DrillState,ID,LimitedDescendantCount,name" - + "&$apply=orderby(name)/com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchy',NodeProperty='ID')" + + "&$apply=orderby(name)/com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchyHierarchy',NodeProperty='ID')" + "&$count=true&$skip=0&$top=100"; client @@ -147,7 +147,7 @@ void search() throws Exception { + "?$select=DistanceFromRoot,DrillState,ID,LimitedDescendantCount,name" + "&$apply=ancestors($root/GenreHierarchy,GenreHierarchy,ID,search(\"true\"),keep start)" + "/orderby(name)" - + "/com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchy',NodeProperty='ID')" + + "/com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchyHierarchy',NodeProperty='ID')" + "&$count=true")) .andExpect(status().isOk()) .andExpect(jsonPath("$.value[0].name").value("Fiction")) @@ -177,7 +177,7 @@ void filterNotExpanded() throws Exception { genresURI + "?$select=DrillState,ID,name,DistanceFromRoot" + "&$apply=ancestors($root/GenreHierarchy,GenreHierarchy,ID,filter(name eq 'Autobiography'),keep start)/orderby(name)" - + "/com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchy',NodeProperty='ID',Levels=1)")) + + "/com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchyHierarchy',NodeProperty='ID',Levels=1)")) .andExpect(status().isOk()) .andExpect(jsonPath("$.value[0].name").value("Non-Fiction")) .andExpect(jsonPath("$.value[0].DrillState").value("collapsed")) @@ -196,7 +196,7 @@ void filterExpandLevels() throws Exception { genresURI + "?$select=DistanceFromRoot,DrillState,ID,LimitedDescendantCount,name" + "&$apply=ancestors($root/GenreHierarchy,GenreHierarchy,ID,filter(name eq 'Autobiography'),keep start)/orderby(name)" - + "/com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchy',NodeProperty='ID',Levels=1,ExpandLevels=" + + "/com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchyHierarchy',NodeProperty='ID',Levels=1,ExpandLevels=" + expandLevelsJson + ")&$count=true"; String uriString = UriComponentsBuilder.fromUriString(unencoded).toUriString(); @@ -219,7 +219,7 @@ void startTwoLevelsOrderByDesc() throws Exception { genresURI + "?$select=DrillState,ID,name,DistanceFromRoot" + "&$apply=orderby(name desc)/" - + "com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchy',NodeProperty='ID',Levels=2)" + + "com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchyHierarchy',NodeProperty='ID',Levels=2)" + "&$count=true")) .andExpect(status().isOk()) .andExpect(jsonPath("$.value[0].name").value("Non-Fiction"))