Ignore:
Timestamp:
2004-11-03T14:46:37+13:00 (20 years ago)
Author:
kjdon
Message:

when creating doc nodes, now we choose hierarchy or simple based on whether there is a section structure in the database. we used to always change doc ids that matched the whole structure to be the first section id, eg 20041102:1 to 20041102:1-1. this is now only done for hierarchical docs, not for simple docs.

File:
1 edited

Legend:

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

    r7312 r8439  
    164164        //ystem.out.println("translated id = "+doc_id);
    165165        }
    166         if (GS3OID.isDocTop(doc_id)) {
    167         System.out.println("adding the structure bit to doc id");
    168         doc_id = GS3OID.createOID(doc_id, "1");
     166        if (GS3OID.isDocTop(doc_id) && database.isHierarchicalDocument(doc_id)) {
     167        // if we have a whole doc id, and the document is hierarchical,
     168        // we want to change the id to be the top id of the section
     169        // hierarchy
     170            doc_id = GS3OID.createOID(doc_id, "1");
    169171        }
    170         String doc_num = this.database.OID2MGNum(doc_id);
    171        
    172         //long doc_num = this.gdbm_src.oid2Docnum(doc_id);
    173         System.out.println("mg doc num = "+doc_num);
     172        String doc_num = this.database.OID2MGNum(doc_id);       
    174173        // doc nums have the index prefixed
    175174        doc_num = doc_num.substring(doc_num.indexOf(".")+1);
    176175        int doc_int = Integer.parseInt(doc_num);
    177         System.out.println("actual mg doc num="+doc_int);
     176       
    178177        String doc_content = "";
    179178        try {
    180           doc_content = this.mg_src.getDocument(basedir, textdir, doc_int);
     179        doc_content = this.mg_src.getDocument(basedir, textdir, doc_int);
    181180        } catch (Exception e) {
    182           System.out.println("exception happended with mg_src.getDocument()");
    183           doc_content = "this is the content for section hash id "+ doc_id+", mg doc num "+doc_int+"\n";
     181        System.out.println("exception happended with mg_src.getDocument()");
     182        doc_content = "this is the content for section hash id "+ doc_id+", mg doc num "+doc_int+"\n";
    184183        }
    185184        //ystem.out.println("Doc content: " + doc_content + "|");
Note: See TracChangeset for help on using the changeset viewer.