[Bio] / Sprout / AttrDBRefresh.pl Repository:
ViewVC logotype

Diff of /Sprout/AttrDBRefresh.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.23, Fri Apr 18 02:13:30 2008 UTC revision 1.24, Tue Aug 12 06:06:02 2008 UTC
# Line 58  Line 58 
58  attribute values. Existing attributes will be unchanged unless the C<replace>  attribute values. Existing attributes will be unchanged unless the C<replace>
59  option is specified.  option is specified.
60    
61  =item loadKey  =item loadKeys
62    
63  If specified, the name of a tab-delimited file containing attribute key data. For each key,  If specified, the name of a tab-delimited file containing attribute key data. For each key,
64  there is a pair of lines. The first line contains the ID, data type, and description  there is a pair of lines. The first line contains the ID, value table name, and
65  of the key. The second line contains the marker C<#GROUPS> followed by zero or more  description of the key. The second line contains the marker C<#GROUPS> followed by zero or
66  group names. The attribute will be connected to all the specified groups.  more group names. The attribute will be connected to all the specified groups.
67    
68  =item backup  =item backup
69    
70  If specified, the name of a file into which all the attribute data should be  If specified, the name of a file into which all the attribute data should be
71  dumped. The file itself will receive the attribute data in the format expected  dumped. The file itself will receive the attribute data in the format expected
72  by C<load>. A second file, consisting of the same file name with the suffix C<.key>,  by C<load>.
73  will contain the attribute key data in the format expected by C<loadKey>.  
74    =item backupKeys
75    
76    If specified, the name of a file into which all the attribute key data should be
77    dumped. The file will receive the attribute key data in the format expected by C<loadKey>.
78    
79  =item compare  =item compare
80    
# Line 163  Line 167 
167                                                initializeAndClear => ["", "if specified, the tables of the attribute database will be re-created"],                                                initializeAndClear => ["", "if specified, the tables of the attribute database will be re-created"],
168                                                phone => ["", "phone number (international format) to call when load finishes"],                                                phone => ["", "phone number (international format) to call when load finishes"],
169                                                load => ["", "file from which to load attribute data"],                                                load => ["", "file from which to load attribute data"],
170                                                loadKey => ["", "file from which to load attribute key data"],                                                loadKeys => ["", "file from which to load attribute key data"],
171                                                backup => ["", "file to which attribute data should be dumped"],                                                backup => ["", "file to which attribute data should be dumped"],
172                                                  backupKeys => ["", "file to which attribute key data should be dumped"],
173                                                compare => ["", "name of a file into which a comparison report will be written"],                                                compare => ["", "name of a file into which a comparison report will be written"],
174                                                summary => ["", "name of a file into which a summary report will be written"],                                                summary => ["", "name of a file into which a summary report will be written"],
175                                                trimSpaces => ["", "if specified, the name of a backup file, which will be processed to remove excess spaces"],                                                trimSpaces => ["", "if specified, the name of a backup file, which will be processed to remove excess spaces"],
# Line 197  Line 202 
202          Trace("Backing up attribute data.") if T(2);          Trace("Backing up attribute data.") if T(2);
203          my $stats = $ca->BackupAllAttributes($backupFileName);          my $stats = $ca->BackupAllAttributes($backupFileName);
204          Trace("Attribute backup statistics:\n" . $stats->Show()) if T(2);          Trace("Attribute backup statistics:\n" . $stats->Show()) if T(2);
205        }
206        if ($options->{backupKeys}) {
207            # Back up the attribute key data to the specified file.
208          Trace("Backing up key data.") if T(2);          Trace("Backing up key data.") if T(2);
209          $stats = $ca->BackupKeys("$backupFileName.key");          my $backupFileName = $options->{backupKeys};
210            my $stats = $ca->BackupKeys($backupFileName);
211          Trace("Key backup statistics:\n" . $stats->Show()) if T(2);          Trace("Key backup statistics:\n" . $stats->Show()) if T(2);
212      }      }
213      if ($options->{initializeAndClear}) {      if ($options->{initializeAndClear}) {
# Line 236  Line 245 
245          close $oh;          close $oh;
246          Trace("$fileName.fixed is now a cleaned backup.\n" . $stats->Show()) if T(2);          Trace("$fileName.fixed is now a cleaned backup.\n" . $stats->Show()) if T(2);
247      }      }
248      if ($options->{loadKey}) {      if ($options->{loadKeys}) {
249          # We want to load the attribute data from the specified file, but          # We want to load the attribute data from the specified file, but
250          # first we need to verify that the file exists.          # first we need to verify that the file exists.
251          my $loadFileName = $options->{loadKey};          my $loadFileName = $options->{loadKeys};
252          if (! -f $loadFileName) {          if (! -f $loadFileName) {
253              Confess("Cannot load keys: file \"$loadFileName\" is not found or not a file.");              Confess("Cannot load keys: file \"$loadFileName\" is not found or not a file.");
254          } else {          } else {

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3