Changeset 652


Ignore:
Timestamp:
1999-10-10T21:22:43+13:00 (25 years ago)
Author:
sjboddie
Message:

redesigned browsing support

Location:
trunk/gsdl/perllib
Files:
2 edited

Legend:

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

    r637 r652  
    118118    $outputtext .= "<doctype>classify\n";
    119119    $outputtext .= "<hastxt>0\n";
    120     $outputtext .= "<classifytype>$classifyinfo->{'classifytype'}\n" if defined $classifyinfo->{'classifytype'};
    121     $outputtext .= "<Title>$classifyinfo->{'Title'}\n" if defined $classifyinfo->{'Title'};
    122     $outputtext .= "<numleafdocs>$classifyinfo->{'numleafdocs'}\n" if defined $classifyinfo->{'numleafdocs'};
    123     print "numleafdocs = $classifyinfo->{'numleafdocs'}\n" if defined $classifyinfo->{'numleafdocs'};
     120    $outputtext .= "<childtype>$classifyinfo->{'childtype'}\n"
     121        if defined $classifyinfo->{'childtype'};
     122    $outputtext .= "<Title>$classifyinfo->{'Title'}\n"
     123        if defined $classifyinfo->{'Title'};
     124    $outputtext .= "<numleafdocs>$classifyinfo->{'numleafdocs'}\n"
     125        if defined $classifyinfo->{'numleafdocs'};
     126    $outputtext .= "<thistype>$classifyinfo->{'thistype'}\n"
     127        if defined $classifyinfo->{'thistype'};
     128
    124129   
    125130    $outputtext .= "<contains>";
  • trunk/gsdl/perllib/classify/AZSectionList.pm

    r618 r652  
    9696    }
    9797    if (defined $self->{'list'}->{"$doc_OID.$section"}) {
    98         print STDERR "WARNING: AZSectionList::classify called multiple times for $doc_OID.$section\n";
     98        print STDERR "WARNING: AZSectionList::classify called multiple times " .
     99        "for $doc_OID.$section\n";
    99100    }
    100101    $self->{'list'}->{"$doc_OID.$section"} = $metavalue;
     
    105106    my $self = shift (@_);
    106107
    107     my @classlist = sort {$self->{'list'}->{$a} cmp $self->{'list'}->{$b};} keys %{$self->{'list'}};
     108    my @classlist = sort {$self->{'list'}->{$a} cmp $self->{'list'}->{$b};}
     109    keys %{$self->{'list'}};
    108110
    109111    return $self->splitlist (\@classlist);
     
    112114sub get_entry {
    113115    my $self = shift (@_);
    114     my ($title, $classifytype) = @_;
     116    my ($title, $childtype, $thistype) = @_;
    115117   
    116118    # organise into classification structure
    117     my %classifyinfo = ('classifytype'=>$classifytype,
     119    my %classifyinfo = ('childtype'=>$childtype,
    118120            'Title'=>$title,
    119121            'contains'=>[]);
     122    $classifyinfo{'thistype'} = $thistype
     123    if defined $thistype && $thistype =~ /\w/;
    120124
    121125    return \%classifyinfo;
     
    130134
    131135    # top level
    132     my $classifyinfo = $self->get_entry ($self->{'metaname'}, "AZList");
     136    my $childtype = "HList";
     137    if (scalar (@$classlistref) <= 20) {$childtype = "VList";}
     138    my $classifyinfo = $self->get_entry ($self->{'metaname'}, $childtype, "Invisible");
    133139
    134140    # don't need to do any splitting if there are less than 20 classifications
     
    147153    if ($title =~ /^[0-9]$/) {$title = '0-9';}
    148154    elsif ($title !~ /^[A-Z]$/) {
    149         print STDERR "AZSectionList: WARNING $classification has badly formatted title ($title)\n";
     155        print STDERR "AZSectionList: WARNING $classification has badly " .
     156        "formatted title ($title)\n";
    150157    }
    151158    $classhash->{$title} = [] unless defined $classhash->{$title};
     
    167174
    168175    foreach $subclass (@tmparr) {
    169     my $tempclassify = $self->get_entry($subclass, "AZList");
     176    my $tempclassify = $self->get_entry($subclass, "VList");
    170177    foreach $subsubOID (@{$classhash->{$subclass}}) {
    171178        push (@{$tempclassify->{'contains'}}, {'OID'=>$subsubOID});
Note: See TracChangeset for help on using the changeset viewer.