Introduced in Feature Pack 3

Creating the source code repository

Introduced in Feature Pack 3

In this lesson, you copy your customized code assets to a local repository so that the WebSphere Commerce Build and Deployment tool can build a deployment package. You then configure the build properties file to package the source code inside that repository. The WebSphere Commerce Build and Deployment tool is configured by default to use a specific repository structure. The default repository structure is followed to reduce configuration efforts.

The following diagram shows the WebSphere Commerce Build and Deployment tool default repository structure:
Default repository structure

For more information, see WebSphere Commerce Build and Deployment tool repository structure.

Procedure

  1. Create the Data Load files in the repository.

    The Data Load utility can be used as part of the WebSphere Commerce Build and Deployment process. The directory structure local_repository/workspace/DataLoad is used by default to hold the files that are used in the build process. Both SQL and XML files are supported. These files can be specific to different database vendors, so ensure that the files are compliant with your runtime environment.

    1. Create the following directory structure:
      • local_repository/workspace
      This folder stores all the customized code assets to be deployed.
    2. Create the following directory structure:
      • local_repository/workspace/DataLoad/sql/common
    3. Create the following CreateWarrantyTables.sql file in the local_repository/workspace/DataLoad/sql/common directory.
      
      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) ON DELETE CASCADE); 
      
      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) ON DELETE CASCADE, CONSTRAINT XCAREINST_FK2 
      FOREIGN KEY (CATENTRY_ID) REFERENCES CATENTRY (CATENTRY_ID) ON DELETE CASCADE); 
      
      insert into cmdreg (storeent_id, interfacename, classname) values 
      (0,'com.ibm.commerce.catalog.facade.server.commands.InsertMoreCatalogEntryDataCmd+MyCompany_All.0', 
      'com.ibm.commerce.foundation.server.command.bod.bom.InsertMoreNounChangeControlMetaDataCmdImpl'); 
      
      insert into cmdreg (storeent_id, interfacename, classname, target) values 
      (0, 'com.ibm.commerce.catalog.facade.server.commands.InsertMoreCatalogEntryDataCmd+MyCompany_All.10', 
      'com.ibm.commerce.foundation.server.version.command.InsertMoreNounVersionMetaDataCmdImpl', 'Local');
      
      INSERT INTO XWARRANTY (CATENTRY_ID, WARTERM, WARTYPE) VALUES (10251, 30, 'LIMITED'); 
      INSERT INTO XWARRANTY (CATENTRY_ID, WARTERM, WARTYPE) VALUES (10253, 45, 'COMPREHENSIVE'); 
      INSERT INTO XWARRANTY (CATENTRY_ID, WARTERM, WARTYPE) VALUES (10255, 60, 'LIMITED'); 
      
      INSERT INTO XCAREINSTRUCTION (CATENTRY_ID, LANGUAGE_ID, CAREINSTRUCTION) VALUES 
      (10251, -1, 'Never use an abrasive cleaner or material on any finished product'); 
      INSERT INTO XCAREINSTRUCTION (CATENTRY_ID, LANGUAGE_ID, CAREINSTRUCTION) VALUES 
      (10253, -1, 'Avoid soap and water'); 
      INSERT INTO XCAREINSTRUCTION (CATENTRY_ID, LANGUAGE_ID, CAREINSTRUCTION) VALUES 
      (10255, -1, 'Never use household cleaners');
      
      Note: You must update the CATENTRY_IDs to correspond with the IDs that exist on your production server.
    4. Create the following directory structure:
      • local_repository/workspace/DataLoad/acp/common
    5. Copy the following files into the local_repository/workspace/DataLoad/acp/common directory:
      • WCDE_installdir/xml/policies/xml/MyCompanyCatalogAccessControlPolicies.xml
      • WCDE_installdir/xml/policies/xml/WarrantyViewCommand.xml
      • WCDE_installdir/xml/policies/xml/WarrantyAccessControlPolicies.xml
    6. Copy the following folder into the local_repository/workspace/DataLoad/acp directory:
      • WCDE_installdir/xml/policies/dtd
  2. Copy the customized projects into the repository.

    In this step, you copy any customized projects for deployment. Examples of customized projects can include Java modules such as WebSphereCommerceServerExtensionsLogic, OpenLaszlo projects such as LOBTools, or web modules such as Stores.

    1. Copy the following folder into the local_repository/workspace directory:
      • WCDE_installdir/workspace/LOBTools
    2. Create the following directory structure:
      • local_repository/workspace/Stores
    3. Copy the following files into the local_repository/workspace/Stores directory:
      • WCDE_installdir/workspace/Stores/WebContent/WEB-INF/config/com.ibm.commerce.catalog-ext/get-data-config.xml
      • WCDE_installdir/workspace/Stores/src/Madisons/storetext.properties
      • WCDE_installdir/workspace/Stores/WebContent/Madisons/Snippets/Catalog/CatalogEntryDisplay/CachedProductOnlyTabsExt.jspf
      • WCDE_installdir/workspace/Stores/WebContent/Madisons/Snippets/Catalog/CatalogEntryDisplay/CachedProductOnlyTabPanesExt.jspf
    4. Copy the following folder into the local_repository/workspace directory:
      • WCDE_installdir/workspace/WebSphereCommerceServerExtensionsLogic
    5. Create the following directory structure:
      • local_repository/workspace/WC/xml/config
    6. Copy the following folder into the local_repository/workspace/WC/xml/config directory:
      • WCDE_installdir/workspace/WC/xml/config/com.ibm.commerce.catalog-ext
    7. Create the following directory structure:
      • local_repository/workspace/WC/xml/content-management
    8. Copy the following folder into the local_repository/workspace/WC/xml/content-management directory:
      • WCDE_installdir/workspace/WC/xml/content-management/com.ibm.commerce.catalog.resource-managers-ext.xml