Changeset 18356 for gli/branches


Ignore:
Timestamp:
2009-01-12T11:18:06+13:00 (15 years ago)
Author:
kjdon
Message:

updated the rtl-gli branch with files from trunk. Result of a merge 14807:18318

Location:
gli/branches/rtl-gli/src/org/greenstone/gatherer/greenstone
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • gli/branches/rtl-gli/src/org/greenstone/gatherer/greenstone/Classifiers.java

    r13594 r18356  
    134134            classinfo_options += "&collection=" + collection_name;
    135135        }
    136         classinfo_xml = RemoteGreenstoneServer.getScriptOptions("classinfo.pl", classinfo_options);
     136        classinfo_xml = Gatherer.remoteGreenstoneServer.getScriptOptions("classinfo.pl", classinfo_options);
    137137        }
    138138        else {
     
    195195            classinfo_options += "&collection=" + collection_name;
    196196        }
    197         String classinfo_output = RemoteGreenstoneServer.getScriptOptions("classinfo.pl", classinfo_options);
     197        String classinfo_output = Gatherer.remoteGreenstoneServer.getScriptOptions("classinfo.pl", classinfo_options);
    198198        xml = new StringBuffer(classinfo_output);
    199199        }
  • gli/branches/rtl-gli/src/org/greenstone/gatherer/greenstone/LocalLibraryServer.java

    r13792 r18356  
    139139
    140140    // Configure the server for immediate entry
    141     gsdlsite_cfg_file.set();
     141    //gsdlsite_cfg_file.set();
    142142
    143143    // Spawn local library server process
     
    286286    public GSDLSiteConfig(File server_exe) {
    287287        debug("New GSDLSiteConfig for: " + server_exe.getAbsolutePath());
     288       
    288289        gsdlsite_cfg = new File(server_exe.getParentFile(), GSDLSITE_CFG);
    289290        glisite_cfg = new File(server_exe.getParentFile(), GLISITE_CFG);
     291
     292        File configFile = null;
     293        if(glisite_cfg.exists()) {
     294        configFile = glisite_cfg;
     295        } else if(gsdlsite_cfg.exists()) {
     296        configFile = gsdlsite_cfg;
     297        } else {
     298        debug("Neither the file glisite.cfg nor GSDLsite.cfg can be found!");
     299        }
     300       
    290301        autoenter_initial = null;
    291302        start_browser_initial = null;
    292         if(gsdlsite_cfg.exists()) {
    293         debug("Load: " + gsdlsite_cfg.getAbsolutePath());
     303        if(configFile != null) {
     304        debug("Load: " + configFile.getAbsolutePath());
    294305        clear();
    295306        try {
    296             BufferedReader in = new BufferedReader(new FileReader(gsdlsite_cfg));
     307            BufferedReader in = new BufferedReader(new FileReader(configFile));
    297308            String line = null;
    298309            while((line = in.readLine()) != null) {
     
    315326        }
    316327        }
    317         else {
    318         debug("No GSDLsite.cfg file can be found!");
    319         }
    320     }
    321 
     328    }
     329   
    322330    public boolean exists() {
    323331        return gsdlsite_cfg.exists();
     
    402410        }
    403411        else {
    404         debug("No GSDLsite.cfg file can be found!");
     412        debug("No glisite.cfg file can be found!");
    405413        }
    406414    }
  • gli/branches/rtl-gli/src/org/greenstone/gatherer/greenstone/Plugins.java

    r13594 r18356  
    8383    // If we've found the plugin, load its arguments now, if required
    8484    if (plugin != null && arguments_required) {
    85         if (plugin.getArguments().size() == 0 && plugin.didLoadingOptionsFail() == false) {
     85        if (!plugin.hasLoadedOptions()) {
    8686        loadPluginInfo(plugin, collection_specific);
    8787        }
     
    135135            pluginfo_options += "&collection=" + collection_name;
    136136        }
    137         pluginfo_xml = RemoteGreenstoneServer.getScriptOptions("pluginfo.pl", pluginfo_options);
     137        pluginfo_xml = Gatherer.remoteGreenstoneServer.getScriptOptions("pluginfo.pl", pluginfo_options);
    138138        }
    139139        else {
     
    165165        // Check the XML output was obtained successfully
    166166        if (pluginfo_xml == null || pluginfo_xml.length() == 0) {
    167         plugin.setLoadingOptionsFailed();
     167        plugin.setHasLoadedOptions(false); // failure to load options
    168168        JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CDM.PlugInManager.PlugIn_XML_Parse_Failed", plugin.getName()), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
    169169        return;
     170        } else {
     171        plugin.setHasLoadedOptions(true);
    170172        }
    171173
     
    196198            pluginfo_options += "&collection=" + collection_name;
    197199        }
    198         String pluginfo_output = RemoteGreenstoneServer.getScriptOptions("pluginfo.pl", pluginfo_options);
     200        String pluginfo_output = Gatherer.remoteGreenstoneServer.getScriptOptions("pluginfo.pl", pluginfo_options);
    199201        xml = new StringBuffer(pluginfo_output);
    200202        }
     
    243245    Document document = XMLTools.parseXML(new StringReader(xml));
    244246    if (document == null) {
    245         plugin.setLoadingOptionsFailed();
     247        plugin.setHasLoadedOptions(false); // failure to load the options/failed plugin
    246248        JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CDM.PlugInManager.PlugIn_XML_Parse_Failed", plugin.getName()), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
    247249        return;
     250    } else {
     251        plugin.setHasLoadedOptions(true);
    248252    }
    249253
     
    268272        else if (node_name.equalsIgnoreCase("Explodes")) {
    269273        plugin.setDoesExplodeMetadataDatabases(XMLTools.getValue(node).equalsIgnoreCase(StaticStrings.YES_STR));
     274        }
     275        else if (node_name.equalsIgnoreCase("SourceReplaceable")) { // looking for <SourceReplaceable> tag
     276        plugin.setDoesReplaceSrcDocsWithHtml(XMLTools.getValue(node).equalsIgnoreCase(StaticStrings.YES_STR));
    270277        }
    271278        else if (node_name.equalsIgnoreCase("Processes")) {
Note: See TracChangeset for help on using the changeset viewer.