Skip to content

Final with Completed Exercises #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,24 @@
This repository contains the Mastering Producing Liferay's Headless APIs course materials.

## Table of Contents

- [Available Branches](#available-branches)
- [Bundle Preparation](#bundle-preparation)
- [Starting and Stopping the Bundle](#starting-and-stopping-the-bundle)

## Available Branches

There are 2 branches available for the course.
1. **main**: This branch is considered the starting branch for the course and can be used in conjunction with the course content and exercises
2. **final**: This branch is considered the final branch in which the final course content and exercises have been completed

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.

1. Open a terminal and navigate to the *client-extensions/distributor-kyc-update/* folder.
2. Start the Spring Boot service (as the microservice is hosted outside of Liferay):
```
blade gw bootRun
```

## Bundle Preparation

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:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
assemble:
- fromTask: bootJar

clarity-distributor-kyc-update:
name: Clarity Distributor KYC Update
oAuth2ApplicationExternalReferenceCode: clarity-distributor-kyc-update-oauth-application-user-agent
resourcePath: /distributor/kyc/update
type: objectAction
clarity-distributor-kyc-update-oauth-application-user-agent:
.serviceAddress: localhost:58081
.serviceScheme: http
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,15 @@
*
* @author dnebinger
*/
@RequestMapping("PLACEHOLDER")
@RequestMapping("/distributor/kyc/update")
@RestController
public class DistributorKYCUpdateController extends BaseRestController {

PLACEHOLDER
@PostMapping
public ResponseEntity<String> post(
@AuthenticationPrincipal Jwt jwt, @RequestBody String json) {

HttpStatus httpStatus = HttpStatus.OK;

try {
_log.info("Received JSON: " + json);
Expand Down
Binary file modified configs/local/data/hypersonic/lportal.lobs
Binary file not shown.
1,500 changes: 897 additions & 603 deletions configs/local/data/hypersonic/lportal.script

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,19 @@ private AbbreviatedDistributorApp _getAbbreviatedDistributorApp(
return abbreviatedDistributorApp;
}

//Insert exercise code snippet here

private ObjectEntry _getDistributorKyc(long id) throws Exception {
ObjectEntryResource objectEntryResource = _getObjectEntryResource(
"c_distributorkycverification", "C_DistributorKYCVerification");

BooleanFilter filter = new BooleanFilter();

filter.addRequiredTerm(
"r_applicationToKYC_c_distributorApplicationId", id);

return objectEntryResource.getObjectEntriesPage(
true, null, null, filter, null, null
).fetchFirstItem();
}

private String _getDistributorKycStatus(long id) throws Exception {
ObjectEntry objectEntry = _getDistributorKyc(id);
Expand Down