Changeset 8221


Ignore:
Timestamp:
2004-10-06T05:38:35+13:00 (20 years ago)
Author:
cs025
Message:

Added AllList to provide a universal list of all documents, which
supports OAI in particular at this early date. Also, changes to
Hierarchy and List to support 'memberof' function, and BasClas
ditto.

Location:
trunk/gsdl/perllib/classify
Files:
1 added
3 edited

Legend:

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

    r7580 r8221  
    220220
    221221    $self->{'outhandle'} = STDERR;
     222    $self->{'idnum'} = -1;
    222223   
    223224    $self->{'option_list'} = [ $options ];
     
    248249sub init {
    249250    my $self = shift (@_);
     251
     252    $self->{'supportsmemberof'} = &supports_memberof();
     253}
     254
     255sub set_number {
     256    my $self = shift (@_);
     257    my ($id)   = @_;
     258    $self->{'idnum'} = $id;
     259}
     260
     261sub get_number {
     262    my $self = shift (@_);
     263    return $self->{'idnum'};
    250264}
    251265
     
    263277    my $outhandle = $self->{'outhandle'};
    264278    &gsprintf($outhandle, "BasClass::get_classify_info {common.must_be_implemented}\n");
     279}
     280
     281sub supports_memberof {
     282    my $self = shift(@_);
     283
     284    return "false";
    265285}
    266286
  • trunk/gsdl/perllib/classify/Hierarchy.pm

    r7572 r8221  
    201201        push (@{$self->{'locatorlist'}->{$self->{'descriptorlist'}->{$metaelement}}->{'contents'}},
    202202          [$doc_OID, $sortmeta]);
     203        my $localid = $self->{'descriptorlist'}->{$metaelement};
     204        my $classid = $self->get_number();
     205
     206        $doc_obj->add_metadata($doc_obj->get_top_section(), "memberof", "CL$classid.$localid");
    203207    }
    204208    }
     
    234238}
    235239
     240sub supports_memberof {
     241    my $self = shift(@_);
     242
     243    return "true";
     244}
     245
    236246sub get_OID_entry {
    237247    my $self = shift (@_);
     
    266276    my $self = shift (@_);
    267277    my ($title, $childtype, $thistype) = @_;
    268 
     278    my $memberof = &supports_memberof();
     279   
    269280    # organise into classification structure
    270281    my %classifyinfo = ('childtype'=>$childtype,
    271282            'Title'=>$title,
     283            'supportsmemberof'=>$memberof,
    272284            'contains'=>[]);
    273285    $classifyinfo{'thistype'} = $thistype
  • trunk/gsdl/perllib/classify/List.pm

    r7835 r8221  
    208208    $self->{'list'}->{$doc_OID} = $metavalue;
    209209    }
     210    my $id = $self->get_number();
     211    $doc_obj->add_metadata($doc_obj->get_top_section(), "memberof", "CL$id");
    210212}
    211213
     
    215217    my ($no_thistype) = @_;
    216218    $no_thistype = 0 unless defined $no_thistype;
     219    my $memberof = &supports_memberof();
    217220
    218221    my @list = ();
     
    231234            'contains'=>[]);
    232235    $classifyinfo{'thistype'} = 'Invisible' unless $no_thistype;
     236    # always supports memberof
     237    $classifyinfo{'supportsmemberof'} = $memberof;
    233238
    234239    foreach $OID (@list) {
     
    246251}
    247252
     253sub supports_memberof {
     254    my $self = shift(@_);
     255
     256    return "true";
     257}
    248258
    2492591;
Note: See TracChangeset for help on using the changeset viewer.