Changeset 1403

Show
Ignore:
Timestamp:
02/23/08 01:32:52 (5 months ago)
Author:
bchoate
Message:

Assignment of priority for publishing pages. BugId:68737

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/release-30/lib/MT/WeblogPublisher.pm

    r1394 r1403  
    22192219    $job->funcname('MT::Worker::Publish'); 
    22202220    $job->uniqkey( $fi->id ); 
    2221     $job->coalesce( $$ . ':' . ( time - ( time % 100 ) ) ); 
    2222  
    2223     # my $at = $fi->archive_type || ''; 
    2224     # 
     2221 
     2222    my $priority = 0; 
     2223 
     2224    my $at = $fi->archive_type || ''; 
    22252225    # Default priority assignment.... 
    2226     # if ($at eq 'Individual') { 
    2227     #     require MT::TemplateMap; 
    2228     #     my $map = MT::TemplateMap->load($fi->templatemap_id); 
    2229     #     # Individual archive pages that are the 'permalink' pages should 
    2230     #     # have highest build priority. 
    2231     #     if ($map && $map->is_preferred) { 
    2232     #         $rqf->priority(1); 
    2233     #     } else { 
    2234     #         $rqf->priority(9); 
    2235     #     } 
    2236     # } elsif ($at eq 'index') { 
    2237     #     # Index pages are second in priority, if they are named 'index' 
    2238     #     # or 'default' 
    2239     #     if ($fi->file_path =~ m!/(index|default|atom|feed)!i) { 
    2240     #         $rqf->priority(3); 
    2241     #     } else { 
    2242     #         $rqf->priority(9); 
    2243     #     } 
    2244     # } elsif (($at eq 'Monthly') || ($at eq 'Weekly') || ($at eq 'Daily')) { 
    2245     #     $rqf->priority(5); 
    2246     # } elsif ($at eq 'Category') { 
    2247     #     $rqf->priority(7); 
    2248     # } 
    2249     # 
    2250     # $rqf->save; 
     2226    if ($at eq 'Individual') { 
     2227        require MT::TemplateMap; 
     2228        my $map = MT::TemplateMap->load($fi->templatemap_id); 
     2229        # Individual archive pages that are the 'permalink' pages should 
     2230        # have highest build priority. 
     2231        if ($map && $map->is_preferred) { 
     2232            $priority = 10; 
     2233        } else { 
     2234            $priority = 5; 
     2235        } 
     2236    } elsif ($at eq 'index') { 
     2237        # Index pages are second in priority, if they are named 'index' 
     2238        # or 'default' 
     2239        if ($fi->file_path =~ m!/(index|default|atom|feed)!i) { 
     2240            $priority = 9; 
     2241        } else { 
     2242            $priority = 3; 
     2243        } 
     2244    } elsif ($at =~ m/Category/) { 
     2245        $priority = 1; 
     2246    } elsif ($at =~ m/Monthly|Weekly|Daily/) { 
     2247        $priority = 2; 
     2248    } 
     2249 
     2250    $job->priority( $priority ); 
     2251    $job->coalesce( ( $fi->blog_id || 0 ) . ':' . $$ . ':' . ( time - ( time % 10 ) ) ); 
    22512252 
    22522253    MT::TheSchwartz->insert($job);