From a3fcbf968e7cb0afa5844daac9b8675722ff98b2 Mon Sep 17 00:00:00 2001 From: Nitin Yadav Date: Wed, 21 Feb 2024 18:53:51 +1100 Subject: [PATCH] Updated lab 'developing-with-quarkus-panache' & SSO integration --- .../01-01-define-entity/assignment.md | 8 ++-- .../assignment.md | 17 ++++++++ .../check-rhd-login-3882343 | 41 +++++++++++++++++++ .../assignment.md | 14 +++---- .../assignment.md | 2 +- .../assignment.md | 4 +- .../setup-crc | 0 .../assignment.md | 2 +- .../setup-crc | 0 .../assignment.md | 6 +-- .../developing-with-quarkus-panache/track.yml | 6 ++- 11 files changed, 80 insertions(+), 20 deletions(-) create mode 100644 instruqt-tracks/developing-with-quarkus-panache/02-join-red-hat-developer-portal/assignment.md create mode 100644 instruqt-tracks/developing-with-quarkus-panache/02-join-red-hat-developer-portal/check-rhd-login-3882343 rename instruqt-tracks/developing-with-quarkus-panache/{02-02-remote-dev => 03-02-remote-dev}/assignment.md (97%) mode change 100755 => 100644 rename instruqt-tracks/developing-with-quarkus-panache/{03-03-add-query-endpoints => 04-03-add-query-endpoints}/assignment.md (99%) mode change 100755 => 100644 rename instruqt-tracks/developing-with-quarkus-panache/{04-04-add-paging-filtering => 05-04-add-paging-filtering}/assignment.md (98%) mode change 100755 => 100644 rename instruqt-tracks/developing-with-quarkus-panache/{04-04-add-paging-filtering => 05-04-add-paging-filtering}/setup-crc (100%) mode change 100755 => 100644 rename instruqt-tracks/developing-with-quarkus-panache/{05-05-add-lifecycle-task => 06-05-add-lifecycle-task}/assignment.md (98%) mode change 100755 => 100644 rename instruqt-tracks/developing-with-quarkus-panache/{05-05-add-lifecycle-task => 06-05-add-lifecycle-task}/setup-crc (100%) mode change 100755 => 100644 rename instruqt-tracks/developing-with-quarkus-panache/{06-06-exercise-table => 07-06-exercise-table}/assignment.md (96%) mode change 100755 => 100644 diff --git a/instruqt-tracks/developing-with-quarkus-panache/01-01-define-entity/assignment.md b/instruqt-tracks/developing-with-quarkus-panache/01-01-define-entity/assignment.md index c928afc5..00285e7d 100755 --- a/instruqt-tracks/developing-with-quarkus-panache/01-01-define-entity/assignment.md +++ b/instruqt-tracks/developing-with-quarkus-panache/01-01-define-entity/assignment.md @@ -109,7 +109,7 @@ As you can see, there are some files in the project that have already been prepa For example, under `src/main/resources/META-INF/resources` you'll see the `HTML` file as shown in the figure below. -![File system](../assets/file-system.png) +![File system](..\assets\file-system.png) The `HTML` file represents the demonstration application's web site. @@ -153,7 +153,7 @@ You will to create a Person entity that has these fields. `Step 8:` Go to the **Visual Editor** tab and use the directory tree to navigate to the file `Person.java` in the directory `src/main/java/org/acme/person/model` as shown in the figure below. -![Person Entity](../assets/person-entity.png) +![Person Entity](..\assets\person-entity.png) ---- @@ -198,7 +198,7 @@ public class Person extends PanacheEntity { `Step 11:` Click on the `Disk` icon or press `CTRL+S` keys to save the file as shown in the figure below: -![Save File](../assets/save-file.png) +![Save File](..\assets\save-file.png) |NOTE:| |----| @@ -218,7 +218,7 @@ However, there is no definition for eye color. You'll need to create the Java fi `Step 13:` Click the `New File` icon to the right of the `src/main/java/org/acme/person/model/` directory to open a new file. Name the file `EyeColor.java` as shown in the figure below. -![Create file](../assets/create-eye-color.png) +![Create file](..\assets\create-eye-color.png) ---- diff --git a/instruqt-tracks/developing-with-quarkus-panache/02-join-red-hat-developer-portal/assignment.md b/instruqt-tracks/developing-with-quarkus-panache/02-join-red-hat-developer-portal/assignment.md new file mode 100644 index 00000000..a6f7d3d3 --- /dev/null +++ b/instruqt-tracks/developing-with-quarkus-panache/02-join-red-hat-developer-portal/assignment.md @@ -0,0 +1,17 @@ +--- +slug: join-red-hat-developer-portal +id: wyweflgmeulq +type: challenge +title: Join Red Hat Developer at no cost +teaser: Join Red Hat Developer at no cost +tabs: +- title: Red Hat Login + type: browser + hostname: rhd-login-3882343 +difficulty: "" +--- +Before you proceed with the next challenge, please take a moment to register for Red Hat Developer. If you already have a Red Hat account, you can use the same login credentials. + +This will help us assess user satisfaction and enable us to provide more curated content. + +Click on the `Check` button at the bottom once you have registered or logged in. diff --git a/instruqt-tracks/developing-with-quarkus-panache/02-join-red-hat-developer-portal/check-rhd-login-3882343 b/instruqt-tracks/developing-with-quarkus-panache/02-join-red-hat-developer-portal/check-rhd-login-3882343 new file mode 100644 index 00000000..53051468 --- /dev/null +++ b/instruqt-tracks/developing-with-quarkus-panache/02-join-red-hat-developer-portal/check-rhd-login-3882343 @@ -0,0 +1,41 @@ +#!/bin/bash +set -euxo pipefail +echo 'logincheck' +if [ "${LOGGEDIN-0}" = "1" ]; then + echo 'loggedin' + exit 0 +fi + +rm -f /home/user/checkResult.json +rm -f /home/user/checkAssets.json +rm -f /home/user/checkError.txt + + +echo 'dropdown check' +echo '{"location":{"conditions":[{"url":"redhat.com","condition":"contains"}]},"innerText":[{"selector":"html \u003e body","value":"Please click on Check button in the bottom right of your screen to continue with the Lab."}]}' > /home/user/checkAssets.json +until [ -f /home/user/checkResult.json ]; do + sleep 1 +done +if grep "SUCCESS" /home/user/checkResult.json; then + echo 'account dropdown' + exit 0 +fi + + +rm -f /home/user/checkResult.json +rm -f /home/user/checkAssets.json +rm -f /home/user/checkError.txt + + +echo 'email check' +echo '{"location":{"conditions":[]},"innerText":[{"selector":"html \u003e body","value":"Email address verification"}]}' > /home/user/checkAssets.json +until [ -f /home/user/checkResult.json ]; do + sleep 1 +done +cat /home/user/checkResult.json +if grep "SUCCESS" /home/user/checkResult.json; then + echo 'email validation' + exit 0 +fi +fail-message "Please login and click 'Check' button." +exit 1 \ No newline at end of file diff --git a/instruqt-tracks/developing-with-quarkus-panache/02-02-remote-dev/assignment.md b/instruqt-tracks/developing-with-quarkus-panache/03-02-remote-dev/assignment.md old mode 100755 new mode 100644 similarity index 97% rename from instruqt-tracks/developing-with-quarkus-panache/02-02-remote-dev/assignment.md rename to instruqt-tracks/developing-with-quarkus-panache/03-02-remote-dev/assignment.md index 41e8ff16..b50cec1b --- a/instruqt-tracks/developing-with-quarkus-panache/02-02-remote-dev/assignment.md +++ b/instruqt-tracks/developing-with-quarkus-panache/03-02-remote-dev/assignment.md @@ -42,7 +42,7 @@ OpenShift ships with a web-based console that allows users to perform various ta `Step 1:` Click on **Web Console** tab on the horizontal menu bar over the terminal window to the left. You will be presented with a login page as shown in the figure below. -![Login](../assets/web-console-login.png) +![Login](..\assets\web-console-login.png) ---- @@ -52,7 +52,7 @@ OpenShift ships with a web-based console that allows users to perform various ta * Password: `developer` NOTE: You might see the following warning notification due to using an untrusted security certificate. -![Security warning](../assets/security_warning.png) +![Security warning](..\assets\security_warning.png) If you do get the warning, click the **Advanced** button to complete the process necessary to grant permission to the browser to access the OpenShift web console. ---- @@ -61,7 +61,7 @@ If you do get the warning, click the **Advanced** button to complete the process After you dismiss the tour page, you'll see that there are no projects found, as shown in the figure below. -![No Projects Found](../assets/no-projects-found.png) +![No Projects Found](..\assets\no-projects-found.png) This is about to change. You will add a project to OpenShift. @@ -168,11 +168,11 @@ The OpenShift web console will appear. `Step 8b:` Then click the link `quarkus` in the projects list that appears as shown in the figure below. -![Select Quarkus](../assets/select-quarkus.png) +![Select Quarkus](..\assets\select-quarkus.png) You'll see a circular graphic that represents the Postgres database as shown in the figure below. -![Postgres](../assets/display-postgres.png) +![Postgres](..\assets\display-postgres.png) You'll be working in the Topology view in upcoming topics. @@ -224,7 +224,7 @@ INFO] --- quarkus-maven-plugin:2.0.0.Final:add-extension (default-cli) @ people `Step 12:` Click the file named `application.properties` in the directory tree to open the file for editing as shown in the figure below: -![Select application properties](../assets/select-app-properties.png) +![Select application properties](..\assets\select-app-properties.png) ---- @@ -328,7 +328,7 @@ NOTE: If the `oc rollout` command seems not to finish, press the `CTRL+C` keys t `Step 18:` Click the **Web Console:** tab to view the updated **Topology** graphics as shown in the figure below. -![People and Postgree](../assets/people-n-postgres.png) +![People and Postgree](..\assets\people-n-postgres.png) Notice that both the People application and the Postgres database are represented in the graphic. Also notice that the relationship between the People application and the Postgres database is described visually by a connecting line between the two. diff --git a/instruqt-tracks/developing-with-quarkus-panache/03-03-add-query-endpoints/assignment.md b/instruqt-tracks/developing-with-quarkus-panache/04-03-add-query-endpoints/assignment.md old mode 100755 new mode 100644 similarity index 99% rename from instruqt-tracks/developing-with-quarkus-panache/03-03-add-query-endpoints/assignment.md rename to instruqt-tracks/developing-with-quarkus-panache/04-03-add-query-endpoints/assignment.md index 6d144c1b..91d0a72e --- a/instruqt-tracks/developing-with-quarkus-panache/03-03-add-query-endpoints/assignment.md +++ b/instruqt-tracks/developing-with-quarkus-panache/04-03-add-query-endpoints/assignment.md @@ -69,7 +69,7 @@ Much like the best practice in object-oriented programming, Panache and Quarkus `Step 2a:` Go to **Visual Editor** tab and navigate to the directory, `src/main/java/org/acme/person/model/` as shown in the figure below. -![Select Person](../assets/selected-person-model.png) +![Select Person](..\assets\selected-person-model.png) `Step 2b:` Click on the file named `Person.java` to open it for editing. diff --git a/instruqt-tracks/developing-with-quarkus-panache/04-04-add-paging-filtering/assignment.md b/instruqt-tracks/developing-with-quarkus-panache/05-04-add-paging-filtering/assignment.md old mode 100755 new mode 100644 similarity index 98% rename from instruqt-tracks/developing-with-quarkus-panache/04-04-add-paging-filtering/assignment.md rename to instruqt-tracks/developing-with-quarkus-panache/05-04-add-paging-filtering/assignment.md index b86ae7f4..a4a0fa20 --- a/instruqt-tracks/developing-with-quarkus-panache/04-04-add-paging-filtering/assignment.md +++ b/instruqt-tracks/developing-with-quarkus-panache/05-04-add-paging-filtering/assignment.md @@ -58,7 +58,7 @@ The query parameters tell the server how to sort, filter, and search the backend `Step 2:` Navigate to the file `src/main/java/org/acme/person/PersonResource.java` using the Visual Editor's directory tree. Click on the file `PersonResource.java` to open it for editing as shown in the figure below: -![Select Person Resource](../assets/select-personresource.png) +![Select Person Resource](..\assets\select-personresource.png) ---- @@ -158,7 +158,7 @@ On the server-side, the `PersonResource.java` endpoint handler function transfor The following figure illustrates the Panache/DataTable architecture: -![Panache Architecture](../assets/panache-arch.png) +![Panache Architecture](..\assets\panache-arch.png) Let's take a look at the particulars of the code again. diff --git a/instruqt-tracks/developing-with-quarkus-panache/04-04-add-paging-filtering/setup-crc b/instruqt-tracks/developing-with-quarkus-panache/05-04-add-paging-filtering/setup-crc old mode 100755 new mode 100644 similarity index 100% rename from instruqt-tracks/developing-with-quarkus-panache/04-04-add-paging-filtering/setup-crc rename to instruqt-tracks/developing-with-quarkus-panache/05-04-add-paging-filtering/setup-crc diff --git a/instruqt-tracks/developing-with-quarkus-panache/05-05-add-lifecycle-task/assignment.md b/instruqt-tracks/developing-with-quarkus-panache/06-05-add-lifecycle-task/assignment.md old mode 100755 new mode 100644 similarity index 98% rename from instruqt-tracks/developing-with-quarkus-panache/05-05-add-lifecycle-task/assignment.md rename to instruqt-tracks/developing-with-quarkus-panache/06-05-add-lifecycle-task/assignment.md index 965feb74..ddaa7347 --- a/instruqt-tracks/developing-with-quarkus-panache/05-05-add-lifecycle-task/assignment.md +++ b/instruqt-tracks/developing-with-quarkus-panache/06-05-add-lifecycle-task/assignment.md @@ -39,7 +39,7 @@ No shut down behavior will be implemented at this time. However, the concept and `Step 2:` Navigate to the file `src/main/java/org/acme/person/PersonResource.java` in the Visual Editor's directory tree and click the file named `PersonResource.java` to open it for editing as shown in the figure below. -![Select Person Resource](../assets/select-personresource.png) +![Select Person Resource](..\assets\select-personresource.png) ---- `Step 3:` Add the following code to the file `PersonResource.java`, placing the code **after** the comment line: `//TODO: Add lifecycle hook`: diff --git a/instruqt-tracks/developing-with-quarkus-panache/05-05-add-lifecycle-task/setup-crc b/instruqt-tracks/developing-with-quarkus-panache/06-05-add-lifecycle-task/setup-crc old mode 100755 new mode 100644 similarity index 100% rename from instruqt-tracks/developing-with-quarkus-panache/05-05-add-lifecycle-task/setup-crc rename to instruqt-tracks/developing-with-quarkus-panache/06-05-add-lifecycle-task/setup-crc diff --git a/instruqt-tracks/developing-with-quarkus-panache/06-06-exercise-table/assignment.md b/instruqt-tracks/developing-with-quarkus-panache/07-06-exercise-table/assignment.md old mode 100755 new mode 100644 similarity index 96% rename from instruqt-tracks/developing-with-quarkus-panache/06-06-exercise-table/assignment.md rename to instruqt-tracks/developing-with-quarkus-panache/07-06-exercise-table/assignment.md index 3db82e11..723f3341 --- a/instruqt-tracks/developing-with-quarkus-panache/06-06-exercise-table/assignment.md +++ b/instruqt-tracks/developing-with-quarkus-panache/07-06-exercise-table/assignment.md @@ -35,11 +35,11 @@ In this topic you will exercise the demonstration application using the front-en `Step 2:` Click the **Topology** tab on the left side on the OpenShift web console. Then, click on the `Open URL` icon in the circular People graphic as shown in the figure below. -![Topology view](../assets/select-route-url.png) +![Topology view](..\assets\select-route-url.png) You'll be taken to the demonstration application's Web UI as shown in the figure below. -![Web Console Overview](../assets/database-gui.png) +![Web Console Overview](..\assets\database-gui.png) Notice the total number of records reported at the bottom of the figure shown above. @@ -47,7 +47,7 @@ Notice the total number of records reported at the bottom of the figure shown ab `Step 3:` Type in the word `Gravel` in the search box of the web UI. You will get a response similar to the one shown in the figure shown below. -![Query result](../assets/gravel-query.png) +![Query result](..\assets\gravel-query.png) It's important to remember that rather than having all 10,000 records loaded in the browser, DataTable makes a call back to the `/person/datatable` REST endpoint to fetch only those records that need to be shown, based on page size, the current page being viewed, and any search filters. diff --git a/instruqt-tracks/developing-with-quarkus-panache/track.yml b/instruqt-tracks/developing-with-quarkus-panache/track.yml index d6d27572..98c643d9 100755 --- a/instruqt-tracks/developing-with-quarkus-panache/track.yml +++ b/instruqt-tracks/developing-with-quarkus-panache/track.yml @@ -36,10 +36,12 @@ developers: - bob@cogarttech.com - ryanj@redhat.com - cclyburn@redhat.com -- dschenck@redhat.com +- null sandbox_preset: openshift-411 lab_config: overlay: false width: 25 position: right -checksum: "5121325703234347595" + feedback_recap_enabled: true + loadingMessages: true +checksum: "15316959707892924589"