Skip to content

Commit 48c76fd

Browse files
authored
Merge pull request #5 from egnajek/2025-q19-final
Final with Completed Exercises
2 parents be44847 + e361115 commit 48c76fd

29 files changed

+936
-609
lines changed

Readme.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,24 @@
33
This repository contains the Mastering Producing Liferay's Headless APIs course materials.
44

55
## Table of Contents
6-
6+
- [Available Branches](#available-branches)
77
- [Bundle Preparation](#bundle-preparation)
88
- [Starting and Stopping the Bundle](#starting-and-stopping-the-bundle)
99

10+
## Available Branches
11+
12+
There are 2 branches available for the course.
13+
1. **main**: This branch is considered the starting branch for the course and can be used in conjunction with the course content and exercises
14+
2. **final**: This branch is considered the final branch in which the final course content and exercises have been completed
15+
16+
In the **final** branch, all Liferay Client Extensions have been auto-deployed. However, the The *distributor-kyc-update* microservice will still need to be started in order to reproduce the Bridging Microservice Exercise.
17+
18+
1. Open a terminal and navigate to the *client-extensions/distributor-kyc-update/* folder.
19+
2. Start the Spring Boot service (as the microservice is hosted outside of Liferay):
20+
```
21+
blade gw bootRun
22+
```
23+
1024
## Bundle Preparation
1125

1226
To prepare your local Liferay bundle, you need to use the Blade CLI tool. The Blade CLI provides a convenient way to manage Liferay projects and bundles. Follow the steps below to set up your local environment:

exercises/distributor-kyc-update/client-extension.yaml renamed to client-extensions/distributor-kyc-update/client-extension.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
assemble:
22
- fromTask: bootJar
3-
3+
clarity-distributor-kyc-update:
4+
name: Clarity Distributor KYC Update
5+
oAuth2ApplicationExternalReferenceCode: clarity-distributor-kyc-update-oauth-application-user-agent
6+
resourcePath: /distributor/kyc/update
7+
type: objectAction
48
clarity-distributor-kyc-update-oauth-application-user-agent:
59
.serviceAddress: localhost:58081
610
.serviceScheme: http
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,15 @@
4444
*
4545
* @author dnebinger
4646
*/
47-
@RequestMapping("PLACEHOLDER")
47+
@RequestMapping("/distributor/kyc/update")
4848
@RestController
4949
public class DistributorKYCUpdateController extends BaseRestController {
5050

51-
PLACEHOLDER
51+
@PostMapping
52+
public ResponseEntity<String> post(
53+
@AuthenticationPrincipal Jwt jwt, @RequestBody String json) {
54+
55+
HttpStatus httpStatus = HttpStatus.OK;
5256

5357
try {
5458
_log.info("Received JSON: " + json);
416 KB
Binary file not shown.

configs/local/data/hypersonic/lportal.script

Lines changed: 897 additions & 603 deletions
Large diffs are not rendered by default.
Binary file not shown.
Binary file not shown.
Binary file not shown.

exercises/rest-exercises/AbbreviatedDistributorAppResourceImpl.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,19 @@ private AbbreviatedDistributorApp _getAbbreviatedDistributorApp(
147147
return abbreviatedDistributorApp;
148148
}
149149

150-
//Insert exercise code snippet here
151-
150+
private ObjectEntry _getDistributorKyc(long id) throws Exception {
151+
ObjectEntryResource objectEntryResource = _getObjectEntryResource(
152+
"c_distributorkycverification", "C_DistributorKYCVerification");
153+
154+
BooleanFilter filter = new BooleanFilter();
155+
156+
filter.addRequiredTerm(
157+
"r_applicationToKYC_c_distributorApplicationId", id);
158+
159+
return objectEntryResource.getObjectEntriesPage(
160+
true, null, null, filter, null, null
161+
).fetchFirstItem();
162+
}
152163

153164
private String _getDistributorKycStatus(long id) throws Exception {
154165
ObjectEntry objectEntry = _getDistributorKyc(id);

0 commit comments

Comments
 (0)