Changeset 11265


Ignore:
Timestamp:
2006-02-16T13:36:30+13:00 (18 years ago)
Author:
kjdon
Message:

resolving macro _httpdocimg_ is now done by replaceList, rather than hard coded

File:
1 edited

Legend:

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

    r10651 r11265  
    6262    {
    6363    this.gdbm_src = new GDBMWrapper();
    64     this.macro_resolver = new GS2MacroResolver(gdbm_src);
     64    this.macro_resolver = new GS2MacroResolver(this.gdbm_src);
    6565    }
    6666
     
    7575        return false;
    7676    }
    77 
     77   
    7878    System.out.println("Configuring AbstractGS2DocumentRetrieve...");
    7979    //this.config_info = info;
     
    408408    protected String resolveTextMacros(String doc_content, String doc_id, String lang)
    409409    {
    410     DBInfo info = null;
    411     if (doc_content.indexOf("_httpdocimg_")!=-1) {
    412         String top_doc_id = OID.getTop(doc_id);
    413         info = this.gdbm_src.getInfo(top_doc_id);
    414         if (info == null) {
    415         // perhaps we had per.iods in the ids - just try the current id
    416         top_doc_id = doc_id;
    417         info = this.gdbm_src.getInfo(top_doc_id);
    418         }
    419         if (info != null) {
    420         String archivedir = info.getInfo("archivedir");
    421         String image_dir  = this.site_http_address + "/collect/"+this.cluster_name+"/index/assoc/"+archivedir;
    422        
    423         // Resolve all "_httpdocimg_"s
    424         doc_content = doc_content.replaceAll("_httpdocimg_", image_dir);
    425         }
    426     }
    427410    // resolve any collection specific macros
    428411    doc_content = macro_resolver.resolve(doc_content, lang, MacroResolver.SCOPE_TEXT, doc_id);
Note: See TracChangeset for help on using the changeset viewer.