Adds and removes data code page header information to and
from exported workspace items (queries, charts, reports, report formats)
and form files created by using the original Rational ClearQuest Designer.
Synopsis
- cqperl cpheader.pl -a [ file-path |
[ directory-path { regular-expression }
] ] code-page
- cqperl cpheader.pl -s [ file-path |
[ directory-path { regular-expression }
] ]
The cpheader command is located in the Rational
ClearQuest installation directory.
Description
Starting in version 7.1.1.0,
IBM Rational ClearQuest adds header information to exported workspace
items and to form files created by using the original ClearQuest Designer.
The header contains information about the data code page of the ClearQuest
database that the files are exported from. The header ensures that
the exported files are imported correctly into other ClearQuest databases
that might use a different code page.
In ClearQuest versions
earlier than 7.1.1.0, exported workspace items and form files do not
have a code page header.
If you are using a mix of pre-and-post
version 7.1.1.0 ClearQuest clients and you want to export or import
the workspace items and form files by using different pre-and-post
version 7.1.1.0 ClearQuest clients, use the cpheader command
to add and remove code page headers to enable cross-version client
compatibility. This allows the exported files to be converted into
the proper format for import by a ClearQuest client at a different
version than the client that exported the files.
Use the cpheader command
to migrate the workspace items and form files created by using the
original ClearQuest Designer into a ClearQuest database with a UTF-8
(8-bit Unicode Transformation Format) code page. By using this command,
you prevent importing workspace items and form files into a ClearQuest
database that does not match the code page of the exported files and
thus prevent data corruption. UTF-8 supports characters from all code
pages, so you can import all code pages into a database that supports
the UTF-8 code page.
Attention: The ClearQuest
Eclipse Designer exports forms into XML format, which contains code
page information. Do not use the cpheader command against forms
exported from the ClearQuest Eclipse Designer.
Options and arguments
- -a
- Add the data code page header to the specified file or files in
the specified directory and its subdirectories.
- -s
- Remove the data code page header from the specified file or files
in the specified directory and its subdirectories.
- file-path
- Path specification of the file to which to add or remove the code
page header.
- directory-path { regular-expression }
- Path specification of the directory containing the files to which
to add or remove the code page header. If you specify a regular-expression,
then the code page header is added to or removed from only the files
in the directory and its subdirectories with a name that matches the regular-expression.
If you do not specify a regular expression, then the code page header
is added to or removed from all the files in the directory and its
subdirectories.
- code-page
- Rational ClearQuest data code page.
Use cases
- Use case 1: Migrate workspace items and original Designer form
files from a ClearQuest pre-version 7.1.1 database to a ClearQuest
7.1.1 UTF-8 (65001) database.
Preferred solution:
Use
a ClearQuest 7.1.1 client to both export the workspace items and original
Designer form files from the ClearQuest pre-version 7.1.1 database,
and to import the workspace items and form files into the UTF-8 database.
With this solution, ClearQuest automatically handles the data code
page header information, converting the files from the different code
pages into UTF-8 format.
Alternate solution:
- Determine the data code page of the ClearQuest database from which
you want to export the workspace items and original Designer form
files.
- Use a ClearQuest pre-version 7.1.1 client, or the command bkt_tool,
to export the workspace items from the ClearQuest pre-version 7.1.1
database.
- Use the pre-version 7.1.1 original Designer to export the form
files from the ClearQuest pre-version 7.1.1 database.
- Use the command cpheader, introduced in ClearQuest 7.1.1,
to add the UTF-8 (65001) code page header to the files that you just
exported in steps 2 and 3.
- Use a ClearQuest 7.1.1 client to import the workspace items and
form files into the UTF-8 database.
Example:
You have a ClearQuest 7.0 database
with code page 932 on one computer. On a second computer, you install
ClearQuest 7.1.1 and create a ClearQuest database with data code page
65001 (UTF-8). Your objective is to move workspace items and form
files from the ClearQuest 7.0 database to the ClearQuest 7.1.1 UTF-8
database without upgrading the ClearQuest 7.0 database first.
Example
solution:
- Use a ClearQuest 7.0 client if you want to export only a few workspace
items. To export all workspace items, use the bkt_tool command.
To export original Designer form files, use the original Designer.
- Use the cpheader command to add the 932 code page header
to all the files that you exported.
- Copy the exported files with the 932 code page header to the computer
that is running ClearQuest 7.1.1.
- Use the ClearQuest 7.1.1 client or the bkt_tool command
to import the workspace items to the ClearQuest 7.1.1 UTF-8 database.
Use the original Designer to import the form files.
- Use case 2: Migrate workspace items and original Designer
form files from one ClearQuest pre-version 7.1.1 database to another
by using a version 7.1.1 client to export the files, and a pre-version
7.1.1 client and the original Designer to import the files.
Solution:
You
must ensure that the database that you are exporting from and the
database that you are importing into have the same code page.
- Export the workspace items and form files by using a version 7.1.1
client.
- Use the cpheader command to remove the code page header
from the exported files.
Attention: Failure to perform
this step can result in data corruption.
- Use a pre-version 7.1.1 client or the bkt_tool command
to import the workspace items into the second database. Use the original
Designer to import the form files into the second database.
Examples
- Add the header for the Western European data code page 1252 to
the file c:/all_defects.qry:
cqperl cpheader.pl -a c:/all_defects.qry 1252
- Add the header for the Simplified Chinese data code page 936 to
all files in the directory c:/queries and its subdirectories:
cqperl cpheader.pl -a c:/queries 936
- Add the header for the Simplified Chinese data code page 936 to
all files in the directory c:/queries and its subdirectories
matched by the expression .cfg$:
cqperl cpheader.pl -a c:/queries .cfg$ 936
- Remove the code page header from the file c:/alldefect.qry:
cqperl cpheader.pl -s c:/alldefect.qry
- Remove the code page header from all files in the directory c:/qrydir and
its subdirectories:
cqperl cpheader.pl -s c:/qrydir