Advertisement
Advertisement
| 08.17.2008 at 10:32PM PDT, ID: 23655476 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: |
#!/usr/bin/perl
use DBI;
use Date::Manip;
use Math::Round qw(:all);
use String::ShellQuote;
use File::Copy;
use File::Copy::Recursive qw(fcopy rcopy dircopy fmove rmove dirmove);
use Archive::Zip;
use File::Basename;
use File::stat;
use Data::Dumper;
use XML::Pastor;
use XML::Dumper;
require "/asx/asx_system/interface_subs.pl";
require "/asx/adservices/asx_globals.pl";
$logging=1;
$script_name="amc_bulk_edition";
my ($numArgs, $inputfile, $INFILE);
$numArgs = $#ARGV + 1;
if ($numArgs == 1){
$inputfile=$ARGV[0];
print_this("");
print_this("Input Booking File:\t$inputfile");
}else {
print "Usage:\n";
print "adm_bulk_edition.pl /data1/queuesin/Edition/Bulk/input/updatefilename.txt\n";
exit_and_disconnect(1);
}
unless(-e $inputfile){
print_this("Error opening input $inputfile");
exit_and_disconnect(1);
}
$TheFile=basename($inputfile);
$TheDir=dirname($inputfile);
print_this("Input File Name:\t$TheFile");
print_this("Input Directory:\t$TheDir");
`dos2unix "$inputfile"`;
@asx_configured_pubs;
@attrs = qw(amc_code pub_key cci_code type);
my @input;
get_publications();
get_special_publications();
@pubs_by_type = @asx_configured_pubs;
input("$inputfile");
print Dumper(\@keepers);
my $a = bless (\@keepers, 'XML::Pastor::NodeArray');
my $h = $a->hash('pub_key', 'date');
$xml = dump_xml(\$h);
print Dumper($xml);
sub input {
open(INFILE, "$inputfile") || die "Error opening input $infile: $!";
while (<INFILE>){
chomp;
$_ =~ s/\t/_/;
$_ = lc($_);
my %rec;
($class, $pub_code, $day, $month, $year, $production_number) = split /_/;
$code = "$pub_code"."_"."$class";
convert_month("$month");
$month = $nmonth;
$date = "$year"."-"."$month"."-"."$day";
my $file_no = scalar(@pubs_by_type);
$looprec=undef;
for (my $i=0; $i < $file_no; $i++){
if ((($pubs_by_type[$i]{'type'} eq 'sectioned' )||($pubs_by_type[$i]{'type'} eq 'special' ))&&($pubs_by_type[$i]{'amc_code'} eq $code)){
#print "$pubs_by_type[$i]{'amc_code'} is a sectioned publication and exists in the hash contained in element $i of the array.\n";
$looprec="$pubs_by_type[$i]{'pub_key'},$date,$production_number";
last;
}else{
$ncode = "$pub_code"."_rodi";
if (($pubs_by_type[$i]{'type'} eq 'normal' )&&($pubs_by_type[$i]{'amc_code'} eq $ncode)){
#print "$pubs_by_type[$i]{'amc_code'} is a normal publication and exists in the hash contained in element $i of the array.\n";
$looprec="$pubs_by_type[$i]{'pub_key'},$date,$production_number";
last;
}else{
next;
}
}
}
if($looprec){
@kpr = qw(pub_key date production_number);
my $newloop = "$looprec";
my %keep;
@keep{@kpr} = split(/,/, $newloop);
push @keepers, \%keep;
}else{
$looprec="$code,$date,$production_number,cannot map";
my $newloop = "$looprec";
push @nomaps, $newloop;
}
}
close(INFILE);
}
sub get_publications {
my $select_rop_pub_codes = $dbh->prepare("select publication_key, cci_code, amc_code, section from adm_master_publications WHERE pub_type_key = '1' and booking_zone_key <> '16'");
$select_rop_pub_codes->execute();
while($subref = $select_rop_pub_codes->fetchrow_hashref()){
my %rec;
my $pub_key=$subref->{'publication_key'};
my $cci_code=$subref->{'cci_code'};
my $amc_code=$subref->{'amc_code'};
my $section=$subref->{'section'};
my $sec_code = "$amc_code"."_"."$section";
if("$section" eq "rodi"){
my $looprec = "$sec_code,$pub_key,$cci_code,normal";
my $newloop = "$looprec";
@rec{@attrs} = split(/,/, $newloop);
push @asx_configured_pubs, \%rec;;
}else{
my $looprec = "$sec_code,$pub_key,$cci_code,sectioned";
#print_this("$sec_code,$pub_key,$cci_code,sectioned");
my $newloop = "$looprec";
@rec{@attrs} = split(/,/, $newloop);
push @asx_configured_pubs, \%rec;;
}
}
$select_rop_pub_codes->finish();
}
sub get_special_publications {
my $select_special_pub_codes = $dbh->prepare("select publication_key, cci_code, amc_code, amc_section from adm_master_amc_special_pub_mapping");
$select_special_pub_codes->execute();
while($subref = $select_special_pub_codes->fetchrow_hashref()){
my %rec;
my $pub_key=$subref->{'publication_key'};
my $cci_code=$subref->{'cci_code'};
my $amc_code=$subref->{'amc_code'};
my $section=$subref->{'amc_section'};
$sec_code = "$amc_code"."_"."$section";
my $looprec = "$sec_code,$pub_key,$cci_code,special";
my $newloop = "$looprec";
@rec{@attrs} = split(/,/, $newloop);
push @asx_configured_pubs, \%rec;;
}
$select_special_pub_codes->finish();
}
exit(0);
|