Customizing the containerized deployment (Fix Pack 5 and later)

Product Master images can be customized with custom tabs and extensions.

Fix Pack 5 and later

Most of the customization requires additional JAR files and JSP files, with modification to the data_entry_properties.xml, flow-config.xml, and the common.properties configuration files. Product Master application runs with the user default user identifier (UID) 5000 and group identifier (GID) 0. Ensure that you use appropriate user while customizing the docker images.

You can update the properties values by using any of the following methods.
  • Create ConfigMap and using the values in the post-config.sh file.
  • Hardcode the values in the post-config.sh file.
Using ConfigMap you do not need to re-create the docker image to change the property value. You can directly change the property value from ConfigMap and restart the associated pod.

Following are the ConfigMap names.

  • productmaster-admin-configmap
  • productmaster-personaui-configmap
  • productmaster-restapi-configmap
  • productmaster-sch-configmap
  • productmaster-wfl-configmap
  • productmaster-fts-indexer-configmap
  • productmaster-fts-pim-configmap
  • productmaster-ml-configmap
  • productmaster-gds-configmap

You can create these ConfigMaps before deployment.

Add all your required properties in the productmaster-admin-configmap.yaml file in the following format.
apiVersion: v1
data:
  XFRAME_HEADER_OPTION: ALLOWALL
  RICH_SEARCH_DEFAULT_VIEW_INDEXED_ONLY: false
  kind: ConfigMap
metadata:
  name: productmaster-admin-configmap
  namespace: <>

Apply productmaster-admin-configmap.yaml file in the namespace where your deployment is present or you where you are going to deploy. If you expect similar changes in other pods like personaui or scheduler, then follow the same steps for those services too.

Following is the automation process to place the custom JAR files in the $TOP folder or configure additional dependencies by using the jars-custom.txt file. The JAR files get added to the Product Master class path.
+-- top-jars
+-- custom-jars  
+-- Dockerfile
+-- public_html
¦   +-- user
+-- user-scripts
top-jars
Copy the JAR files to this directory. These files are added in the $TOP folder.
custom-jars
Copy the JAR files to this folder if you want to add them through the jars-custom file.
user-scripts
Pre-configuration or Post-configuration (Any processing before or after the configureEnv.sh file) through pre-config.sh or post-config.sh scripts. For any processing that happens after the installation but before starting the service, copy the script to this folder.
public_html/user
Any other files that need to be copied into the image.
Sample Dockerfile to update the Admin UI image
FROM ipm-admin-ubi8:12.0.x
USER root
RUN mkdir -p /home/default/user-scripts; \
mkdir -p /home/default/custom-jars; \
mkdir -p /home/default/files
COPY user-scripts/*.sh /home/default/user-scripts/
COPY custom-jars/*.jar /home/default/custom-jars/
COPY etc/default/flow-config.xml /home/default/files/
COPY etc/default/data_entry_properties.xml /home/default/files/
COPY public_html/user/* /home/default/files/
RUN chmod 755 /home/default/user-scripts/*.sh; \
chown 5000.0 /home/default/ -R;
USER 5000
WORKDIR /home/default
ENTRYPOINT ["./cmd.sh"]

Additional configuration is required, for custom tabs and entry preview functions that involve interaction between the UI elements in the Admin UI and the Persona-based UIs. You can perform the configuration by using the post-config.sh script. When the container is initialized, the post-config.sh script runs and updates the configuration. In the following example, an entry preview script is configured to open a new results window.

Sample Dockerfile
FROM ipm-restapi-ubi8:12.0.x
USER root
RUN mkdir -p /home/default/user-scripts; \
mkdir -p /home/default/custom-jars; \
mkdir -p /home/default/files
COPY user-scripts/*.sh /home/default/user-scripts/
COPY custom-jars/*.jar /home/default/custom-jars/
COPY etc/default/flow-config.xml /home/default/files/
COPY etc/default/data_entry_properties.xml /home/default/files/
COPY public_html/user/* /home/default/files/
RUN chmod 755 /home/default/user-scripts/*.sh; \
chown 5000.0 /home/default/ -R;
USER 5000
WORKDIR /home/default
ENTRYPOINT ["./cmd.sh"]
Sample post-config.sh script
#!/bin/sh
echo "Starting post-config.sh script....."
cp -f /home/default/files/flow-config.xml /opt/MDM/etc/default/
cp -f /home/default/files/data_entry_properties.xml /opt/MDM/etc/default/
cp -f /home/default/files/CustomAction.jsp /opt/MDM/public_html/user/CustomAction.jsp
cp -f /home/default/files/SamplePage.jsp /opt/MDM/public_html/user/SamplePage.jsp
cp -f /home/default/files/systemTab.css /opt/MDM/public_html/user/systemTab.css
sed -i "s/^xframe_header_option=.*/xframe_header_option=$XFRAME_HEADER_OPTION/g" /opt/MDM/etc/default/common.properties
sed -i "s/^rich_search_default_view_indexed_only=.*/rich_search_default_view_indexed_only=$RICH_SEARCH_DEFAULT_VIEW_INDEXED_ONLY/g" /opt/MDM/etc/default/common.properties
Similarly, the pre-config.sh file can be used to customize application. The script runs before the configureEnv.sh file runs when the container is initialized. In the following example, Angular-based entry preview, custom tool, and custom tab scripts are added. Similarly, configuration for custom REST APIs can be added in the ipm-restapi-ubi8:12.0.x image.
Sample Docker file
FROM ipm-personaui-ubi8:12.0.x
USER root
RUN mkdir -p /home/default/user-scripts; \
mkdir -p /home/default/custom-jars; \
mkdir -p /home/default/files;\
mkdir -p /home/default/files/personaCustomTabsLibrary.chunk;\
mkdir -p /home/default/files/classes/
COPY user-scripts/*.sh /home/default/user-scripts/
COPY angular-custom-code/*.json /home/default/files/
COPY angular-custom-code/*.js /home/default/files/personaCustomTabsLibrary.chunk/
COPY rest-custom-code/*.class /home/default/files/classes/
RUN chmod 755 /home/default/user-scripts/*.sh; \
chown 5000.0 /home/default/ -R;
USER 5000
WORKDIR /home/default
ENTRYPOINT ["./cmd.sh"]
Sample pre-config.sh file
#!/bin/sh
echo "Starting pre-config.sh script....."
cp -ar /home/default/files/redirectBusinessUI.js /opt/MDM/public_html/user/redirectBusinessUI.js
cp -ar /home/default/files/preview-script.json /opt/MDM/mdmui/custom/ui/json/preview-script.json
cp -ar /home/default/files/persona-custom-tabs.json /opt/MDM/mdmui/custom/ui/json/persona-custom-tabs.json
cp -ar /home/default/files/persona-custom-tools.json /opt/MDM/mdmui/custom/ui/json/persona-custom-tools.json
cp -ar /home/default/files/personaCustomTabsLibrary.chunk/personaCustomTabsLibrary.bundle.js /opt/MDM/mdmui/custom/ui/js/personaCustomTabsLibrary.bundle.js
cp -ar /home/default/files/personaCustomTabsLibrary.chunk/personaCustomToolsLibrary.bundle.js /opt/MDM/mdmui/custom/ui/js/personaCustomToolsLibrary.bundle.js
cp -ar /home/default/files/personaCustomTabsLibrary.chunk/previewScriptLibrary.bundle.js /opt/MDM/mdmui/custom/ui/js/previewScriptLibrary.bundle.js
cp -ar /home/default/files/classes /opt/MDM/mdmui/custom/api/

If you want to change value of property after the custom images are deployed, you can adjust the value anytime from the OpenShift UI > ConfigMap and then restarting pod.

If you are using Kubernetes, then you can edit ConfigMap using the following command and then restart the pod.
kubectl edit configmap productmaster-admin-configmap

You can follow the same steps for other pods that are using custom images.

Best practice for starting or stopping Product Master services

  • Make the replica count 0 for required service in the ipm_12.0.x_cr.yaml file and apply the CR file. As soon as you apply the CR file, the associated service pod is removed.
  • To restart the service, you need to change the replica count back to 1 and apply the CR file. A new pod is created and started.
  • Database backup or maintenance - Database maintenance tasks like REORG or backup should be only performed when all the pods are in the stopped state.
  • Product maintenance scripts - Scripts like delete_old_versions.sh or estimate_old_version.sh do not need pods to be in a stopped state. The recommendation is to run the scripts when the system is under low load. After you log in to the pod, run the following command to load the required environment variables of the Product Master.
    source /home/default/.bash_profile
    The only product scripts that should be run with all pods in the stopped state are create_schema.sh and migration scripts. For more information, see Creating or migrating database schema.