Tutorials > Customize > Rapid store development and deployment
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:
- massextract utility
- txttansform utility
- xmltransform utility
- idresgen utility
- massload utility
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:
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
- Open Configuration Assistant: Start > Programs > DB2 > Set-up Tools > Configuration Assistant
- Open Wizard: From the Configuration Assistant window, Selected > Add database using Wizard...
- Click Manually Configure a connection to a database, and then click Next
- Select TCP/IP, and then click Next
- 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)
- Enter the database name and database alias (alias will be entered as DBNAME in the env.bat file), and then click Next
- For Data source, use defaults and click Next
- For Node option, select the OS and click Next
- For System options, use defaults and click Next
- For Security options, use defaults and click Finish
- 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:
- EXTRACTFILE - the raw data that is output from the source database to this file name
- IDENTTRANSFORM - the transformation Style Sheet used to transform raw extracted data into unique references
- IDENTTRANSFORMUSER - the transformation Style Sheet used to transform user data to properly reference the member table
- DTDFILE - the DTD file to be referenced by the resolved data
- TRANSFORMEDFILE - the output file name from the result of a transformation from raw data output into unique key referencing
- RESGENFILE - the output file name from the result of resolving the unique references from the target database
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:
- Set DBNAME to represent the database name of the WebSphere Commerce Server.
- Set DBUSER to represent the database user of the WebSphere Commerce Server.
- Set DBPWD to represent the database password of the WebSphere Commerce Server.
- Set RESGENFILE to represent the output resolved file.
- Set INPUTFILE to represent the input file tax.xml.
- Set processType to represent the target type.
- For WebSphere Commerce Toolkit, set processType=toolkit.
- For all other versions, set processType=server.
- Set TOOLKITDIR to represent the target toolkit install directory for the Commerce Toolkit.
- Set WCSHOME to represent the path of the WebSphere Commerce Server.
- 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.