Changeset 10576


Ignore:
Timestamp:
2005-08-28T16:58:35+12:00 (19 years ago)
Author:
mdewsnip
Message:

Rearranged a few things when using classinfo.pl and pluginfo.pl, to make this easier when using a remote Greenstone server.

Location:
trunk/gli/src/org/greenstone/gatherer/cdm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/cdm/ClassifierManager.java

    r10556 r10576  
    309309    // Run classinfo on this classifier, and then send the results for parsing.
    310310    try {
     311        StringBuffer xml = null;
    311312        if (Gatherer.isGsdlRemote) {
    312313        String launch  = Gatherer.cgiBase + "launch";
     
    320321        URLConnection launch_connection = launch_url.openConnection();
    321322        input_stream = launch_connection.getInputStream();
     323        xml = Utility.readXMLStream(input_stream);
    322324        }
    323325        else {
     
    351353
    352354        input_stream = process.getErrorStream();
    353         }
    354 
    355         StringBuffer xml = Utility.readXMLStream(input_stream);
     355        xml = Utility.readXMLStream(input_stream);
     356        }
     357
    356358        document = CollectionDesignManager.XMLStringToDOM(xml,classifier);
    357359    }
     
    398400            URLConnection launch_connection = launch_url.openConnection();
    399401            InputStream input_stream = launch_connection.getInputStream();
    400             loadClassifiers(input_stream);
     402            StringBuffer xml = Utility.readXMLStream(input_stream);
     403            loadClassifiers(xml);
    401404        }
    402405        catch (Exception error) {
     
    437440     * @param input_stream An <strong>InputStream</strong> indicating the where list of classifiers -- encoded in XML -- can be read from
    438441     */
    439     private void loadClassifiers(InputStream input_stream)
     442    private void loadClassifiers(StringBuffer xml)
    440443    {
    441     StringBuffer xml  = Utility.readXMLStream(input_stream);
    442444    Document document = CollectionDesignManager.XMLStringToDOM(xml, "-listall");
    443445
  • trunk/gli/src/org/greenstone/gatherer/cdm/PluginManager.java

    r10556 r10576  
    441441    // Run pluginfo on this plugin, and then send the results for parsing.
    442442    try {
     443        StringBuffer xml = null;
    443444        if (Gatherer.isGsdlRemote) {
    444445        String launch  = Gatherer.cgiBase + "launch";
     
    452453        URLConnection launch_connection = launch_url.openConnection();
    453454        input_stream = launch_connection.getInputStream();
     455        xml = Utility.readXMLStream(input_stream);
    454456        }
    455457        else {
     
    482484        Process process = runtime.exec(args);
    483485        input_stream = process.getErrorStream();
    484         }
    485 
    486         StringBuffer xml = Utility.readXMLStream(input_stream);
     486        xml = Utility.readXMLStream(input_stream);
     487        }
     488
    487489        document = CollectionDesignManager.XMLStringToDOM(xml,plugin);
    488490    }
     
    527529            URLConnection launch_connection = launch_url.openConnection();
    528530            InputStream input_stream = launch_connection.getInputStream();
    529             loadPlugins(input_stream);
     531            StringBuffer xml = Utility.readXMLStream(input_stream);
     532            loadPlugins(xml);
    530533        }
    531534        catch (Exception error) {
     
    550553     * @param input_stream An <strong>InputStream</strong> indicating the where list of plugins -- encoded in XML -- can be read from
    551554     */
    552     private void loadPlugins(InputStream input_stream)
     555    private void loadPlugins(StringBuffer xml)
    553556    {
    554     StringBuffer xml  = Utility.readXMLStream(input_stream);
    555557    Document document = CollectionDesignManager.XMLStringToDOM(xml, "-listall");
    556558
Note: See TracChangeset for help on using the changeset viewer.