Ignore:
Timestamp:
2003-07-11T16:29:16+12:00 (21 years ago)
Author:
kjdon
Message:

tidied up a lot of stuff, particularly the display text stuff, including how its formatted, and some of the service rack methods

File:
1 edited

Legend:

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

    r4246 r4903  
    4444    private MGPPWrapper mgpp_src_=null;
    4545    private String basepath_ = null;
     46
     47    private Element applet_description = null;
     48   
    4649    public PhindPhraseBrowse() {
    4750    mgpp_src_ = new MGPPWrapper();
     
    6871    short_service_info_.appendChild(e);
    6972
    70     // set up service_info_map_ - we only have one element, and it has
    71     // no extra info yet - we are not processing the config info
    72     Element f = doc_.createElement(GSXML.SERVICE_ELEM);
    73     f.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_APPLET);
    74     f.setAttribute(GSXML.NAME_ATT, PHIND_SERVICE);
     73    // set up the static applet description
     74
     75    applet_description = doc_.createElement(GSXML.SERVICE_ELEM);
     76    applet_description.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_APPLET);
     77    applet_description.setAttribute(GSXML.NAME_ATT, PHIND_SERVICE);
    7578
    7679    // add in the applet info for the phind applet
     
    8790    Document dom = converter_.getDOM(app_info);
    8891    Element app_elem = dom.getDocumentElement();
    89     f.appendChild(doc_.importNode(app_elem, true));
    90    
    91     service_info_map_.put(PHIND_SERVICE, f);
     92    applet_description.appendChild(doc_.importNode(app_elem, true));
    9293   
    9394    return true;
    9495    }
    9596
    96     /** creates a display element containing all the text strings needed to display the service page, in the language specified */
    97     protected Element createServiceDisplay(String service, String lang) {
    98     Element display = doc_.createElement(GSXML.DISPLAY_ELEM);
    99     display.appendChild(GSXML.createTextElement(doc_, GSXML.DISPLAY_NAME_ELEM,  getTextString(service+".name", lang)));
    100     //display.appendChild(GSXML.createTextElement(doc_,  GSXML.DISPLAY_SUBMIT_ELEM, getTextString(service+".submit", lang)));
    101 
    102     return display;
    103    
     97    protected Element getServiceDescription(String service, String lang) {
     98    if (!service.equals(PHIND_SERVICE)) {
     99        return null;
     100    }
     101    Element describe = (Element) applet_description.cloneNode(true);
     102    describe.appendChild(GSXML.createDisplayTextElement(doc_, GSXML.DISPLAY_TEXT_NAME,  getTextString(PHIND_SERVICE+".name", lang)));
     103    return describe;
    104104    }
    105105
Note: See TracChangeset for help on using the changeset viewer.