Tutorials > Customize > Rapid store development and deployment

< Previous | Next >


Update the env batch file

This section explains how to update env batch file.

In this step of the tutorial, we will learn how to update the env.bat file needed to use the following WebSphere Commerce utilities:

This file is included in the resources ZIP file for this tutorial. Before continuing with this tutorial, ensure you have published a starter store, and downloaded the included ZIP file as well as located the env.bat file.

The following code is from the env.bat file used for this implementation:

:: 
Database Variables
set DBNAME=shpudb
set DBUSER=wcsadmin
set DBPWD=xxxxxx
set CUSTOMIZEFILE=OracleConnectionCustomizer.properties

:: 
Load utilities input/output files
set EXTRACTFILE=Extract.xml
set IDENTTRANSFORM=..\identtransform.xsl
set IDENTTRANSFORMUSER=identtransform.xsl
set TRANSFORMEDFILE=Transform.xml
set RESGENFILE=ResGen.xml

:: 
Data Asset Unique References
set MEMBERID=-2001
set CATALOGNAME=ConsumerDirect
set CATALOGID=10001
set STOREENTID=10001
set TRADEPOSCNID=10001
set STORENAME=ConsumerDirect

:: 
Commerce Path Location and Assets
set WCSHOME=E:\WebSphere\CommerceStudio\Commerce
set DTDFILE=%WCSHOME%\schema\xml\wcs.dtd
set PATH=.;%WCSHOME%\bin;%PATH%
set processType=server
set TOOLKITDIR=E:\WCToolkit 

The following information describes the sections of the env.bat file:

Database variables

The administrator would configure env.bat based on the implementation of WebSphere Commerce, the database environment and the state of the data assets. For Oracle users, a customizer must be referenced in order to specify special processing on the massload utility. The customizer file can be placed anywhere in the path. For this implementation, the customizer was placed in the same directory as the massload utility itself in the WebSphere Commerce path under the lib directory. The actual customizer parameter would have to be added to any scripts calling the loading utilities.

Although Windows batch files are used, this does not limit you only to the Windows environment. Since you are dealing with databases to process data assets, you can use a number of functions provided by the DB2 product family to enhance our productivity. With DB2 Client installed, any remote database could be catalogued on the target Windows machine despite the operating system. The benefit of using catalogued databases allows extraction from any external server into the same machine as the target machine. This greatly simplifies the management of XML files and the loading process because we isolate our scripts into one environment to access many asset repositories. In order to catalog an external database, you can use the DB2 Configuration Assistant.

The following steps are required to create a catalogued database in DB2 Database:


Procedure

  1. Open Configuration Assistant: Start > Programs > DB2 > Set-up Tools > Configuration Assistant

  2. Open Wizard: From the Configuration Assistant window, Selected > Add database using Wizard...

  3. Click Manually Configure a connection to a database, and then click Next

  4. Select TCP/IP, and then click Next

  5. Enter the host name, service name and the port number, and then click Next (Service name is optional, Port number can be found in etc/services file)

  6. Enter the database name and database alias (alias will be entered as DBNAME in the env.bat file), and then click Next

  7. For Data source, use defaults and click Next

  8. For Node option, select the OS and click Next

  9. For System options, use defaults and click Next

  10. For Security options, use defaults and click Finish

  11. Use CLI and test the connection

Note: These steps may be different for connection configurations.

Common related input/output files

The following is a list and description of the XML files used for the data asset management procedure:

Data asset unique references

Each of the variables in this listing references the primary or unique keys of the source database. In other instances, these values are used to filter data. Other instances, these values are used to preserve transformed data and load it into the target database.

WebSphere Commerce path location

The WebSphere Commerce installation directory is added to the system path. This allows usage of the WebSphere Commerce commands as well as referencing the environment.

Follow these steps to update the env.bat file:

  1. Set DBNAME to represent the database name of the WebSphere Commerce Server.

  2. Set DBUSER to represent the database user of the WebSphere Commerce Server.

  3. Set DBPWD to represent the database password of the WebSphere Commerce Server.

  4. Set RESGENFILE to represent the output resolved file.

  5. Set INPUTFILE to represent the input file tax.xml.

  6. Set processType to represent the target type.

    • For WebSphere Commerce Toolkit, set processType=toolkit.

    • For all other versions, set processType=server.

  7. Set TOOLKITDIR to represent the target toolkit install directory for the Commerce Toolkit.

  8. Set WCSHOME to represent the path of the WebSphere Commerce Server.

  9. Set PATH to add the WCSHOME parameter.

You have now updated the env.bat file to match the WebSphere Commerce configuration. In the next step we will execute the WebSphere Commerce utilities that will load the necessary resources into your store.

< Previous | Next >


+

Search Tips   |   Advanced Search