Commerce Enabled Portal JSP file tag library

WebSphere Commerce provides several tags that you should use to convert your WebSphere Commerce JSP files to work with WebSphere Portal. Each of these tags is identified by the prefix wcep.

For a better understanding and more examples of how these tags work in a JSP file, complete the following tutorials:

Tag Attributes Description Example
<wcep:cpinit/>
servletname: The servlet name that forms the proper URL. If the attribute is not specified, the default value servlet will be used. Use this tag to initialize the Commerce Enabled Portal specific parameters. Place this in a JSP file before any other Commerce Enabled Portal specific tag.
<%@ taglib uri="WCEP.tld" prefix="wcep" %> <wcep:cpinit/>

The Commerce Enabled Portal taglib tag is initialized and the cpinit tag is invoked before using any other Commerce Enabled Portal specific tags.

<wcep:linkencoder/>
additionalparams

Specifies the parameters that will be submitted in addition to the parameters in the encoded URLs.

Use this tag to encode URLs in the correct format for Commerce Enabled Portal. All URLs in Commerce Enabled Portal JSP files should be encoded using this tag.
a href="<wcep:linkencoder>DiscountDetailsDisplayView?code=<%=calcodeDBs[0].getCode()%>&catalogID=<%=catalogId%>&storeId=<%=storeId%>&langId=<%=languageId%></wcep:linkencoder>">See Details</a>

All the URLs used in the href attribute of the <a> HTML tag need to be properly encoded for usage in Commerce Enabled Portal.

<wcep:imglink/>
https

: (true or false) Specifies that the images should be delivered through the HTTPS connection.

Use this tag to convert WebSphere Commerce relative paths for images into absolute paths, which are required for correct image display in Commerce Enabled Portal. <img src="<wcep:imglink https="false"> <%=itemsAB[i].getObjectPath()%><%=catalogEntryDescriptionAB.getThumbNail() %>></wcep:imglink>" hspace="5" width="50" height="50" border="0" align="left">

All links to the image files should be converted. The original link is put in the body of the tag.

<wcep:formparam>
Use this tag to add the parameter to the form submitted from a Commerce Enabled Portal JSP. You must specify the WebSphere Commerce command that should handle the request submitted by the form in the body of the tag. Each form in the Commerce Enabled Portal JSPmust have this tag.
<form method="post" action="<wcep:formaction/>" name="<wcep:nsencoder>SimpleSearchForm</wcep:nesencoder>"><wcep:formparam>CatalogSearchResultView</wcep:formparam>
<input type="hidden" name="storeId" value="<%= storeId %>">
<input type="hidden" name="beginIndex" value="0">
<input type="hidden" name="sType" value="SimpleSearch">
<input type="hidden" name="resultType" value="2">
</form>
<wcep:formparamjs>
Use this tag to encode the value of the Commerce Enabled Portal specific parameter ôruö when the value of this parameter is set explicitly in the JavaScript function. (Otherwise this parameter would be implicitly set by the <wcep:formparam> tag
document.<wcep:
nsencoder>MQuickOrderForm</wcep:nesencoder>.ru.value="<wcep:formparamjs>CatalogItemAdd</wcep:formparamjs>";
<wcep:nsencoder>
Use this tag to ensure the correct namespace encoding for all name sensitive HTML elements. To avoid name collision encode names of all forms, JavaScript functions, and so on.
<form method="post" action="<wcep:formaction/>"name="<wcep:nsencoder>SimpleSearchForm</wcep:nesencoder>"><wcep:formparam>CatalogSearchResultView</wcep:formparam>
<input type="hidden" name="storeId" value="<%= storeId %>">
<input type="hidden" name="beginIndex" value="0">
<input type="hidden" name="sType" value="SimpleSearch">
<input type="hidden" name="resultType" value="2">
</form>
<wcep:initurl>
Use this tag to retrieve the original URL for the given portlet (initial URL specified in portlet.xml)

Feedback