Changeset 17381 for trunk/DataStoreServer/scripts
- Timestamp:
- Apr 7, 2008, 3:59:25 PM (18 years ago)
- Location:
- trunk/DataStoreServer/scripts
- Files:
-
- 1 added
- 4 edited
-
dsdbh.pm (added)
-
dsfsindex (modified) (2 diffs)
-
dsprodindex (modified) (2 diffs)
-
dsrootindex (modified) (2 diffs)
-
tabledefs.sql (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataStoreServer/scripts/dsfsindex
r16954 r17381 8 8 use warnings; 9 9 10 use dsdbh; 10 11 use DBI; 11 12 12 use PS::IPP::Config qw($PS_EXIT_SUCCESS 13 $PS_EXIT_UNKNOWN_ERROR 14 $PS_EXIT_SYS_ERROR 15 $PS_EXIT_CONFIG_ERROR 16 $PS_EXIT_PROG_ERROR 17 $PS_EXIT_DATA_ERROR 18 $PS_EXIT_TIMEOUT_ERROR 19 metadataLookupStr 20 metadataLookupBool 21 caturi 22 ); 13 my $PS_EXIT_CONFIG_ERROR = 3; 14 my $PS_EXIT_DATA_ERROR = 5; 23 15 24 16 my $fileset = pop; … … 114 106 print "$line\n"; 115 107 } 116 117 sub getDBHandle {118 my $ipprc = PS::IPP::Config->new(); # IPP Configuration119 my $siteConfig = $ipprc->{_siteConfig};120 121 my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER');122 my $dbname = metadataLookupStr($siteConfig, 'DBNAME');123 my $dbuser = metadataLookupStr($siteConfig, 'DBUSER');124 my $dbpass = metadataLookupStr($siteConfig, 'DBPASSWORD');125 exit ($PS_EXIT_CONFIG_ERROR) unless defined $dbserver and $dbname and $dbuser and $dbpass;126 127 my $dsn = "DBI:mysql:host=$dbserver;database=$dbname";128 129 my $dbh = DBI->connect($dsn, $dbuser, $dbpass) or die "Cannot connect to server\n";130 return $dbh;131 } -
trunk/DataStoreServer/scripts/dsprodindex
r16762 r17381 7 7 8 8 use DBI; 9 use PS::IPP::Config qw($PS_EXIT_SUCCESS 10 $PS_EXIT_UNKNOWN_ERROR 11 $PS_EXIT_SYS_ERROR 12 $PS_EXIT_CONFIG_ERROR 13 $PS_EXIT_PROG_ERROR 14 $PS_EXIT_DATA_ERROR 15 $PS_EXIT_TIMEOUT_ERROR 16 metadataLookupStr 17 metadataLookupBool 18 caturi 19 ); 9 use dsdbh; 20 10 11 my $PS_EXIT_CONFIG_ERROR = 3; 12 my $PS_EXIT_DATA_ERROR = 5; 21 13 my $product = shift; 22 14 die("must specify product to list") unless defined $product; … … 145 137 print "$line\n"; 146 138 } 147 148 # TODO: move this to a module149 sub getDBHandle {150 my $ipprc = PS::IPP::Config->new(); # IPP Configuration151 my $siteConfig = $ipprc->{_siteConfig};152 153 my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER');154 my $dbname = metadataLookupStr($siteConfig, 'DBNAME');155 my $dbuser = metadataLookupStr($siteConfig, 'DBUSER');156 my $dbpass = metadataLookupStr($siteConfig, 'DBPASSWORD');157 exit ($PS_EXIT_CONFIG_ERROR) unless defined $dbserver and $dbname and $dbuser and $dbpass;158 159 my $dsn = "DBI:mysql:host=$dbserver;database=$dbname";160 161 my $dbh = DBI->connect($dsn, $dbuser, $dbpass) or die "Cannot connect to server\n";162 return $dbh;163 } -
trunk/DataStoreServer/scripts/dsrootindex
r16762 r17381 8 8 use warnings; 9 9 10 use dsdbh; 11 10 12 use DBI; 11 13 12 use PS::IPP::Config qw($PS_EXIT_SUCCESS 13 $PS_EXIT_UNKNOWN_ERROR 14 $PS_EXIT_SYS_ERROR 15 $PS_EXIT_CONFIG_ERROR 16 $PS_EXIT_PROG_ERROR 17 $PS_EXIT_DATA_ERROR 18 $PS_EXIT_TIMEOUT_ERROR 19 metadataLookupStr 20 metadataLookupBool 21 caturi 22 ); 14 my $PS_EXIT_CONFIG_ERROR = 3; 23 15 24 16 my $dbh = getDBHandle(); … … 46 38 print $line; 47 39 } 48 49 # todo move to a module50 sub getDBHandle {51 my $ipprc = PS::IPP::Config->new(); # IPP Configuration52 my $siteConfig = $ipprc->{_siteConfig};53 54 my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER');55 my $dbname = metadataLookupStr($siteConfig, 'DBNAME');56 my $dbuser = metadataLookupStr($siteConfig, 'DBUSER');57 my $dbpass = metadataLookupStr($siteConfig, 'DBPASSWORD');58 exit ($PS_EXIT_CONFIG_ERROR) unless defined $dbserver and $dbname and $dbuser and $dbpass;59 60 my $dsn = "DBI:mysql:host=$dbserver;database=$dbname";61 62 my $dbh = DBI->connect($dsn, $dbuser, $dbpass) or die "Cannot connect to server\n";63 return $dbh;64 } -
trunk/DataStoreServer/scripts/tabledefs.sql
r16872 r17381 77 77 78 78 # none of these types have any type specific columns 79 INSERT INTO dsFileType (type) VALUES('psrequest');80 INSERT INTO dsFileType (type) VALUES('psresults');81 INSERT INTO dsFileType (type) VALUES('pstamp');79 #INSERT INTO dsFileType (type) VALUES('psrequest'); 80 #INSERT INTO dsFileType (type) VALUES('psresults'); 81 #INSERT INTO dsFileType (type) VALUES('pstamp');
Note:
See TracChangeset
for help on using the changeset viewer.
