Deploying your customized code

In this lesson, you deploy your custom code to a target WebSphere Commerce Server. Deploying to the server involves transferring the code from the WebSphere Commerce development environment to the target WebSphere Commerce Server.

About this task

Procedure

  1. Create the XWARRANTY and XCAREINSTRUCTION tables in the database that is used by your target WebSphere Commerce Server:
    Apache DerbyDB2
    1. Connect to your DB2 database.
    2. Run the SQL statement to create the tables.
      CREATE TABLE XWARRANTY
      (
      CATENTRY_ID BIGINT NOT NULL, 
      WARTERM INTEGER, 
      WARTYPE VARCHAR(32), 
      OPTCOUNTER SMALLINT, 
      CONSTRAINT XWARRANTY_PK PRIMARY KEY(CATENTRY_ID), 
      CONSTRAINT XWARRANTY_FK FOREIGN KEY (CATENTRY_ID) REFERENCES CATENTRY(CATENTRY_ID)
      );
      CREATE TABLE XCAREINSTRUCTION 
      (
      CATENTRY_ID BIGINT NOT NULL,
      LANGUAGE_ID INTEGER NOT NULL,
      CAREINSTRUCTION VARCHAR(254),
      OPTCOUNTER SMALLINT,
      CONSTRAINT XCAREINST_PK PRIMARY KEY (CATENTRY_ID, LANGUAGE_ID),
      CONSTRAINT XCAREINST_FK1 FOREIGN KEY (CATENTRY_ID, LANGUAGE_ID) REFERENCES CATENTDESC(CATENTRY_ID, LANGUAGE_ID),
      CONSTRAINT XCAREINST_FK2 FOREIGN KEY (CATENTRY_ID) REFERENCES CATENTRY (CATENTRY_ID)
      );
    Oracle
    1. Connect to your Oracle database.
    2. Run the SQL statement to create the tables.
      CREATE TABLE XWARRANTY
      ( 
      CATENTRY_ID NUMBER NOT NULL,
      WARTERM INTEGER,
      WARTYPE VARCHAR(32),
      OPTCOUNTER SMALLINT,
      CONSTRAINT XWARRANTY_PK PRIMARY KEY(CATENTRY_ID),
      CONSTRAINT XWARRANTY_FK FOREIGN KEY (CATENTRY_ID) REFERENCES CATENTRY(CATENTRY_ID)
      );
      CREATE TABLE XCAREINSTRUCTION (
      CATENTRY_ID NUMBER NOT NULL,
      LANGUAGE_ID INTEGER NOT NULL,
      CAREINSTRUCTION VARCHAR(254),
      OPTCOUNTER SMALLINT,
      CONSTRAINT XCAREINSTRUCTION_PK PRIMARY KEY (CATENTRY_ID, LANGUAGE_ID),
      CONSTRAINT XCAREINSTRUCTION_FK1 FOREIGN KEY (CATENTRY_ID, LANGUAGE_ID) REFERENCES CATENTDESC(CATENTRY_ID, LANGUAGE_ID),
      CONSTRAINT XCAREINSTRUCTION_FK2 FOREIGN KEY (CATENTRY_ID) REFERENCES CATENTRY (CATENTRY_ID)
      );
      
  2. Create the WC_installdir\instances\instance_name\xml\config\com.ibm.commerce.catalog-ext directory if the directory does not exist.
  3. Copy all the custom Data Service Layer configuration files from the WebSphere Commerce development environment to the WebSphere Commerce server instance directory.
    1. Navigate to the workspace_dir\WC\xml\config\com.ibm.commerce.catalog-ext directory.
    2. Copy all of the custom Data Service Layer configuration files within this directory.
    3. Navigate to the WC_installdir\instances\instance_name\xml\config\com.ibm.commerce.catalog-ext directory.
    4. Paste all of the files into this directory.
  4. Package your custom XML reader class and the custom physical SDO classes. Package these classes in the WebSphereCommerceServerExtensionsLogic project to a JAR file.
  5. Create the WC_installdir\ext\lib directory if the directory does not exist. Copy the JAR file to the WC_installdir\ext\lib directory. Your custom JAR files must be placed within the WC_installdir\ext\lib directory.
  6. Copy all the custom data load configuration files from the WebSphere Commerce development environment to the WebSphere Commerce server environment.
    1. Navigate to the WCDE_installdir\samples\DataLoad\warranty directory.
    2. Copy all of the custom data load configuration files within this directory.
    3. Navigate to the WC_installdir\samples\DataLoad\warranty directory.
    4. Paste all of the files into this directory.
  7. Modify the data load environment configuration file, wc-dataload-env.xml, to match your WebSphere Commerce Server instance information:
    • Change the attribute values for the <_config:BusinessContext> configuration element to match your store settings.
    • Change the attribute values for the <_config:Database> configuration element to match your database environment properties.

    For more information about configuring the data load environment file, see Configuring the data load environment settings.

  8. Test your customization on the WebSphere Commerce server by running the Data Load utility. Ensure that you include the parameter -Dinstance=instance_name when you run the utility
    For example, SolarisLinuxAIX
    ./dataload.sh ..samples/DataLoad/warranty/wc-dataload-warranty.xml -Dinstance=instance_name
    WebSphere Commerce DeveloperWindows
    dataload ..\samples\DataLoad\warranty\wc-dataload-warranty.xml -Dinstance=instance_name
  9. Verify the results of the data load. You can verify your results by reviewing the summary and by checking that the data exists in the appropriate database tables.
    To check the database tables for the sample custom tables, run the following SQL statements.
    SELECT * FROM XWARRANTY;
    SELECT * FROM XCAREINSTRUCTION;
    

    If you see the warranty and care information that is included in the csv file that you loaded, your data load is successful.