Changeset 29990

Show
Ignore:
Timestamp:
24.06.2015 14:19:42 (4 years ago)
Author:
kjdon
Message:

classifier metadata can have macros, eg _textmonth06_ in a datelist. So pass meta values to macro resolver. Also, need to initialise the macro resolver in constructor so that super.configure can load the macros in to it

Files:
1 modified

Legend:

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

    r28966 r29990  
    2828import org.greenstone.gsdl3.util.BasicDocumentDatabase; 
    2929import org.greenstone.gsdl3.util.DBInfo; 
     30import org.greenstone.gsdl3.util.MacroResolver; 
    3031import org.greenstone.gsdl3.util.GS2MacroResolver; 
    3132import org.greenstone.gsdl3.util.GSFile; 
     
    5051    public GS2Browse() 
    5152    { 
     53      this.macro_resolver = new GS2MacroResolver(this.coll_db, this.class_loader); 
    5254    } 
    5355 
     
    107109            return false; 
    108110        } 
    109         this.macro_resolver = new GS2MacroResolver(this.coll_db, this.class_loader); 
     111         
    110112         
    111113        gs_doc_db = new BasicDocumentDatabase(database_type, this.site_home, this.cluster_name, index_stem); 
     
    190192                String key = it.next(); 
    191193                String value = info.getInfo(key); 
    192                 GSXML.addMetadata(metadata_list, key, value); 
     194                GSXML.addMetadata(metadata_list, key, this.macro_resolver.resolve(value, lang, MacroResolver.SCOPE_META, node_id)); 
    193195            } 
    194196 
     
    200202                String meta_name = metadata_names.get(i); 
    201203                String value = (String) info.getInfo(meta_name); 
    202                 GSXML.addMetadata(metadata_list, meta_name, value); 
     204                GSXML.addMetadata(metadata_list, meta_name, this.macro_resolver.resolve(value, lang, MacroResolver.SCOPE_META, node_id)); 
    203205            } 
    204206        }