@ui5/mcp-server 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/LICENSE +201 -0
  3. package/LICENSES/Apache-2.0.txt +73 -0
  4. package/README.md +131 -0
  5. package/bin/ui5mcp.js +2 -0
  6. package/lib/Context.d.ts +28 -0
  7. package/lib/Context.js +71 -0
  8. package/lib/Context.js.map +1 -0
  9. package/lib/api.d.ts +3 -0
  10. package/lib/api.js +3 -0
  11. package/lib/api.js.map +1 -0
  12. package/lib/cli.d.ts +1 -0
  13. package/lib/cli.js +12 -0
  14. package/lib/cli.js.map +1 -0
  15. package/lib/registerTools.d.ts +133 -0
  16. package/lib/registerTools.js +59 -0
  17. package/lib/registerTools.js.map +1 -0
  18. package/lib/resources/documentation/getDocumentation.d.ts +18 -0
  19. package/lib/resources/documentation/getDocumentation.js +70 -0
  20. package/lib/resources/documentation/getDocumentation.js.map +1 -0
  21. package/lib/server.d.ts +10 -0
  22. package/lib/server.js +113 -0
  23. package/lib/server.js.map +1 -0
  24. package/lib/tools/create_ui5_app/ODataMetadata.d.ts +55 -0
  25. package/lib/tools/create_ui5_app/ODataMetadata.js +99 -0
  26. package/lib/tools/create_ui5_app/ODataMetadata.js.map +1 -0
  27. package/lib/tools/create_ui5_app/createSuccessMessage.d.ts +13 -0
  28. package/lib/tools/create_ui5_app/createSuccessMessage.js +45 -0
  29. package/lib/tools/create_ui5_app/createSuccessMessage.js.map +1 -0
  30. package/lib/tools/create_ui5_app/create_ui5_app.d.ts +8 -0
  31. package/lib/tools/create_ui5_app/create_ui5_app.js +273 -0
  32. package/lib/tools/create_ui5_app/create_ui5_app.js.map +1 -0
  33. package/lib/tools/create_ui5_app/index.d.ts +3 -0
  34. package/lib/tools/create_ui5_app/index.js +58 -0
  35. package/lib/tools/create_ui5_app/index.js.map +1 -0
  36. package/lib/tools/create_ui5_app/isValidUrl.d.ts +16 -0
  37. package/lib/tools/create_ui5_app/isValidUrl.js +59 -0
  38. package/lib/tools/create_ui5_app/isValidUrl.js.map +1 -0
  39. package/lib/tools/create_ui5_app/schema.d.ts +135 -0
  40. package/lib/tools/create_ui5_app/schema.js +67 -0
  41. package/lib/tools/create_ui5_app/schema.js.map +1 -0
  42. package/lib/tools/create_ui5_app/templateProcessor.d.ts +67 -0
  43. package/lib/tools/create_ui5_app/templateProcessor.js +59 -0
  44. package/lib/tools/create_ui5_app/templateProcessor.js.map +1 -0
  45. package/lib/tools/create_ui5_app/ui5Version.d.ts +2 -0
  46. package/lib/tools/create_ui5_app/ui5Version.js +6 -0
  47. package/lib/tools/create_ui5_app/ui5Version.js.map +1 -0
  48. package/lib/tools/get_api_reference/createUriForSymbol.d.ts +2 -0
  49. package/lib/tools/get_api_reference/createUriForSymbol.js +49 -0
  50. package/lib/tools/get_api_reference/createUriForSymbol.js.map +1 -0
  51. package/lib/tools/get_api_reference/getApiReference.d.ts +10 -0
  52. package/lib/tools/get_api_reference/getApiReference.js +51 -0
  53. package/lib/tools/get_api_reference/getApiReference.js.map +1 -0
  54. package/lib/tools/get_api_reference/index.d.ts +3 -0
  55. package/lib/tools/get_api_reference/index.js +38 -0
  56. package/lib/tools/get_api_reference/index.js.map +1 -0
  57. package/lib/tools/get_api_reference/lib/ApiReferenceProvider.d.ts +85 -0
  58. package/lib/tools/get_api_reference/lib/ApiReferenceProvider.js +452 -0
  59. package/lib/tools/get_api_reference/lib/ApiReferenceProvider.js.map +1 -0
  60. package/lib/tools/get_api_reference/lib/apiReferenceResources.d.ts +18 -0
  61. package/lib/tools/get_api_reference/lib/apiReferenceResources.js +138 -0
  62. package/lib/tools/get_api_reference/lib/apiReferenceResources.js.map +1 -0
  63. package/lib/tools/get_api_reference/lib/formatSymbol.d.ts +24 -0
  64. package/lib/tools/get_api_reference/lib/formatSymbol.js +109 -0
  65. package/lib/tools/get_api_reference/lib/formatSymbol.js.map +1 -0
  66. package/lib/tools/get_api_reference/schema.d.ts +16 -0
  67. package/lib/tools/get_api_reference/schema.js +12 -0
  68. package/lib/tools/get_api_reference/schema.js.map +1 -0
  69. package/lib/tools/get_guidelines/guidelines.d.ts +1 -0
  70. package/lib/tools/get_guidelines/guidelines.js +6 -0
  71. package/lib/tools/get_guidelines/guidelines.js.map +1 -0
  72. package/lib/tools/get_guidelines/index.d.ts +3 -0
  73. package/lib/tools/get_guidelines/index.js +30 -0
  74. package/lib/tools/get_guidelines/index.js.map +1 -0
  75. package/lib/tools/get_project_info/getProjectInfo.d.ts +2 -0
  76. package/lib/tools/get_project_info/getProjectInfo.js +205 -0
  77. package/lib/tools/get_project_info/getProjectInfo.js.map +1 -0
  78. package/lib/tools/get_project_info/index.d.ts +3 -0
  79. package/lib/tools/get_project_info/index.js +28 -0
  80. package/lib/tools/get_project_info/index.js.map +1 -0
  81. package/lib/tools/get_project_info/schema.d.ts +87 -0
  82. package/lib/tools/get_project_info/schema.js +28 -0
  83. package/lib/tools/get_project_info/schema.js.map +1 -0
  84. package/lib/tools/get_version_info/getVersionInfo.d.ts +8 -0
  85. package/lib/tools/get_version_info/getVersionInfo.js +41 -0
  86. package/lib/tools/get_version_info/getVersionInfo.js.map +1 -0
  87. package/lib/tools/get_version_info/index.d.ts +9 -0
  88. package/lib/tools/get_version_info/index.js +33 -0
  89. package/lib/tools/get_version_info/index.js.map +1 -0
  90. package/lib/tools/get_version_info/schema.d.ts +66 -0
  91. package/lib/tools/get_version_info/schema.js +16 -0
  92. package/lib/tools/get_version_info/schema.js.map +1 -0
  93. package/lib/tools/get_version_info/types.d.ts +5 -0
  94. package/lib/tools/get_version_info/types.js +2 -0
  95. package/lib/tools/get_version_info/types.js.map +1 -0
  96. package/lib/tools/run_ui5_linter/index.d.ts +3 -0
  97. package/lib/tools/run_ui5_linter/index.js +86 -0
  98. package/lib/tools/run_ui5_linter/index.js.map +1 -0
  99. package/lib/tools/run_ui5_linter/migrationGuides.d.ts +6 -0
  100. package/lib/tools/run_ui5_linter/migrationGuides.js +88 -0
  101. package/lib/tools/run_ui5_linter/migrationGuides.js.map +1 -0
  102. package/lib/tools/run_ui5_linter/resultContext.d.ts +3 -0
  103. package/lib/tools/run_ui5_linter/resultContext.js +236 -0
  104. package/lib/tools/run_ui5_linter/resultContext.js.map +1 -0
  105. package/lib/tools/run_ui5_linter/runUi5Linter.d.ts +2 -0
  106. package/lib/tools/run_ui5_linter/runUi5Linter.js +72 -0
  107. package/lib/tools/run_ui5_linter/runUi5Linter.js.map +1 -0
  108. package/lib/tools/run_ui5_linter/schema.d.ts +340 -0
  109. package/lib/tools/run_ui5_linter/schema.js +55 -0
  110. package/lib/tools/run_ui5_linter/schema.js.map +1 -0
  111. package/lib/utils/cdnHelper.d.ts +9 -0
  112. package/lib/utils/cdnHelper.js +50 -0
  113. package/lib/utils/cdnHelper.js.map +1 -0
  114. package/lib/utils/dataStorageHelper.d.ts +2 -0
  115. package/lib/utils/dataStorageHelper.js +65 -0
  116. package/lib/utils/dataStorageHelper.js.map +1 -0
  117. package/lib/utils/ui5Framework.d.ts +4 -0
  118. package/lib/utils/ui5Framework.js +6 -0
  119. package/lib/utils/ui5Framework.js.map +1 -0
  120. package/lib/utils.d.ts +10 -0
  121. package/lib/utils.js +87 -0
  122. package/lib/utils.js.map +1 -0
  123. package/npm-shrinkwrap.json +7880 -0
  124. package/package.json +121 -0
  125. package/resources/docs/1.136.7/00737d6c1b864dc3ab72ef56611491c4.md +155 -0
  126. package/resources/docs/1.136.7/0187ea5e2eff4166b0453b9dcc8fc64f.md +164 -0
  127. package/resources/docs/1.136.7/032be2cb2e1d4115af20862673bedcdb.md +12 -0
  128. package/resources/docs/1.136.7/28fcd55b04654977b63dacbee0552712.md +317 -0
  129. package/resources/docs/1.136.7/676b636446c94eada183b1218a824717.md +135 -0
  130. package/resources/docs/1.136.7/a87ca843bcee469f82a9072927a7dcdb.md +355 -0
  131. package/resources/docs/1.136.7/b0fb4de7364f4bcbb053a99aa645affe.md +126 -0
  132. package/resources/docs/1.136.7/fe1a6dba940e479fb7c3bc753f92b28c.md +670 -0
  133. package/resources/docs/1.136.7/index.json +58 -0
  134. package/resources/guidelines.md +104 -0
  135. package/resources/migrationGuides/deprecated-controller-factory.md +116 -0
  136. package/resources/migrationGuides/deprecated-getLibraryResourceBundle.md +62 -0
  137. package/resources/migrationGuides/deprecated-jquery-sap-require.md +141 -0
  138. package/resources/migrationGuides/deprecated-messagePage.md +162 -0
  139. package/resources/migrationGuides/deprecated-table-table-property.md +154 -0
  140. package/resources/template-js/LICENSE +201 -0
  141. package/resources/template-js/README.md +87 -0
  142. package/resources/template-js/_.editorconfig +22 -0
  143. package/resources/template-js/_.gitignore +17 -0
  144. package/resources/template-js/eslint.config.js +68 -0
  145. package/resources/template-js/karma-ci-cov.conf.js +20 -0
  146. package/resources/template-js/karma-ci.conf.js +9 -0
  147. package/resources/template-js/karma.conf.js +9 -0
  148. package/resources/template-js/package.json +34 -0
  149. package/resources/template-js/ui5-dist.yaml +18 -0
  150. package/resources/template-js/ui5.yaml +24 -0
  151. package/resources/template-js/webapp/Component.js +41 -0
  152. package/resources/template-js/webapp/controller/App.controller.js +10 -0
  153. package/resources/template-js/webapp/controller/BaseController.js +67 -0
  154. package/resources/template-js/webapp/controller/Main.controller.js +14 -0
  155. package/resources/template-js/webapp/i18n/i18n.properties +3 -0
  156. package/resources/template-js/webapp/i18n/i18n_en.properties +3 -0
  157. package/resources/template-js/webapp/index-cdn.html +34 -0
  158. package/resources/template-js/webapp/index.html +34 -0
  159. package/resources/template-js/webapp/manifest.json +103 -0
  160. package/resources/template-js/webapp/model/formatter.js +9 -0
  161. package/resources/template-js/webapp/model/models.js +11 -0
  162. package/resources/template-js/webapp/test/Test.qunit.html +16 -0
  163. package/resources/template-js/webapp/test/integration/HelloJourney.js +85 -0
  164. package/resources/template-js/webapp/test/integration/opaTests.qunit.js +1 -0
  165. package/resources/template-js/webapp/test/integration/pages/Main.js +112 -0
  166. package/resources/template-js/webapp/test/testsuite.qunit.html +18 -0
  167. package/resources/template-js/webapp/test/testsuite.qunit.js +37 -0
  168. package/resources/template-js/webapp/test/unit/controller/Main.qunit.js +11 -0
  169. package/resources/template-js/webapp/test/unit/unitTests.qunit.js +1 -0
  170. package/resources/template-js/webapp/test-lt1_124/integration/HelloJourney.js +85 -0
  171. package/resources/template-js/webapp/test-lt1_124/integration/opaTests.qunit.html +31 -0
  172. package/resources/template-js/webapp/test-lt1_124/integration/opaTests.qunit.js +11 -0
  173. package/resources/template-js/webapp/test-lt1_124/integration/pages/Main.js +112 -0
  174. package/resources/template-js/webapp/test-lt1_124/testsuite.qunit.html +13 -0
  175. package/resources/template-js/webapp/test-lt1_124/testsuite.qunit.js +9 -0
  176. package/resources/template-js/webapp/test-lt1_124/unit/controller/Main.qunit.js +11 -0
  177. package/resources/template-js/webapp/test-lt1_124/unit/unitTests.qunit.html +30 -0
  178. package/resources/template-js/webapp/test-lt1_124/unit/unitTests.qunit.js +12 -0
  179. package/resources/template-js/webapp/view/App.view.xml +9 -0
  180. package/resources/template-js/webapp/view/Main.view.xml +90 -0
  181. package/resources/template-ts/LICENSE +201 -0
  182. package/resources/template-ts/README.md +101 -0
  183. package/resources/template-ts/_.editorconfig +23 -0
  184. package/resources/template-ts/_.gitignore +18 -0
  185. package/resources/template-ts/_.nycrc.json +7 -0
  186. package/resources/template-ts/_tsconfig.json +21 -0
  187. package/resources/template-ts/eslint.config.mjs +27 -0
  188. package/resources/template-ts/package.json +40 -0
  189. package/resources/template-ts/ui5-coverage.yaml +40 -0
  190. package/resources/template-ts/ui5-dist.yaml +18 -0
  191. package/resources/template-ts/ui5.yaml +27 -0
  192. package/resources/template-ts/webapp/Component.ts +49 -0
  193. package/resources/template-ts/webapp/controller/App.controller.ts +11 -0
  194. package/resources/template-ts/webapp/controller/BaseController.ts +83 -0
  195. package/resources/template-ts/webapp/controller/Main.controller.ts +19 -0
  196. package/resources/template-ts/webapp/i18n/i18n.properties +3 -0
  197. package/resources/template-ts/webapp/i18n/i18n_en.properties +3 -0
  198. package/resources/template-ts/webapp/index-cdn.html +35 -0
  199. package/resources/template-ts/webapp/index.html +35 -0
  200. package/resources/template-ts/webapp/manifest.json +105 -0
  201. package/resources/template-ts/webapp/model/formatter.ts +5 -0
  202. package/resources/template-ts/webapp/model/models.ts +15 -0
  203. package/resources/template-ts/webapp/test/Test.qunit.html +16 -0
  204. package/resources/template-ts/webapp/test/integration/HelloJourney.ts +84 -0
  205. package/resources/template-ts/webapp/test/integration/opaTests.qunit.ts +2 -0
  206. package/resources/template-ts/webapp/test/integration/pages/MainPage.ts +112 -0
  207. package/resources/template-ts/webapp/test/testsuite.qunit.html +18 -0
  208. package/resources/template-ts/webapp/test/testsuite.qunit.ts +33 -0
  209. package/resources/template-ts/webapp/test/unit/controller/Main.qunit.ts +8 -0
  210. package/resources/template-ts/webapp/test/unit/unitTests.qunit.ts +2 -0
  211. package/resources/template-ts/webapp/test-lt1_124/integration/HelloJourney.ts +86 -0
  212. package/resources/template-ts/webapp/test-lt1_124/integration/opaTests.qunit.html +34 -0
  213. package/resources/template-ts/webapp/test-lt1_124/integration/opaTests.qunit.ts +8 -0
  214. package/resources/template-ts/webapp/test-lt1_124/integration/pages/MainPage.ts +112 -0
  215. package/resources/template-ts/webapp/test-lt1_124/testsuite.qunit.html +13 -0
  216. package/resources/template-ts/webapp/test-lt1_124/testsuite.qunit.ts +9 -0
  217. package/resources/template-ts/webapp/test-lt1_124/unit/controller/Main.qunit.ts +8 -0
  218. package/resources/template-ts/webapp/test-lt1_124/unit/unitTests.qunit.html +37 -0
  219. package/resources/template-ts/webapp/test-lt1_124/unit/unitTests.qunit.ts +8 -0
  220. package/resources/template-ts/webapp/view/App.view.xml +9 -0
  221. package/resources/template-ts/webapp/view/Main.view.xml +90 -0
@@ -0,0 +1,41 @@
1
+ sap.ui.define(["sap/ui/core/UIComponent", "sap/ui/Device", "./model/models"], function (UIComponent, Device, models) {
2
+ "use strict";
3
+
4
+ return UIComponent.extend("<%= appId %>.Component", {
5
+ metadata: {
6
+ manifest: "json",
7
+ interfaces: ["sap.ui.core.IAsyncContentCreation"]
8
+ },
9
+ init: function () {
10
+ // call the base component's init function
11
+ UIComponent.prototype.init.call(this); // create the views based on the url/hash
12
+
13
+ // create the device model
14
+ this.setModel(models.createDeviceModel(), "device");
15
+
16
+ // create the views based on the url/hash
17
+ this.getRouter().initialize();
18
+ },
19
+ /**
20
+ * This method can be called to determine whether the sapUiSizeCompact or sapUiSizeCozy
21
+ * design mode class should be set, which influences the size appearance of some controls.
22
+ * @public
23
+ * @returns {string} css class, either 'sapUiSizeCompact' or 'sapUiSizeCozy' - or an empty string if no css class should be set
24
+ */
25
+ getContentDensityClass: function () {
26
+ if (this.contentDensityClass === undefined) {
27
+ // check whether FLP has already set the content density class; do nothing in this case
28
+ if (document.body.classList.contains("sapUiSizeCozy") || document.body.classList.contains("sapUiSizeCompact")) {
29
+ this.contentDensityClass = "";
30
+ } else if (!Device.support.touch) {
31
+ // apply "compact" mode if touch is not supported
32
+ this.contentDensityClass = "sapUiSizeCompact";
33
+ } else {
34
+ // "cozy" in case of touch support; default for most sap.m controls, but needed for desktop-first controls like sap.ui.table.Table
35
+ this.contentDensityClass = "sapUiSizeCozy";
36
+ }
37
+ }
38
+ return this.contentDensityClass;
39
+ }
40
+ });
41
+ });
@@ -0,0 +1,10 @@
1
+ sap.ui.define(["./BaseController"], function (BaseController) {
2
+ "use strict";
3
+
4
+ return BaseController.extend("<%= appId %>.controller.App", {
5
+ onInit: function () {
6
+ // apply content density mode to root view
7
+ this.getView().addStyleClass(this.getOwnerComponent().getContentDensityClass());
8
+ }
9
+ });
10
+ });
@@ -0,0 +1,67 @@
1
+ sap.ui.define(["sap/ui/core/mvc/Controller", "sap/ui/core/UIComponent", "sap/ui/core/routing/History"], function (Controller, UIComponent, History) {
2
+ "use strict";
3
+
4
+ return Controller.extend("<%= appId %>.controller.BaseController", {
5
+ /**
6
+ * Convenience method to get the components' router instance.
7
+ * @returns {sap.m.routing.Router} The router instance
8
+ */
9
+ getRouter: function () {
10
+ return UIComponent.getRouterFor(this);
11
+ },
12
+
13
+ /**
14
+ * Convenience method for getting the i18n resource bundle of the component.
15
+ * @returns {Promise<sap.base.i18n.ResourceBundle>} The i18n resource bundle of the component
16
+ */
17
+ getResourceBundle: function () {
18
+ const oModel = this.getOwnerComponent().getModel("i18n");
19
+ return oModel.getResourceBundle();
20
+ },
21
+
22
+ /**
23
+ * Convenience method for getting the view model by name in every controller of the application.
24
+ * @param {string} [sName] The model name
25
+ * @returns {sap.ui.model.Model} The model instance
26
+ */
27
+ getModel: function (sName) {
28
+ return this.getView().getModel(sName);
29
+ },
30
+
31
+ /**
32
+ * Convenience method for setting the view model in every controller of the application.
33
+ * @param {sap.ui.model.Model} oModel The model instance
34
+ * @param {string} [sName] The model name
35
+ * @returns {sap.ui.core.mvc.Controller} The current base controller instance
36
+ */
37
+ setModel: function (oModel, sName) {
38
+ this.getView().setModel(oModel, sName);
39
+ return this;
40
+ },
41
+
42
+ /**
43
+ * Convenience method for triggering the navigation to a specific target.
44
+ * @public
45
+ * @param {string} sName Target name
46
+ * @param {object} [oParameters] Navigation parameters
47
+ * @param {boolean} [bReplace] Defines if the hash should be replaced (no browser history entry) or set (browser history entry)
48
+ */
49
+ navTo: function (sName, oParameters, bReplace) {
50
+ this.getRouter().navTo(sName, oParameters, undefined, bReplace);
51
+ },
52
+
53
+ /**
54
+ * Convenience event handler for navigating back.
55
+ * It there is a history entry we go one step back in the browser history
56
+ * If not, it will replace the current entry of the browser history with the main route.
57
+ */
58
+ onNavBack: function () {
59
+ const sPreviousHash = History.getInstance().getPreviousHash();
60
+ if (sPreviousHash !== undefined) {
61
+ window.history.go(-1);
62
+ } else {
63
+ this.getRouter().navTo("main", {}, undefined, true);
64
+ }
65
+ }
66
+ });
67
+ });
@@ -0,0 +1,14 @@
1
+ sap.ui.define(["./BaseController"<% if (!oDataEntitySet) { %>, "sap/m/MessageBox"<% } %>], function (BaseController<% if (!oDataEntitySet) { %>, MessageBox<% } %>) {
2
+ "use strict";
3
+
4
+ return BaseController.extend("<%= appId %>.controller.Main", {<% if (!oDataEntitySet) { %>
5
+ sayHello: function () {
6
+ MessageBox.show("Hello World!");
7
+ }<% } else { %>
8
+
9
+ onRowSelectionChange: function(oEvent) {
10
+ const selectedContext = oEvent.getParameter("rowContext");
11
+ this.byId("detailForm").setBindingContext(selectedContext);
12
+ }<% } %>
13
+ });
14
+ });
@@ -0,0 +1,3 @@
1
+ appTitle=<%= appId %>
2
+ appDescription=UI5 Application <%= appId %>
3
+ btnText=Say Hello
@@ -0,0 +1,3 @@
1
+ appTitle=<%= appId %>
2
+ appDescription=UI5 Application <%= appId %>
3
+ btnText=Say Hello
@@ -0,0 +1,34 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Cache-control" content="no-cache, no-store, must-revalidate" />
5
+ <meta http-equiv="Pragma" content="no-cache" />
6
+ <meta http-equiv="expires" content="0" />
7
+ <meta charset="utf-8" />
8
+
9
+ <title>UI5 Application: <%= namespace %></title>
10
+
11
+ <script
12
+ id="sap-ui-bootstrap"
13
+ src="https://<%= cdnDomain %>/<%= frameworkVersion %>/resources/sap-ui-core.js"<% if (gte1_120_0) { %>
14
+ data-sap-ui-resource-roots='{
15
+ "<%= appId %>": "./"
16
+ }'
17
+ data-sap-ui-on-init="module:sap/ui/core/ComponentSupport"
18
+ data-sap-ui-compat-version="edge"
19
+ data-sap-ui-frame-options="trusted"<% } else { %>
20
+ data-sap-ui-theme="<%= defaultTheme %>"
21
+ data-sap-ui-resourceroots='{
22
+ "<%= appId %>": "./"
23
+ }'
24
+ data-sap-ui-onInit="module:sap/ui/core/ComponentSupport"
25
+ data-sap-ui-compatVersion="edge"
26
+ data-sap-ui-frameOptions="trusted"<% } %>
27
+ data-sap-ui-async="true"
28
+ ></script>
29
+ </head>
30
+
31
+ <body class="sapUiBody">
32
+ <div data-sap-ui-component data-name="<%= appId %>"></div>
33
+ </body>
34
+ </html>
@@ -0,0 +1,34 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Cache-control" content="no-cache, no-store, must-revalidate" />
5
+ <meta http-equiv="Pragma" content="no-cache" />
6
+ <meta http-equiv="expires" content="0" />
7
+ <meta charset="utf-8" />
8
+
9
+ <title>UI5 Application: <%= namespace %></title>
10
+
11
+ <script
12
+ id="sap-ui-bootstrap"
13
+ src="resources/sap-ui-core.js"<% if (gte1_120_0) { %>
14
+ data-sap-ui-resource-roots='{
15
+ "<%= appId %>": "./"
16
+ }'
17
+ data-sap-ui-on-init="module:sap/ui/core/ComponentSupport"
18
+ data-sap-ui-compat-version="edge"
19
+ data-sap-ui-frame-options="trusted"<% } else { %>
20
+ data-sap-ui-theme="<%= defaultTheme %>"
21
+ data-sap-ui-resourceroots='{
22
+ "<%= appId %>": "./"
23
+ }'
24
+ data-sap-ui-onInit="module:sap/ui/core/ComponentSupport"
25
+ data-sap-ui-compatVersion="edge"
26
+ data-sap-ui-frameOptions="trusted"<% } %>
27
+ data-sap-ui-async="true"
28
+ ></script>
29
+ </head>
30
+
31
+ <body class="sapUiBody">
32
+ <div data-sap-ui-component data-name="<%= appId %>"></div>
33
+ </body>
34
+ </html>
@@ -0,0 +1,103 @@
1
+ {
2
+ "_version": "1.21.0",
3
+
4
+ "sap.app": {
5
+ "id": "<%= appId %>",
6
+ "type": "application",
7
+ "i18n": "i18n/i18n.properties",
8
+ "title": "{{appTitle}}",
9
+ "description": "{{appDescription}}",
10
+ "applicationVersion": {
11
+ "version": "${version}"
12
+ }<% if (oDataV4Url) { %>,
13
+ "dataSources": {
14
+ "default": {
15
+ "uri": "<%= oDataV4Url %>",
16
+ "type": "OData",
17
+ "settings": {
18
+ "odataVersion": "4.0"
19
+ }
20
+ }
21
+ }<% } %>
22
+ },
23
+
24
+ "sap.ui": {
25
+ "technology": "UI5",
26
+ "icons": {},
27
+ "deviceTypes": {
28
+ "desktop": true,
29
+ "tablet": true,
30
+ "phone": true
31
+ }
32
+ },
33
+
34
+ "sap.ui5": {
35
+ "rootView": {
36
+ "viewName": "<%= appId %>.view.App",
37
+ "type": "XML",
38
+ "id": "app"
39
+ },
40
+
41
+ "dependencies": {
42
+ "minUI5Version": "<%= frameworkVersion %>",
43
+ "libs": {
44
+ "sap.ui.core": {},
45
+ "sap.m": {}<% if (oDataEntitySet) { %>,
46
+ "sap.ui.layout": {},
47
+ "sap.f": {},
48
+ "sap.ui.table": {}<% } %>
49
+ }
50
+ },
51
+
52
+ "handleValidation": true,
53
+
54
+ "contentDensities": {
55
+ "compact": true,
56
+ "cozy": true
57
+ },
58
+
59
+ "models": {
60
+ "i18n": {
61
+ "type": "sap.ui.model.resource.ResourceModel",
62
+ "settings": {
63
+ "bundleName": "<%= appId %>.i18n.i18n",
64
+ "async": true
65
+ }
66
+ }<% if (oDataV4Url) { %>,
67
+ "": {
68
+ "dataSource": "default",
69
+ "preload": true,
70
+ "settings": {
71
+ "autoExpandSelect": true,<% if (serverRequiresXCSRF) { %>
72
+ "earlyRequests": true,<% } %>
73
+ "operationMode": "Server"<% if (lt1_110_0) { %>,
74
+ "synchronizationMode": "None"<% } %>
75
+ }
76
+ }<% } %>
77
+ },
78
+
79
+ "routing": {
80
+ "config": {
81
+ "routerClass": "sap.m.routing.Router",
82
+ "type": "View",
83
+ "viewType": "XML",
84
+ "path": "<%= appId %>.view",
85
+ "controlId": "app",
86
+ "controlAggregation": "pages"
87
+ },
88
+ "routes": [
89
+ {
90
+ "pattern": "",
91
+ "name": "main",
92
+ "target": "main"
93
+ }
94
+ ],
95
+ "targets": {
96
+ "main": {
97
+ "id": "main",
98
+ "name": "Main"
99
+ }
100
+ }
101
+ }
102
+ }
103
+ }
@@ -0,0 +1,9 @@
1
+ sap.ui.define(function () {
2
+ "use strict";
3
+
4
+ return {
5
+ formatValue: function (value) {
6
+ return value && value.toUpperCase();
7
+ }
8
+ };
9
+ });
@@ -0,0 +1,11 @@
1
+ sap.ui.define(["sap/ui/model/json/JSONModel", "sap/ui/model/BindingMode", "sap/ui/Device"], function (JSONModel, BindingMode, Device) {
2
+ "use strict";
3
+
4
+ return {
5
+ createDeviceModel: function () {
6
+ const oModel = new JSONModel(Device);
7
+ oModel.setDefaultBindingMode(BindingMode.OneWay);
8
+ return oModel;
9
+ }
10
+ };
11
+ });
@@ -0,0 +1,16 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <script
6
+ src="../resources/sap/ui/test/starter/runTest.js"
7
+ data-sap-ui-resource-roots='{
8
+ "test-resources.<%= appId %>": "./"
9
+ }'
10
+ ></script>
11
+ </head>
12
+ <body class="sapUiBody">
13
+ <div id="qunit"></div>
14
+ <div id="qunit-fixture"></div>
15
+ </body>
16
+ </html>
@@ -0,0 +1,85 @@
1
+ /* global QUnit */
2
+ sap.ui.define(["sap/ui/test/opaQunit", "./pages/Main"], function (opaTest) {
3
+ "use strict";
4
+
5
+ <% if (!oDataEntitySet) { %> QUnit.module("Sample Hello Journey");
6
+
7
+ opaTest("Should open the Hello dialog", function (Given, When, Then) {
8
+ // Arrangements
9
+ Given.iStartMyUIComponent({
10
+ componentConfig: {
11
+ name: "<%= appId %>"
12
+ }
13
+ });
14
+
15
+ // Actions
16
+ When.onTheMainPage.iPressTheSayHelloButton();
17
+
18
+ // Assertions
19
+ Then.onTheMainPage.iShouldSeeTheHelloDialog();
20
+
21
+ // Actions
22
+ When.onTheMainPage.iPressTheOkButtonInTheDialog();
23
+
24
+ // Assertions
25
+ Then.onTheMainPage.iShouldNotSeeTheHelloDialog();
26
+
27
+ // Cleanup
28
+ Then.iTeardownMyApp();
29
+ });
30
+
31
+ opaTest("Should close the Hello dialog", function (Given, When, Then) {
32
+ // Arrangements
33
+ Given.iStartMyUIComponent({
34
+ componentConfig: {
35
+ name: "<%= appId %>"
36
+ }
37
+ });
38
+
39
+ // Actions
40
+ When.onTheMainPage.iPressTheSayHelloButton();
41
+ When.onTheMainPage.iPressTheOkButtonInTheDialog();
42
+
43
+ // Assertions
44
+ Then.onTheMainPage.iShouldNotSeeTheHelloDialog();
45
+
46
+ // Cleanup
47
+ Then.iTeardownMyApp();
48
+ });
49
+ <% } %><% if (oDataEntitySet) { %> QUnit.module("Sample Data Journey");
50
+
51
+ opaTest("Should display the data table", function (Given, When, Then) {
52
+ // Arrangements
53
+ Given.iStartMyUIComponent({
54
+ componentConfig: {
55
+ name: "<%= appId %>"
56
+ }
57
+ });
58
+
59
+ // Assertions
60
+ Then.onTheMainPage.iShouldSeeTheDataTable();
61
+ Then.onTheMainPage.iShouldSeeTheDetailForm();
62
+ Then.onTheMainPage.iShouldSeeTableWithCorrectColumns();
63
+
64
+ // Cleanup
65
+ Then.iTeardownMyApp();
66
+ });
67
+
68
+ opaTest("Should select table row and populate detail form", function (Given, When, Then) {
69
+ // Arrangements
70
+ Given.iStartMyUIComponent({
71
+ componentConfig: {
72
+ name: "<%= appId %>"
73
+ }
74
+ });
75
+
76
+ // Actions
77
+ When.onTheMainPage.iSelectFirstTableRow();
78
+
79
+ // Assertions
80
+ Then.onTheMainPage.iShouldSeeTheDetailForm();
81
+
82
+ // Cleanup
83
+ Then.iTeardownMyApp();
84
+ });
85
+ <% } %>});
@@ -0,0 +1 @@
1
+ sap.ui.define(["./HelloJourney"]);
@@ -0,0 +1,112 @@
1
+ sap.ui.define(["sap/ui/test/Opa5"<% if (!oDataEntitySet) { %>, "sap/ui/test/actions/Press"<% } %>], function (Opa5<% if (!oDataEntitySet) { %>, Press<% } %>) {
2
+ "use strict";
3
+
4
+ Opa5.createPageObjects({
5
+ onTheMainPage: {
6
+ actions: {<% if (!oDataEntitySet) { %>
7
+ iPressTheSayHelloButton: function () {
8
+ return this.waitFor({
9
+ id: "helloButton",
10
+ viewName: "<%= appId %>.view.Main",
11
+ actions: new Press(),
12
+ errorMessage: "Did not find the 'Say Hello With Dialog' button on the App view"
13
+ });
14
+ },
15
+
16
+ iPressTheOkButtonInTheDialog: function () {
17
+ return this.waitFor({
18
+ controlType: "sap.m.Button",
19
+ searchOpenDialogs: true,
20
+ viewName: "<%= appId %>.view.Main",
21
+ actions: new Press(),
22
+ errorMessage: "Did not find the 'OK' button in the Dialog"
23
+ });
24
+ }<% } else { %>
25
+ iSelectFirstTableRow: function () {
26
+ return this.waitFor({
27
+ controlType: "sap.ui.table.Table",
28
+ viewName: "<%= appId %>.view.Main",
29
+ actions: function (oTable) {
30
+ // Select the first row if available
31
+ if (oTable.getRows().length > 0) {
32
+ oTable.setSelectedIndex(0);
33
+ oTable.fireRowSelectionChange({
34
+ rowIndex: 0,
35
+ rowContext: oTable.getRows()[0].getBindingContext(),
36
+ userInteraction: true
37
+ });
38
+ }
39
+ },
40
+ errorMessage: "Did not find the data table"
41
+ });
42
+ }<% } %>
43
+ },
44
+
45
+ assertions: {<% if (!oDataEntitySet) { %>
46
+ iShouldSeeTheHelloDialog: function () {
47
+ return this.waitFor({
48
+ controlType: "sap.m.Dialog",
49
+ success: function () {
50
+ // we set the view busy, so we need to query the parent of the app
51
+ Opa5.assert.ok(true, "The dialog is open");
52
+ },
53
+ errorMessage: "Did not find the dialog control"
54
+ });
55
+ },
56
+
57
+ iShouldNotSeeTheHelloDialog: function () {
58
+ return this.waitFor({
59
+ controlType: "sap.m.App", // dummy, I just want a check function, where I can search the DOM. Probably there is a better way for a NEGATIVE test (NO dialog).
60
+ check: function () {
61
+ return document.querySelectorAll(".sapMDialog").length === 0;
62
+ },
63
+ success: function () {
64
+ Opa5.assert.ok(true, "No dialog is open");
65
+ }
66
+ });
67
+ }<% } else { %>
68
+ iShouldSeeTheDataTable: function () {
69
+ return this.waitFor({
70
+ controlType: "sap.ui.table.Table",
71
+ viewName: "<%= appId %>.view.Main",
72
+ success: function (aTables) {
73
+ Opa5.assert.ok(aTables.length > 0, "The data table is displayed");
74
+ },
75
+ errorMessage: "Did not find the data table"
76
+ });
77
+ },
78
+
79
+ iShouldSeeTheDetailForm: function () {
80
+ return this.waitFor({
81
+ id: "detailForm",
82
+ viewName: "<%= appId %>.view.Main",
83
+ success: function (oForm) {
84
+ Opa5.assert.ok(oForm, "The detail form is displayed");
85
+ },
86
+ errorMessage: "Did not find the detail form"
87
+ });
88
+ },
89
+
90
+ iShouldSeeTableWithCorrectColumns: function () {
91
+ return this.waitFor({
92
+ controlType: "sap.ui.table.Table",
93
+ viewName: "<%= appId %>.view.Main",
94
+ success: function (aTables) {
95
+ const oTable = aTables[0];
96
+ const aColumns = oTable.getColumns();
97
+ const expectedColumns = [<% entityProperties.forEach(function(property, index) { %>"<%= property %>"<% if (index < entityProperties.length - 1) { %>, <% } %><% }); %>];
98
+
99
+ Opa5.assert.equal(aColumns.length, expectedColumns.length, "Table has the correct number of columns");
100
+
101
+ for (let i = 0; i < expectedColumns.length; i++) {
102
+ const sColumnText = aColumns[i].getLabel().getText();
103
+ Opa5.assert.equal(sColumnText, expectedColumns[i], "Column " + i + " has correct label: " + expectedColumns[i]);
104
+ }
105
+ },
106
+ errorMessage: "Table columns do not match expected properties"
107
+ });
108
+ }<% } %>
109
+ }
110
+ }
111
+ });
112
+ });
@@ -0,0 +1,18 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Cache-control" content="no-cache, no-store, must-revalidate" />
5
+ <meta http-equiv="Pragma" content="no-cache" />
6
+ <meta http-equiv="expires" content="0" />
7
+ <meta charset="utf-8" />
8
+ <title>QUnit test suite for the UI5 Application: <%= namespace %></title>
9
+ <script
10
+ src="../resources/sap/ui/test/starter/createSuite.js"
11
+ data-sap-ui-testsuite="test-resources/<%= appURI %>/testsuite.qunit"
12
+ data-sap-ui-resource-roots='{
13
+ "test-resources.<%= appId %>": "./"
14
+ }'
15
+ ></script>
16
+ </head>
17
+ <body></body>
18
+ </html>
@@ -0,0 +1,37 @@
1
+ sap.ui.define(function () {
2
+ "use strict";
3
+
4
+ return {
5
+ name: "QUnit test suite for the UI5 Application: <%= namespace %>",
6
+ defaults: {
7
+ page: "ui5://test-resources/<%= appURI %>/Test.qunit.html?testsuite={suite}&test={name}",
8
+ qunit: {
9
+ version: 2
10
+ },
11
+ sinon: {
12
+ version: 1
13
+ },
14
+ ui5: {
15
+ language: "EN",
16
+ theme: "<%= defaultTheme %>"
17
+ },
18
+ coverage: {
19
+ only: "<%= appURI %>/",
20
+ never: "test-resources/<%= appURI %>/"
21
+ },
22
+ loader: {
23
+ paths: {
24
+ "<%= appURI %>": "../"
25
+ }
26
+ }
27
+ },
28
+ tests: {
29
+ "unit/unitTests": {
30
+ title: "Unit tests for <%= namespace %>"
31
+ },
32
+ "integration/opaTests": {
33
+ title: "Integration tests for <%= namespace %>"
34
+ }
35
+ }
36
+ };
37
+ });
@@ -0,0 +1,11 @@
1
+ /* global QUnit */
2
+ sap.ui.define(["<%= appURI %>/controller/Main.controller"], function (MainController) {
3
+ "use strict";
4
+
5
+ QUnit.module("Sample Main controller test");
6
+
7
+ QUnit.test("The MainController class has a <% if (!oDataEntitySet) { %>sayHello<% } else { %>onRowSelectionChange<% } %> method", function (assert) {
8
+ // as a very basic test example just check the presence of the "<% if (!oDataEntitySet) { %>sayHello<% } else { %>onRowSelectionChange<% } %>" method
9
+ assert.strictEqual(typeof MainController.prototype.<% if (!oDataEntitySet) { %>sayHello<% } else { %>onRowSelectionChange<% } %>, "function");
10
+ });
11
+ });
@@ -0,0 +1 @@
1
+ sap.ui.define(["./controller/Main.qunit"]);