Changeset 24306

Show
Ignore:
Timestamp:
22.07.2011 20:24:23 (8 years ago)
Author:
ak19
Message:

More changes to do with the ex. prefixed to embedded metadata (that may have an additional metadata set as namespace qualifier). The C code now removes the ex. prefix only if there are no other metadataset qualifiers in the metadata name.

Location:
main/trunk/greenstone2
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/DSpacePlugin.pm

    r24219 r24306  
    286286    } 
    287287 
    288     my $mimetype_list = $self->{'saved_metadata'}->{'dc.Format^mimetype'}; 
     288    my $mimetype_list = $self->{'saved_metadata'}->{'ex.dc.Format^mimetype'}; 
    289289    my ($doc_file_mimes, $assoc_file_mimes) = $self->read_content($dir, $only_first_doc, $first_inorder_ext,  
    290290                                  $first_inorder_mime, $mimetype_list); 
     
    300300    push(@$extrametakeys,$file_re); 
    301301 
    302     if (defined $self->{'saved_metadata'}->{'dc.Format^extent'}) { 
    303     delete $self->{'saved_metadata'}->{'dc.Format^extent'}; 
     302    if (defined $self->{'saved_metadata'}->{'ex.dc.Format^extent'}) { 
     303    delete $self->{'saved_metadata'}->{'ex.dc.Format^extent'}; 
    304304    } 
    305305 
    306306    if (defined $mimetype_list) { 
    307     delete $self->{'saved_metadata'}->{'dc.Format^mimetype'}; 
     307    delete $self->{'saved_metadata'}->{'ex.dc.Format^mimetype'}; 
    308308 
    309309    # Temporarily store associate file info in metadata table 
     
    369369    if ($metaname ne "description" || $qualifier ne "provenance") { 
    370370        $metaname .= "^$qualifier" if ($qualifier ne "none" && $qualifier ne ""); 
    371         $self->{'metaname'} = "dc.\u$metaname"; 
     371        $self->{'metaname'} = "ex.dc.\u$metaname"; 
    372372    } 
    373373    } 
  • main/trunk/greenstone2/runtime-src/src/recpt/formattools.cpp

    r24226 r24306  
    622622   
    623623  // check for ex. which may occur in format statements 
    624   if (meta.size()>3 && (substr(meta.begin(), meta.begin()+3) == "ex.")) { 
     624  // remove "ex." prefix, but only if there are no other metadata set qualifiers  
     625  // in the metaname, since we want to retain prefixes like "ex.dc." as-is 
     626  text_t::iterator period = findchar(meta.begin(), meta.end(), '.'); 
     627  text_t::iterator lastperiod = findlastchar(meta.begin(), meta.end(), '.'); 
     628 
     629  if (meta.size()>3 && (substr(meta.begin(), meta.begin()+3) == "ex.") && period == lastperiod) { 
    625630    meta = substr (meta.begin()+3, meta.end()); 
    626631  } 
     
    644649   
    645650  // check for ex. which may occur in format statements 
    646   if (meta.size()>3 && (substr(meta.begin(), meta.begin()+3) == "ex.")) { 
     651  // remove "ex." prefix, but only if there are no other metadata set qualifiers  
     652  // in the metaname, since we want to retain prefixes like "ex.dc." as-is 
     653  text_t::iterator period = findchar(meta.begin(), meta.end(), '.'); 
     654  text_t::iterator lastperiod = findlastchar(meta.begin(), meta.end(), '.'); 
     655 
     656  if (meta.size()>3 && (substr(meta.begin(), meta.begin()+3) == "ex.") && period == lastperiod) { 
    647657    meta = substr (meta.begin()+3, meta.end()); 
    648658  } 
  • main/trunk/greenstone2/runtime-src/src/recpt/querytools.cpp

    r24111 r24306  
    989989    if (!tag.empty()) { 
    990990 
    991       if (tag.size()>3 && (substr(tag.begin(), tag.begin()+3) == "ex.")) { 
     991      // remove "ex." prefix, but only if there are no other metadata set qualifiers  
     992      // in the metaname, since we want to retain prefixes like "ex.dc." as-is 
     993      text_t::iterator period = findchar(tag.begin(), tag.end(), '.'); 
     994      text_t::iterator lastperiod = findlastchar(tag.begin(), tag.end(), '.'); 
     995 
     996      if (tag.size()>3 && (substr(tag.begin(), tag.begin()+3) == "ex.") && period == lastperiod) { 
    992997    tag = substr (tag.begin()+3, tag.end()); 
    993998      }