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

Diff of /Sprout/ERDBLoader.pl

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

revision 1.7, Thu Feb 5 06:50:12 2009 UTC revision 1.10, Mon May 4 18:49:49 2009 UTC
# Line 113  Line 113 
113    
114  =item DBD  =item DBD
115    
116  Name of the DBD file. If specified, the DBD must be in the main FIG directory  Fully-qualified name of the DBD file. This option allows the use of an alternate
117  (specified in C<$FIG_Config::fig>). This option allows the use of an alternate  DBD during load so that access to the database by other processes is not
 DBD during load, so that access to the database by other processes is not  
118  compromised.  compromised.
119    
120    =item loadDirectory
121    
122    Directoty containing the load files. This option allows you to request that
123    load files from another version of the NMPDR be used, which is useful when
124    creating a new NMPDR: we can yank in the data from the previous database while
125    waiting for the new load files to be generated.
126    
127    =item dbName
128    
129    SQL name of the target database. If not specified, the default name is used.
130    This option allows you to specify a backup or alternate database that can
131    be loaded without compromising the main database.
132    
133  =back  =back
134    
135  =cut  =cut
# Line 125  Line 137 
137  # Get the command-line options and parameters.  # Get the command-line options and parameters.
138  my ($options, @parameters) = StandardSetup([qw(ERDBLoadGroup ERDB Stats) ],  my ($options, @parameters) = StandardSetup([qw(ERDBLoadGroup ERDB Stats) ],
139                                             {                                             {
140                                                  dbName => ["", "if specified, the SQL name of the target database"],
141                                                clear => ["", "overwrite existing load files if sections are present"],                                                clear => ["", "overwrite existing load files if sections are present"],
142                                                sanityCheck => ["", "don't load, trace contents of first N load file records instead"],                                                sanityCheck => ["", "don't load, trace contents of first N load file records instead"],
143                                                trace => ["2", "tracing level"],                                                trace => ["2", "tracing level"],
144                                                keepSections => ["", "if specified, section files will not be deleted after being collated"],                                                keepSections => ["", "if specified, section files will not be deleted after being collated"],
145                                                phone => ["", "phone number (international format) to call when load finishes"],                                                phone => ["", "phone number (international format) to call when load finishes"],
146                                                DBD => ["", "if specified, the name of a DBD file in the FIG directory"],                                                DBD => ["", "if specified, the name of a DBD file in the FIG directory"],
147                                                  loadDirectory => ["", "if specified, an alternate directory containing the load files"],
148                                             },                                             },
149                                             "<database> <group1> <group2> ...",                                             "<database> <group1> <group2> ...",
150                                             @ARGV);                                             @ARGV);
# Line 140  Line 154 
154  eval {  eval {
155      # Get the parameters.      # Get the parameters.
156      my ($database, @groups) = @parameters;      my ($database, @groups) = @parameters;
     # Check for an alternate DBD.  
     my $altDBD = ($options->{DBD} ? "$FIG_Config::fig/$options->{DBD}" : undef);  
157      # Connect to the database and get its load directory.      # Connect to the database and get its load directory.
158      my $erdb = ERDB::GetDatabase($database, $altDBD);      my $erdb = ERDB::GetDatabase($database, undef, %$options);
159      # Fix the group list.      # Fix the group list.
160      my @realGroups = ERDBLoadGroup::ComputeGroups($erdb, \@groups);      my @realGroups = ERDBLoadGroup::ComputeGroups($erdb, \@groups);
161      # Get the source object and load directory for this database.      # Get the source object and load directory for this database.
162      my $source = $erdb->GetSourceObject();      my $source = $erdb->GetSourceObject();
163      my $directory = $erdb->LoadDirectory();      my $directory = $options->{loadDirectory} || $erdb->LoadDirectory();
164      # Get the list of sections.      # Get the list of sections.
165      my @sectionList = $erdb->SectionList($source);      my @sectionList = $erdb->SectionList($source);
166      # Create a statistics object to track our progress.      # Create a statistics object to track our progress.
# Line 304  Line 316 
316      }      }
317  }  }
318    
319    =head2 Internal Methods
320    
321  =head3 CheckLoadFile  =head3 CheckLoadFile
322    
323      CheckLoadFile($erdb, $table, $fileName, $count);      CheckLoadFile($erdb, $table, $fileName, $count);

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.10

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3