Skip to content

DBACLD-160992 [ODM K8S] Validate Instructions for GUI Customization Sample #12

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 10 commits into from
Apr 30, 2025
Merged
Show file tree
Hide file tree
Changes from 9 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
44 changes: 22 additions & 22 deletions decisioncenter/guicustomization/README-DOCKER.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

This readme explains how to run the GUI Customization sample in Docker.

Doing so, you do not need to have ODM installed. Instead we are relying on the 'ODM for developer' container image.
Doing so, you do not need to have ODM installed. Instead we are relying on the 'ODM for Developer' container image.

Before following the steps below, make sure you have built the images as explained in [README.md](README.md).

Expand All @@ -14,20 +14,20 @@ Before following the steps below, make sure you have built the images as explain
cd decisioncenter/guicustomization/guicustomization-source
```

Run ODM and Notifiers docker images
Run ODM docker images containing GUI customization:
```bash
docker-compose -f compose-odm-dev.yml up odm-with-gui-customization &
```

### Using the Sample
### Using the sample

**Log in** to the Business Console at [http://localhost:9060/decisioncenter](http://localhost:9060/decisioncenter) using the credentials:
- **Username**: `Paul`
- **Password**: `Paul`

Load the [LoanValidationService.zip](./projects/LoanValidationService.zip) Decision Service.
Open the **Library** tab. Import the [LoanValidationService.zip](./projects/LoanValidationService.zip) Decision Service.

To activate the Custom Value Editor, after login in Decision Center :
To activate the GUI customization:
- Go in the menu **Administration>Settings>Custom Settings**
- Register a new setting named **decisioncenter.web.core.extensions.entrypoints** keeping blank the **default value of the setting** field.

Expand All @@ -43,51 +43,51 @@ Log in to the Business console by using **Paul** as the username and password.

Open the **Library** tab. Click the **Loan Validation Service** box anywhere but the name, and select the **main** branch.

Click the new button **My Admin Button**. A dialog displays metrics on the decision service.
Click the new button **My Admin Button** in the main toolbar. A dialog displays metrics on the decision service. Close the dialog.

Click the new tab **My Admin Tab**. The tab displays the same metrics on the decision service.

Click the **Decision Artifacts** tab. Expand the **Loan Validation Scoring computation** package, and edit the rule **neverBankruptcy** (accept any default settings if prompted).
Click the **Decision Artifacts** tab. Expand the **computation** package of the **Loan Validation Scoring** project. Edit the rule **neverBankruptcy** (accept any default settings if prompted).

Click the button **My Info**. A dialog displays information on the rule.

Close the dialog and cancel the editing session. Click **main** in the breadcrumbs.
Close the dialog and cancel the editing session to go back to the **Decision Artifacts** tab.

Click the **Decision Artifacts** tab and make sure that the operations are displayed. To display them, click **Types** and select **Operations**.
Make sure that the **Operations** type are displayed. To display them, click **Types** and select **Operations**.

Expand the **Operations** folder under **Loan Validation Scoring** to edit the scoring operation.
Click the **Operations** element under **Loan Validation Scoring** project and edit the **scoring** operation.

Click the button **My Operation Info**. A dialog displays information on the operation.

Close the dialog, and cancel the editing session. Click **main** in the breadcrumbs.
Close the dialog, and cancel the editing session to go back to the **Decision Artifacts** tab.

Click the tab **Deployments** and edit the **test deployment configuration**.
Click the **Deployments** tab and edit the **test deployment** configuration.

Click the **Targets** tab and select the **Decision Service Execution server**. Save the test deployment configuration.
Click the **Targets** tab and make sure the **Decision Service Execution** server is well selected. Save the **test deployment** configuration and create a new version.

Click the name of the test deployment configuration.
Click the name of the **test deployment** configuration.

Click the **Custom Deploy** button in the toolbar. A dialog shows the status of the deployment.
Click the **Custom Deploy** button in the toolbar. This will start the deployment and a dialog shows its status: _Deploying..._ to _Report status: COMPLETED_

Close the dialog and log out of the Business console.
Close the dialog and log out of the Business Console.

![Business Console Custom GUI Admin](images/custom_gui_admin.png)

#### To see the customization for a non-administrative user:

Log in to the Business console by using **Bea** as the username and password.
Log in to the Business Console by using **Bea** as the username and password.

Open the **Library** tab. Click the **Loan Validation Service** box anywhere but the name, and then select the main branch.
Open the **Library** tab. Click the **Loan Validation Service** box anywhere but the name, and then select the **main** branch.

Click the new button **My Button**. A dialog displays some metrics on the decision service. The dialog content is different from the content that is provided for the administrator.
Click the new button **My Button**. A dialog displays some metrics on the decision service. The dialog content is different from the content that is provided for the an administrator user.

Close the dialog and then click the new tab **My Tab**. The tab displays the same metrics on the decision service. The tab content is different from the content that is provided for the administrator.
Close the dialog and then click the new tab **My Tab**. The tab displays the same metrics on the decision service. The tab content is different from the content that is provided for an administrator user.

Log out of the Business console.
Log out of the Business Console.

![Business Console Custom GUI](images/custom_gui.png)

### Stopping the Sample
### Stopping the sample

```bash
docker-compose -f compose-odm-dev.yml down
Expand Down
68 changes: 36 additions & 32 deletions decisioncenter/guicustomization/README-KUBERNETES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Introduction

This README explains how to run the GUI Customization sample in Kubernetes.
This readme explains how to run the GUI Customization sample in Kubernetes.
Before following the steps below, make sure you have built the images as explained in [README.md](README.md).

# Configuring the sample in Kubernetes
Expand All @@ -9,9 +9,9 @@ Before following the steps below, make sure you have built the images as explain

Any file server reachable by Decision Center is suitable.

You can either use an existing one or follow the instructions [here](https://github.com/DecisionsDev/odm-docker-kubernetes/blob/vnext-release/contrib/file-server/README.md#setup-an-httpd-file-server) to deploy a httpd file server in a new pod.
You can either use an existing one or follow the instructions [here](https://github.com/DecisionsDev/odm-docker-kubernetes/blob/vnext-release/contrib/file-server/README.md#setup-an-httpd-file-server) to deploy an httpd file server in a new pod.

Upload the **guicustomization-1.0.jar** file on the file server :
Upload the **guicustomization-1.0.jar** file on the file server:
```
curl -T guicustomization/guicustomization-source/target/guicustomization-1.0.jar $FILESERVER_URL
```
Expand Down Expand Up @@ -55,14 +55,16 @@ helm repo update
#### d. Check your access to the ODM chart

```bash
$ helm search repo ibm-odm-prod
helm search repo ibm-odm-prod
```
```bash
NAME CHART VERSION APP VERSION DESCRIPTION
ibm-helm/ibm-odm-prod 24.0.0 9.0.0.0 IBM Operational Decision Manager
ibm-helm/ibm-odm-prod 25.0.0 9.5.0.0 IBM Operational Decision Manager
```

#### e. Create a secret to manage custom authentication/authorization

Create a secret to manage custom authentication/authorization using the [webSecurity.xml](./guicustomization-source/webSecurity.xml) and [group-security-configurations.xml](./guicustomization-source/group-security-configurations.xml) files :
Create a secret to manage custom authentication/authorization using the [webSecurity.xml](./guicustomization-source/webSecurity.xml) and [group-security-configurations.xml](./guicustomization-source/group-security-configurations.xml) files:

```
kubectl create secret generic my-custom-auth-secret --from-file=webSecurity.xml --from-file=group-security-configurations.xml
Expand All @@ -85,7 +87,7 @@ Add all the other parameters suitable to your platform in `values.yaml`. Check t
If you are on OCP, you can use this [values.yaml](./guicustomization-source/values.yaml) file by replacing `<FILESERVER_URL>` by the actual URL of the file server hosting the JARs.

```bash
helm install guicustomization-sample ibmcharts/ibm-odm-prod -f values.yaml
helm install guicustomization-sample ibm-helm/ibm-odm-prod -f values.yaml
```

# Using the Sample
Expand All @@ -94,9 +96,9 @@ helm install guicustomization-sample ibmcharts/ibm-odm-prod -f values.yaml
- **Username**: `Paul`
- **Password**: `Paul`

Load the [LoanValidationService.zip](./projects/LoanValidationService.zip) Decision Service.
Open the **Library** tab. Import the [LoanValidationService.zip](./projects/LoanValidationService.zip) Decision Service.

To activate the Custom Value Editor, after login in Decision Center :
To activate the Custom Value Editor, after login in Decision Center:
- Go in the menu **Administration>Settings>Custom Settings**
- Register a new setting named **decisioncenter.web.core.extensions.entrypoints** keeping blank the **default value of the setting** field.

Expand All @@ -106,52 +108,54 @@ To activate the Custom Value Editor, after login in Decision Center :

![Custom Settings](images/custom_settings_2.png)

#### To see the customization for an administrator:

Log in to the Business console by using **Paul** as the username and password.

Open the **Library** tab. Click the **Loan Validation Service** box anywhere but the name, and select the **main** branch.

Click the new button **My Admin Button**. A dialog displays metrics on the decision service.
Click the new button **My Admin Button** in the main toolbar. A dialog displays metrics on the decision service. Close the dialog.

Click the new tab **My Admin Tab**. The tab displays the same metrics on the decision service.

Click the **Decision Artifacts** tab. Expand the **Loan Validation Scoring>computation** package, and edit the rule **neverBankruptcy** (accept any default settings if prompted).
![Business Console Custom GUI Admin](images/custom_gui_admin.png)

Click the **Decision Artifacts** tab. Expand the **computation** package of the **Loan Validation Scoring** project. Edit the rule **neverBankruptcy** (accept any default settings if prompted).

Click the button **My Info**. A dialog displays information on the rule.

Close the dialog and cancel the editing session. Click **main** in the breadcrumbs.
Close the dialog and cancel the editing session to go back to the **Decision Artifacts** tab.

Click the **Decision Artifacts** tab and make sure that the operations are displayed. To display them, click **Types** and select **Operations**.
Make sure that the **Operations** type are displayed. To display them, click **Types** and select **Operations**.

Expand the **Operations** folder under **Loan Validation Scoring** to edit the scoring operation.
Click the **Operations** element under **Loan Validation Scoring** project and edit the **scoring** operation.

Click the button **My Operation Info**. A dialog displays information on the operation.

Close the dialog, and cancel the editing session. Click **main** in the breadcrumbs.

Click the tab **Deployments** and edit the **test deployment configuration**.
Close the dialog, and cancel the editing session to go back to the **Decision Artifacts** tab.

Click the **Targets** tab and select the **Decision Service Execution server**. Save the test deployment configuration.
Click the **Deployments** tab and edit the **test deployment** configuration.

Click the name of the test deployment configuration.
Click the **Targets** tab and make sure the **Decision Service Execution** server is well selected. Save the **test deployment** configuration and create a new version.

Click the **Custom Deploy** button in the toolbar. A dialog shows the status of the deployment.
Click the name of the **test deployment** configuration.

Close the dialog and log out of the Business console.
Click the **Custom Deploy** button in the toolbar. This will start the deployment and a dialog shows its status: _Deploying..._ to _Report status: COMPLETED_

![Business Console Custom GUI Admin](images/custom_gui_admin.png)
Close the dialog and log out of the Business Console.

#### To see the customization for a non-administrative user:

Log in to the Business console by using **Bea** as the username and password.

Open the **Library** tab. Click the **Loan Validation Service** box anywhere but the name, and then select the main branch.
Log in to the Business Console by using **Bea** as the username and password.

Click the new button **My Button**. A dialog displays some metrics on the decision service. The dialog content is different from the content that is provided for the administrator.
Open the **Library** tab. Click the **Loan Validation Service** box anywhere but the name, and then select the **main** branch.

Close the dialog and then click the new tab **My Tab**. The tab displays the same metrics on the decision service. The tab content is different from the content that is provided for the administrator.
Click the new button **My Button**. A dialog displays some metrics on the decision service. The dialog content is different from the content that is provided for the an administrator user.

Log out of the Business console.
Close the dialog and then click the new tab **My Tab**. The tab displays the same metrics on the decision service. The tab content is different from the content that is provided for an administrator user.

![Business Console Custom GUI](images/custom_gui.png)

Log out of the Business Console.

### Stopping the sample

```bash
helm uninstall guicustomization-sample
```
10 changes: 5 additions & 5 deletions decisioncenter/guicustomization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## Introduction

This sample shows you how to customize the Business console using [GUI customization sample](https://www.ibm.com/docs/en/odm/9.0.0?topic=center-gui-customization) in a container environment.
This sample shows you how to customize the Business Console using [GUI customization sample](https://www.ibm.com/docs/en/odm/9.0.0?topic=center-gui-customization) in a container environment.

## Running this sample in Decision Center

### 1) Prerequisites

Before you begin, ensure you have at least Docker 24.0.x (and optionally Kubernetes 1.25+).
Before you begin, ensure you have at least Docker 24.0.x (and optionally Kubernetes 1.28+).

### 2) Building the Decision Center extension JAR

Expand All @@ -31,7 +31,7 @@ To use the sample in Decision Center, you need to build a JAR.
wget http://localhost:9060/decisioncenter/assets/decision-center-client-api.zip
```

Then, unzip decision-center-client-api.zip on the **lib** directory :
Then, unzip decision-center-client-api.zip to the **lib** directory :
```
unzip decision-center-client-api.zip -d "lib"
```
Expand All @@ -43,15 +43,15 @@ To use the sample in Decision Center, you need to build a JAR.

2. Build the JAR

The instructions below enable to build the JAR using a Docker container featuring Maven and a JDK version 17.
The instructions below enable to build the JAR using a Docker container featuring Maven and a JDK version 21, compatible for ODM 9.5.

Run the command below in the **decisioncenter/guicustomization/guicustomization-source** directory:

```bash
docker run --rm \
-v "$(pwd)":/usr/src/sample \
-w /usr/src/sample \
maven:3.8.5-openjdk-17 \
maven:3.9.9-ibm-semeru-21-jammy \
mvn clean install
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
odm:
image: icr.io/cpopen/odm-k8s/odm:9.0.0
image: icr.io/cpopen/odm-k8s/odm:9.5
mem_limit: 4G
memswap_limit: 4G
user: "1001:0"
Expand All @@ -12,7 +12,7 @@ services:
- 9453:9453

odm-with-gui-customization:
image: icr.io/cpopen/odm-k8s/odm:9.0.0
image: icr.io/cpopen/odm-k8s/odm:9.5
mem_limit: 4G
memswap_limit: 4G
user: "1001:0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
<goal>run</goal>
</goals>
<configuration>
<tasks>
<javac srcdir="${project.build.sourceDirectory}"
<target>
<javac srcdir="${project.build.sourceDirectory}"
destdir="${project.build.outputDirectory}"
includeantruntime="false"
compiler="modern">
<classpath>
<fileset dir="${project.basedir}/lib" includes="**/*.jar"/>
</classpath>
</javac>
</tasks>
</target>
</configuration>
</execution>
</executions>
Expand All @@ -39,6 +39,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.0</version>
<executions>
<execution>
<id>default-compile</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
package com.ibm.rules.decisioncenter.web.ext;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
Expand Down