Changeset 30891

Show
Ignore:
Timestamp:
20.10.2016 10:34:50 (3 years ago)
Author:
kjdon
Message:

removed some commented out code. when looking up metadata, if we have an underscore we take the first part off and assume that it is a relation tag, root, parent etc. But if we have gone through our list of relations and it doesn't match, then put it back on and look up the full name, as the user may have underscores in their metadata.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2DocumentRetrieve.java

    r29523 r30891  
    5151 * Implements the generic retrieval and classifier services for GS2 collections. 
    5252 *  
    53  * @author Katherine Don 
    54  * @author Michael Dewsnip 
    5553 */ 
    5654 
     
    232230    } 
    233231    // we need to get metadata for one or more different nodes 
     232    // we have a relation root, parent, ancestors, siblings, children, descendents 
    234233    String relation = metadata.substring(0, index); 
    235234    String relation_id=""; 
     
    304303    } 
    305304    // unknown relation 
    306     logger.error("asked for relation "+relation+" and don't understand it."); 
    307     return null; 
     305    logger.error("asked for relation "+relation+" and don't understand it, so getting the full metadata name "+relation+GSConstants.META_RELATION_SEP+metadata); 
     306    // we assume that maybe the metadata has an _ in the name, so get the original name 
     307    return info.getMultiInfo(relation+GSConstants.META_RELATION_SEP+metadata); 
     308 
    308309  } 
    309310       
    310   //   } else { 
    311   //   if (relation.equals("parent") || relation.equals("ancestors")) { 
    312   //     relation_id = OID.getParent(node_id); 
    313   //     if (relation_id.equals(node_id)) { 
    314   //    return null; 
    315   //     } 
    316   //   } else if (relation.equals("root")) { 
    317   //     relation_id = OID.getTop(node_id); 
    318   //   } 
    319  
    320   //   DBInfo relation_info; 
    321   //   if (relation_id.equals(node_id)) { 
    322   //     relation_info = info; 
    323   //   } else { 
    324   //     relation_info = this.coll_db.getInfo(relation_id); 
    325   //   } 
    326   //   if (relation_info == null) 
    327   //     { 
    328   //    return null; 
    329   //     } 
    330  
    331   //   Vector<String> values = relation_info.getMultiInfo(metadata); 
    332   //   // do resolving 
    333   //   if (!relation.equals("ancestors")){ 
    334   //     return values; 
    335   //   } 
    336  
    337   //   // ancestors: go up the chain 
    338  
    339   //   String current_id = relation_id; 
    340   //   relation_id = OID.getParent(current_id); 
    341   //   while (!relation_id.equals(current_id)) 
    342   //     { 
    343   //    relation_info = this.coll_db.getInfo(relation_id); 
    344   //    if (relation_info == null) 
    345   //      return values; 
    346      
    347   //    Vector<String> more_values = relation_info.getMultiInfo(metadata); 
    348   //    if (more_values != null) 
    349   //      { 
    350   //        values.addAll(0, more_values); 
    351   //      } 
    352      
    353              
    354   //    current_id = relation_id; 
    355   //    relation_id = OID.getParent(current_id); 
    356   //     } 
    357   //   return values; // for now 
    358   // } 
    359311 
    360312    protected Vector<String> getMetaValuesForOID(String oid, String metadata) {