In the previous step of this tutorial, Editing the ProductOnlyDisplay.jsp file, you edited the ProductOnlyDisplay.jsp. In this step of the tutorial, you must define the dynamic context relationship between the shopping cart portlet and the product information display portlet.
Dynamic context relationships are defined through XML files. For more information about dynamic context and the XML files used to create the relationships, see Synchronized content through dynamic context.
For the purposes of this tutorial, a sample XML file defining the dynamic context relationship is provided. To review the sample XML file, do the following:
- Review the information in Synchronized content through dynamic context.
- Ensure you have downloaded the sample code package from Commerce Enabled Portal tutorials sample code.
- Locate the portlet.xml file in the Project Navigator by locating the portlet project you created when you installed and configured the development environment.
- In the Project Navigator, expand project > WebContent > WEB-INF.
- Open the portlet.xml file. The file displays in the main window.
- Edit the file:
- Select the Source view.
- Find the shopping cart concrete portlet section.
- Add the following configuration parameter to the end of the section:<config-param> <param-name>master_list</param-name> <param-value>ProductInfoGroup_productId</param-value> </config-param>
- Find the product info display concrete portlet section, which you added in the previous step
- Add the following configuration parameter to the end of the section:<config-param> <param-name>slave_list</param-name> <param-value>ProductInfoGroup_productId</param-value> </config-param> <config-param> <param-name>ProductInfoGroup_productId_slave_action_url</param-name> <param-value>https://hostname/webapp/wcs/stores/servlet/ProductDisplay?catalogId= catalogID &storeId= storeID &productId= productID &langId=- languageID &productInfo=true</param-value> </config-param> <config-param> <param-name>ProductInfoGroup_productId_context_to_param_map</param-name> <param-value>productId</param-value> </config-param>
- Save your changes.