From 24f80a88d6dfb93b5361f2b2f1946c1e592203f1 Mon Sep 17 00:00:00 2001 From: Gaurav Gupta Date: Wed, 9 Oct 2024 21:39:44 +0530 Subject: [PATCH 1/6] FISH-9548 Added placeholder/tooltip added to UI components and Source Editor focused --- .../resources/ApplicationGenerator.java | 3 +- starter-ui/src/main/webapp/assets/main.js | 6 +- .../Membership Management System.mmd | 3 +- starter-ui/src/main/webapp/index.html | 99 +++++++++++-------- 4 files changed, 64 insertions(+), 47 deletions(-) diff --git a/starter-ui/src/main/java/fish/payara/starter/resources/ApplicationGenerator.java b/starter-ui/src/main/java/fish/payara/starter/resources/ApplicationGenerator.java index 2344355..d83665a 100644 --- a/starter-ui/src/main/java/fish/payara/starter/resources/ApplicationGenerator.java +++ b/starter-ui/src/main/java/fish/payara/starter/resources/ApplicationGenerator.java @@ -136,11 +136,10 @@ public Future generate(ApplicationConfiguration appProperties) { if (erModel != null && !erModel.getEntities().isEmpty()) { Jsonb jsonb = JsonbBuilder.create(); String jsonString = jsonb.toJson(erModel); + LOGGER.info("Generating web components info from AI."); String outputJson = langChainChatService.addFronEndDetailsToERDiagram(jsonString); if (outputJson != null && !outputJson.isEmpty()) { String updatedJson = outputJson.strip().replaceAll("^```json|```$", ""); - // convert json to ERModel - erModel = jsonb.fromJson(updatedJson, ERModel.class); } CRUDAppGenerator generator = new CRUDAppGenerator(erModel, diff --git a/starter-ui/src/main/webapp/assets/main.js b/starter-ui/src/main/webapp/assets/main.js index 8d5f76f..bf6b2f8 100644 --- a/starter-ui/src/main/webapp/assets/main.js +++ b/starter-ui/src/main/webapp/assets/main.js @@ -108,6 +108,10 @@ form.addEventListener('submit', function (event) { } } else { jsonObject[key] = input.value; + if(input.id == 'erDiagram' && !$("#mermaidErDiagramList").val()) { + jsonObject[key] = ''; + debugger; + } } }); @@ -118,7 +122,7 @@ form.addEventListener('submit', function (event) { }, body: JSON.stringify(jsonObject), }; -debugger; + fetch('resources/starter', requestOptions) .then(response => { if (response.status === 200) { diff --git a/starter-ui/src/main/webapp/erDiagram/Membership Management System.mmd b/starter-ui/src/main/webapp/erDiagram/Membership Management System.mmd index 006c8e1..a61f07c 100644 --- a/starter-ui/src/main/webapp/erDiagram/Membership Management System.mmd +++ b/starter-ui/src/main/webapp/erDiagram/Membership Management System.mmd @@ -48,5 +48,4 @@ erDiagram int adminId PK string name string role - } -%%{ icon[card],title[Membership Management System],home-page-description[A system for managing membership registrations and benefits. Track members, subscriptions, and privileges efficiently.],about-us-page-description[Explore our membership management system and discover exclusive benefits for our members. Connect with other members and stay updated with our events and notifications.],menu[Home, Memberships, Benefits, About Us, Contact + } \ No newline at end of file diff --git a/starter-ui/src/main/webapp/index.html b/starter-ui/src/main/webapp/index.html index 2faec86..6b4df2e 100644 --- a/starter-ui/src/main/webapp/index.html +++ b/starter-ui/src/main/webapp/index.html @@ -425,7 +425,7 @@

Simply select your options, and click ‘Generate’ - and Payara Pl

- +

@@ -630,12 +630,12 @@

Simply select your options, and click ‘Generate’ - and Payara Pl

Source

- +
- +
@@ -647,13 +647,12 @@

Live Preview

- - - - - - - + + + + + +

× @@ -661,15 +660,24 @@

Live Preview

@@ -678,8 +686,8 @@

Live Preview

color: #aaa; } button:disabled { - box-shadow: 0 0 0 1px #aaa inset !important; -} + box-shadow: 0 0 0 1px #aaa inset !important; + } .modal { display: none; position: fixed; @@ -768,6 +776,9 @@

Live Preview

color: #ff0000; /* Change this to your desired color */ } + From 23a29761c002b0805267651b050fde98b0605c42 Mon Sep 17 00:00:00 2001 From: Gaurav Gupta Date: Thu, 10 Oct 2024 11:52:12 +0530 Subject: [PATCH 2/6] FISH-9548 Rename Data Model Configuration to ER Diagram Designer --- starter-ui/src/main/webapp/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/starter-ui/src/main/webapp/index.html b/starter-ui/src/main/webapp/index.html index 6b4df2e..e626436 100644 --- a/starter-ui/src/main/webapp/index.html +++ b/starter-ui/src/main/webapp/index.html @@ -412,8 +412,8 @@

Simply select your options, and click ‘Generate’ - and Payara Pl
- Data Model Configuration - + ER Diagram Designer +

Simply select your options, and click ‘Generate’ - and Payara Pl

From 997d5fa8600e8b8b5e5a42b8aa16762985166dc2 Mon Sep 17 00:00:00 2001 From: Gaurav Gupta Date: Thu, 10 Oct 2024 12:11:23 +0530 Subject: [PATCH 4/6] FISH-9548 Rename subproject --- .gitignore | 2 +- pom.xml | 2 +- {PayaraStarterGenerator => starter-generator}/pom.xml | 0 .../java/fish/payara/starter/application/domain/Attribute.java | 0 .../java/fish/payara/starter/application/domain/Constant.java | 0 .../java/fish/payara/starter/application/domain/ERModel.java | 0 .../java/fish/payara/starter/application/domain/Entity.java | 0 .../fish/payara/starter/application/domain/Relationship.java | 0 .../payara/starter/application/generator/CRUDAppGenerator.java | 0 .../payara/starter/application/generator/ERDiagramParser.java | 0 .../fish/payara/starter/application/util/AttributeType.java | 0 .../java/fish/payara/starter/application/util/Constants.java | 0 .../java/fish/payara/starter/application/util/Inflector.java | 0 .../main/java/fish/payara/starter/application/util/JPAUtil.java | 0 .../java/fish/payara/starter/application/util/JavaUtil.java | 0 .../java/fish/payara/starter/application/util/StringHelper.java | 0 .../java/fish/payara/starter/application/util/StringUtils.java | 0 .../src/main/resources/template/descriptor/beans.xml.ftl | 0 .../src/main/resources/template/descriptor/persistence.xml.ftl | 0 .../src/main/resources/template/html/about-us.html.ftl | 0 .../src/main/resources/template/html/app.html.ftl | 0 .../src/main/resources/template/html/entity.html.ftl | 0 .../src/main/resources/template/html/home.html.ftl | 0 .../resources/template/repository/AbstractRepository.java.ftl | 0 .../resources/template/repository/EntityRepository.java.ftl | 0 .../src/main/resources/template/rest/EntityController.java.ftl | 0 .../src/main/resources/template/rest/HeaderUtil.java.ftl | 0 .../src/main/resources/template/rest/RestConfiguration.java.ftl | 0 .../template/service/producer/EntityManagerProducer.java.ftl | 0 starter-ui/src/main/webapp/assets/main.js | 1 - 30 files changed, 2 insertions(+), 3 deletions(-) rename {PayaraStarterGenerator => starter-generator}/pom.xml (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/java/fish/payara/starter/application/domain/Attribute.java (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/java/fish/payara/starter/application/domain/Constant.java (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/java/fish/payara/starter/application/domain/ERModel.java (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/java/fish/payara/starter/application/domain/Entity.java (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/java/fish/payara/starter/application/domain/Relationship.java (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/java/fish/payara/starter/application/generator/CRUDAppGenerator.java (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/java/fish/payara/starter/application/generator/ERDiagramParser.java (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/java/fish/payara/starter/application/util/AttributeType.java (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/java/fish/payara/starter/application/util/Constants.java (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/java/fish/payara/starter/application/util/Inflector.java (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/java/fish/payara/starter/application/util/JPAUtil.java (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/java/fish/payara/starter/application/util/JavaUtil.java (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/java/fish/payara/starter/application/util/StringHelper.java (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/java/fish/payara/starter/application/util/StringUtils.java (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/resources/template/descriptor/beans.xml.ftl (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/resources/template/descriptor/persistence.xml.ftl (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/resources/template/html/about-us.html.ftl (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/resources/template/html/app.html.ftl (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/resources/template/html/entity.html.ftl (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/resources/template/html/home.html.ftl (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/resources/template/repository/AbstractRepository.java.ftl (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/resources/template/repository/EntityRepository.java.ftl (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/resources/template/rest/EntityController.java.ftl (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/resources/template/rest/HeaderUtil.java.ftl (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/resources/template/rest/RestConfiguration.java.ftl (100%) rename {PayaraStarterGenerator => starter-generator}/src/main/resources/template/service/producer/EntityManagerProducer.java.ftl (100%) diff --git a/.gitignore b/.gitignore index 3068568..8bb7a9d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,6 @@ /starter-archetype/payara-starter-archetype.iml /starter-archetype/src/main/resources/archetype-resources/.gradle /starter-ui/payara-starter-ui.iml -/PayaraStarterGenerator/target/ +/starter-generator/target/ starter-ui/nb-configuration.xml starter-ui/nb-configuration.xml diff --git a/pom.xml b/pom.xml index 6eb5f0a..bef47e3 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ starter-archetype starter-ui - PayaraStarterGenerator + starter-generator diff --git a/PayaraStarterGenerator/pom.xml b/starter-generator/pom.xml similarity index 100% rename from PayaraStarterGenerator/pom.xml rename to starter-generator/pom.xml diff --git a/PayaraStarterGenerator/src/main/java/fish/payara/starter/application/domain/Attribute.java b/starter-generator/src/main/java/fish/payara/starter/application/domain/Attribute.java similarity index 100% rename from PayaraStarterGenerator/src/main/java/fish/payara/starter/application/domain/Attribute.java rename to starter-generator/src/main/java/fish/payara/starter/application/domain/Attribute.java diff --git a/PayaraStarterGenerator/src/main/java/fish/payara/starter/application/domain/Constant.java b/starter-generator/src/main/java/fish/payara/starter/application/domain/Constant.java similarity index 100% rename from PayaraStarterGenerator/src/main/java/fish/payara/starter/application/domain/Constant.java rename to starter-generator/src/main/java/fish/payara/starter/application/domain/Constant.java diff --git a/PayaraStarterGenerator/src/main/java/fish/payara/starter/application/domain/ERModel.java b/starter-generator/src/main/java/fish/payara/starter/application/domain/ERModel.java similarity index 100% rename from PayaraStarterGenerator/src/main/java/fish/payara/starter/application/domain/ERModel.java rename to starter-generator/src/main/java/fish/payara/starter/application/domain/ERModel.java diff --git a/PayaraStarterGenerator/src/main/java/fish/payara/starter/application/domain/Entity.java b/starter-generator/src/main/java/fish/payara/starter/application/domain/Entity.java similarity index 100% rename from PayaraStarterGenerator/src/main/java/fish/payara/starter/application/domain/Entity.java rename to starter-generator/src/main/java/fish/payara/starter/application/domain/Entity.java diff --git a/PayaraStarterGenerator/src/main/java/fish/payara/starter/application/domain/Relationship.java b/starter-generator/src/main/java/fish/payara/starter/application/domain/Relationship.java similarity index 100% rename from PayaraStarterGenerator/src/main/java/fish/payara/starter/application/domain/Relationship.java rename to starter-generator/src/main/java/fish/payara/starter/application/domain/Relationship.java diff --git a/PayaraStarterGenerator/src/main/java/fish/payara/starter/application/generator/CRUDAppGenerator.java b/starter-generator/src/main/java/fish/payara/starter/application/generator/CRUDAppGenerator.java similarity index 100% rename from PayaraStarterGenerator/src/main/java/fish/payara/starter/application/generator/CRUDAppGenerator.java rename to starter-generator/src/main/java/fish/payara/starter/application/generator/CRUDAppGenerator.java diff --git a/PayaraStarterGenerator/src/main/java/fish/payara/starter/application/generator/ERDiagramParser.java b/starter-generator/src/main/java/fish/payara/starter/application/generator/ERDiagramParser.java similarity index 100% rename from PayaraStarterGenerator/src/main/java/fish/payara/starter/application/generator/ERDiagramParser.java rename to starter-generator/src/main/java/fish/payara/starter/application/generator/ERDiagramParser.java diff --git a/PayaraStarterGenerator/src/main/java/fish/payara/starter/application/util/AttributeType.java b/starter-generator/src/main/java/fish/payara/starter/application/util/AttributeType.java similarity index 100% rename from PayaraStarterGenerator/src/main/java/fish/payara/starter/application/util/AttributeType.java rename to starter-generator/src/main/java/fish/payara/starter/application/util/AttributeType.java diff --git a/PayaraStarterGenerator/src/main/java/fish/payara/starter/application/util/Constants.java b/starter-generator/src/main/java/fish/payara/starter/application/util/Constants.java similarity index 100% rename from PayaraStarterGenerator/src/main/java/fish/payara/starter/application/util/Constants.java rename to starter-generator/src/main/java/fish/payara/starter/application/util/Constants.java diff --git a/PayaraStarterGenerator/src/main/java/fish/payara/starter/application/util/Inflector.java b/starter-generator/src/main/java/fish/payara/starter/application/util/Inflector.java similarity index 100% rename from PayaraStarterGenerator/src/main/java/fish/payara/starter/application/util/Inflector.java rename to starter-generator/src/main/java/fish/payara/starter/application/util/Inflector.java diff --git a/PayaraStarterGenerator/src/main/java/fish/payara/starter/application/util/JPAUtil.java b/starter-generator/src/main/java/fish/payara/starter/application/util/JPAUtil.java similarity index 100% rename from PayaraStarterGenerator/src/main/java/fish/payara/starter/application/util/JPAUtil.java rename to starter-generator/src/main/java/fish/payara/starter/application/util/JPAUtil.java diff --git a/PayaraStarterGenerator/src/main/java/fish/payara/starter/application/util/JavaUtil.java b/starter-generator/src/main/java/fish/payara/starter/application/util/JavaUtil.java similarity index 100% rename from PayaraStarterGenerator/src/main/java/fish/payara/starter/application/util/JavaUtil.java rename to starter-generator/src/main/java/fish/payara/starter/application/util/JavaUtil.java diff --git a/PayaraStarterGenerator/src/main/java/fish/payara/starter/application/util/StringHelper.java b/starter-generator/src/main/java/fish/payara/starter/application/util/StringHelper.java similarity index 100% rename from PayaraStarterGenerator/src/main/java/fish/payara/starter/application/util/StringHelper.java rename to starter-generator/src/main/java/fish/payara/starter/application/util/StringHelper.java diff --git a/PayaraStarterGenerator/src/main/java/fish/payara/starter/application/util/StringUtils.java b/starter-generator/src/main/java/fish/payara/starter/application/util/StringUtils.java similarity index 100% rename from PayaraStarterGenerator/src/main/java/fish/payara/starter/application/util/StringUtils.java rename to starter-generator/src/main/java/fish/payara/starter/application/util/StringUtils.java diff --git a/PayaraStarterGenerator/src/main/resources/template/descriptor/beans.xml.ftl b/starter-generator/src/main/resources/template/descriptor/beans.xml.ftl similarity index 100% rename from PayaraStarterGenerator/src/main/resources/template/descriptor/beans.xml.ftl rename to starter-generator/src/main/resources/template/descriptor/beans.xml.ftl diff --git a/PayaraStarterGenerator/src/main/resources/template/descriptor/persistence.xml.ftl b/starter-generator/src/main/resources/template/descriptor/persistence.xml.ftl similarity index 100% rename from PayaraStarterGenerator/src/main/resources/template/descriptor/persistence.xml.ftl rename to starter-generator/src/main/resources/template/descriptor/persistence.xml.ftl diff --git a/PayaraStarterGenerator/src/main/resources/template/html/about-us.html.ftl b/starter-generator/src/main/resources/template/html/about-us.html.ftl similarity index 100% rename from PayaraStarterGenerator/src/main/resources/template/html/about-us.html.ftl rename to starter-generator/src/main/resources/template/html/about-us.html.ftl diff --git a/PayaraStarterGenerator/src/main/resources/template/html/app.html.ftl b/starter-generator/src/main/resources/template/html/app.html.ftl similarity index 100% rename from PayaraStarterGenerator/src/main/resources/template/html/app.html.ftl rename to starter-generator/src/main/resources/template/html/app.html.ftl diff --git a/PayaraStarterGenerator/src/main/resources/template/html/entity.html.ftl b/starter-generator/src/main/resources/template/html/entity.html.ftl similarity index 100% rename from PayaraStarterGenerator/src/main/resources/template/html/entity.html.ftl rename to starter-generator/src/main/resources/template/html/entity.html.ftl diff --git a/PayaraStarterGenerator/src/main/resources/template/html/home.html.ftl b/starter-generator/src/main/resources/template/html/home.html.ftl similarity index 100% rename from PayaraStarterGenerator/src/main/resources/template/html/home.html.ftl rename to starter-generator/src/main/resources/template/html/home.html.ftl diff --git a/PayaraStarterGenerator/src/main/resources/template/repository/AbstractRepository.java.ftl b/starter-generator/src/main/resources/template/repository/AbstractRepository.java.ftl similarity index 100% rename from PayaraStarterGenerator/src/main/resources/template/repository/AbstractRepository.java.ftl rename to starter-generator/src/main/resources/template/repository/AbstractRepository.java.ftl diff --git a/PayaraStarterGenerator/src/main/resources/template/repository/EntityRepository.java.ftl b/starter-generator/src/main/resources/template/repository/EntityRepository.java.ftl similarity index 100% rename from PayaraStarterGenerator/src/main/resources/template/repository/EntityRepository.java.ftl rename to starter-generator/src/main/resources/template/repository/EntityRepository.java.ftl diff --git a/PayaraStarterGenerator/src/main/resources/template/rest/EntityController.java.ftl b/starter-generator/src/main/resources/template/rest/EntityController.java.ftl similarity index 100% rename from PayaraStarterGenerator/src/main/resources/template/rest/EntityController.java.ftl rename to starter-generator/src/main/resources/template/rest/EntityController.java.ftl diff --git a/PayaraStarterGenerator/src/main/resources/template/rest/HeaderUtil.java.ftl b/starter-generator/src/main/resources/template/rest/HeaderUtil.java.ftl similarity index 100% rename from PayaraStarterGenerator/src/main/resources/template/rest/HeaderUtil.java.ftl rename to starter-generator/src/main/resources/template/rest/HeaderUtil.java.ftl diff --git a/PayaraStarterGenerator/src/main/resources/template/rest/RestConfiguration.java.ftl b/starter-generator/src/main/resources/template/rest/RestConfiguration.java.ftl similarity index 100% rename from PayaraStarterGenerator/src/main/resources/template/rest/RestConfiguration.java.ftl rename to starter-generator/src/main/resources/template/rest/RestConfiguration.java.ftl diff --git a/PayaraStarterGenerator/src/main/resources/template/service/producer/EntityManagerProducer.java.ftl b/starter-generator/src/main/resources/template/service/producer/EntityManagerProducer.java.ftl similarity index 100% rename from PayaraStarterGenerator/src/main/resources/template/service/producer/EntityManagerProducer.java.ftl rename to starter-generator/src/main/resources/template/service/producer/EntityManagerProducer.java.ftl diff --git a/starter-ui/src/main/webapp/assets/main.js b/starter-ui/src/main/webapp/assets/main.js index bf6b2f8..5f94cf5 100644 --- a/starter-ui/src/main/webapp/assets/main.js +++ b/starter-ui/src/main/webapp/assets/main.js @@ -110,7 +110,6 @@ form.addEventListener('submit', function (event) { jsonObject[key] = input.value; if(input.id == 'erDiagram' && !$("#mermaidErDiagramList").val()) { jsonObject[key] = ''; - debugger; } } }); From 789cee0c8c978871027d358e50c6e750a8c29b64 Mon Sep 17 00:00:00 2001 From: Gaurav Gupta Date: Thu, 10 Oct 2024 12:39:26 +0530 Subject: [PATCH 5/6] FISH-9548 Tooltips for package --- starter-ui/src/main/webapp/index.html | 100 ++++++++++++-------------- 1 file changed, 46 insertions(+), 54 deletions(-) diff --git a/starter-ui/src/main/webapp/index.html b/starter-ui/src/main/webapp/index.html index 4f419d1..a0817bb 100644 --- a/starter-ui/src/main/webapp/index.html +++ b/starter-ui/src/main/webapp/index.html @@ -411,82 +411,74 @@

Simply select your options, and click ‘Generate’ - and Payara Pl

-
- ER Diagram Designer - -
- +
+ -
-
-
-

- - - -

-

- -

-

- Generate Code For: - - + +

+
+
+

+ + + +

+

+ +

+

+ Generate Code For:

- + - - +
-
- +
- + - - +
-
- +
- + - - +
-
- +
- +
-

+

-

- -

+ + - Previous: Payara Platform - - - + Previous: Payara Platform + + + - Next: Security Configuration - -

-
+ + Next: Security Configuration + +

-
+ +
Security Configuration From fe6c3b516da2b90e84d7a68e7860d5299d45c2be Mon Sep 17 00:00:00 2001 From: Gaurav Gupta Date: Thu, 10 Oct 2024 13:48:09 +0530 Subject: [PATCH 6/6] FISH-9548 Add app main page to index.html --- .../META-INF/archetype-post-generate.groovy | 8 +++++--- .../META-INF/maven/archetype-metadata.xml | 7 +++++++ .../src/main/webapp/index.html | 11 +++++++---- .../resources/ApplicationConfiguration.java | 19 ++++++++++++++++--- .../resources/ApplicationGenerator.java | 3 ++- starter-ui/src/main/webapp/index.html | 2 +- 6 files changed, 38 insertions(+), 12 deletions(-) diff --git a/starter-archetype/src/main/resources/META-INF/archetype-post-generate.groovy b/starter-archetype/src/main/resources/META-INF/archetype-post-generate.groovy index 7f1852d..7ff38a8 100644 --- a/starter-archetype/src/main/resources/META-INF/archetype-post-generate.groovy +++ b/starter-archetype/src/main/resources/META-INF/archetype-post-generate.groovy @@ -16,12 +16,13 @@ def mpOpenAPI = request.properties["mpOpenAPI"].trim() def mpFaultTolerance = request.properties["mpFaultTolerance"].trim() def mpMetrics = request.properties["mpMetrics"].trim() def auth = request.properties["auth"].trim() +def erDiagram = request.properties["erDiagram"].trim() def outputDirectory = new File(request.getOutputDirectory(), request.getArtifactId()) validateInput(profile, jakartaEEVersion, javaVersion, platform, outputDirectory) generateSource(build, _package, platform, jakartaEEVersion, includeTests, docker, mpConfig, mpOpenAPI, auth, outputDirectory) -bindEEPackage(jakartaEEVersion, mpConfig, mpOpenAPI, mpFaultTolerance, mpMetrics, auth, outputDirectory) +bindEEPackage(jakartaEEVersion, mpConfig, mpOpenAPI, mpFaultTolerance, mpMetrics, auth, erDiagram, outputDirectory) private void validateInput(String profile, String jakartaEEVersion, String javaVersion, String platform, File outputDirectory) { boolean deleteDirectory = true; @@ -136,7 +137,7 @@ private generateSource(build, _package, platform, jakartaEEVersion, } } -private void bindEEPackage(String jakartaEEVersion, String mpConfig, String mpOpenAPI, String mpFaultTolerance, String mpMetrics, String auth, File outputDirectory) { +private void bindEEPackage(String jakartaEEVersion, String mpConfig, String mpOpenAPI, String mpFaultTolerance, String mpMetrics, String auth, String erDiagram, File outputDirectory) { def eePackage = (jakartaEEVersion == '8') ? 'javax' : 'jakarta' println "Binding EE package: $eePackage" @@ -144,7 +145,8 @@ private void bindEEPackage(String jakartaEEVersion, String mpConfig, String mpOp 'mpConfig': mpConfig.toBoolean(), 'mpOpenAPI': mpOpenAPI.toBoolean(), 'mpFaultTolerance': mpFaultTolerance.toBoolean(), 'mpMetrics': mpMetrics.toBoolean(), 'formAuthFileRealm': auth.equals("formAuthFileRealm"), 'formAuthDB': auth.equals("formAuthDB"), - 'formAuthLDAP': auth.equals("formAuthLDAP") + 'formAuthLDAP': auth.equals("formAuthLDAP"), + 'erDiagram': erDiagram.toBoolean() ] def engine = new SimpleTemplateEngine() diff --git a/starter-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/starter-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml index 90ce97d..ad994cb 100644 --- a/starter-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml +++ b/starter-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -138,6 +138,13 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. none ^(none|formAuthFileRealm|formAuthDB|formAuthLDAP)$ + + false + ^(false|true)$ + + + + diff --git a/starter-archetype/src/main/resources/archetype-resources/src/main/webapp/index.html b/starter-archetype/src/main/resources/archetype-resources/src/main/webapp/index.html index 2da2e00..276459f 100644 --- a/starter-archetype/src/main/resources/archetype-resources/src/main/webapp/index.html +++ b/starter-archetype/src/main/resources/archetype-resources/src/main/webapp/index.html @@ -16,7 +16,6 @@ -

Greetings from Payara!

Thank you for visiting Payara! We're thrilled to have you here. Payara is your go-to destination for all things Jakarta EE and Java enterprise applications. @@ -24,13 +23,18 @@

Greetings from Payara!

Payara Logo

- + <% if (erDiagram) { %> +

${erDiagramName} Home Page

+

+ To manage the ${erDiagramName}, visit the home page: + Main Page. +

+ <% } %>

RESTful Service

The REST end-point is available at resources/hello. You can supply a name to the end-point using a query parameter like this: resources/hello?name=John

- <% if (formAuthFileRealm || formAuthDB || formAuthLDAP) { %>

Secure Pages

@@ -50,7 +54,6 @@

Secured RESTful Endpoints

  • Secured Admin Resource
  • <% } %> - <% if (mpOpenAPI) { %>

    API Documentation

    diff --git a/starter-ui/src/main/java/fish/payara/starter/resources/ApplicationConfiguration.java b/starter-ui/src/main/java/fish/payara/starter/resources/ApplicationConfiguration.java index b2a54c3..76e925b 100644 --- a/starter-ui/src/main/java/fish/payara/starter/resources/ApplicationConfiguration.java +++ b/starter-ui/src/main/java/fish/payara/starter/resources/ApplicationConfiguration.java @@ -73,7 +73,8 @@ public class ApplicationConfiguration { public static final String DEPLOY_WAR = "deployWar"; public static final String CONTEXT_ROOT = "contextRoot"; public static final String AUTH = "auth"; - public static final String ENTITIES = "entities"; + public static final String ER_DIAGRAM = "erDiagram"; + public static final String ER_DIAGRAM_NAME = "erDiagramName"; public static final String PAYARA_VERSION_6_2023_11 = "6.2023.11"; @@ -157,9 +158,13 @@ public class ApplicationConfiguration { @JsonbProperty(AUTH) private String auth = "none"; - - + + @JsonbProperty(ER_DIAGRAM) private String erDiagram = null; + + @JsonbProperty(ER_DIAGRAM_NAME) + private String erDiagramName = null; + private boolean generateJPA = true; private boolean generateRepository = true; private boolean generateRest = true; @@ -396,6 +401,14 @@ public void setErDiagram(String erDiagram) { this.erDiagram = erDiagram; } + public String getErDiagramName() { + return erDiagramName; + } + + public void setErDiagramName(String erDiagramName) { + this.erDiagramName = erDiagramName; + } + public boolean isGenerateJPA() { return generateJPA; } diff --git a/starter-ui/src/main/java/fish/payara/starter/resources/ApplicationGenerator.java b/starter-ui/src/main/java/fish/payara/starter/resources/ApplicationGenerator.java index d83665a..74b44e1 100644 --- a/starter-ui/src/main/java/fish/payara/starter/resources/ApplicationGenerator.java +++ b/starter-ui/src/main/java/fish/payara/starter/resources/ApplicationGenerator.java @@ -125,7 +125,8 @@ public Future generate(ApplicationConfiguration appProperties) { ERDiagramParser parser = new ERDiagramParser(); erModel = parser.parse(appProperties.getErDiagram()); if (erModel != null && !erModel.getEntities().isEmpty()) { - properties.put(ApplicationConfiguration.ENTITIES, appProperties.getAuth()); + properties.put(ApplicationConfiguration.ER_DIAGRAM, true); + properties.put(ApplicationConfiguration.ER_DIAGRAM_NAME, appProperties.getErDiagramName()); } } invokeMavenArchetype(ARCHETYPE_GROUP_ID, ARCHETYPE_ARTIFACT_ID, ARCHETYPE_VERSION, diff --git a/starter-ui/src/main/webapp/index.html b/starter-ui/src/main/webapp/index.html index a0817bb..7666ec7 100644 --- a/starter-ui/src/main/webapp/index.html +++ b/starter-ui/src/main/webapp/index.html @@ -425,7 +425,7 @@

    Simply select your options, and click ‘Generate’ - and Payara Pl

    - +