In the previous step of the tutorial (Viewing the JSP files in the WebSphere Commerce development environment), you viewed the JSP files for the consumer direct commerce enabled starter store in the Commerce Enabled Portal development environment.
In this step of the tutorial you will learn how Commerce Enabled Portal JSP files use a library of Commerce Enabled Portal specific tags to convert WebSphere Commerce JSP files to work with WebSphere Portal.
WebSphere Commerce provides several tags that you can use to convert your WebSphere Commerce JSP files to work with WebSphere Portal. Each of these tags is identified by the prefix wcep: These tags are explained in more detail in Commerce Enabled Portal JSP file tag library.
In this step of the tutorial we will discuss the following tags:
- <wcep: cpinit>
- <wcep: imglink>
- <wcep: linkencoder>
To view the commerce enable portal specific tags in JSP files, do the following:
- In the SubCategoriesDisplay.jsp page find <% taglib uri="WCEP.tld" prefix="wcep"%><wcep: cpinit/>. It should be near the top of the page in the include line. This tag initializes the Commerce Enabled Portal tag library. If a JSP file uses the Commerce Enabled Portal tags, this tag must be placed in the JSP file before any other Commerce Enabled Portal specific tag.
- Next, look for img src = <wcep: imglink https="false">. This tag converts WebSphere Commerce relative paths for images into absolute paths, which are required for correct image display in Commerce Enabled Portal. When using images in Commerce Enabled Portal JSP files, follow the guidelines for WebSphere Commerce JSP files, then add the wcep: imglink tag.
- Look for
<a href="<wcep:linkencoder>ProductDisplay?catalogId=<%=catalogId%>&storeId=<%=storeId%>&productId=
<%=product.getProductID()%>&langId=<%=languageId%>&parent_category_rn=
<%=parentCategoryId%>&origin=CategoryDisplay</wcep:linkencoder>">
- This tag encodes URLs in the correct format for Commerce Enabled Portal. All URLs in Commerce Enabled Portal JSP files should be encoded using this tag. Note that the URL is the same as for WebSphere Commerce JSP files. The only difference is that the URL is prefaced with the <wcep:linkencoder> tag.
- Complete the tutorial, by completing the steps in Editing a Commerce Enabled Portal JSP file.