Skip to content

Commit 9022319

Browse files
authored
Merge branch 'devonfw-tutorials:main' into main
2 parents 6225908 + 5b801fe commit 9022319

19 files changed

Lines changed: 186 additions & 112 deletions

JumpTheQueue/index.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
====
33
Jump The Queue is a small application based on the devonfw framework, which you can create yourself by following our simple step-by-step tutorial. By doing so, you will learn about the app development workflow and gain insight into the design of a professional business information system.
44
5-
## Prerequisites
5+
### Prerequisites
66
* User should have Java, Angular development experience
77
8-
## Learning goals
9-
After completing this tutorial, you will have learned about a devonfw sample application Jump-The-Queue and its architecture.
8+
### Learning goals
9+
* After completing this tutorial, you will have learned about a devonfw sample application Jump-The-Queue and its architecture.
1010
1111
More information about Jump The Queue on https://github.com/devonfw/jump-the-queue
1212
====

autoReviewPullRequest.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ function parseFile(file, filename) {
8383
let description = parseResult[1][2].descriptionlines;
8484

8585
let messageBody = "";
86-
if(!description.includes("## Prerequisites")) {
87-
messageBody = "The description must describe the prerequisites of a tutorial. It must contain a '## Prerequisites' part.";
86+
if(!description.includes("### Prerequisites")) {
87+
messageBody = "The description must describe the prerequisites of a tutorial. It must contain a '### Prerequisites' part.";
8888
}
8989

90-
if(!description.includes("## Learning goals")) {
90+
if(!description.includes("### Learning goals")) {
9191
messageBody = (messageBody == "")
92-
? "The description should describe what the user will learn in the tutorial. It must contain a '## Learning goals' part."
92+
? "The description should describe what the user will learn in the tutorial. It must contain a '### Learning goals' part."
9393
: messageBody + " The description should describe what the user will learn in the tutorial. It must contain a '## Learning goals' part.";
9494
}
9595

cobigen/index.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
====
33
CobiGen is a generic incremental code generator for end to end code generation tasks. It allows you to build Java, Angular CRUD application code based on the devonfw architecture including all software layers.
44
5-
## Prerequisites
5+
### Prerequisites
66
* User should have Java development experience
77
8-
## Learning goals
9-
After completing this scenario, you will have learned how to generate an end-to-end Java CRUD application code using devonfw CobiGen.
8+
### Learning goals
9+
* After completing this scenario, you will have learned how to generate an end-to-end Java CRUD application code using devonfw CobiGen.
1010
1111
More information about CobiGen on https://devonfw.com/website/pages/docs/master-cobigen.asciidoc.html
1212
====

devon4j-http-rest-client/files/BaseWebSecurityConfig.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ public abstract class BaseWebSecurityConfig extends WebSecurityConfigurerAdapter
3737
@Inject
3838
private WebSecurityConfigurer webSecurityConfigurer;
3939

40+
41+
4042
/**
4143
* Configure spring security to enable a simple webform-login + a simple rest login.
4244
*/
@@ -47,11 +49,11 @@ public abstract class BaseWebSecurityConfig extends WebSecurityConfigurerAdapter
4749
"/services/rest/logout" };
4850

4951
// disable CSRF protection by default, use csrf starter to override.
50-
http = http.csrf().disable();
52+
http = http.httpBasic().and().csrf().disable();
5153
// load starters as pluggins.
5254
http = this.webSecurityConfigurer.configure(http);
5355

54-
http.httpBasic().and()
56+
http
5557
//
5658
.userDetailsService(this.userDetailsService)
5759
// define all urls that are not to be secured
@@ -109,8 +111,7 @@ public abstract class BaseWebSecurityConfig extends WebSecurityConfigurerAdapter
109111
@SuppressWarnings("javadoc")
110112
@Inject
111113
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
112-
113-
auth.inMemoryAuthentication().withUser("admin").password(this.passwordEncoder.encode("admin")).roles("Admin");
114+
auth.inMemoryAuthentication().withUser("admin").password(this.passwordEncoder.encode("admin")).authorities("Admin");
114115
}
115116

116117
}

devon4j-http-rest-client/files/Devon4jRestClientImpl.java

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
package com.sample.application.httprestclient.general.service.api.rest;
2-
3-
import javax.ws.rs.Consumes;
4-
import javax.ws.rs.GET;
5-
import javax.ws.rs.Path;
6-
import javax.ws.rs.Produces;
7-
import javax.ws.rs.core.MediaType;
8-
9-
@Path("/devon4jrestclient")
10-
@Consumes(MediaType.APPLICATION_JSON)
11-
@Produces(MediaType.APPLICATION_JSON)
12-
public interface Devon4jRestClient {
13-
14-
@GET
15-
@Path("/response")
16-
public String showResponse();
17-
18-
@GET
19-
@Path("/clientService")
20-
public String returnServiceDetail();
21-
}
1+
package com.example.application.httprestclient.general.service.api.rest;
2+
3+
import javax.ws.rs.Consumes;
4+
import javax.ws.rs.GET;
5+
import javax.ws.rs.Path;
6+
import javax.ws.rs.Produces;
7+
import javax.ws.rs.core.MediaType;
8+
9+
@Path("/testrest/v1")
10+
@Consumes(MediaType.APPLICATION_JSON)
11+
@Produces(MediaType.APPLICATION_JSON)
12+
public interface TestRestService {
13+
14+
@GET
15+
@Path("/response/")
16+
public String showResponse();
17+
18+
@GET
19+
@Path("/verify/")
20+
public String verifyServiceWork();
21+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package com.example.application.httprestclient.general.service.impl.rest;
2+
3+
import javax.inject.Inject;
4+
import javax.inject.Named;
5+
6+
import com.devonfw.module.service.common.api.client.ServiceClientFactory;
7+
import com.devonfw.module.service.common.api.client.config.ServiceClientConfigBuilder;
8+
import com.example.application.httprestclient.general.service.api.rest.TestRestService;
9+
import com.example.application.httprestclient.general.service.api.rest.VisitormanagementRestService;
10+
11+
@Named("TestRestService")
12+
public class TestRestServiceImpl implements TestRestService {
13+
14+
@Inject
15+
private ServiceClientFactory serviceClientFactory;
16+
17+
@Override
18+
public String showResponse() {
19+
20+
String result = callSynchronous();
21+
System.out.println("**********inside client method***********");
22+
System.out.println(result);
23+
System.out.println("************Thank you for choosing devon4j ****************");
24+
return result;
25+
26+
}
27+
28+
private String callSynchronous() {
29+
30+
System.out.println("***********inside synchronous call************");
31+
VisitormanagementRestService visitormanagementRestService = this.serviceClientFactory.create(
32+
VisitormanagementRestService.class,
33+
new ServiceClientConfigBuilder().authBasic().userLogin("admin").userPassword("admin").buildMap());
34+
// call of service over the wire, synchronously blocking until result is received or error occurred
35+
String resultFromAPICall = visitormanagementRestService.returnResponseToClient();
36+
System.out.println("************************got result from api" + resultFromAPICall + "***************");
37+
return resultFromAPICall;
38+
}
39+
40+
@Override
41+
public String verifyServiceWork() {
42+
43+
return "Verified... service is working";
44+
}
45+
46+
}
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
package com.sample.application.httprestclient.general.service.api.rest;
1+
package com.example.application.httprestclient.general.service.api.rest;
22

33
import javax.ws.rs.Consumes;
44
import javax.ws.rs.GET;
55
import javax.ws.rs.Path;
66
import javax.ws.rs.Produces;
77
import javax.ws.rs.core.MediaType;
88

9-
10-
@Path("/visitormanagement")
9+
@Path("/visitormanagement/v1")
1110
@Consumes(MediaType.APPLICATION_JSON)
1211
@Produces(MediaType.APPLICATION_JSON)
1312
public interface VisitormanagementRestService {
1413

1514
@GET
16-
@Path("/clientrequest")
15+
@Path("/clientrequest/")
16+
@Consumes(MediaType.APPLICATION_JSON)
17+
@Produces(MediaType.APPLICATION_JSON)
1718
public String returnResponseToClient();
1819

1920
}

devon4j-http-rest-client/files/VisitormanagementRestService.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
import javax.ws.rs.Produces;
77
import javax.ws.rs.core.MediaType;
88

9-
10-
@Path("/visitormanagement")
9+
@Path("/visitormanagement/v1")
1110
@Consumes(MediaType.APPLICATION_JSON)
1211
@Produces(MediaType.APPLICATION_JSON)
1312
public interface VisitormanagementRestService {
1413

1514
@GET
16-
@Path("/clientrequest")
15+
@Path("/clientrequest/")
16+
@Consumes(MediaType.APPLICATION_JSON)
17+
@Produces(MediaType.APPLICATION_JSON)
1718
public String returnResponseToClient();
1819

1920
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.example.application.httprestserver.visitormanagement.service.impl.rest;
22

3-
import javax.inject.Inject;
43
import javax.inject.Named;
54

65
import com.example.application.httprestserver.visitormanagement.service.api.rest.VisitormanagementRestService;
@@ -10,7 +9,8 @@ public class VisitormanagementRestServiceImpl implements VisitormanagementRestSe
109

1110
@Override
1211
public String returnResponseToClient() {
13-
String args = "welcome to rest api";
14-
return args;
12+
13+
return "Welcome to REST API world";
1514
}
16-
}
15+
16+
}

0 commit comments

Comments
 (0)