Changeset 23081

Show
Ignore:
Timestamp:
11.10.2010 15:31:47 (9 years ago)
Author:
kjdon
Message:

added a classifyOID param to get_OID_entry. Used to set the classifyOID in the classifyinfo. This is needed to keep the hfile hierarchy numbering the same as what ends up in hte classifier. Otherwise, if do remove empty classifications, then the numbering gets mucked up, and memberof doesn't work, and the user can't assign categories to the documents.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/classify/HFileHierarchy.pm

    r20425 r23081  
    228228    my $list = $self->{'locatorlist'}; 
    229229 
     230    my $classifier_num = "CL".$self->get_number(); 
    230231    # sorted the keys - otherwise funny things happen - kjdon 03/01/03 
    231232    foreach my $OID (sort keys (%$list)) { 
    232     my $tempinfo = $self->get_OID_entry ($OID, $classifyinfo, $list->{$OID}->{'title'}, "VList"); 
     233    my $tempinfo = $self->get_OID_entry ($OID, $classifyinfo, "$classifier_num.$OID", $list->{$OID}->{'title'}, "VList"); 
    233234     
    234235    if (defined $self->{'sort'}) { 
     
    263264sub get_OID_entry { 
    264265    my $self = shift (@_); 
    265     my ($OID, $classifyinfo, $title, $classifytype) = @_; 
     266    my ($OID, $classifyinfo, $classifyOID, $title, $classifytype) = @_; 
    266267 
    267268    $OID = "" unless defined $OID; 
     
    273274    if (!defined $headOID) { 
    274275    $classifyinfo->{'Title'} = $title; 
     276    $classifyinfo->{'classifyOID'} = $classifyOID; 
    275277    $classifyinfo->{'classifytype'} = $classifytype; 
    276278    return $classifyinfo; 
     
    292294    } 
    293295 
    294     return $self->get_OID_entry ($tailOID, $classifyinfo->{'contains'}->[($headOID-1)], $title, $classifytype); 
     296    return $self->get_OID_entry ($tailOID, $classifyinfo->{'contains'}->[($headOID-1)], $classifyOID, $title, $classifytype); 
    295297 
    296298    } 
     
    306308    } 
    307309 
    308     return $self->get_OID_entry ($tailOID, $classifyinfo->{'contains'}->[($headOID+$offset-1)], $title, $classifytype); 
     310    return $self->get_OID_entry ($tailOID, $classifyinfo->{'contains'}->[($headOID+$offset-1)], $classifyOID, $title, $classifytype); 
    309311} 
    310312