ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/Genquire/gq_local.cfg
Revision: 1.3
Committed: Thu Jul 29 22:46:02 2004 UTC (12 years, 4 months ago) by skchan
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +50 -25 lines
Log Message:
added comments

Line File contents
1 # any cfg file must return a valid Context object
2 # based on whatever data source is being configured.
3 # see the AdaptorLayer documentation for details on
4 # how to construct your own Context object and adaptor layer
5 # for your own datasource.
6
7 # ALL METHODS OF Context.pm and ContextI must be available!
8
9 # The variables $Username, $Password, $IPAddress, and/or $Filename
10 # may be set here, and the values will appear in the appropriate
11 # box on the opening genquire GUI. This is FYI only!! Modifying
12 # their values from the GUI makes **no difference** to the final connection parameters,
13 # since the final Context object is created here!
14
15 use Bio::SeqIO;
16 use Tk;
17 use Tk::widgets qw(FileSelect);
18
19
20 #my $tigr_xml_main_window = MainWindow->new;
21 #my $FileMW = $tigr_xml_main_window->FileSelect(
22 # -width => 30);
23 #$tigr_xml_main_window->withdraw;
24 #my $Filename = $FileMW->Show;
25
26 # unless ($Filename){ return undef};
27 ### unless ($Filename =~ /\.xml$/i){ return undef };
28 #$FileMW->destroy;
29 #$tigr_xml_main_window->destroy;
30
31
32 $Username = "root";
33 $Password = "";
34 $IPAddress = "localhost";
35 ### $Filename = "";
36
37
38 $Default_DB = "genquire";
39
40 # note that DbObj is not an absolute requirement for all Context objects
41 # we use it in the Genquire_local adaptor layer because it is useful...
42 # you will probably want to have something like DbObj (call it what you wish)
43 # as the test of database or flat-file availability/successful connection.
44
45 $dbobj = GQ::Server::DB::DbObj->new($Username, $Password, $Default_DB, $IPAddress);
46 if ($dbobj) { #successful connection
47 #print "Connecting to $Filename\n";
48 #system("perl", "./Admin/Data_Dump.pl", "$Filename", "1");
49 $context=GQ::Server::DB::Context->new($dbobj) # not all Context objects will require $dbobj for initialization!
50 # system("perl", "./Admin/Data_Dump.pl", "$Filename", "1");
51
52 } else {
53 die "failed to connect to local Genquire database to extract organism list";
54 }