Changeset 20817


Ignore:
Timestamp:
10/14/09 15:58:44 (12 years ago)
Author:
kjdon
Message:

we no longer use sequential ids for sections. so can use doc_id to get the section.

File:
1 edited

Legend:

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

    r18421 r20817  
    4747    protected static final String DOC_LEVEL="Doc";
    4848    protected static final String SEC_LEVEL="Sec";
    49     protected static final String ID_ATT = "gs2:id";
     49    protected static final String ID_ATT = "gs2:docOID";
    5050
    5151    // Parameters used
     
    102102     */
    103103    protected Element getNodeContent(String doc_id, String lang) throws GSException {   
    104     String doc_content = getTextString("TextRetrievalError", lang);
     104      String [] args = new String[1];
     105      args[0] = doc_id;
     106      String doc_content = getTextString("TextRetrievalError", lang, args);
    105107    try {
    106108        if (!text_available) {
    107109        throw new Exception("No text directory available");
    108110        }
    109        
    110         String doc_num = this.coll_db.OID2Docnum(doc_id);
    111         if (doc_num == null || doc_num.equals("")) {
    112         throw new Exception("OID "+doc_id +" couldn't be converted to lucene doc num");
    113         }
    114    
     111           
    115112        DBInfo info=this.coll_db.getInfo(OID.getTop(doc_id));
    116113        if (info == null) {
     
    135132        current_section = full_document;
    136133        } else {
    137         current_section = GSXML.getNamedElement(full_document, SEC_LEVEL, ID_ATT, doc_num);
     134        current_section = GSXML.getNamedElement(full_document, SEC_LEVEL, ID_ATT, doc_id);
    138135        }
    139136        if (current_section == null) {
    140         throw new Exception("Couldn't find section "+ doc_num+" in file "+doc_xml_file.getPath());
     137        throw new Exception("Couldn't find section "+ doc_id+" in file "+doc_xml_file.getPath());
    141138        }
    142139        doc_content = GSXML.getNodeText(current_section);
Note: See TracChangeset for help on using the changeset viewer.