Changeset 26198 for main


Ignore:
Timestamp:
09/18/12 15:19:18 (8 years ago)
Author:
kjdon
Message:

getMetadataList needs a language param, as we may need to look up a dictionary for macro resolving. and set a class loader for the macro resolver so we can have collection specific dictionaries

Location:
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service
Files:
3 edited

Legend:

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

    r26089 r26198  
    287287            try
    288288            {
    289                 Element metadata_list = getMetadataList(node_id, all_metadata, metadata_names_list);
     289              Element metadata_list = getMetadataList(node_id, all_metadata, metadata_names_list, lang);
    290290                if (metadata_list != null)
    291291                {
     
    759759     * <metadataList><metadata name="xxx">value</metadata></metadataList>
    760760     */
    761     abstract protected Element getMetadataList(String doc_id, boolean all_metadata, ArrayList<String> metadata_names) throws GSException;
     761  abstract protected Element getMetadataList(String doc_id, boolean all_metadata, ArrayList<String> metadata_names, String lang) throws GSException;
    762762
    763763    /**
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2DocumentRetrieve.java

    r26090 r26198  
    138138        GS2MacroResolver gs2_macro_resolver = (GS2MacroResolver) this.macro_resolver;
    139139        gs2_macro_resolver.setDB(this.coll_db);
    140 
     140        // set the class loader in case we have collection specific properties files
     141        gs2_macro_resolver.setClassLoader(this.class_loader);
    141142        return true;
    142143    }
     
    173174     * name="xxx">value</metadata></metadataList>
    174175     */
    175     protected Element getMetadataList(String node_id, boolean all_metadata, ArrayList<String> metadata_names) throws GSException
     176  protected Element getMetadataList(String node_id, boolean all_metadata, ArrayList<String> metadata_names, String lang) throws GSException
    176177    {
    177178        Element metadata_list = this.doc.createElement(GSXML.METADATA_ELEM + GSXML.LIST_MODIFIER);
     
    181182            return null;
    182183        }
    183         String lang = "en"; // why do we need this??
     184       
    184185        if (all_metadata) // this will get all metadata for current node
    185186        {
     
    194195                for (int i = 0; i < values.size(); i++)
    195196                {
    196                     GSXML.addMetadata(this.doc, metadata_list, key, this.macro_resolver.resolve(values.elementAt(i), lang, MacroResolver.SCOPE_META, node_id));
     197                  GSXML.addMetadata(this.doc, metadata_list, key, this.macro_resolver.resolve(values.elementAt(i), lang, MacroResolver.SCOPE_META, node_id));
    197198                }
    198199            }
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2Browse.java

    r26088 r26198  
    106106            return false;
    107107        }
    108         this.macro_resolver = new GS2MacroResolver(this.coll_db);
     108        this.macro_resolver = new GS2MacroResolver(this.coll_db, this.class_loader);
    109109       
    110110        gs_doc_db = new BasicDocumentDatabase(this.doc, database_type, this.site_home, this.cluster_name, index_stem);
Note: See TracChangeset for help on using the changeset viewer.