Previous Contents Index Next |
BuyerXpert/SellerXpert 4.1 Administrator's Guide |
Chapter 8 Importing Data
This chapter describes the Import utility, and provides guidelines for using the import function from the graphical Admin interface or the command line.
Note The information in this chapter is based on the assumption that you have already read Concepts and Release Notes.
This chapter contains the following sections:
About Importing
Instructions for importing catalog data are contained in Chapter 7 "Administering Catalogs," and in the iPlanet Market Maker Catalog Import Guide.Administrator's Importing Tasks
About Importing
The Import utility allows you to import batch data from external files into the BuyerXpert/SellerXpert database. Data for any of the BuyerXpert/SellerXpert resources can be updated this way, such as:There are two ways to update your BuyerXpert/SellerXpert data:
Individual transactionsData is entered manually, using the data entry screens of the Admin interface. For the most part, instructions for using the various graphical screens are contained in the Admin interface Help.
The import process involves two elements:
Batch transactionsData is entered as a batch, using the Import utility. An import session can be initiated either by using the Import screens in the Admin interface, or by invoking the import script from the command line.
- This method is generally used when your transactions are relatively simple, or when you are unfamiliar with the batch transaction process of the Import utility.
- This method is used in some of these common situations:
You have a large quantity of updates.
The update is a repeating operation, where this updating is done on a regular basis. For example, updating a catalog price list.
When the transaction is complex. If you have to go to many screens in the Admin interface to complete the transaction, it may be more efficient to use the batch process, even for a single transaction.
Import data file(s)text files that contain commands and data for updating BuyerXpert/SellerXpert resources
Import utilitya program that processes the data in the import data file
Import Data File
An import data file is the text file, in comma-separated values (CSV) format, that contains the data that will modify the BuyerXpert/SellerXpert database. Import data files must have the file extension .imp, such as people.imp or catalogABC.imp.An import data file is written to update a particular resource. Each resource has a different set of attributes that are to be updated, some required, some not. A list of attributes for every BuyerXpert/SellerXpert resource can be found in the templates in the sample file directory:
IAS_Root/buyer/sample_data/impexp_files/
An import data file contains four different types of information lines: comments, commands, headers, body. Table 8-1 describes these information lines.
During processing, blank lines and comments are ignored.
Symbols Used in an Import Data File
The import data file uses special symbols. Table 8-2 lists these symbols and an example of each.
Table 8-2    Import Data File Symbols
Symbol
Data Type
Description
Example
Commands Used in an Import Data File
A command line identifies the command and the resource that will be processed during importing. Any or all of the following commands are recognized by the Import utility and can be included in an import data file:
insertAdd new data associated with these body lines.
A command line is followed by a header line; a header line is followed by body lines. Each time a new command in specified, its associated header and body lines follow. For example, for a delete command, there will be a set of header-body lines, for an update command, another set of header-body lines, and so on.insert_overwriteAdd data associated with these body lines; if the data already exists in the database, replace it with this data.
updateUpdate existing data with the data in these body lines.
ExampleImport Data File
When all the lines are combined, they make up an import data file.# insert: required attributes - common_name, parent_org
# insert_overwrite: required attributes - common_name, parent_org
# update: required attributes - reference_name
# delete: required attributes - reference_name
# Command line: insert command
# Header line: Lists fields for body lines;
# Required fields: common_name,parent_org^common_name, parent_org, country_code, postal_code, \
effective_from_date, effective_to_date,telephone_number, \
fax_number, websites Paristest
Paristest,[Organization name=mercury.com], France, 1234, 01/01/2000, 01/01/2020, \
(408)111-2222&(408)333-4444, (510)111-2222&(510)333-444, a@b.com&a@c.com
## Example of multivalued attributes
# Header line: Lists fields for body lines
# Required field: reference_name^ reference_name, add_websites,del_websites, add_telephone_number, \ del_telephone_number, add_fax_number, del_fax_number
[Location common_name=Paristest organization=mercury.com], \
C.b.com&D.b.com&E.b.com,AB.b.com&CD.b.com, 715&716, 716&761, 815&816, 816&861
# Command line: insert_overwrite command
# Header line: Lists fields for body line
# Required fields: common_name, parent_org
^common_name, parent_org, country_code, postal_code, postal_address, definable_id,telephone_number
Paristest,[Organization name=mercury.com], France, 1234, LocAddress,0000, \
(408)111-2222&(408)333-4444&(408)555-6666
# Command line: delete command
# Required field: reference_name
# Header line: Lists fields for body lines
[Location common_name=Paristest organization=mercury.com]
Import Utility
Importing can be accomplished either using graphical screens in the Admin interface or using the command line.
Admin Interface Screens
The Admin interface provides screens for defining an import session and managing it through to completion. You can monitor the progress of a session, stop a session, or resume a stopped session. In addition, you can use the Drop option to clean up the Import utility data tables and log files after the session has completed.
Note The main advantage of using the graphical Import screen rather than the Import script, is that you can easily monitor the progress of a session.
Instructions are contained in the "Importing with the Admin Interface" section in this chapter or in the Admin interface Help.
Command-Line Interface
BuyerXpert/SellerXpert provides a UNIX shell script that allows you to run the Import utility as a batch process from the command line. An advantage of the command line is that you can import an unlimited number of files in a single batch.Instructions for using the import script and its options are contained in the "Importing with the Command Line" section in this chapter.
Administrator's Importing Tasks
Table 8-3 lists typical ongoing administrative tasks for importing. The right-hand column provides information about where to find instructions, guidelines, or tools for performing that task.
Table 8-3    Ongoing Importing Tasks
Task
Location of Instructions/Guidelines/Tools
Creating an Import Data File section
Import the data file using the graphical Admin interface Import screens.
Import the data file using the Import script on the command line.
Importing with the Command Line section
Creating an Import Data File
For any importing, you must first create an import data file for the specific resource you are importing, for example, payment data. Each different type of resource usually has its own import data file. Sample import data files are supplied with BuyerXpert/SellerXpert for the common BuyerXpert/SellerXpert resources.
Tip It is recommended that you use an appropriate sample file for creating your import data file rather than writing a file from scratch.
An import data file has specific contents requirements, which must be followed precisely. The first time you create an import data file for a resource, you will probably encounter a number of import failures before the file is correct. Once you have done a successful import for that type of resource, you can reuse the file for subsequent importing.
Use the following guidelines to create an import data file for a resource:
Copy the sample import data file for your resource to your working directory. Sample import data files are located in the following directory:
Use a text editor to edit the comment, command, and header lines for your resource.
- IAS_Root/buyer/sample_data/impexp_files/
Note Each command you plan to use in the import session will need its own command/header/body section in the import data file.
Insert the body lines for the import text.
Verify that the attributes listed in the header lines correspond to the values in the body lines.
- The sample files contain all the possible attributes that come with a BuyerXpert/SellerXpert resource. You will need to delete or modify the attributes where your data is different.
Importing with the Admin Interface
After you have created an import data file, you can use the Admin interface Import function to import the data. The following high-level options are available when you click the Import tab in the Admin interface:
Start New SessionUse to start a new session by specifying the import data file(s).
Follow these guidelines to import a data file using the Admin interface (field and procedure details are contained in Help):Session ManagerUse to manage existing sessions (both active and inactive).
Select Import.
Follow procedures in Help to perform additional tasks.Enter the number of files you want to import, up to ten.
Enter the file name or URL of the file location. If you are unsure of the name or location, click Browse to find the files you want to import.
Click Start to import all files that you have selected.
- The Start Session screen appears.
The Session Status screen displays the state of the current session.
Importing with the Command Line
The Import utility batch process can be initiated from the command-line by running the BXImport.sh shell script. The script for BuyerXpert is located in the IAS_ROOT /buyer/admin/bin directory along with the default configuration file, cli.conf.The script for SellerXpert is located in the IAS_ROOT /seller/admin/bin directory along with the default configuration file, cli.conf.Some values are set during installation (for example, the path to JAVA classes, or the path to the default configuration file). You can enter script options directly on the command-line or indirectly through a configuration file.
Note Options passed from the command line override any options set in a configuration file.
Syntax
BXImport.sh [options] import_filesTable 8-4 lists the options that are used with the import script.
If you don't specify any options when you invoke the import script on the command line, the default values in the cli.config file are used, as shown in Example 1.
Example 1Default Configuration File
The following example contains typical values that the import script would use to start the Import utility from the command line.If you want to use other values, you can enter specific options when you start the import script. These two methods are illustrated in Example 2 and Example 3.
Example 2 Using Default Values
The following command imports two files, locations.imp and usergroups.imp, from /import_files directory. All settings are taken from the default configuration file.# BXImport.sh /import_files/locations.imp /import_files/usergroups.imp
Example 3Redefining Default Values
This command imports two files, orders.imp and payments.imp, from the /import_files directory. Option settings are:
Login name - admin.login password - admin; Organization - corp.com.All other settings are taken from the default configuration file.
# BXImport.sh -n admin -p admin -o corp.com /import_files/orders.imp /import_files/payments.imp\
By default, the import script uses the cli.conf file which consists of default settings for the options. If you want to redirect to another configuration file, you can as shown in Example 4.
Example 4Redirect to a Configuration File
The following command imports one file, /import_files/users.imp, using the option settings from specific configuration file, /myfiles/myconf.conf.# BXImport.sh -c /myfiles/myconf.conf /import_files/users.imp
Previous Contents Index Next
Copyright © 2001 Sun Microsystems, Inc. Some preexisting portions Copyright © 2001 Netscape Communications Corp. All rights reserved.
Last Updated September 07, 2001