Skip to content
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

Updated lab 'developing-with-quarkus-panache' & SSO integration #312

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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)

----

Expand Down Expand Up @@ -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:|
|----|
Expand All @@ -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)

----

Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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)

----

Expand All @@ -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.

----
Expand All @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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)

----

Expand Down Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

----

Expand Down Expand Up @@ -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.

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ 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.

----

`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.

Expand Down
6 changes: 4 additions & 2 deletions instruqt-tracks/developing-with-quarkus-panache/track.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ developers:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- null
sandbox_preset: openshift-411
lab_config:
overlay: false
width: 25
position: right
checksum: "5121325703234347595"
feedback_recap_enabled: true
loadingMessages: true
checksum: "15316959707892924589"
Loading