Changeset 9461


Ignore:
Timestamp:
2005-03-18T10:46:03+13:00 (19 years ago)
Author:
davidb
Message:

Hierarchy of metadata can now be expressed dc.Format|dc.Title in addition to
dc.Format/dc.Title (to make it more consistent with other parts of Greenstone).

Also changed level in hierarchy that it switches from a recursive call to
AZCompactList to SectionList/List. Was at 0, now at 1.

File:
1 edited

Legend:

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

    r9064 r9461  
    186186    $self->{'title'} = "$title";     # title for the titlebar.
    187187    $self->{'sortname'} = $sortname;
     188
    188189    if (defined($removeprefix) && $removeprefix) {
    189190    $removeprefix =~ s/^\^//; # don't need a leading ^
     
    249250    my $outhandle = $self->{'outhandle'};
    250251
    251     $metaname =~ s/(\/.*)//; # grab first name in n1/n2/n3 list
     252    $metaname =~ s/(\/|\|).*//; # grab first name in n1/n2/n3 or n1|n2|n3 list
    252253    my @commameta_list = split(/,/, $metaname);
    253254
     
    411412    my $doclevel = $self->{'doclevel'};
    412413    my $mingroup = $self->{'mingroup'};
    413     my @metaname_list = split('/',$self->{'metaname'});
     414    my @metaname_list = split(/\/|\|/,$self->{'metaname'});
    414415    my $metaname = shift(@metaname_list);
    415416    my $hierarchical = 0;
    416     if (!(@metaname_list == 0)) {
     417    if (scalar(@metaname_list) > 1) {
    417418    $hierarchical = 1;
    418419    $metaname = join('/',@metaname_list);
     
    435436        if ($doclevel =~ m/^top(level)?/i)
    436437        {
    437             eval ("\$listclassobj = new List(\@args)"); warn $@ if $@;
     438            eval ("\$listclassobj = new List(\@args)");
     439            warn $@ if $@;
    438440        }
    439441        else
    440442        {
    441             eval ("\$listclassobj = new SectionList(\@args)");
     443            eval ("\$listclassobj = new SectionList(\@args)");
     444            warn $@ if $@;
    442445        }
    443446        }
     
    449452        # buttonname is also used for the node's title
    450453        push @args, ("-buttonname", "$metavalue");
     454        push @args, ("-sort", $self->{'sortname'});
    451455        push @args, ("-doclevel", "$doclevel");
    452456        push @args, ("-mingroup", $mingroup);
     
    454458
    455459        eval ("\$listclassobj = new AZCompactList(\@args)");
     460        warn $@ if $@;
    456461        }
    457462        if ($@) {
     
    682687
    683688    # top level
    684     my @metanames = split("/",$self->{'metaname'});
     689    my @metanames = split(/\/|\|/,$self->{'metaname'});
    685690    my $metaname = shift(@metanames);
    686691
Note: See TracChangeset for help on using the changeset viewer.