dtdgen utility

The dtdgen utility creates document type definition (DTD) file and (optionally) XML schema definition (XSD) files for use with the loading utilities based on the target database to which your data must conform.

The DTD specifies structural elements and markup definitions that can be used within the XML data document and the DTD describes the tables and columns into which the massload utility imports data. For example, a DTD can list elements to be used in a document and specify the attributes that each element can take.

If the target database structure does not change, the dtdgen utility needs to be run only once.

The wcs.dtd file located in WC_installdir\schema\xml is provided with WebSphere Commerce. If you use this DTD or the DTDs provided with the starter store archives and you do not modify the database schema, you normally do not need to generate a DTD using the dtdgen utility.

Before running this utility, ensure that you have complete the required configuration tasks:

  1. Configure the environment variable setting scripts.

  2. Configure tracing and logging for the loading utilities.

  3. (Optional) Create a text file containing the list of database tables for which you want to generate a DTD file. The full path to this file name is specified in the -infile paramater. If you do not create this file, specify the list of database tables for which you want to generate a DTD file in the -tablenames parameter.

Filenames specified as parameters for this utility can be preceded by relative or absolute paths. Relative paths must be relative to the directory from which you run the dtdgen utility.

In addition to the the trace log and message log for the loading utilities, this utility produces the following log file:

(AIX)(Linux)(Solaris) Run this utility as the non-root WebSphere Commerce user ID. Do not run this command as root.

 

Utility command

The dtdgen utility has the following file name:

 

 

Parameter values

-dbname

-dbuser

-dbpwd

  • Do not specify this parameter when using Cloudscape as the development database.

  • Password for the user connecting to the database.

-outfile

Name of the output DTD file.

-infile

Name of an input text file containing a database-table name on each line.

-tablenames

Name of table or or tables for which you want to generate a DTD file. You can specify any of the following values:

Single database table name

When you specify a single database table name, the generated DTD file only reflects that database table.

Comma-separated list of database table names

To specify multiple table names, separate each table name with a comma (","). The generated DTD file reflects the tables specified.

*

Specifying an asterisk ("*") for the -tablenames parameter generates a DTD covering all tables in the database.

-xmlTableDesc

(Optional) Specify this parameter to generate an XSD file for the tables specified in the -tablenames parameter. You must specify the full path to the XSD file that is generated.

-schemaname

(Optional) Name of the target database schema. If this parameter is not specified when running the utility, the utility looks for a name=value pair in the customizer property file that specifies the value of SchemaName. If this pair is present in the property file, the utility uses the value specified. If neither a command-line nor a property-file specification for this parameter exists, the utility defaults to the name of the database user.

-customizer

Name of the customizer property to be used for your WebSphere Commerce database. When specifying the customizer property file with this parameter, omit the ".properties" file extension.

Specify one of the following customizer values:

  • Do not specify this parameter when using Cloudscape as the development database.

  • (AIX)(Linux)(Solaris)(Windows) (Not required) Do not specify this parameter if you are using DB2 Universal Database on AIX, Linux, Solaris, or Windows operating systems.

  • (i5/OS) (Required) Specify one of the following values:

    ISeries_GENWCSDTD_Customizer

    Specify this customizer value if you are using the native i5/OS JDBC driver.

    When you specify this value, the dtdgen utility uses the values specified in the following file:

    WC_installdir/properties/ISeries_GENWCSDTD_Customizer.properties

    Toolbox_GENWCSDTD_Customizer

    Specify this customizer value if you are using the IBM Toolbox for Java JDBC driver.

    When you specify this value, the dtdgen utility uses the values specified in the following file:

    WC_installdir/properties/Toolbox_GENWCSDTD_Customizer.properties

    If you specify this customizer value, specify the hostname as the -dbname parameter. The following is an example of invoking the dtdgen utility:

    ./dtdgen.sh -dbname MY.HOSTNAME.COM -dbuser instance -dbpwd mypass -outfile /path/out.dtd 
    method sqlimport -customizer Toolbox_GENWCSDTD_Customizer -infile /path/file.xml
    

  • (Required) DB2390ConnectionCustomizer

    When you specify this value, the dtdgen utility uses the values specified in the following file:

    WC_installdir/properties/DB2390ConnectionCustomizer.properties

  • (Required) OracleConnectionCustomizer

    When you specify this value, the dtdgen utility uses the values specified in the following file:

    WC_installdir/properties/OracleConnectionCustomizer.properties.

 

Example

The following example command generates a DTD file for the
MEMBER ,
ADDRBOOK , and
ADDRESS database tables in a DB2 database called MALL. The database table names are defined in a file called tablenames.txt.

(AIX)(Linux)(Solaris)

./dtdgen.sh -dbname mall -dbuser myname -dbpwd mypassword
-outfile threetables.dtd -infile tablenames.txt

(i5/OS)

./dtdgen.sh -dbname mall -dbuser myname -dbpwd mypassword -outfile threetables.dtd -infile tablenames.txt -customizer ISeries_GENWCSDTD_Customizer

(Windows)

dtdgen.cmd -dbname mall -dbuser myname -dbpwd mypassword
-outfile threetables.dtd -infile tablenames.txt

The output from this command is shown in Example: wc.dtd output from dtdgen utility.

Related concepts

Related tasks

Related reference