Installing the Pers_Offers portlet
In this topic, you will learn how to install the Pers_Offers portlet using Microsoft Visual Studio Code (VSCode). You will also learn how to clone, compile, and package the Pers_offers project required to install the portlet.
Prerequisites
- Ensure you have installed git or git-bash, VSCode, and Maven. Refer to Prerequisites for the Personalization portlet exercise for more information.
- Ensure to run the following ConfigEngine tasks:
- UNIX™Linux™:
./ConfigEngine.sh create-pzndemo-users -DPortalAdminPwd=<password> -DWasPassword=<password>./ConfigEngine.sh install-pzndemo -DPortalAdminPwd=<password> -DWasPassword=<password>
- Windows™:
ConfigEngine.bat create-pzndemo-users -DPortalAdminPwd=<password> -DWasPassword=<password>ConfigEngine.bat install-pzndemo -DPortalAdminPwd=<password> -DWasPassword=<password>
- UNIX™Linux™:
Compiling and packaging the Pers_offers project
Refer to the following steps to compile and package the Pers_offers project in VSCode.
-
Clone the HCL Digital Experience Personalization development sample (Pers_Offers) git repository using the following command:
git clone https://github.com/HCL-TECH-SOFTWARE/DX-Personalization-Development-Sample -
In VSCode, go to this file path:
\dx-portlet-development-utilities\personalization\Pers_Offers\pers_offers -
Add the
ejb-thin-clientJAR dependencies to thepom.xmlfile of the pers_offers project. For example:
The
com.ibm.ws.ejb.thinclient_9.0.jarfile is an additional dependency needed to compile the project correctly. Refer to Running the IBM Thin Client for Enterprise JavaBeans (EJB) for more information. -
Compile and package the pers_offers project using the Maven plugin in VSCode.
- In the VSCode, go to Explorer > MAVEN > HCL DX Pers_Offers Personalization Demo Portlet > Lifecycle.
- Click package.
After packaging the project, a
\target\pers_offers-1.0-SNAPSHOT\WEB-INF\lib\pers_offers-1.0-SNAPSHOT.jarfile is created. -
Modify the
pers_offers-1.0-SNAPSHOT.jarfile using tools such as 7-zip to ensure the file only contains the pers_offers folder and its Java classes. Remove all other files and directories in the JAR file to ensure that the rule classes are loaded correctly by the Portal runtime.You can also use the Java JAR-Tool to package all classes of the pers_offers folder into a JAR file. Refer to Java JAR-Tool for more information.
-
Copy the modified
pers_offers-1.0-SNAPSHOT.jarfile to\PortalServer\pzn\prereq.pzn\collections. -
Restart the HCL Digital Experience (DX) server.
Installing the Pers_Offers portlet manually or through the DX client
As soon as the server restarts, you can install the Pers_Offers portlet. You can install the portlet manually, or through the HCL DX client.
-
Install the Pers_Offers portlet:
-
DX client installation
-
In VSCode, open the
tasks.jsonfile and verify the DXclient command settings to ensure it matches your DX environment settings. -
Click Terminal > Run task....
-
Click deploy_OR_Update_Portlet. A window will appear confirming if the deployment is successful.
You can also click undeploy_Portlet to undeploy the portlet again.
-
-
Manual installation
-
Log in to HCL DX as the Portal administrator (wpsadmin).
-
Navigate to Administration > Applications > Web Modules.
-
Click Install.
-
Select the
\dx-portlet-development-utilities\personalization\Pers_Offers\pers_offers\target\pers_offers-1.0-SNAPSHOT.warfile and install it.
-
-
-
Create a new page and name it Pers Offers.
-
Add the Pers Offers portlet.
Note
- After installing the Pers_Offers portlet, you will not see any personalized information in the portlet because the Personalization rules are not yet installed.
- Personalized information only appear for the Personalization sample users and not the Portal administrator (wpsadmin).