Feature Pack 7 or later

Packaging and deploying custom Commerce Composer widget code

You can deploy your custom Commerce Composer widget code into your production environment with the WebSphere Commerce Build and Deployment tool.

The WebSphere Commerce Build and Deployment tool is designed to address the error-prone and time-consuming nature of customized asset deployment. The WebSphere Commerce Build and Deployment tool provides a starting point for you to automate your build and deployment processes in a standardized, controlled manner. For more information about the WebSphere Commerce Build and Deployment tool, see WebSphere Commerce Build and Deployment tool.

The following procedure provides information to help you package and deploy the specific widget customization code that you created in this tutorial. For more information about the full process for packaging and deploying customization code if you are not familiar with using the tool, see Tutorial: Using the WebSphere Commerce Build and Deployment tool.

Procedure

Create the source code repository
  1. Create the source code repository to include the Data Load utility files and code packages for your widget customization code.
    1. In a File Manager, go to the WCBD_installdir directory.
    2. Create the following directory structure within the wcbd directory:

      source\workspace

  2. Add the Data Load utility files for your custom widget into your source code repository for the WebSphere Commerce Build and Deployment tool.
    1. In the WCBD_installdir\source\workspace directory, create the following directory structure:

      DataLoad\dataload\common

      You use the directory structure to hold your widget Data Load utility files during the build process.
    2. Go to the DataLoad directory within your new widget project.
      For example, if your new widget project is at the top level in your workspace the filepath to the directory, can be workspace_dir\NewWidgetProject\Dataload.
    3. Copy all of the folders and files within the DataLoad directory.
    4. Paste the copied folders and files within the WCBD_installdir\source\workspace\DataLoad\dataload\common directory.
      The contents of your common directory can resemble the following image:
      Directory contents for WebSphere Commerce Build and Deployment tool package
  3. Add the code packages for your custom widget into your source code repository for the WebSphere Commerce Build and Deployment tool.
    1. Go to the workspace_dir directory.
    2. Copy the LOBTools directory.
    3. Paste the LOBTools directory within the WCDE_installdir\wcbd\source\workspace directory.
    4. In the WCBD_installdir\source\workspace directory, create the following directory structure:

      Stores\WebContent\Aurora\ShoppingArea\ShopcartSection

    5. Go to the workspace_dir\Stores\WebContent\Aurora\ShoppingArea\ShopcartSection directory.
    6. Copy the OrderItemDisplay.jsp file.
    7. Paste the OrderItemDisplay.jsp file into the WCBD_installdir\source\workspace\Stores\WebContent\Aurora\ShoppingArea\ShopcartSection directory.
    8. Go to the workspace_dir\Stores\WebContent directory.
    9. Copy the Widgets-MyCompany directory.
    10. Paste the Widgets-MyCompany directory into the WCBD_installdir\source\workspace\Stores\WebContent directory.
Configure and run the build process
  1. Set up the source extraction Ant script.
    The Ant script extracts the source code from the source code repository that you created.
    1. Go to the WCBD_installdir\extract directory.
    2. Copy the wcbd-sample-extract-local.properties and wcbd-sample-extract-local.xml files.
    3. Paste the files into the WCBD_installdir directory.
    4. Rename the wcbd-sample-extract-local.properties file to be extract-local.properties.
    5. Rename the wcbd-sample-extract-local.xml file to be extract-local.xml.
    6. Open the extract-local.xml file for editing.
    7. Locate the following line of code:
      <project name="wcbd-sample-extract-local" default="all">
    8. Replace the line of code that you located with the following code:
      <project name="extract-local" default="all">
    9. Save and close the files.
    10. Open the extract-local.properties file for editing.
    11. Set the value for local.extract.dir= to be WCBD_installdir/source
      Note: In all of the properties files that your WebSphere Commerce Build and Deployment tool uses, you must use forward slashes in the filepaths. Otherwise, the build process fails.
  2. Configure the WebSphere Commerce Build and Deployment tool build settings.
    1. Go to the Ant_installdir\lib
    2. Copy the ant-contrib-1.0b3.jar file.
    3. Paste the JAR files into the WCBD_installdir\lib directory.
    4. Go to the WCBD_installdir directory.
    5. Create a copy of the wcbd-setenv.bat file and rename the copy setenv.bat.
    6. Create a copy of the wcbd-build.private.properties.template and rename the copy build-local.private.properties.
    7. Create a copy of the wcbd-build.properties.template and rename the copy build-local.properties.
    8. Open the setenv.bat for editing.
    9. Change the value for ANT_HOME to be Ant_installdir.
      For example, C:/apache-ant-1.8.1
    10. Ensure that the value for WAS_HOME to be the correct value.
      For example, C:/Progra~1/IBM/SDP/runtimes/base_v7
    11. Open the build-local.properties file for editing.
    12. Set the following properties and values:
      web.module.list=Stores
      open.laszlo.web.module.list=LOBTools
      wc.home=WCDE_installdir
      was.home=C:/Progra~1/IBM/SDP/runtimes/base_v7
      extract.ant.file=${basedir}/extract-local.xml
    13. Save and close the files.
  3. Run the build process. During the build process, you run a script to create the deployment package.
    1. Open a command prompt and go to the WCBD_installdirdirectory.
    2. Run the following command:

      wcbd-ant.bat -buildfile wcbd-build.xml -Dbuild.label=composer -Dbuild.type=local

      Where the value for the -Dbuild.label parameter is the name of your package. You can set the value for the parameter to be whatever value that you want to name your package. As an example, the previous command, names the package composer.
    When the command runs, the WebSphere Commerce Build and Deployment tool creates two deployment packages
    • A package for production server deployment.
    • A package for WebSphere Commerce Developer server deployment.
    The packages are located within the WCBD_installdir\dist directory.
The following steps demonstrate how to deploy your package from you build system into another WebSphere Commerce Developer environment. For information about deploying the package for a production environment, see Configuring and running the server deployment process.
  1. Install the package for WebSphere Commerce Developer server deployment in your WebSphere Commerce Developer environment.
    1. In the WebSphere Commerce Developer environment where you are deploying your package, create the WCBD_deploy_toolkit_common_dir directory.
    2. In the WebSphere Commerce Developer environment where you built the package, go to the WCBD_installdir\dist directory.
    3. Copy the generated wcbd-deploy-toolkit-build-label.zip compressed file.
    4. In the WebSphere Commerce Developer environment where you are deploying your package, go to the WCBD_deploy_toolkit_common_dir directory.
    5. Paste and extract the copied compressed file.
      The WCBD_deploy_toolkit_dir directory is created.
  2. Configure the deployment settings for the WebSphere Commerce Developer environment where you are deploying your package. You must configure the settings before you run the deployment script. The settings identify information such as installation paths and environment settings for your WebSphere Commerce Developer environment.
    1. Go to the WCBD_deploy_toolkit_dir directory.
    2. Create a copy of the wcbd-setenv.bat.template and rename the copy setenv.bat.
    3. Create a copy of the wcbd-deploy.private.properties.template and rename the copy deploy-target-env.private.properties, where target-env is the identifier for your target environment.
    4. Create a copy of the wcbd-deploy.properties.template and rename the copy deploy-target-env.properties.
    5. Open the setenv.bat file for editing.
    6. Change the value for WCDE_HOME to be WCDE_installdir.
    7. Open the deploy-target-env.private.properties for editing.
    8. Configure the following properties to ensure that the appropriate values are set:
      db.user.name=
      db.user.password=
      For example,
      db.user.name=app
      db.user.password=password
    9. Open the deploy-target-env.properties file for editing.
    10. Configure the following properties to ensure that the appropriate values are set:
      web.module.list=
      open.laszlo.web.module.list=
      db.name=
      db.schema.name=
      jdbc.url=
      jdbc.driver=
      jdbc.driver.path=
      datasource.jdni.name=
      dataload.dataload.common.order=
      dataload.dataload.common.ordered.list=
      For example,
      web.module.list=Stores
      open.laszlo.web.module.list=LOBTools
      db.name=${wc.home}/db/mall
      db.schema.name=APP
      jdbc.url=jdbc:derby:${db.name}
      jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
      jdbc.driver.path=${wc.home}/lib/derby.jar
      datasource.jdni.name=jdbc/WebSphere Commerce Cloudscape DataSource demo
      dataload.dataload.common.order=true
      dataload.dataload.common.ordered.list=widgets/wc-dataload-widget.xml,layout/wc-dataload-layout.xml,page/wc-dataload-page.xml
    11. Save and close the files.
  3. Run the toolkit deployment process.