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
- Create the XWARRANTY and XCAREINSTRUCTION tables
in the database that is used by your target WebSphere Commerce Server:
- Connect to your DB2 database.
- 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) );
- Connect to your Oracle database.
- 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) );
- Create the WC_installdir\instances\instance_name\xml\config\com.ibm.commerce.catalog-ext directory if the directory does not exist.
- Copy all the custom Data Service Layer configuration files
from the WebSphere Commerce development environment to the WebSphere
Commerce server instance directory.
- Navigate to the workspace_dir\WC\xml\config\com.ibm.commerce.catalog-ext directory.
- Copy all of the custom Data Service Layer configuration files within this directory.
- Navigate to the WC_installdir\instances\instance_name\xml\config\com.ibm.commerce.catalog-ext directory.
- Paste all of the files into this directory.
- Package your custom XML reader class and the custom physical SDO classes. Package these classes in the WebSphereCommerceServerExtensionsLogic project to a JAR file.
- 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.
- Copy all the custom data load configuration files from
the WebSphere Commerce development environment to the WebSphere Commerce
server environment.
- Navigate to the WCDE_installdir\samples\DataLoad\warranty directory.
- Copy all of the custom data load configuration files within this directory.
- Navigate to the WC_installdir\samples\DataLoad\warranty directory.
- Paste all of the files into this directory.
- 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.
- Change the attribute values for the
- 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 utilityFor example,./dataload.sh ..samples/DataLoad/warranty/wc-dataload-warranty.xml -Dinstance=instance_name
dataload ..\samples\DataLoad\warranty\wc-dataload-warranty.xml -Dinstance=instance_name
- 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.