Once you complete and test the customization,
you are ready to deploy your custom code to a target WebSphere Commerce
Server to make the new function available to your business users.
Deploying to the server involves exporting code from the WebSphere
Commerce development environment and deploying code into the target
WebSphere Commerce Server.
Before you begin
You must have created a store, based upon the ConsumerDirect
starter store, on the remote WebSphere Commerce Server before starting
these deployment steps.
About this task
This tutorial continues the customization performed in
Tutorial: Adding fields in the Catalogs tool. You can choose to complete
the deployment together after completing these two tutorials or you
can deploy them separately, in sequence. To reduce the deployment
time and downtime of a production site, it is recommended that you
complete one single deployment.
Procedure
- Export the code from the WebSphere Commerce development
environment:
- Export the LOBTools project:
- In the Enterprise Explorer view,
expand ;
then click .
- Click Browse to select a destination.
- Click Finish.
- Optional: If you have not already deployed
either Tutorial:
Adding new properties to a WebSphere Commerce service using the data
service layer or Tutorial: Adding fields in the Catalogs tool, export the WebSphereCommerceServerExtensionsLogic
project:
- Switch to the Enterprise Explorer view.
- Navigate to .
- Right-click the WebSphereCommerceServerExtensionsLogic project
and select Export. The Export wizard opens.
- In the Export wizard:
- Select JAR file and click Next.
The WebSphereCommerceServerExtensionsLogic project
is selected by default. Leave this value selected.
- In the right panel, ensure that the following resources are not
selected:
- .classpath
- .classpath.template
- .project
- .runtime
- Ensure that Export generated class files and resources is
selected.
- Do not select Export Java source files and resources.
- In the Select the export destination field,
type the fully-qualified JAR file name to use. In this case, type
Drive:\ExportTemp\WebSphereCommerceServerExtensionsLogic.jar.
- Click Finish.
- To export the data service layer (DSL) extension configuration
files, copy the XML configuration files to the directory that you
are using to build your deployment package:
- Navigate to your temporary directory, for example, drive:\ExportTemp.
- Create the xml\config\com.ibm.commerce.catalog-ext directory.
The structure within this directory must match the structure that
you want inside the EAR file.
- Copy the files from the WC_eardir\xml\config\com.ibm.commerce.catalog-ext
directory to drive:\ExportTemp\xml\config\com.ibm.commerce.catalog-ext
directory. In this tutorial, these files include:
- wc-component.xml
- wc-business-object-mediator.xml
- wc-object-relational-metadata.xml
- *.tpl (the query templates files)
- Create a compressed (zip) file that contains all of the files
under the ExportTemp directory. Name the file partialApp.zip, for
example, drive:\ExportTemp\partialApp.zip. The
following example shows a sample structure of the zip file:
WebSphereCommerceServerExtensionsLogic.jar
xml\config\com.ibm.commerce.catalog-ext/wc-component.xml
xml\config\com.ibm.commerce.catalog-ext/wc-business-object-mediator.xml
xml\config\com.ibm.commerce.catalog-ext/wc-object-relational-metadata.xml
xml\config\com.ibm.commerce.catalog-ext/wc-query-MyCompanyCatalogEntry-get.tpl
xml\config\com.ibm.commerce.catalog-ext/wc-query-MyCompanyCatalogEntry-update.tpl
- Copy the access control policies that were created for
your new resources:
- Navigate to the WC_eardir\xml\policies\xml directory.
- Copy the following files into the drive:\ExportTemp\ACPolicies
directory:
- MyCompanyCatalogAccessControlPolicies.xml
- Deploy the code into the target WebSphere Commerce Server:
- To deploy LOBTools.war:
- In the WebSphere Application Server, select Administrative
console. Navigate to .
- In the Application Name field, specify
the name of the application, for example, WC_demo,
and click Update.
- Select Single module and change the specified
path to your path.
- Click Next.
- In the next page, do not make any changes and click Next.
- Click Continue on the following page.
- To map the module to the server, select the Module, press Ctrl,
select the Clusters and Servers that are running your WebSphere Commerce
application, and then click Apply.
- Select VH_demo_Tools in the Virtual host dropdown
list.
- Click Next, and then click Finish.
- To deploy the WebSphereCommerceServerExtensionsLogic.jar
file and the XML configuration files, you create a temporary directory
on the target WebSphere Commerce Server, and then copy your export
assets into this directory:
- Package the WebSphereCommerceServerExtensionsLogic.jar file and
the xml directory into a zip file. For example, partialApp.zip.
- In the WebSphere Application Server administrative console, select
.
- In the Application Name field, specify
the name of the application, for example, WC_demo,
and click Update.
- Select Partial Application.
- In the Upload the archive file with the new or replacement
files section, select Local file system,
click Browse, and then specify the path to
the drive:\ImportTemp\partialApp.zip file.
- Click Next.
- Click OK.
- Save the changes:
- Click Save to Master Configuration. The
WebSphere Commerce application will restart. Your changes will be
applied.
- Click Save.
- Load access control policies on your target WebSphere
Commerce Server: