Skip to content

Commit 7595166

Browse files
changed textAfter for cobiGenJava
1 parent d447c4b commit 7595166

File tree

3 files changed

+26
-18
lines changed

3 files changed

+26
-18
lines changed

playbooks/cobigen-cli/index.asciidoc

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,28 @@ CobiGen is integrated via plugin in the VS Code IDE. We will use it to generate
2525
--
2626
cobiGenJava("cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/dataaccess/api/CustomerEntity.java",[1,3,5,6,8])
2727
--
28-
The CobiGen code generator will generate some java class for you. These contain code for basic CRUD operations, REST service handling and data access.
28+
The CobiGen code generator will generate some java classes for you. These contain code for basic CRUD operations, REST service handling and data access.
29+
30+
For example, the following files are generated by CobiGen when using the specified templates:
31+
32+
(1) CRUD logic: Generates the logic layer and implementations for some use cases.
33+
- `devonfw/workspaces/main/cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/logic/impl/CustomermanagementImpl.java`{{open}}
34+
- `devonfw/workspaces/main/cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/logic/impl/usecase/UcManageCustomerImpl.java`{{open}}
35+
- `devonfw/workspaces/main/cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/logic/impl/usecase/UcFindCustomerImpl.java`{{open}}
36+
- `devonfw/workspaces/main/cobigenexample/api/src/main/java/com/example/application/cobigenexample/customermanagement/logic/api/Customermanagement.java`{{open}}
37+
38+
(3) CRUD REST services: Generates the service layer with CRUD operations for using in REST services.
39+
- `devonfw/workspaces/main/cobigenexample/api/src/main/java/com/example/application/cobigenexample/customermanagement/service/api/rest/CustomermanagementRestService.java`{{open}}
40+
- `devonfw/workspaces/main/cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/service/impl/rest/CustomermanagementRestServiceImpl.java`{{open}}
41+
42+
(5) TO's: Generates the related Transfer Objects.
43+
- `devonfw/workspaces/main/cobigenexample/api/src/main/java/com/example/application/cobigenexample/customermanagement/logic/api/to/CustomerEto.java`{{open}}
44+
- `devonfw/workspaces/main/cobigenexample/api/src/main/java/com/example/application/cobigenexample/customermanagement/logic/api/to/CustomerSearchCriteriaTo.java`{{open}}
45+
46+
(6) Entity infrastructure: Creates the entity main interface and edits (by a merge) the current entity to extend the newly generated classes.
47+
- `devonfw/workspaces/main/cobigenexample/api/src/main/java/com/example/application/cobigenexample/customermanagement/common/api/Customer.java`{{open}}
48+
- `devonfw/workspaces/main/cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/dataaccess/api/CustomerEntity.java`{{open}} (changed)
49+
50+
(8) CRUD SpringData Repository: Generates the entity repository (that contains the CRUD operations) in the data access layer.
51+
- `devonfw/workspaces/main/cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/dataaccess/api/repo/CustomerRepository.java`{{open}}
2952
====

runners/katacoda/index.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,6 @@ export class Katacoda extends Runner {
9797
runCobiGenJava(step: Step, command: Command): RunResult {
9898
let params = command.parameters;
9999
let cobiGenTemplates = params[1].join(",");
100-
101-
let javaFilePath = new String(params[0]);
102-
let entity = javaFilePath.slice(javaFilePath.lastIndexOf("/") + 1, javaFilePath.lastIndexOf(".")).replace("Entity", "");
103-
104-
// remove the last two directories of the path to the entity class
105-
let tmpPath = javaFilePath.split("/").splice(0, javaFilePath.match(/\//g).length - 2).join("/");
106-
let generatedFiles = [];
107-
generatedFiles.push("devonfw/workspaces/main/" + tmpPath + "/logic/base/usecase/Abstract" + entity + "Uc.java");
108-
generatedFiles.push("devonfw/workspaces/main/" + tmpPath + "/service/impl/rest/" + entity + "managementRestServiceImpl.java");
109-
generatedFiles.push("devonfw/workspaces/main/" + tmpPath + "/dataaccess/api/repo/" + entity + "Repository.java");
110100

111101
this.renderTemplate(path.join("scripts", "installCobiGenPlugin.sh"), path.join(this.setupDir, "installCobiGenPlugin.sh"), { vsixFile: "cobigen-0.0.1.vsix", pluginName: "cobigen" });
112102
this.setupScripts.push({
@@ -119,7 +109,7 @@ export class Katacoda extends Runner {
119109
"title": "CobiGen Java",
120110
"text": "step" + this.stepsCount + ".md"
121111
});
122-
this.renderTemplate("cobiGenJava.md", this.outputPathTutorial + "step" + (this.stepsCount++) + ".md", { text: step.text, textAfter: step.textAfter, javaFile: params[0], cobiGenTemplates: cobiGenTemplates, generatedFiles: generatedFiles });
112+
this.renderTemplate("cobiGenJava.md", this.outputPathTutorial + "step" + (this.stepsCount++) + ".md", { text: step.text, textAfter: step.textAfter, javaFile: params[0], cobiGenTemplates: cobiGenTemplates });
123113
return null;
124114
}
125115

runners/katacoda/templates/cobiGenJava.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,4 @@ You can choose the templates CobiGen should use by entering the numbers.
1313

1414
`<%= cobiGenTemplates; %>`{{execute}}
1515

16-
<%= textAfter; %>
17-
18-
For example, the following files are generated by CobiGen.
19-
<% for(var i=0; i<generatedFiles.length; i++) {%>
20-
`<%=generatedFiles[i]%>`{{open}}
21-
<% } %>
16+
<%= textAfter; %>

0 commit comments

Comments
 (0)