| Previous Contents Index Next |
| iPlanet Market Maker 4.5 Catalog Import Guide |
Chapter 3 Running the Import Utility
This chapter describes how to set up and run the Import utility to create the load file and load it in the PMC.The following sections are contained in this chapter:
Dependency Trees
Preparing To Run the Import Utility
An Example of Running the Import Utility
Dependency Trees
After you create CSF and CSS files, you are ready to specify the information that the Import utility needs to create the load file to load in the Public Master catalog (PMC).The Import utility uses the make command to create the load file. The make command inputs and the output targets are shown as dependency trees in Figure 3-1 and Figure 3-2. Figure 3-1 shows the dependency tree to create a seller ontology when there is not an exiting PMC ontology. Figure 3-2 shows the dependency tree to update an existing PMC ontology.
Figure 3-1    Dependency Tree for Creating a Seller Ontology with No Existing PMC Ontology
![]()
Figure 3-2    Dependency Tree for Updating an Existing PMC Ontology
![]()
Setting Up Your Environment
The Import utility uses the make command. To be sure that the make command runs properly, check the following items.
Be sure that the make command is in your command path. This command is in the /usr/ccs/bin directory.
Source either the mm.kshrc or mm.cshrc files, depending on whether you run the Import utility from a Korn shell or C-shell. These files are in the iPlanet Market Maker installation directory.
- If you get a word too long error message when you source the mm.cshrc file, you need to create a symbolic link from your root directory to the iPlanet Market Maker installation directory (usually iMM). To create this link, go to your root directory and type the command ln -s <install_dir> <link_name>, where <install_dir> is the path to your iPlanet Market Maker installation directory and <link_name> is the name of the symbolic link. After you create this link, replace all instances of the iPlanet Market Maker installation directory name in your mm.cshrc file with the directory name defined by the symbolic link.
Preparing To Run the Import Utility
Before you can create the load file, you need to specify the input file names. To specify this information, you edit a file named makefile in a text editor. To create the makefile file, you must start with the filenames.mk file in the following directory.<imm_install_dir>/catalogtools/etc/filenames.mk
Copy the filenames.mk file to your working directory. Then rename filenames.mk to makefile. This section describes the information you need to provide in the makefile file. This file contains all the information the Import utility needs to run properly, so make sure that you enter this information completely and correctly. Figure 3-3 shows a sample makefile file.
The "#" character in a makefile file is a comment. The Import utility ignores all the lines that begin with this character. Be sure to remove the "#" character when you specify an entry in the makefile file.
The makefile file contains the following sections.
Specifying Output Targets
This section of the makefile contains the output targets that the Import utility uses to create the load file. You do not need to edit this section of the makefile file. You specify the output targets on the Import utility command line. See Table 3-1.
Specifying the Required Source File Names
Table 3-2 shows the required source input file names you provide in the makefile file.
Specifying the Optional File Names
Table 3-3 shows the optional source input file names you can provide in the makefile file.
Table 3-3    Optional Input File Names
Option
Description
Encoding of the input CSF file. For information about encoding rules, see the following URL.
http://java.sun.com/products/jdk/1.2/docs/guide/internat/encoding.doc.html
Name of the file you specify to resolve name clashes. For an example of this file, see the "Resolving Name Clashes" section in Chapter 3.
Name of the file you specify to resolve path clashes. For an example of this file, see the "Resolving Path Clashes" section in Chapter 3.
Name of the XML file you use to perform attribute unit normalization. For more information about unit normalization, see the "Renaming Attribute Units" section in Chapter 2.
Name of the XML file you use to perform attribute name normalization. For details, see the "Attribute Name Normalization" section in Chapter 2.
Name of the XML file you use to specify attribute types. For details, see the "Specifying Attribute Types" section in Chapter 2.
Specifying the Ultimate Targets
The ultimate targets are the result of running the Import utility. The CLEAN option does not remove these targets. You can use the default targets to run the Import utility, or you can change them. See Table 3-4.
Specifying the Ontology Mapping File
The Import utility can generate the ontology mapping file automatically, but you might need to modify this file depending on the ontologies of your seller catalog and load file. The default file name is omd.xml. For details about ontology mapping, see the "Defining the Ontology Mapping" section in Chapter 3.
Specifying Optional Variables
The optional variables define the characteristics of your CSF file. You can change the defaults.
Specifying Error Reports
The error reports tell you if your seller catalog has name or path clash problems. You can change the default report file names.
Table 3-6    Error Report File Names
Report
Default File Name
Description
Specifies the file name of the name clash report that the Import utility generates when you use the CHECK option. For an example of this file, see the "Resolving Name Clashes" section in Chapter 3.
Specifies the file name of the path clash report that the Import utility generates when you use the CHECK option. For an example of this file, see the "Resolving Path Clashes" section in Chapter 3.
Specifying Command Arguments
The command argument specify whether or not to suppress the output messages from the programs that the Import utility uses. See Table 3-8.
Specifying Internal Targets
The internal targets are the internal files that the Import utility uses. You can change the default names. See Table 3-8.
Specifying Directory Locations
The Import utility accesses these directories for XSLT and XML processing. You should not change these directory paths unless you are creating a customized environment to run the Import utility.
Figure 3-3 shows a sample makefile file.
Figure 3-3    Sample makefile File
An Example of Running the Import Utility
This section provides an example using some sample files you can copy to your working directory and use to run the Import utility. This example uses the CSF and CSS files shown in Figure 3-4 and Figure 3-5.To run the Import utility with the sample files, do the following steps.
Make sure that your environment is set up correctly.
Create a working directory to contain your sample files.
Copy the sample input.csf CSF file shown in Figure 3-4 to your working directory.
Figure 3-4    An input.csf Example
Hard Drives~SCSI~1234452~case~15000.00~$~9.1 Gig HD~MassFastSCSI~add
Hard Drives~EIDE~1234472~case~15000.00~JPY~9.1 Gig HD~MassFastSCSI~add
Copy the sample css.xml CSS file shown in Figure 3-5 to your working directory.
Figure 3-5    A css.xml Example
<!DOCTYPE column-specifications SYSTEM
"<imm_install_dir>/catalogtools/dtd/ColumnStructureSpecification.dtd">
To map the category name "Product Name" in the seller catalog to "Name" in the load file, use the attr-renaming.xml file shown in Figure 3-6.
Figure 3-6    An attr-renaming.xml Example
"<imm_install_dir>/catalogtools/dtd/attribute-renaming.dtd">
To map the attribute unit of "$" in the seller catalog to "USD" in the load file, uses the units.xml file shown in Figure 3-7.
Figure 3-7    A units.xml Example
Copy the filenames.mk file from the <imm_install_dir>/catalogtools directory to your working directory.
Rename filenames.mk in your working directory to makefile.
Edit the makefile file in your working directory and specify the input file names.
- Be sure to remove the "#" character when you specify an entry in the makefile file. See Figure 3-8. Note that Figure 3-8 omits the parts of the makefile that you do not need to edit for this Import utility run.
Figure 3-8    Edited makefile file To create the load file from a UNIX command line, type
- make ALL
- If successful, this command creates the mm.xml file shown in Figure 3-9.
Figure 3-9    The mm.xml File Created by the Import Utility If you want to display an image file with an item in the iPlanet Market Maker catalog user interface, such as an image to go with one of hard drives in Figure 3-9, use the following format in your mm.xml file.
To load the mm.xml file in the iPlanet Market Maker catalog database, type the following information on a UNIX command line. Substitute your user name, password, and company name for the entries within the brackets ("<>").
- <Item ...>
- <Attribute vortex-type="attribute" value="image_file" name="value">
- </Item>
- The image_file can be an absolute or relative path. If you specify a relative path, that path must be under the following directory.
- <server_root_dir>/docs
- The value for the name specifies the image size, which can be imagefile_sm for a thumbnail size image, imagefile for a regular size image, or imagefile_lg for a large size image only.
- run -xms64M -Xmx512M com.iplanet.ecommerce.vortex.catalogtools.loader.Loader -USER <your_user_name> -PASSWORD <your_password> -COMPANYID <your_company_name> -IN mm.xml -ontology
- Or:
- $IMM_HOME/catalogtools/bin/load.sh
- For information about your load run, see the <-COMPANYID>.error and <-COMPANYID>.log files.
- For more information about how to load the load file in the PMC, see the following "Loading the Load File in the PMC" section.
Loading the Load File in the PMC
After you have created your mm.xml file, you can load it into the iPlanet Market Maker catalog database. Note that you must register your user and company name in an iPlanet Market Maker marketplace to load catalog information.To load an mm.xml file into the catalog database, use one of the following commands:
run -xms64M -Xmx512M com.iplanet.ecommerce.vortex.catalogtools.loader.Loader [inputs]
$IMM_HOME/catalogtools/bin/load.sh
The inputs to this command line are described in the following table. The required inputs to the loader are in bold in the left column in Table 3-10.
Exporting Catalogs
In addition to importing catalogs, you can also export them. You might want to export catalogs for the following reasons.
To use the Export utility to provide the existing PMC ontology information to a new seller who wants to import a new catalog. The new seller can use the omd.xml file generated by the Export utility to ensure that the new seller catalog ontology matches the exiting PMC ontology.
Given an existing PMC, you can export an mm.xml file that contains the catalog information for a specified seller. If there are name or path clash violations after your first Export utility run, you must specify the -n or -p options to resolve the violations the next time you run the Export utility. If there are no name and path clashes after subsequent Export utility runs, the name or path clash report files are empty.The Export utility lets you export a seller catalog for backup and archiving purposes.
For more information about name and path clashes, see the "Detecting Clashes" section in Chapter 3.
The Export utility outputs mm.dtd, mm.xml, omd.xml, and name and path clash files. See Figure 3-10.
Figure 3-10    Export Utility Flow
![]()
Running the Export Utility
To export an mm.xml seller catalog file from the catalog database, use one of the following commands:run -xms64M -Xmx512M com.iplanet.ecommerce.vortex.catalogtools.export.Main [inputs]
$IMM_HOME/catalogtools/bin/export_cat.sh
The inputs to this command line are described in the following table. The required inputs to the loader are in bold in the left column in Table 3-11.
Table 3-11    Inputs to the Export Utility Command Line
Export Utility Input
Definiton
Increases the default initial heap size for better performance loading large catalogs.
Increases the default maximum heap size for better performance loading large catalogs.
Root directory for the files that the export utility needs to access., which is <imm_install_dir>/catalogtools.
Marketmaker administrator login name or ID of the user running the Export utility. If you do not specify the -seller option, the Export utility exports items under this company name or ID.
Name of the name clash report file. For information about resolving name clashes, see the "Resolving Name Clashes" section in Chapter 3.
Name of the path clash report file. For information about resolving path clashes, see the "Resolving Path Clashes" section in Chapter 3.
Specifies an optional locale other than the default. If you specify a locale, use the form <language code>-<country code>, where the language and country code comply to the ISO 639 standard. The locale for French, for example, is fr-FR.
Enables the verbose messaging mode, which can be useful for debugging purposes.
Previous Contents Index Next
Copyright © 2002 Sun Microsystems, Inc. All rights reserved.
Last Updated March 25, 2002