Changeset 15761

Show
Ignore:
Timestamp:
28.05.2008 15:19:01 (11 years ago)
Author:
mdewsnip
Message:

(Adding dynamic classifiers) Adding get_metadata_values() function, which uses SQLBrowseFilter to get all the metadata values assigned to an element.

Location:
gsdl/trunk/src/protocol
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/src/protocol/recptprototools.cpp

    r15596 r15761  
    249249  } 
    250250} 
     251 
     252 
     253bool get_metadata_values (const text_t metadata_element, const text_t &collection, 
     254              recptproto *collectproto, FilterResponse_t &response, ostream &logout) 
     255{ 
     256  response.clear(); 
     257 
     258  comerror_t err = noError; 
     259  FilterRequest_t request; 
     260  request.clear(); 
     261 
     262  request.filterName = "SQLBrowseFilter"; 
     263  request.filterResultOptions = FRmetadataValues; 
     264  request.fields.insert (metadata_element); 
     265  assert (collectproto != NULL); 
     266 
     267  collectproto->filter (collection, request, response, err, logout); 
     268  if (err != noError) 
     269  { 
     270    outconvertclass text_t2ascii; 
     271    logout << text_t2ascii 
     272       << "Error: call to filter failed for " << metadata_element 
     273       << " in OIDtools::get_metadata_values ("  
     274       << get_comerror_string (err) << ")\n"; 
     275    return false; 
     276  } 
     277   
     278  return true; 
     279} 
  • gsdl/trunk/src/protocol/recptprototools.h

    r15572 r15761  
    6868           ostream &logout); 
    6969 
     70bool get_metadata_values (const text_t metadata_element, const text_t &collection, 
     71              recptproto *collectproto, FilterResponse_t &response, ostream &logout); 
    7072 
    7173#endif