Changeset 16950

Show
Ignore:
Timestamp:
21.08.2008 16:17:14 (11 years ago)
Author:
ak19
Message:

Added some convenience methods to get often-used metadata: Source, SourceFile?, next to the one added earlier for getting the assoc_filename from the SourceFile?

Files:
1 modified

Legend:

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

    r16934 r16950  
    179179                 $converted_filename); 
    180180} 
    181  
    182181 
    183182# returns the source_filename as it was provided 
     
    932931} 
    933932 
    934 # get the actual name of the assocfile from SourceFile which is the url referring to it  
    935 sub assocfile_from_sourcefile { 
     933# returns the Source meta, which is the utf8 filename generated. 
     934# Added a separate method here for convenience 
     935sub get_source { 
     936    my $self = shift (@_); 
     937    return $self->get_metadata_element ($self->get_top_section(), "Source"); 
     938} 
     939 
     940# returns the SourceFile meta, which is the url reference to the URL-encoded 
     941# version of Source (the utf8 filename). Added a separate method here for convenience 
     942sub get_sourcefile { 
     943    my $self = shift (@_); 
     944    return $self->get_metadata_element ($self->get_top_section(), "SourceFile"); 
     945} 
     946 
     947# Get the actual name of the assocfile, a url-encoded string derived from SourceFile. 
     948# The SourceFile meta is the (escaped) url reference to the url-encoded assocfile. 
     949sub get_assocfile_from_sourcefile { 
    936950    my $self = shift (@_); 
    937951     
     
    945959    return $assocfilename; 
    946960} 
    947  
    948961 
    949962# methods for dealing with associated files 
     
    957970    my ($real_filename, $assoc_filename, $mime_type, $section) = @_; 
    958971    $mime_type = &ghtml::guess_mime_type ($real_filename) unless defined $mime_type; 
    959  
    960 #   my ($cpackage,$cfilename,$cline,$csubr,$chas_args,$cwantarray) = caller(1); 
    961 #   print STDERR "Calling method; $cfilename:$cline $cpackage->$csubr\n"; 
    962972 
    963973    # remove all associated files with the same name