Ignore:
Timestamp:
2004-12-01T16:14:11+13:00 (19 years ago)
Author:
kjdon
Message:

added some changes made by Emanuel Dejanu (Simple Words)

File:
1 edited

Legend:

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

    r8504 r8716  
    9595    my $newobj = {};
    9696   
    97     foreach $k (keys %$self) {
     97    foreach my $k (keys %$self) {
    9898    $newobj->{$k} = &clone ($self->{$k});
    9999    }
     
    109109    if ($type eq "HASH") {
    110110    my $to = {};
    111     foreach $key (keys %$from) {
     111    foreach my $key (keys %$from) {
    112112        $to->{$key} = &clone ($from->{$key});
    113113    }
     
    115115    } elsif ($type eq "ARRAY") {
    116116    my $to = [];
    117     foreach $v (@$from) {
     117    foreach my $v (@$from) {
    118118        push (@$to, &clone ($v));
    119119    }
     
    128128    my ($type) = @_;
    129129
    130     if ($type eq "incremental") {
     130    if ($type =~ /^(hash|incremental|dirname)$/) {
    131131    $self->{'OIDtype'} = $type;
    132132    } else {
     
    638638        $OID = "D" . $OIDcount;
    639639        $OIDcount ++;
     640     
     641    } elsif ($self->{'OIDtype'} eq "dirname") {
     642        $OID = 'J';
     643        my $filename = $self->get_source_filename();
     644        if (defined($filename) && -e $filename) {
     645        $OID = &File::Basename::dirname($filename);
     646        if (defined $OID) {
     647            $OID = 'J'.&File::Basename::basename($OID);
     648        } else {
     649            print STDERR "Failed to find base for filename ($filename).....\n";
     650            die("\n"); 
     651        }
     652        } else {
     653        print STDERR "Failed to find filename.....\n";
     654        die("\n");
     655        }   
    640656       
    641657    } else {
     
    10021018    my $section_ptr = $self->_lookup_section($section);
    10031019    if (!defined $section_ptr) {
    1004     print STDERR "doc::get_metadata_element couldn't find section " .
    1005         "$section\n";
     1020    print STDERR "doc::get_metadata_element couldn't find section ", $section, "\n";
    10061021    return;
    10071022    }
     
    10361051    my $section_ptr = $self->_lookup_section($section);
    10371052    if (!defined $section_ptr) {
    1038         print STDERR "doc::get_metadata couldn't find section " .
    1039             "$section\n";
     1053        print STDERR "doc::get_metadata couldn't find section ",
     1054        $section, "\n";
    10401055        return;
    10411056    }
     
    10681083    my $section_ptr = $self->_lookup_section($section);
    10691084    if (!defined $section_ptr) {
    1070     print STDERR "doc::get_all_metadata couldn't find section " .
    1071         "$section\n";
     1085    print STDERR "doc::get_all_metadata couldn't find section ", $section, "\n";
    10721086    return;
    10731087    }
     
    10831097    my $section_ptr = $self->_lookup_section($section);
    10841098    if (!defined $section_ptr) {
    1085     print STDERR "doc::delete_metadata couldn't find section " .
    1086         "$section\n";
     1099    print STDERR "doc::delete_metadata couldn't find section ", $section, "\n";
    10871100    return;
    10881101    }
     
    11051118    my $section_ptr = $self->_lookup_section($section);
    11061119    if (!defined $section_ptr) {
    1107     print STDERR "doc::delete_all_metadata couldn't find section " .
    1108         "$section\n";
     1120    print STDERR "doc::delete_all_metadata couldn't find section ", $section, "\n";
    11091121    return;
    11101122    }
     
    11491161    my $section_ptr = $self->_lookup_section($section);
    11501162    if (!defined $section_ptr) {
    1151     print STDERR "doc::add_utf8_metadata couldn't find section " .
    1152         "$section\n";
     1163    print STDERR "doc::add_utf8_metadata couldn't find section ", $section, "\n";
    11531164    return;
    11541165    }
Note: See TracChangeset for help on using the changeset viewer.