Customizing the Visual Modeler UI and backend
You can customize the Visual Modeler UI and backend by using the cpq-vmoc-base image.
Before you begin
- Install the most recent Sterling Configure, Price, Quote, Release 10.0 fix pack.
- Mount the required logs or volumes that you might need to browse.
- Ensure that Docker is installed on the host machine and ensure that you can run Podman commands. Also, ensure that the cpq-vmoc-base image is pulled into the local Docker repository.
- Create a custom base container from the base image by running the Podman
command.
podman run -it --net=podman --privileged -e LICENSE=accept <image>:<tagname>
- By default, the Helm chart copies the following files while deploying the Visual Modeler application. Create a directory as VM in the configuration
repository, if not already present, which is in parallel with the IBM® Omni-Configurator.
- Any *.jar file that is placed in the [mounted dir]/VM/extensions directory is copied to the <VM_wardir>/WEB-INF/lib directory.
- Any *.properties or *.xml file that is placed in the [mounted dir]/VM/properties directory is copied to the <VM_wardir>/WEB-INF/properties directory.
- Any *.* file that is placed in the [mounted dir]/VM/web directory is copied to the <VM_wardir>/WEB-INF/web directory.
Preparing the base image for customization
To prepare the base image for customization, complete the following steps:- Check whether you have the /opt/VMSDK/projects/matrix folder inside the
container. If not, run the following command to create a matrix folder inside the directory
/opt/VMSDK/projects/.
./executeAll.sh --DBTYPE=dbtype --createDB=false --loadDB=false --MODE=vm --generateImage=false
Updating your customization
Important: Maintain a backup of all the customization changes in the shared directory
/opt/VMSDK/customization_backup so that your changes are not lost even if the
container is lost.
- To customize the Visual Modeler backend, copy the Java files CreateNewMGController.java and MGGIController.java along with the directory structure src/com/comergent/reference/apps/visualModeler to the /opt/VMSDK/projects/matrix/src folder.
- To customize the Visual Modeler UI, copy the JSP file VM_MG_GeneralInfo.jsp along with the directory structure WEB_INF/web/en/US/visualModeler to the /opt/VMSDK/projects/matrix folder.
Building and generating the custom image
To build the custom image, go to the /opt/VMSDK folder inside the container
and run the following command to build the Visual Modeler WAR file with the customized
changes.
./buildvmwar.sh --DBTYPE="$DBTYPE"
To generate the custom image, run the following
command.
./generateImage.sh --DBTYPE="$DBTYPE" --MODE=vm --IMAGE_TAG_NAME="$IMAGE_TAG_NAME" --generateImageTarFlag=true --pushImageFlag=true --imageRegistryURL="$imageRegistryURL" --imageRegistryPassword="$imageRegistryPassword"
Loading the custom images to OpenShift Container Platform
To load the custom images to OpenShift® Container Platform, complete the following steps:
- Log in to the registry where you have pushed the customized images, and then pull the images by
running the following
command:
podman pull registry/<imagename>:<tagname>
- Log in to the private Docker image registry by running the following
command:
buildah login <rhocp_docker_registry>
- Load the custom images by completing the following steps:
-
buildah tag <image_id> <rhocp_docker_registry>/<namespace>/<imagename>:<tagname>
For example,
buildah tag <image_id> <rhocp_docker_registry>/default/cpq-vmoc-base:10.0-x86-64
For more information about loading the custom images to OpenShift Container Platform, see Pushing and pulling images.
- Push the custom image into the private registry by running the following
command:
buildah push <rhocp_docker_registry>/<namespace>/<imagename>:<tagname>
For example,
buildah push <rhocp_docker_registry>/default/cpq-vmoc-base:10.0-x86-64
-
- Verify that the Docker images are loaded to OpenShift Container Platform by completing the
following steps:
- Log in to Red Hat® OpenShift Container Platform web console as the OpenShift administrator by providing
valid credentials, and click Log In.
Ensure that Cluster Console is selected in the application launcher menu.
- From the left navigation pane, click
You can view all the images that are pushed to a particular NAMESPACE.
. - To verify that the custom images are loaded with the correct tag name, click the image name. In the Tags pane, you can view all the tag names for the selected image.
- Log in to Red Hat® OpenShift Container Platform web console as the OpenShift administrator by providing
valid credentials, and click Log In.
- Ensure that you use the new image with the updated tag name when you install or update the Sterling Configure, Price, Quote Helm chart.