From 2d2b30e8dacedabd76781942d7b47a18d3300d21 Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Thu, 25 Mar 2021 13:26:08 +0530 Subject: [PATCH 01/31] commit1 tutorial for cobigen angular client generation commit1 tutorial for cobigen angular client generation --- .../index.asciidoc | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 cobigen-angular-client-generation/index.asciidoc diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc new file mode 100644 index 00000000..8005dae0 --- /dev/null +++ b/cobigen-angular-client-generation/index.asciidoc @@ -0,0 +1,30 @@ += CobiGen Angular client generation +==== +With the CobiGen code generator you can easily generate components for your angular application. +The following tutorial provides an example for using the CobiGen cli. +You can find more information on https://github.com/devonfw/cobigen/wiki/howto_angular-client-generation +==== + +[step] +-- +restoreDevonfwIde(["java", "mvn", "node", "ng", "npm"]) +-- + +For this tutorial an installation of the devonfw IDE is required, which was already set up for you. The next step is to install the CobiGen CLI. +[step] +-- +installCobigen() +-- + +CobiGen uses the backend classes for generating your code used in the angular application. So in the next steps you will create a java project, create a simple java class and run the backend server. +[step] +-- +createDevon4jProject("backend-server") +-- + +[step] +== Build and run the Java backend server +-- +buildJava("backend-server") +runServerJava("backend-server") +-- \ No newline at end of file From e09029aa4ddbb067d92fd0cb6c8178816c9466e8 Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Tue, 30 Mar 2021 17:15:10 +0530 Subject: [PATCH 02/31] rename to installCobiGen rename to installCobiGen() --- cobigen-angular-client-generation/index.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index 8005dae0..40fef89b 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -13,7 +13,7 @@ restoreDevonfwIde(["java", "mvn", "node", "ng", "npm"]) For this tutorial an installation of the devonfw IDE is required, which was already set up for you. The next step is to install the CobiGen CLI. [step] -- -installCobigen() +installCobiGen() -- CobiGen uses the backend classes for generating your code used in the angular application. So in the next steps you will create a java project, create a simple java class and run the backend server. From c04434aaad1cf833f28c87aef215e9c2761d9ea4 Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Thu, 1 Apr 2021 10:29:27 +0530 Subject: [PATCH 03/31] remove hyphen remove hyphen --- cobigen-angular-client-generation/index.asciidoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index 40fef89b..80d3c130 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -19,12 +19,12 @@ installCobiGen() CobiGen uses the backend classes for generating your code used in the angular application. So in the next steps you will create a java project, create a simple java class and run the backend server. [step] -- -createDevon4jProject("backend-server") +createDevon4jProject("backend server") -- [step] == Build and run the Java backend server -- -buildJava("backend-server") -runServerJava("backend-server") +buildJava("backend server") +runServerJava("backend server") -- \ No newline at end of file From 664670a5e81e148b0e44bed288a50adca4932d78 Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Thu, 1 Apr 2021 10:50:30 +0530 Subject: [PATCH 04/31] Update index.asciidoc Testing backendServer --- cobigen-angular-client-generation/index.asciidoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index 80d3c130..ee55fef3 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -19,12 +19,12 @@ installCobiGen() CobiGen uses the backend classes for generating your code used in the angular application. So in the next steps you will create a java project, create a simple java class and run the backend server. [step] -- -createDevon4jProject("backend server") +createDevon4jProject("backendServer") -- [step] == Build and run the Java backend server -- -buildJava("backend server") -runServerJava("backend server") +buildJava("backendServer") +runServerJava("backendServer") -- \ No newline at end of file From 00e9905b437d8280d8b0a460548b1fa8fd7149d3 Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Thu, 1 Apr 2021 19:32:25 +0530 Subject: [PATCH 05/31] updated to backendServer/server updated to backendServer/server --- cobigen-angular-client-generation/index.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index ee55fef3..5b902301 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -26,5 +26,5 @@ createDevon4jProject("backendServer") == Build and run the Java backend server -- buildJava("backendServer") -runServerJava("backendServer") +runServerJava("backendServer/server") -- \ No newline at end of file From 8db291ba92edd3e7bce1f153fc2f451d1551a091 Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Mon, 5 Apr 2021 11:12:10 +0530 Subject: [PATCH 06/31] tutorial for angular client generation with cobigen tutorial for angular client generation with cobigen --- cobigen-angular-client-generation/index.asciidoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index 5b902301..fbaa82d7 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -21,9 +21,8 @@ CobiGen uses the backend classes for generating your code used in the angular ap -- createDevon4jProject("backendServer") -- - +Build and run the Java backend server [step] -== Build and run the Java backend server -- buildJava("backendServer") runServerJava("backendServer/server") From e054940affe4adaebc1fac1209379b881a075fac Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Wed, 14 Apr 2021 09:25:10 +0530 Subject: [PATCH 07/31] added port added port --- cobigen-angular-client-generation/index.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index fbaa82d7..ab1a42f4 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -25,5 +25,5 @@ Build and run the Java backend server [step] -- buildJava("backendServer") -runServerJava("backendServer/server") +runServerJava("backendServer/server",{ "startupTime": 40, "port": 8081, "path": "backendServer" }) -- \ No newline at end of file From 6d191a225141523ccf2bcfd060192d2e2f46607b Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Wed, 14 Apr 2021 10:11:50 +0530 Subject: [PATCH 08/31] Added port Added port --- cobigen-angular-client-generation/index.asciidoc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index ab1a42f4..b915e7d5 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -21,9 +21,13 @@ CobiGen uses the backend classes for generating your code used in the angular ap -- createDevon4jProject("backendServer") -- -Build and run the Java backend server + +==== [step] +== Build and Run Java Server -- buildJava("backendServer") runServerJava("backendServer/server",{ "startupTime": 40, "port": 8081, "path": "backendServer" }) --- \ No newline at end of file +-- +Now the Java Server should be running. +==== \ No newline at end of file From 4b8a270d4dbace4ccf807459465ca78bc7177ea3 Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Wed, 14 Apr 2021 15:14:34 +0530 Subject: [PATCH 09/31] Update index.asciidoc Port changed --- cobigen-angular-client-generation/index.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index b915e7d5..000f48e1 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -27,7 +27,7 @@ createDevon4jProject("backendServer") == Build and Run Java Server -- buildJava("backendServer") -runServerJava("backendServer/server",{ "startupTime": 40, "port": 8081, "path": "backendServer" }) +runServerJava("backendServer/server",{ "startupTime": 40, "port": 5000, "path": "backendServer" }) -- Now the Java Server should be running. ==== \ No newline at end of file From 75a54c97891c9ce30415295a2bb51e1f43ac0d85 Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Wed, 14 Apr 2021 23:32:04 +0530 Subject: [PATCH 10/31] added angular client generation added angular client generation --- .../files/CustomerEntity.java | 60 +++++++++++++++++++ .../files/Placeholder.java | 9 +++ .../index.asciidoc | 51 ++++++++++++++-- 3 files changed, 116 insertions(+), 4 deletions(-) create mode 100644 cobigen-angular-client-generation/files/CustomerEntity.java create mode 100644 cobigen-angular-client-generation/files/Placeholder.java diff --git a/cobigen-angular-client-generation/files/CustomerEntity.java b/cobigen-angular-client-generation/files/CustomerEntity.java new file mode 100644 index 00000000..f16846c6 --- /dev/null +++ b/cobigen-angular-client-generation/files/CustomerEntity.java @@ -0,0 +1,60 @@ +package com.example.application.cobigenexample.customermanagement.dataaccess.api; + +import java.sql.Timestamp; + +import javax.persistence.Entity; +import javax.persistence.Table; + +@Entity +@Table(name = "Customer") +public class CustomerEntity { + + private String firstname; + + private String lastname; + + private int age; + + /** + * @return the firstname + */ + public String getFirstname() { + return firstname; + } + + /** + * @param firstname the firstname to set + */ + public void setFirstname(String firstname) { + this.firstname = firstname; + } + + /** + * @return the lastname + */ + public String getLastname() { + return lastname; + } + + /** + * @param lastname the lastname to set + */ + public void setLastname(String lastname) { + this.lastname = lastname; + } + + /** + * @return the age + */ + public int getAge() { + return age; + } + + /** + * @param age the age to set + */ + public void setAge(int age) { + this.age = age; + } + +} \ No newline at end of file diff --git a/cobigen-angular-client-generation/files/Placeholder.java b/cobigen-angular-client-generation/files/Placeholder.java new file mode 100644 index 00000000..9b5cedde --- /dev/null +++ b/cobigen-angular-client-generation/files/Placeholder.java @@ -0,0 +1,9 @@ +private int age; +private String company; + +public String getCompany() { + return company; +} +public void setCompany(String company) { + this.company = company; +} \ No newline at end of file diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index 000f48e1..be6b359a 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -19,15 +19,58 @@ installCobiGen() CobiGen uses the backend classes for generating your code used in the angular application. So in the next steps you will create a java project, create a simple java class and run the backend server. [step] -- -createDevon4jProject("backendServer") +createDevon4jProject("cobigenexample") -- ==== [step] == Build and Run Java Server -- -buildJava("backendServer") -runServerJava("backendServer/server",{ "startupTime": 40, "port": 5000, "path": "backendServer" }) +buildJava("cobigenexample") +runServerJava("cobigenexample/server",{ "startupTime": 180, "port": 8081, "path": "backendServer" }) -- Now the Java Server should be running. -==== \ No newline at end of file +==== + +CobiGen is integrated via plugin in the VS Code IDE. We will use it to generate code from one single java class based on existing templates. +[step] +-- +createDevon4ngProject("cobigenexample", "") +runClientNg("cobigenexample/angular", { "startupTime": 200, "port": 4200, "path": "" }) +createFile("cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/dataaccess/api/CustomerEntity.java", "files/CustomerEntity.java") +adaptTemplatesCobiGen() +cobiGenJava("cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/dataaccess/api/CustomerEntity.java",[1,3,5,6,8]) +-- +The CobiGen code generator will generate some java classes for you. These contain code for basic CRUD operations, REST service handling and data access. + +For example, the following files are generated by CobiGen when using the specified templates: + +(1) CRUD logic: Generates the logic layer and implementations for some use cases. +- `devonfw/workspaces/main/cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/logic/impl/CustomermanagementImpl.java`{{open}} +- `devonfw/workspaces/main/cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/logic/impl/usecase/UcManageCustomerImpl.java`{{open}} +- `devonfw/workspaces/main/cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/logic/impl/usecase/UcFindCustomerImpl.java`{{open}} +- `devonfw/workspaces/main/cobigenexample/api/src/main/java/com/example/application/cobigenexample/customermanagement/logic/api/Customermanagement.java`{{open}} + +(3) CRUD REST services: Generates the service layer with CRUD operations for using in REST services. +- `devonfw/workspaces/main/cobigenexample/api/src/main/java/com/example/application/cobigenexample/customermanagement/service/api/rest/CustomermanagementRestService.java`{{open}} +- `devonfw/workspaces/main/cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/service/impl/rest/CustomermanagementRestServiceImpl.java`{{open}} + +(5) TO's: Generates the related Transfer Objects. +- `devonfw/workspaces/main/cobigenexample/api/src/main/java/com/example/application/cobigenexample/customermanagement/logic/api/to/CustomerEto.java`{{open}} +- `devonfw/workspaces/main/cobigenexample/api/src/main/java/com/example/application/cobigenexample/customermanagement/logic/api/to/CustomerSearchCriteriaTo.java`{{open}} + +(6) Entity infrastructure: Creates the entity main interface and edits (by a merge) the current entity to extend the newly generated classes. +- `devonfw/workspaces/main/cobigenexample/api/src/main/java/com/example/application/cobigenexample/customermanagement/common/api/Customer.java`{{open}} +- `devonfw/workspaces/main/cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/dataaccess/api/CustomerEntity.java`{{open}} (changed) + +(8) CRUD SpringData Repository: Generates the entity repository (that contains the CRUD operations) in the data access layer. +- `devonfw/workspaces/main/cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/dataaccess/api/repo/CustomerRepository.java`{{open}} +==== + +Furthermore, we can change the CustomerEntity afterwards and update our source files simply by running cobigen again. +[step] +== Change Entity and run cobigen again +-- +changeFile("cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/dataaccess/api/CustomerEntity.java", { "file": "files/Placeholder.java", "placeholder": "private int age;" }) +cobiGenJava("cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/dataaccess/api/CustomerEntity.java",[1,3,5,6,8]) +-- \ No newline at end of file From 63bc32ad5c969859ba1ae88a2e249eb52859f9e1 Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Thu, 15 Apr 2021 10:15:37 +0530 Subject: [PATCH 11/31] changed to cobigenexample changed to cobigenexample --- cobigen-angular-client-generation/index.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index be6b359a..a28ff3e4 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -27,7 +27,7 @@ createDevon4jProject("cobigenexample") == Build and Run Java Server -- buildJava("cobigenexample") -runServerJava("cobigenexample/server",{ "startupTime": 180, "port": 8081, "path": "backendServer" }) +runServerJava("cobigenexample/server",{ "startupTime": 180, "port": 8081, "path": "cobigenexample" }) -- Now the Java Server should be running. ==== From 49cdc6a96b854a5936e3061c1e42fe833eeeb9e8 Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Thu, 15 Apr 2021 10:51:25 +0530 Subject: [PATCH 12/31] added Prerequisites and Learning goals added Prerequisites and Learning goals --- cobigen-angular-client-generation/index.asciidoc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index a28ff3e4..9b1869e8 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -3,6 +3,15 @@ With the CobiGen code generator you can easily generate components for your angular application. The following tutorial provides an example for using the CobiGen cli. You can find more information on https://github.com/devonfw/cobigen/wiki/howto_angular-client-generation +== Prerequisites +* devonfw Ide +* Install yarn globally +== Learning goals. +Here in this tutorial we will learn the following: +* Create an angular project +* Cobigen to generate the angular source code out of the java files +* Change the user interface in the angular project to show the new components +* Show the newly created components ==== [step] From f7fbe224d417507090bbe1a4a292023c07e9716f Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Thu, 15 Apr 2021 16:46:34 +0530 Subject: [PATCH 13/31] changed port number changed port number --- cobigen-angular-client-generation/index.asciidoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index 9b1869e8..425ef02f 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -36,7 +36,7 @@ createDevon4jProject("cobigenexample") == Build and Run Java Server -- buildJava("cobigenexample") -runServerJava("cobigenexample/server",{ "startupTime": 180, "port": 8081, "path": "cobigenexample" }) +runServerJava("cobigenexample/server",{ "startupTime": 180, "port": 8080, "path": "cobigenexample" }) -- Now the Java Server should be running. ==== @@ -45,6 +45,7 @@ CobiGen is integrated via plugin in the VS Code IDE. We will use it to generate [step] -- createDevon4ngProject("cobigenexample", "") +buildNg("cobigenexample") runClientNg("cobigenexample/angular", { "startupTime": 200, "port": 4200, "path": "" }) createFile("cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/dataaccess/api/CustomerEntity.java", "files/CustomerEntity.java") adaptTemplatesCobiGen() From afb0eb4631851d4bf4213b51e9024f37d195eb76 Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Mon, 19 Apr 2021 13:16:27 +0530 Subject: [PATCH 14/31] changed projectname changed projectname --- cobigen-angular-client-generation/index.asciidoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index 425ef02f..ab6cb13e 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -28,15 +28,15 @@ installCobiGen() CobiGen uses the backend classes for generating your code used in the angular application. So in the next steps you will create a java project, create a simple java class and run the backend server. [step] -- -createDevon4jProject("cobigenexample") +createDevon4jProject("cobigenangularexample") -- ==== [step] == Build and Run Java Server -- -buildJava("cobigenexample") -runServerJava("cobigenexample/server",{ "startupTime": 180, "port": 8080, "path": "cobigenexample" }) +buildJava("cobigenangularexample") +runServerJava("cobigenangularexample/server",{ "startupTime": 180, "port": 8080, "path": "cobigenangularexample" }) -- Now the Java Server should be running. ==== From 3458de294b133580ac3d40e0145a669f784eb53b Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Mon, 19 Apr 2021 13:47:44 +0530 Subject: [PATCH 15/31] prerequisites and learning goals changed prerequisites and learning goals changed --- cobigen-angular-client-generation/index.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index ab6cb13e..26ed28cd 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -3,10 +3,10 @@ With the CobiGen code generator you can easily generate components for your angular application. The following tutorial provides an example for using the CobiGen cli. You can find more information on https://github.com/devonfw/cobigen/wiki/howto_angular-client-generation -== Prerequisites +## Prerequisites * devonfw Ide * Install yarn globally -== Learning goals. +## Learning goals. Here in this tutorial we will learn the following: * Create an angular project * Cobigen to generate the angular source code out of the java files From 1c7b2ad2cf91fc278f1eef26ebf7db63329b140b Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Mon, 19 Apr 2021 17:01:44 +0530 Subject: [PATCH 16/31] title changed title changed --- cobigen-angular-client-generation/index.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index 26ed28cd..2a8fd666 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -1,4 +1,4 @@ -= CobiGen Angular client generation += Generate Angular Client with devonfw ==== With the CobiGen code generator you can easily generate components for your angular application. The following tutorial provides an example for using the CobiGen cli. From b94221cc2c9487a00997d0c933ad723537b974b3 Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Wed, 21 Apr 2021 13:19:09 +0530 Subject: [PATCH 17/31] rename cobigenjavaexample rename cobigenjavaexample --- .../index.asciidoc | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index 2a8fd666..1872ad8f 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -28,15 +28,15 @@ installCobiGen() CobiGen uses the backend classes for generating your code used in the angular application. So in the next steps you will create a java project, create a simple java class and run the backend server. [step] -- -createDevon4jProject("cobigenangularexample") +createDevon4jProject("cobigenjavaexample") -- ==== [step] == Build and Run Java Server -- -buildJava("cobigenangularexample") -runServerJava("cobigenangularexample/server",{ "startupTime": 180, "port": 8080, "path": "cobigenangularexample" }) +buildJava("cobigenjavaexample") +runServerJava("cobigenjavaexample/server",{ "startupTime": 180, "port": 8080, "path": "cobigenjavaexample" }) -- Now the Java Server should be running. ==== @@ -44,43 +44,43 @@ Now the Java Server should be running. CobiGen is integrated via plugin in the VS Code IDE. We will use it to generate code from one single java class based on existing templates. [step] -- -createDevon4ngProject("cobigenexample", "") -buildNg("cobigenexample") -runClientNg("cobigenexample/angular", { "startupTime": 200, "port": 4200, "path": "" }) -createFile("cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/dataaccess/api/CustomerEntity.java", "files/CustomerEntity.java") +createDevon4ngProject("cobigenangularexample", "") +buildNg("cobigenangularexample") +runClientNg("cobigenangularexample/angular", { "startupTime": 200, "port": 4200, "path": "" }) +createFile("cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/dataaccess/api/CustomerEntity.java", "files/CustomerEntity.java") adaptTemplatesCobiGen() -cobiGenJava("cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/dataaccess/api/CustomerEntity.java",[1,3,5,6,8]) +cobiGenJava("cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/dataaccess/api/CustomerEntity.java",[1,3,5,6,8]) -- The CobiGen code generator will generate some java classes for you. These contain code for basic CRUD operations, REST service handling and data access. For example, the following files are generated by CobiGen when using the specified templates: (1) CRUD logic: Generates the logic layer and implementations for some use cases. -- `devonfw/workspaces/main/cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/logic/impl/CustomermanagementImpl.java`{{open}} -- `devonfw/workspaces/main/cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/logic/impl/usecase/UcManageCustomerImpl.java`{{open}} -- `devonfw/workspaces/main/cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/logic/impl/usecase/UcFindCustomerImpl.java`{{open}} -- `devonfw/workspaces/main/cobigenexample/api/src/main/java/com/example/application/cobigenexample/customermanagement/logic/api/Customermanagement.java`{{open}} +- `devonfw/workspaces/main/cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/logic/impl/CustomermanagementImpl.java`{{open}} +- `devonfw/workspaces/main/cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/logic/impl/usecase/UcManageCustomerImpl.java`{{open}} +- `devonfw/workspaces/main/cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/logic/impl/usecase/UcFindCustomerImpl.java`{{open}} +- `devonfw/workspaces/main/cobigenangularexample/api/src/main/java/com/example/application/cobigenangularexample/customermanagement/logic/api/Customermanagement.java`{{open}} (3) CRUD REST services: Generates the service layer with CRUD operations for using in REST services. -- `devonfw/workspaces/main/cobigenexample/api/src/main/java/com/example/application/cobigenexample/customermanagement/service/api/rest/CustomermanagementRestService.java`{{open}} -- `devonfw/workspaces/main/cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/service/impl/rest/CustomermanagementRestServiceImpl.java`{{open}} +- `devonfw/workspaces/main/cobigenangularexample/api/src/main/java/com/example/application/cobigenangularexample/customermanagement/service/api/rest/CustomermanagementRestService.java`{{open}} +- `devonfw/workspaces/main/cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/service/impl/rest/CustomermanagementRestServiceImpl.java`{{open}} (5) TO's: Generates the related Transfer Objects. -- `devonfw/workspaces/main/cobigenexample/api/src/main/java/com/example/application/cobigenexample/customermanagement/logic/api/to/CustomerEto.java`{{open}} -- `devonfw/workspaces/main/cobigenexample/api/src/main/java/com/example/application/cobigenexample/customermanagement/logic/api/to/CustomerSearchCriteriaTo.java`{{open}} +- `devonfw/workspaces/main/cobigenangularexample/api/src/main/java/com/example/application/cobigenangularexample/customermanagement/logic/api/to/CustomerEto.java`{{open}} +- `devonfw/workspaces/main/cobigenangularexample/api/src/main/java/com/example/application/cobigenangularexample/customermanagement/logic/api/to/CustomerSearchCriteriaTo.java`{{open}} (6) Entity infrastructure: Creates the entity main interface and edits (by a merge) the current entity to extend the newly generated classes. -- `devonfw/workspaces/main/cobigenexample/api/src/main/java/com/example/application/cobigenexample/customermanagement/common/api/Customer.java`{{open}} -- `devonfw/workspaces/main/cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/dataaccess/api/CustomerEntity.java`{{open}} (changed) +- `devonfw/workspaces/main/cobigenangularexample/api/src/main/java/com/example/application/cobigenangularexample/customermanagement/common/api/Customer.java`{{open}} +- `devonfw/workspaces/main/cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/dataaccess/api/CustomerEntity.java`{{open}} (changed) (8) CRUD SpringData Repository: Generates the entity repository (that contains the CRUD operations) in the data access layer. -- `devonfw/workspaces/main/cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/dataaccess/api/repo/CustomerRepository.java`{{open}} +- `devonfw/workspaces/main/cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/dataaccess/api/repo/CustomerRepository.java`{{open}} ==== Furthermore, we can change the CustomerEntity afterwards and update our source files simply by running cobigen again. [step] == Change Entity and run cobigen again -- -changeFile("cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/dataaccess/api/CustomerEntity.java", { "file": "files/Placeholder.java", "placeholder": "private int age;" }) -cobiGenJava("cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/dataaccess/api/CustomerEntity.java",[1,3,5,6,8]) +changeFile("cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/dataaccess/api/CustomerEntity.java", { "file": "files/Placeholder.java", "placeholder": "private int age;" }) +cobiGenJava("cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/dataaccess/api/CustomerEntity.java",[1,3,5,6,8]) -- \ No newline at end of file From 7c2f64a3cd88434045c299ef54cfb7dc437ca8f0 Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Wed, 21 Apr 2021 14:03:01 +0530 Subject: [PATCH 18/31] rename cobigenexample to cobigenangularexample rename cobigenexample to cobigenangularexample --- cobigen-angular-client-generation/files/CustomerEntity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cobigen-angular-client-generation/files/CustomerEntity.java b/cobigen-angular-client-generation/files/CustomerEntity.java index f16846c6..b820bdbd 100644 --- a/cobigen-angular-client-generation/files/CustomerEntity.java +++ b/cobigen-angular-client-generation/files/CustomerEntity.java @@ -1,4 +1,4 @@ -package com.example.application.cobigenexample.customermanagement.dataaccess.api; +package com.example.application.cobigenangularexample.customermanagement.dataaccess.api; import java.sql.Timestamp; From c951a28f61a8c3ddc5d152971da01201eb1fc5af Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Wed, 21 Apr 2021 15:32:18 +0530 Subject: [PATCH 19/31] conclusion added conclusion added --- cobigen-angular-client-generation/index.asciidoc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index 1872ad8f..8d8c55da 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -83,4 +83,11 @@ Furthermore, we can change the CustomerEntity afterwards and update our source f -- changeFile("cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/dataaccess/api/CustomerEntity.java", { "file": "files/Placeholder.java", "placeholder": "private int age;" }) cobiGenJava("cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/dataaccess/api/CustomerEntity.java",[1,3,5,6,8]) --- \ No newline at end of file +-- +==== +Conclusion: In this Tutorial we learned the following things below. +Create an angular project +Cobigen to generate the angular source code out of the java files +Change the user interface in the angular project to show the new components +Show the newly created components +==== \ No newline at end of file From ec0a3d7f5688a86e9193d906f2ef9aa4da8133bd Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Wed, 21 Apr 2021 20:17:06 +0530 Subject: [PATCH 20/31] adding Subtitle adding Subtitle --- cobigen-angular-client-generation/index.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index 8d8c55da..6d158cf1 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -1,4 +1,5 @@ = Generate Angular Client with devonfw +== angular client generation with cobigen ==== With the CobiGen code generator you can easily generate components for your angular application. The following tutorial provides an example for using the CobiGen cli. From 4b84226e565895a096f0debb04265e51bb12beb9 Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Tue, 27 Apr 2021 19:21:06 +0530 Subject: [PATCH 21/31] Update index.asciidoc ==== is missing and vscode added --- cobigen-angular-client-generation/index.asciidoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index 6d158cf1..90408f70 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -17,7 +17,7 @@ Here in this tutorial we will learn the following: [step] -- -restoreDevonfwIde(["java", "mvn", "node", "ng", "npm"]) +restoreDevonfwIde(["java", "mvn", "vscode", "node", "ng", "npm"]) -- For this tutorial an installation of the devonfw IDE is required, which was already set up for you. The next step is to install the CobiGen CLI. @@ -86,6 +86,7 @@ changeFile("cobigenangularexample/core/src/main/java/com/example/application/cob cobiGenJava("cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/dataaccess/api/CustomerEntity.java",[1,3,5,6,8]) -- ==== +==== Conclusion: In this Tutorial we learned the following things below. Create an angular project Cobigen to generate the angular source code out of the java files From af5ea9c819f570583724b2e985d8592fd5906f1a Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Tue, 27 Apr 2021 20:01:18 +0530 Subject: [PATCH 22/31] removed ==== removed ==== --- cobigen-angular-client-generation/index.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index 90408f70..f184f2a2 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -85,7 +85,7 @@ Furthermore, we can change the CustomerEntity afterwards and update our source f changeFile("cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/dataaccess/api/CustomerEntity.java", { "file": "files/Placeholder.java", "placeholder": "private int age;" }) cobiGenJava("cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/dataaccess/api/CustomerEntity.java",[1,3,5,6,8]) -- -==== + ==== Conclusion: In this Tutorial we learned the following things below. Create an angular project From 3a59430b94928633a7c8ec8cedeb13ca2c1a8e75 Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Wed, 28 Apr 2021 22:00:32 +0530 Subject: [PATCH 23/31] comments fixed comments fixed --- cobigen-angular-client-generation/index.asciidoc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index f184f2a2..dc1390a6 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -1,5 +1,5 @@ = Generate Angular Client with devonfw -== angular client generation with cobigen +== Angular client generation with CobiGen ==== With the CobiGen code generator you can easily generate components for your angular application. The following tutorial provides an example for using the CobiGen cli. @@ -7,10 +7,11 @@ You can find more information on https://github.com/devonfw/cobigen/wiki/howto_a ## Prerequisites * devonfw Ide * Install yarn globally + ## Learning goals. Here in this tutorial we will learn the following: -* Create an angular project -* Cobigen to generate the angular source code out of the java files +* Create an Angular project +* CobiGen to generate the angular source code out of the java files * Change the user interface in the angular project to show the new components * Show the newly created components ==== @@ -45,9 +46,9 @@ Now the Java Server should be running. CobiGen is integrated via plugin in the VS Code IDE. We will use it to generate code from one single java class based on existing templates. [step] -- -createDevon4ngProject("cobigenangularexample", "") +createDevon4ngProject("cobigenangularexample", "", ["--style=scss", "--routing=true", "--strict=false"]) buildNg("cobigenangularexample") -runClientNg("cobigenangularexample/angular", { "startupTime": 200, "port": 4200, "path": "" }) +runClientNg("cobigenangularexample", { "startupTime": 200, "port": 4200, "path": "" }) createFile("cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/dataaccess/api/CustomerEntity.java", "files/CustomerEntity.java") adaptTemplatesCobiGen() cobiGenJava("cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/dataaccess/api/CustomerEntity.java",[1,3,5,6,8]) @@ -88,8 +89,8 @@ cobiGenJava("cobigenangularexample/core/src/main/java/com/example/application/co ==== Conclusion: In this Tutorial we learned the following things below. -Create an angular project -Cobigen to generate the angular source code out of the java files +Create an Angular project +CobiGen to generate the angular source code out of the java files Change the user interface in the angular project to show the new components Show the newly created components ==== \ No newline at end of file From baaf8f54554b87d5bb3ecb4d20a1fe215c9eb241 Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Thu, 29 Apr 2021 20:03:08 +0530 Subject: [PATCH 24/31] restructuring the code restructuring the code --- .../files/CustomerEntity.java | 2 +- .../files/Placeholder.java | 9 --- .../index.asciidoc | 68 +++++++------------ 3 files changed, 24 insertions(+), 55 deletions(-) delete mode 100644 cobigen-angular-client-generation/files/Placeholder.java diff --git a/cobigen-angular-client-generation/files/CustomerEntity.java b/cobigen-angular-client-generation/files/CustomerEntity.java index b820bdbd..2527a4da 100644 --- a/cobigen-angular-client-generation/files/CustomerEntity.java +++ b/cobigen-angular-client-generation/files/CustomerEntity.java @@ -1,4 +1,4 @@ -package com.example.application.cobigenangularexample.customermanagement.dataaccess.api; +package com.example.application.cobigenjavaexample.customermanagement.dataaccess.api; import java.sql.Timestamp; diff --git a/cobigen-angular-client-generation/files/Placeholder.java b/cobigen-angular-client-generation/files/Placeholder.java deleted file mode 100644 index 9b5cedde..00000000 --- a/cobigen-angular-client-generation/files/Placeholder.java +++ /dev/null @@ -1,9 +0,0 @@ -private int age; -private String company; - -public String getCompany() { - return company; -} -public void setCompany(String company) { - this.company = company; -} \ No newline at end of file diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index dc1390a6..5e10b0da 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -1,24 +1,22 @@ = Generate Angular Client with devonfw == Angular client generation with CobiGen ==== -With the CobiGen code generator you can easily generate components for your angular application. +With the CobiGen code generator you can easily generate components for your Angular application. The following tutorial provides an example for using the CobiGen cli. You can find more information on https://github.com/devonfw/cobigen/wiki/howto_angular-client-generation ## Prerequisites * devonfw Ide -* Install yarn globally ## Learning goals. Here in this tutorial we will learn the following: -* Create an Angular project -* CobiGen to generate the angular source code out of the java files -* Change the user interface in the angular project to show the new components -* Show the newly created components +* Create java project +* CobiGen to generate the Angular source code out of the java files + ==== [step] -- -restoreDevonfwIde(["java", "mvn", "vscode", "node", "ng", "npm"]) +restoreDevonfwIde(["java", "mvn", "vscode"]) -- For this tutorial an installation of the devonfw IDE is required, which was already set up for you. The next step is to install the CobiGen CLI. @@ -27,7 +25,7 @@ For this tutorial an installation of the devonfw IDE is required, which was alre installCobiGen() -- -CobiGen uses the backend classes for generating your code used in the angular application. So in the next steps you will create a java project, create a simple java class and run the backend server. +CobiGen uses the backend classes for generating your code used in the Angular application. So in the next steps you will create a java project, create a simple java class. [step] -- createDevon4jProject("cobigenjavaexample") @@ -35,62 +33,42 @@ createDevon4jProject("cobigenjavaexample") ==== [step] -== Build and Run Java Server +== Build the java project -- buildJava("cobigenjavaexample") -runServerJava("cobigenjavaexample/server",{ "startupTime": 180, "port": 8080, "path": "cobigenjavaexample" }) -- -Now the Java Server should be running. + ==== CobiGen is integrated via plugin in the VS Code IDE. We will use it to generate code from one single java class based on existing templates. [step] -- -createDevon4ngProject("cobigenangularexample", "", ["--style=scss", "--routing=true", "--strict=false"]) -buildNg("cobigenangularexample") -runClientNg("cobigenangularexample", { "startupTime": 200, "port": 4200, "path": "" }) -createFile("cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/dataaccess/api/CustomerEntity.java", "files/CustomerEntity.java") + +createFile("cobigenjavaexample/core/src/main/java/com/example/application/cobigenjavaexample/customermanagement/dataaccess/api/CustomerEntity.java", "files/CustomerEntity.java") adaptTemplatesCobiGen() -cobiGenJava("cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/dataaccess/api/CustomerEntity.java",[1,3,5,6,8]) +cobiGenJava("cobigenjavaexample/core/src/main/java/com/example/application/cobigenjavaexample/customermanagement/dataaccess/api/CustomerEntity.java",[5]) -- -The CobiGen code generator will generate some java classes for you. These contain code for basic CRUD operations, REST service handling and data access. +The CobiGen code generator will generate some java classes for you. These contain code for Transfer object, REST service handling and data access and so on. For example, the following files are generated by CobiGen when using the specified templates: -(1) CRUD logic: Generates the logic layer and implementations for some use cases. -- `devonfw/workspaces/main/cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/logic/impl/CustomermanagementImpl.java`{{open}} -- `devonfw/workspaces/main/cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/logic/impl/usecase/UcManageCustomerImpl.java`{{open}} -- `devonfw/workspaces/main/cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/logic/impl/usecase/UcFindCustomerImpl.java`{{open}} -- `devonfw/workspaces/main/cobigenangularexample/api/src/main/java/com/example/application/cobigenangularexample/customermanagement/logic/api/Customermanagement.java`{{open}} - -(3) CRUD REST services: Generates the service layer with CRUD operations for using in REST services. -- `devonfw/workspaces/main/cobigenangularexample/api/src/main/java/com/example/application/cobigenangularexample/customermanagement/service/api/rest/CustomermanagementRestService.java`{{open}} -- `devonfw/workspaces/main/cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/service/impl/rest/CustomermanagementRestServiceImpl.java`{{open}} - (5) TO's: Generates the related Transfer Objects. -- `devonfw/workspaces/main/cobigenangularexample/api/src/main/java/com/example/application/cobigenangularexample/customermanagement/logic/api/to/CustomerEto.java`{{open}} -- `devonfw/workspaces/main/cobigenangularexample/api/src/main/java/com/example/application/cobigenangularexample/customermanagement/logic/api/to/CustomerSearchCriteriaTo.java`{{open}} - -(6) Entity infrastructure: Creates the entity main interface and edits (by a merge) the current entity to extend the newly generated classes. -- `devonfw/workspaces/main/cobigenangularexample/api/src/main/java/com/example/application/cobigenangularexample/customermanagement/common/api/Customer.java`{{open}} -- `devonfw/workspaces/main/cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/dataaccess/api/CustomerEntity.java`{{open}} (changed) +- `devonfw/workspaces/main/cobigenjavaexample/api/src/main/java/com/example/application/cobigenjavaexample/customermanagement/logic/api/to/CustomerEto.java`{{open}} +- `devonfw/workspaces/main/cobigenjavaexample/api/src/main/java/com/example/application/cobigenjavaexample/customermanagement/logic/api/to/CustomerSearchCriteriaTo.java`{{open}} -(8) CRUD SpringData Repository: Generates the entity repository (that contains the CRUD operations) in the data access layer. -- `devonfw/workspaces/main/cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/dataaccess/api/repo/CustomerRepository.java`{{open}} ==== - -Furthermore, we can change the CustomerEntity afterwards and update our source files simply by running cobigen again. +==== +Now you can go through api module of your java project and use Cobigen again to generate your client. [step] -== Change Entity and run cobigen again +== Running CobiGen to generate to your Angular code -- -changeFile("cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/dataaccess/api/CustomerEntity.java", { "file": "files/Placeholder.java", "placeholder": "private int age;" }) -cobiGenJava("cobigenangularexample/core/src/main/java/com/example/application/cobigenangularexample/customermanagement/dataaccess/api/CustomerEntity.java",[1,3,5,6,8]) +cobiGenJava("cobigenjavaexample/api/src/main/java/com/example/application/cobigenjavaexample/customermanagement/logic/api/to/CustomerEto.java",[1]) -- - +your Angular client will be generated inside your devon4ng-application-template/src folder. +==== ==== Conclusion: In this Tutorial we learned the following things below. -Create an Angular project -CobiGen to generate the angular source code out of the java files -Change the user interface in the angular project to show the new components -Show the newly created components +Create an java project +CobiGen to generate the Angular source code out of the java files + ==== \ No newline at end of file From 393b9e5520a581deb98d1899d0a3dad93ea7d0b3 Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Thu, 29 Apr 2021 20:11:54 +0530 Subject: [PATCH 25/31] fix syntax fix syntax --- cobigen-angular-client-generation/index.asciidoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index 5e10b0da..4d2910fb 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -37,9 +37,8 @@ createDevon4jProject("cobigenjavaexample") -- buildJava("cobigenjavaexample") -- - ==== - +==== CobiGen is integrated via plugin in the VS Code IDE. We will use it to generate code from one single java class based on existing templates. [step] -- From 85382a36752d03bf0e2e98548e1a84a879314f2b Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Wed, 5 May 2021 23:09:05 +0530 Subject: [PATCH 26/31] Update index.asciidoc comment fixed --- cobigen-angular-client-generation/index.asciidoc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index 4d2910fb..4e0c16ab 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -19,13 +19,13 @@ Here in this tutorial we will learn the following: restoreDevonfwIde(["java", "mvn", "vscode"]) -- -For this tutorial an installation of the devonfw IDE is required, which was already set up for you. The next step is to install the CobiGen CLI. +For this tutorial an installation of the devonfw IDE is required first time you use it. The next step is to install the CobiGen CLI. [step] -- installCobiGen() -- -CobiGen uses the backend classes for generating your code used in the Angular application. So in the next steps you will create a java project, create a simple java class. +CobiGen is build as an extensible framework for incremental code generation. It provides extension points for new input readers which allow reading new input types and converting them to an internally processed model.CobiGen uses the backend classes for generating your code used in the Angular application. So in the next steps you will create a java project, create a simple java class. [step] -- createDevon4jProject("cobigenjavaexample") @@ -63,7 +63,9 @@ Now you can go through api module of your java project and use Cobigen again to -- cobiGenJava("cobigenjavaexample/api/src/main/java/com/example/application/cobigenjavaexample/customermanagement/logic/api/to/CustomerEto.java",[1]) -- -your Angular client will be generated inside your devon4ng-application-template/src folder. +Angular client will be generated inside devon4ng-application-template/src folder. +Client application for displaying your entities within minutes. + ==== ==== Conclusion: In this Tutorial we learned the following things below. From 5403decf27b7ab9d730cbeb4e571fe2592a4a378 Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Thu, 6 May 2021 16:32:39 +0530 Subject: [PATCH 27/31] adding steps adding steps --- cobigen-angular-client-generation/index.asciidoc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index 4e0c16ab..3ee9b389 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -64,10 +64,12 @@ Now you can go through api module of your java project and use Cobigen again to cobiGenJava("cobigenjavaexample/api/src/main/java/com/example/application/cobigenjavaexample/customermanagement/logic/api/to/CustomerEto.java",[1]) -- Angular client will be generated inside devon4ng-application-template/src folder. -Client application for displaying your entities within minutes. +Your client application for displaying your entities has been generated within minutes.Now you can check your angular client by running Angular application. +[step] +-- +runClientNg("devon4ng-application-template"), { "startupTime": 200, "port": 4200, "path": "" }) +-- -==== -==== Conclusion: In this Tutorial we learned the following things below. Create an java project CobiGen to generate the Angular source code out of the java files From fbc4e5642f1a21fd6561db38e82499f5f728f648 Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Thu, 6 May 2021 18:35:05 +0530 Subject: [PATCH 28/31] text added text added --- cobigen-angular-client-generation/index.asciidoc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index 3ee9b389..25be4af8 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -63,15 +63,19 @@ Now you can go through api module of your java project and use Cobigen again to -- cobiGenJava("cobigenjavaexample/api/src/main/java/com/example/application/cobigenjavaexample/customermanagement/logic/api/to/CustomerEto.java",[1]) -- -Angular client will be generated inside devon4ng-application-template/src folder. -Your client application for displaying your entities has been generated within minutes.Now you can check your angular client by running Angular application. +The angular code generation is done now and the generated code is stored in the workspace/main/devon4ng-applicaiton-template directory. Make sure the backend server url is configured in environemts/enviroment.ts file. + +The below commands are used, to run the angular front end. +npm install +ng serve + [step] -- runClientNg("devon4ng-application-template"), { "startupTime": 200, "port": 4200, "path": "" }) -- Conclusion: In this Tutorial we learned the following things below. -Create an java project -CobiGen to generate the Angular source code out of the java files +How to create a java project +How to generate the Angular source code using CobiGen ==== \ No newline at end of file From c84e0a9bcf2d648a4b72b15bfa51634100319948 Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Mon, 10 May 2021 17:08:49 +0530 Subject: [PATCH 29/31] spelling fixed spelling fixed --- cobigen-angular-client-generation/index.asciidoc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index 25be4af8..18742b0f 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -31,13 +31,13 @@ CobiGen is build as an extensible framework for incremental code generation. It createDevon4jProject("cobigenjavaexample") -- -==== +This step is for building the java project. [step] == Build the java project -- buildJava("cobigenjavaexample") -- -==== + ==== CobiGen is integrated via plugin in the VS Code IDE. We will use it to generate code from one single java class based on existing templates. [step] @@ -63,7 +63,9 @@ Now you can go through api module of your java project and use Cobigen again to -- cobiGenJava("cobigenjavaexample/api/src/main/java/com/example/application/cobigenjavaexample/customermanagement/logic/api/to/CustomerEto.java",[1]) -- -The angular code generation is done now and the generated code is stored in the workspace/main/devon4ng-applicaiton-template directory. Make sure the backend server url is configured in environemts/enviroment.ts file. +The angular code generation is done now and the generated code is stored in the workspace/main/devon4ng-applicaiton-template directory. Make sure the backend server url is configured in environments/environment.ts file. + +==== The below commands are used, to run the angular front end. npm install @@ -71,11 +73,10 @@ ng serve [step] -- -runClientNg("devon4ng-application-template"), { "startupTime": 200, "port": 4200, "path": "" }) +runClientNg("devon4ng-application-template", { "startupTime": 200, "port": 4200, "path": "" }) -- - +==== Conclusion: In this Tutorial we learned the following things below. How to create a java project -How to generate the Angular source code using CobiGen - +How to generate the Angular source code using CobiGen ==== \ No newline at end of file From 2df2803db3dd97d31c5c7b6af5182f8c1d1d3dab Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Mon, 10 May 2021 18:45:25 +0530 Subject: [PATCH 30/31] Update index.asciidoc conclusion added --- cobigen-angular-client-generation/index.asciidoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index 18742b0f..ef1aa172 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -76,7 +76,7 @@ ng serve runClientNg("devon4ng-application-template", { "startupTime": 200, "port": 4200, "path": "" }) -- ==== -Conclusion: In this Tutorial we learned the following things below. -How to create a java project -How to generate the Angular source code using CobiGen +Conclusion: In this Tutorial we learned the following things. +* How to create a java project. +* How to generate the Angular source code using CobiGen. ==== \ No newline at end of file From 8984313b13637a0b327b39b63515c1694d6ae8b2 Mon Sep 17 00:00:00 2001 From: Suvendu Mandal Date: Thu, 20 May 2021 15:41:19 +0530 Subject: [PATCH 31/31] Update PR fixed Update PR fixed --- cobigen-angular-client-generation/index.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cobigen-angular-client-generation/index.asciidoc b/cobigen-angular-client-generation/index.asciidoc index ef1aa172..92d96603 100644 --- a/cobigen-angular-client-generation/index.asciidoc +++ b/cobigen-angular-client-generation/index.asciidoc @@ -47,7 +47,7 @@ createFile("cobigenjavaexample/core/src/main/java/com/example/application/cobige adaptTemplatesCobiGen() cobiGenJava("cobigenjavaexample/core/src/main/java/com/example/application/cobigenjavaexample/customermanagement/dataaccess/api/CustomerEntity.java",[5]) -- -The CobiGen code generator will generate some java classes for you. These contain code for Transfer object, REST service handling and data access and so on. +The CobiGen code generator will generate code for Transfer object, REST service handling and data access and so on. For example, the following files are generated by CobiGen when using the specified templates: @@ -57,7 +57,7 @@ For example, the following files are generated by CobiGen when using the specifi ==== ==== -Now you can go through api module of your java project and use Cobigen again to generate your client. +Now you can go through api module of your java project and use Cobigen again to generate your front end (angular code). [step] == Running CobiGen to generate to your Angular code --