[Bio] / Babel / bin / dump_expert_assertions.pl Repository:
ViewVC logotype

View of /Babel/bin/dump_expert_assertions.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Tue Dec 1 15:22:43 2009 UTC (10 years, 6 months ago) by wilke
Branch: MAIN
CVS Tags: mgrast_dev_08112011, mgrast_dev_08022011, mgrast_dev_03052011, mgrast_dev_05262011, mgrast_dev_04082011, mgrast_dev_12152011, mgrast_dev_06072011, mgrast_dev_10262011, mgrast_dev_02212011, mgrast_release_3_0, mgrast_dev_03252011, mgrast_release_3_0_4, mgrast_release_3_0_2, mgrast_release_3_0_3, mgrast_release_3_0_1, mgrast_dev_03312011, mgrast_release_3_1_2, mgrast_release_3_1_1, mgrast_release_3_1_0, mgrast_dev_04132011, mgrast_dev_04012011, mgrast_dev_04052011, mgrast_dev_02222011
initial babel checkin

use strict;
use warnings;
use FIG;
use WebApplicationDBHandle;
use DBMaster;

my $db = DBMaster->new(-database => 'WebAppBackend' ,
		       -backend  => 'MySQL',
		       -host     => 'bio-app-authdb.mcs.anl.gov' ,
		       -user     => 'mgrast',); 





my $query = "select md5 , id , function , expert from ACH_Assertion";

my $fig = new FIG;
my $dbf = $fig->db_handle;	
my $assertions = $dbf->SQL( $query );

my $user = {};

foreach my $row (@$assertions){
    my $login = $row->[3];
    unless ($user->{ $login } ){
	$user->{ $login } = &get_user($db , $login);
    }
    $row->[3] = $user->{ $login };
    
    print join "\t" , @$row , "\n";
    
}





sub get_user{
  my ($db , $login) = @_;
  my $user = $db->User->init({ login => $login });
  my $name = "unknown" ;
  $name =  $user->firstname.' '.$user->lastname if (ref $user);
  return $name;
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3