Ignore:
Timestamp:
2010-12-14T16:16:48+13:00 (13 years ago)
Author:
davidb
Message:

read_infodb_entry now returns a hashmap directly. Code updated to take advantage of this, and in places where the hashmap is not needed, the alternative read_infodb_rawentry is called.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/ClassifyTreeNode.pm

    r22749 r23485  
    6262    # Check if this node already exists in the database, and if not insert it
    6363    # now
    64     my $text = &dbutil::read_infodb_entry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
     64    my $text = &dbutil::read_infodb_rawentry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
    6565    if($text !~ /\w+/ && $force_new)
    6666      {
     
    268268
    269269    # Now determine if this node exists.
    270     if (&dbutil::read_infodb_entry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $next_clid) =~ /\w+/)
     270    if (&dbutil::read_infodb_rawentry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $next_clid) =~ /\w+/)
    271271      {
    272272        # And if so, create it.
     
    658658
    659659    # Load the text of this node
    660     my $text = &dbutil::read_infodb_entry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
     660    my $text = &dbutil::read_infodb_rawentry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
    661661
    662662    # Replace the contains
     
    686686
    687687    # Load the text of this node
    688     my $text = &dbutil::read_infodb_entry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
     688    my $text = &dbutil::read_infodb_rawentry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
    689689    # Replace the numleafdocs
    690690    $text =~ s/<numleafdocs>\d*?\n+/<numleafdocs>$numleafdocs\n/;
     
    713713
    714714    # Load the text of this node
    715     my $text = &dbutil::read_infodb_entry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
     715    my $text = &dbutil::read_infodb_rawentry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
    716716    # Replace the title
    717717    $text =~ s/<Title>.*?\n+/<Title>$title\n/;
     
    736736    my $clid = $self->{'clid'};
    737737
    738     my $text = &dbutil::read_infodb_entry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
     738    my $text = &dbutil::read_infodb_rawentry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
    739739    return $text;
    740740  }
Note: See TracChangeset for help on using the changeset viewer.