Changeset 6544


Ignore:
Timestamp:
2004-01-19T15:38:42+13:00 (20 years ago)
Author:
kjdon
Message:

the bit where you put language items into the indexexparr was comparing them unnecessarily to the entries in the collect.cfg. don't know why but it wasn't working so I deleted that bit. also added the lang stuff to the gdbm db so now language subcollections work with mgpp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/mgppbuilder.pm

    r6407 r6544  
    169169        else { # add in an empty subcollection field
    170170            push (@{$self->{'collect_cfg'}->{'indexes'}}, "$index\:\:$language");
     171           
    171172        }       
    172173        }
     
    513514    if ($plang =~ /\w/ && !defined ($mapping{'languagemap'}{$languages})) {
    514515        $mapping{'languagemap'}{$languages} = $plang;
    515         push (@{$mapping{'languagemaporder'}}, $language);
     516        push (@{$mapping{'languagemaporder'}}, $languages);
    516517        $mapping{$languages} = $plang;
    517518    }
     
    649650    # a language subcollection - only put languages expressions for the
    650651    # ones we want in the index
    651 
     652   
    652653    my @languages = ();
    653654    @languages = split /,/, $language if (defined $language);
     
    657658        $not = 1;
    658659    }
    659     foreach $lang (@{$self->{'collect_cfg'}->{'languages'}}) {
    660         if ($lang eq $language) {
    661         if ($not) {
    662             push (@$indexexparr, "!Language/$language/");
    663         } else {
    664             push (@$indexexparr, "Language/$language/");
    665         }
    666         last;
    667         }
     660    if ($not) {
     661        push (@$indexexparr, "!Language/$language/");
     662    } else {
     663        push (@$indexexparr, "Language/$language/");
    668664    }
    669665    }
     
    907903    }
    908904    print $handle $subcoll_entry;
    909     #end the collection entry
     905     # now add language meta
     906    $lang_entry = "";
     907    foreach $lang (@{$self->{'index_mapping'}->{'languagemaporder'}}) {
     908    if (defined $self->{'collect_cfg'}->{'collectionmeta'}->{".$lang"}) {
     909        my $shortname = $self->{'index_mapping'}->{$lang};
     910        $one_entry = $self->create_language_db_map(".$lang", $shortname);
     911        $lang_entry .= $one_entry;
     912    } else {
     913        $lang_entry .= "<$shortname>$lang\n";
     914    }
     915    }
     916    print $handle $lang_entry;
     917   #end the collection entry
    910918    print $handle "\n" . ('-' x 70) . "\n";
    911919   
Note: See TracChangeset for help on using the changeset viewer.