296 WebSphere Commerce Portal V5.4 Solutions
tants.S_TERMINAL_URI_PARAM%>"value="<%=com.ibm.commerce.portal.exports.C
ommercePortalConstants.S_TERMINAL_URI_PARAM_TRUE%>">
For example, if your original form looked like:
<FORM METHOD="POST" NAME="Logon" action="Logon"><INPUT TYPE="hidden"
NAME="storeId" VALUE="<%=storeId%>"><INPUT TYPE="hidden"
NAME="catalogId"VALUE="<%=catalogId%>"></FORM>
Then it should become:
<FORM METHOD="POST" NAME="Logon" action="<%=sPortalURI%>"><INPUT
TYPE="hidden" name="<%=sRemoteServletURIParam %>" value="<%=sURLPrefix
+"Logon"%>"><INPUT TYPE="hidden" NAME="storeId"
VALUE="<%=storeId%>"><INPUT TYPE="hidden" NAME="catalogId"
VALUE="<%=catalogId%>"></FORM>
7.3.5 Developing commerce enabled portlets
To develop portlets, you can use the WebSphere Studio Application Developer
wizards, subclass the provided classes of the WebSphere Commerce Portal
provided with the Commerce Enhancement Pack, or write native WebSphere
Portal portlets. In the event you develop native portlets, you must ensure that the
UserAgent parameter is set properly.
The Commerce Enhancement Pack portal adapters assume that the following
string is added to the UserAgent information:
(WpsHTTPClient)
For example:
httpurlconnection.setRequestProperty("User-Agent", sAgentId +
"(WpsHTTPClient)");
7.4 Package SAR and publish Web assets
This section describes how to package and publish the CEP stores. In our CEP
scenario, we have several CEP stores for different B2B customers.
This section includes the following tasks:
򐂰 Create a SAR using ant_create_sar.xml
򐂰 Publish Web assets to WebSphere Commerce using ant_publish_WCS.xml
To fully take advantage of the scripts provided for publishing, it is required that
the WebSphere Commerce Portal development environment is installed and
configured as described in Chapter 6, “Implement the development environment”
on page 253.
Chapter 7. Create a commerce enabled portal store 297
7.4.1 Create a SAR using ant_create_sar.xml
This section describes how the ant_create_sar.xml script, found in the
b2bCepWeb\ant directory of the workspace, can be used to repackage a SAR
file.
Figure 7-1 ant_create_sar.xml targets
To run the ant_create_sar.xml script within the WebSphere Studio Application
Developer, do the following:
1. Open the ant directory under your b2bCepWeb folder.
2. Right-click the ant_create_sar.xml and from the context menu select Run
Ant.
3. Select one of the following targets to run, as seen in Figure 7-1.
Note: You must modify the cep.config.properties file for your environment. It
contains a set of directory settings.
298 WebSphere Commerce Portal V5.4 Solutions
full To generate all assets including the SAR file and copying the
SAR file to the source directory.
copy_sar To copy the SAR file to the source directory.
sar To generate the SAR file including all necessary assets.
init To initialize script.
clean To delete all generated assets.
webassets To generate all assets for the SAR file.
4. By default, the SAR file is packaged in the
c:\sg246890-code\wsad\cep\b2bCepWeb\sar directory.
The SAR file packaged using this script can be deployed to the runtime or
development test environment using Store Services as described in Chapter 9,
“Deploy the commerce enabled portal” on page 309.
7.4.2 Publish Web assets to WebSphere Commerce using
ant_publish_WCS.xml
The ant_publish_WCS.xml script can be used if you want to publish Web assets
to the WebSphere Commerce runtime environment. This requires that you have
a network mapped drive from the development node to the runtime node. The
publish process updates the following directories:
򐂰 Store properties
C:\IBM\was\installedApps\WC_Enterprise_App_demo.ear\wcstores.war\WEB-INF\cl
asses\b2bCep
򐂰 Portal assets
C:\IBM\was\installedApps\WC_Enterprise_App_demo.ear\wcstores.war\b2bCep
򐂰 Web assets
C:\IBM\was\installedApps\WC_Enterprise_App_demo.ear\wcstores.war\b2bCep
򐂰 Tools runtime xml
C:\IBM\was\installedApps\WC_Enterprise_App_demo.ear\wcstores.war\xml\b2bCep
򐂰 Tools properties
C:\IBM\was\installedApps\WC_Enterprise_App_demo.ear\properties\tools\stores
\b2bCep
򐂰 Tools assets
C:\IBM\was\installedApps\WC_Enterprise_App_demo.ear\wctools.war\xml\tools\s
tores\b2bCep
Chapter 7. Create a commerce enabled portal store 299
Figure 7-2 ant_publish_WCS.xml targets
To run the script within the WebSphere Studio Application Developer, do the
following:
1. Open the ant directory under your b2bCepWeb folder.
2. Right-click ant_publish_WCS.xml and from the context menu, select Run
Ant.
3. Select one of the following targets to run:
publish_FULL To publish all assets to the destination
directories for WebSphere Commerce.
Note: The instance name and directories are defined in the
cep.config.properties file and cep.wcs.properties file.
300 WebSphere Commerce Portal V5.4 Solutions
publish_properties To publish only the properties to the
destination directories for WebSphere
Commerce.
publish_tools To publish all tool assets to the destination
directories for WebSphere Commerce.
publish_webassets To publish all Web assets to the destination
directories for WebSphere Commerce.
publish_webassets_portal To publish all portal Web assets to the
destination directories for WebSphere
Commerce.
init To initialize ant_publish_WCS.xml script
variables
clean To clean publish of store assets.

Get WebSphere Commerce Portal V5.4 Solutions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.