Changeset 677


Ignore:
Timestamp:
1999-10-15T12:36:14+13:00 (25 years ago)
Author:
sjboddie
Message:

changes for new browsing support

Location:
trunk/gsdl/perllib
Files:
8 edited

Legend:

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

    r618 r677  
    9999sub get_entry {
    100100    my $self = shift (@_);
    101     my ($title, $classifytype) = @_;
     101    my ($title, $childtype, $thistype) = @_;
    102102   
    103103    # organise into classification structure
    104     my %classifyinfo = ('classifytype'=>$classifytype,
     104    my %classifyinfo = ('childtype'=>$childtype,
    105105            'Title'=>$title,
    106106            'contains'=>[]);
     107    $classifyinfo{'thistype'} = $thistype
     108    if defined $thistype && $thistype =~ /\w/;
    107109
    108110    return \%classifyinfo;
     
    117119
    118120    # top level
    119     my $classifyinfo = $self->get_entry ($self->{'title'}, "AZList");
     121    my $childtype = "HList";
     122    if (scalar (@$classlistref) <= 20) {$childtype = "VList";}
     123    my $classifyinfo = $self->get_entry ($self->{'metaname'}, $childtype, "Invisible");
    120124
    121125    # don't need to do any splitting if there are less than 20 classifications
     
    154158
    155159    foreach $subclass (@tmparr) {
    156     my $tempclassify = $self->get_entry($subclass, "AZList");
     160    my $tempclassify = $self->get_entry($subclass, "VList");
    157161    foreach $subsubOID (@{$classhash->{$subclass}}) {
    158162        push (@{$tempclassify->{'contains'}}, {'OID'=>$subsubOID});
     
    204208        @currentOIDs = ();
    205209        $currentfirstletter = "";
     210        $lastkey = $subsection;
    206211        } else {
    207212        @currentOIDs = @{$classhashref->{$subsection}};
  • trunk/gsdl/perllib/classify/AZSectionList.pm

    r652 r677  
    224224        @currentOIDs = ();
    225225        $currentfirstletter = "";
     226        $lastkey = $subsection;
    226227        } else {
    227228        @currentOIDs = @{$classhashref->{$subsection}};
  • trunk/gsdl/perllib/classify/DateList.pm

    r537 r677  
    7979sub get_entry {
    8080    my $self = shift (@_);
    81     my ($title, $classifytype) = @_;
     81    my ($title, $childtype, $thistype) = @_;
    8282   
    8383    # organise into classification structure
    84     my %classifyinfo = ('classifytype'=>$classifytype,
     84    my %classifyinfo = ('childtype'=>$childtype,
    8585            'Title'=>$title,
    8686            'contains'=>[]);
     87    $classifyinfo{'thistype'} = $thistype
     88    if defined $thistype && $thistype =~ /\w/;
    8789
    8890    return \%classifyinfo;
     
    9799
    98100    # top level
    99     my $classifyinfo = $self->get_entry ("Date", "DateList");
     101    my $childtype = "HList";
     102    if (scalar (@$classlistref) <= 20) {$childtype = "DateList";}
     103    my $classifyinfo = $self->get_entry ("Date", $childtype, "Invisible");
    100104
    101105    # don't need to do any splitting if there are less than 20 classifications
     
    164168        @currentOIDs = ();
    165169        $currentfirstletter = "";
     170        $lastkey = $subsection;
    166171        } else {
    167172        @currentOIDs = @{$classhashref->{$subsection}};
     
    175180    # add final sub-classification
    176181    if (scalar (@currentOIDs) < $min) {
    177     my ($newkey) = $lastkey =~ /^(.)/;
     182    my ($newkey) = $lastkey =~ /^(\d\d\d\d)/;
    178183    @currentOIDs = (@{$compactedhash->{$lastkey}}, @currentOIDs);
    179184    delete $compactedhash->{$lastkey};
  • trunk/gsdl/perllib/classify/Hierarchy.pm

    r641 r677  
    151151}
    152152
    153 
    154153sub get_classify_info {
    155154    my $self = shift (@_);
     
    157156    my $list = $self->{'locatorlist'};
    158157
    159     my $classifyinfo = $self->get_entry ($self->{'title'}, "Hierarchy");
     158    my $classifyinfo = $self->get_entry ($self->{'title'}, "VList", "Invisible");
    160159    foreach $OID (keys (%$list)) {
    161     my $tempinfo = $self->get_OID_entry ($OID, $classifyinfo, $list->{$OID}->{'title'}, "Hierarchy");
     160    my $tempinfo = $self->get_OID_entry ($OID, $classifyinfo, $list->{$OID}->{'title'}, "VList");
    162161
    163162    if (defined $self->{'sortname'}) {
     
    175174}
    176175
    177 
    178176sub get_OID_entry {
    179177    my $self = shift (@_);
     
    205203sub get_entry {
    206204    my $self = shift (@_);
    207     my ($title, $classifytype) = @_;
     205    my ($title, $childtype, $thistype) = @_;
    208206   
    209207    # organise into classification structure
    210     my %classifyinfo = ('classifytype'=>$classifytype,
     208    my %classifyinfo = ('childtype'=>$childtype,
    211209            'Title'=>$title,
    212210            'contains'=>[]);
     211    $classifyinfo{'thistype'} = $thistype
     212    if defined $thistype && $thistype =~ /\w/;
    213213
    214214    return \%classifyinfo;
     
    216216
    217217
    218 
    2192181;
  • trunk/gsdl/perllib/classify/List.pm

    r641 r677  
    156156
    157157    # organise into classification structure
    158     my %classifyinfo = ('classifytype'=>'List',
     158    my %classifyinfo = ('thistype'=>'Invisible',
     159            'childtype'=>'VList',
    159160            'Title'=>$self->{'title'},
    160161            'contains'=>[]);
  • trunk/gsdl/perllib/classify/SectionList.pm

    r545 r677  
    172172
    173173    # organise into classification structure
    174     my %classifyinfo = ('classifytype'=>'List',
     174    my %classifyinfo = ('thistype'=>'Invisible',
     175            'childtype'=>'VList',
    175176            'Title'=>$self->{'title'},
    176177            'contains'=>[]);
  • trunk/gsdl/perllib/mgbuilder.pm

    r626 r677  
    123123    }
    124124
    125     # set the classifytype to use for displaying documents - if the doctype field hasn't
    126     # been set in the collect.cfg then the receptionist currently defaults to displaying
    127     # documents as 'Book'
    128     if (open (COLCFG, $colcfgname)) {
    129     while (defined ($line = &cfgread::read_cfg_line('mgbuilder::COLCFG'))) {
    130         if (scalar(@$line) == 2) {
    131         my $key = shift (@$line);
    132         if ($key eq "doctype") {
    133             $self->{'classifytype'} = shift (@$line);
    134         }
    135         }
    136     }
    137     close (COLCFG);
    138     }
    139 
    140125    # load up the document processor for building
    141126    # if a buildproc class has been created for this collection, use it
  • trunk/gsdl/perllib/mgbuildproc.pm

    r544 r677  
    132132}
    133133
     134# use 'Paged' if document has no more than 2 levels
     135# and each section at second level has a number for
     136# Title metadata
     137sub get_document_type {
     138    my $self = shift (@_);
     139    my ($doc_obj) = @_;
     140
     141    my $thistype = "VList";
     142    my $childtype = "VList";
     143    my $title;
     144    my @tmp = ();
     145   
     146    my $section = $doc_obj->get_top_section ();
     147    my $first = 1;
     148    while (defined $section) {
     149    @tmp = split /\./, $section;
     150    if (scalar(@tmp) > 1) {
     151        return ($thistype, $childtype);
     152    }
     153    if (!$first) {
     154        $title = $doc_obj->get_metadata_element ($section, "Title");
     155        if (defined $title && $title !~ /^\d+$/) {
     156        return ($thistype, $childtype);
     157        }
     158    }
     159    $first = 0;
     160    $section = $doc_obj->get_next_section($section);
     161    }
     162    if ($doc_obj->get_text_length ($doc_obj->get_top_section())) {
     163    $thistype = "Paged";
     164    } else {
     165    $thistype = "Invisible";
     166    }
     167    $childtype = "Paged";
     168    return ($thistype, $childtype);
     169}
     170
    134171sub infodb {
    135172    my $self = shift (@_);
     
    146183    $self->{'num_docs'} += 1 unless ($doctype eq "classification");
    147184
     185    # is this a paged or a hierarchical document
     186    my ($thistype, $childtype) = $self->get_document_type ($doc_obj);
     187
    148188    my $section = $doc_obj->get_top_section ();
    149189    my $doc_OID = $doc_obj->get_OID();
     190    my $first = 1;
    150191    while (defined $section) {
    151192    # update a few statistics
     
    192233    }
    193234
     235    # output document display type
     236    if ($first) {
     237        print $handle "<thistype>$thistype\n";
     238    }
     239
    194240    # output a list of children
    195241    my $children = $doc_obj->get_children ($section);
    196242    if (scalar(@$children) > 0) {
     243        print $handle "<childtype>$childtype\n";
    197244        print $handle "<contains>";
    198245        my $firstchild = 1;
     
    224271    print $handle '-' x 70, "\n";
    225272
    226 
     273    $first = 0;
    227274    $section = $doc_obj->get_next_section($section);
    228275    }
Note: See TracChangeset for help on using the changeset viewer.