Deploying your customized code

This section refers to deploying your customized code.

Before you begin

Before you start these deployment steps, you must have already created a store on the remote WebSphere Commerce Server that is based on the Consumer Direct starter storeconsumer direct sample store.

About this task

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.

Since this scenario follows the scenario 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.


  1. Export the LOBTools project:
    1. In the Enterprise Explorer view, expand
    2. Right-click LOBTools and select Export > WAR file.
    3. Click Browse to select a destination.
    4. Click Finish.
  2. Optional: If you have not already deployed either Tutorial: Extending a BOD service to manage UserData with the Data Service layer or Tutorial: Adding fields in the Catalogs tool, export the WebSphereCommerceServerExtensionsLogic project:
    1. Switch to the Enterprise Explorer view.
    2. Navigate to Other Projects > WebSphereCommerceServerExtensionsLogic.
    3. Right-click the WebSphereCommerceServerExtensionsLogic project and select Export. The Export wizard opens.
    4. In the Export wizard:
      1. Select JAR file and click Next. The WebSphereCommerceServerExtensionsLogic project is selected by default. Leave this value selected.
      2. In the right pane, ensure that resources that start with a period are not selected. For example:
        • .classpath
        • .classpath.template
        • .project
        • .runtime
      3. Ensure that Export generated class files and resources is selected.
      4. Do not select Export Java source files and resources.
      5. In the Select the export destination field, type the fully-qualified JAR file name to use. In this case, type Drive:\ExportTemp\WebSphereCommerceServerExtensionsLogic.jar.
      6. Click Finish.
  3. 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:
    1. Navigate to your temporary directory, for example, drive:\ExportTemp.
    2. Create the xml\config\ directory. The structure within this directory must match the structure that you want inside the EAR file.
    3. Copy the files from the drive:\WCDE_installdir\xml\config\ directory to the drive:\ExportTemp\xml\config\ directory. In this tutorial, these files include:
      • wc-component.xml
      • wc-business-object-mediator.xml
      • wc-object-relational-metadata.xml
      • query templates file
      For example, wc-query-MyCompanyCatalogEntry-get.tpl.
    4. Create a compressed (zip) file that contains all of the files under the ExportTemp directory. Name the file, for example, drive:\ExportTemp\ The following example shows a sample structure of the zip file:
  4. Deploying code into the target WebSphere Commerce Server. In this step, you create a temporary directory on the target WebSphere Commerce Server, and then copy your export assets into this directory
    1. In the WebSphere Application Server, select administrative console. Navigate to Applications > Enterprise Applications.
    2. In the Application Name field, specify the name of the application, for example, WC_demo, and click Update.
    3. Select Single module and change the specified path to your path.
    4. Click Next.
    5. In the next page, do not make any changes and click Next.
    6. Click Continue on the following page.
    7. 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.
    8. Select Virtual host.
    9. Click Next, and then click OK.
  5. To deploy the WebSphereCommerceServerExtensionsLogic.jar file and the XML configuration files:
    1. Package the WebSphereCommerceServerExtensionsLogic.jar file and the xml directory into a zip file. For example,
    2. In the WebSphere Application Server administrative console, select Applications > Enterprise Applications.
    3. In the Application Name field, specify the name of the application, for example, WC_demo, and click Update.
    4. Select Partial Application.
    5. 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\ file.
    6. Click Next.
    7. Click OK.
  6. Save the changes:
    1. Click Save to Master Configuration. The WebSphere Commerce application will restart. Your changes will be applied.
    2. Click Save.


In this tutorial, you have customized:
  1. Management Center user interface files to add new sections with extended properties in the Advanced Search dialog and Catalog Search Result list view
  2. Controller JSP files to transfer extended query parameters from the user interface to the search template in the expression builder
  3. The wc-component.xml and get-data-config.xml configuration files to extend the search template in the expression builder to handle the search with more conditions