Changeset 14000


Ignore:
Timestamp:
2007-04-02T12:30:26+12:00 (15 years ago)
Author:
qq6
Message:

add parameters:defaultIndexSubcollection, defaultIndexLanguage

File:
1 edited

Legend:

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

    r13911 r14000  
    4343    private static final String INDEX_LIST_ELEM = "indexList";
    4444    private static final String INDEX_ELEM = "index";
    45 
     45    private static final String DEFAULT_INDEX_SUBCOLLECTION_ELEM = "defaultIndexSubcollection";
     46    private static final String DEFAULT_INDEX_LANGUAGE_ELEM = "defaultIndexLanguage";
     47 
    4648    private MGWrapper mg_src = null;
    4749    private String mg_basedir = null;
     
    7476        this.default_index = def.getAttribute(GSXML.SHORTNAME_ATT);
    7577    }
     78         Element defSub = (Element) GSXML.getChildByTagName(info, DEFAULT_INDEX_SUBCOLLECTION_ELEM);
     79    if (defSub != null) {
     80        this.default_index += defSub.getAttribute(GSXML.SHORTNAME_ATT);
     81        logger.info("default indexSubcollection is "+defSub.getAttribute(GSXML.SHORTNAME_ATT));     
     82    } //concate defaultIndex + defaultIndexSubcollection
     83
     84    //get the default indexLanguage out of <defaultIndexLanguage> (buildConfig.xml)
     85        Element defLang = (Element) GSXML.getChildByTagName(info, DEFAULT_INDEX_LANGUAGE_ELEM);
     86    if (defLang != null) {
     87        this.default_index += defLang.getAttribute(GSXML.SHORTNAME_ATT);
     88            logger.info("default indexLanguage is "+defLang.getAttribute(GSXML.SHORTNAME_ATT));
     89    } //concate defaultIndex + defaultIndexSubcollection + defaultIndexLanguage
     90     
     91
    7692    if (this.default_index == null || this.default_index.equals("")) {
    7793             logger.error("default index is not specified, the content of a document will not be retrieved");
     
    107123    String doc_content = null;
    108124
     125        //means that this.mg_src is up and running 
    109126    if (has_default_index ){
    110127            doc_content =  this.mg_src.getDocument(this.mg_basedir,
Note: See TracChangeset for help on using the changeset viewer.