greenstone.org greenstone wiki greenstone trac planet greenstone

Changeset 17000

Show
Ignore:
Timestamp:
2008-08-25 20:42:08 (5 months ago)
Author:
ak19
Message:

Merged GathererApplet?.java and GathererApplet?4gs3.java

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gli/trunk/src/org/greenstone/gatherer/GathererApplet.java

    r13599 r17000  
    115115        Gatherer.isApplet = true; 
    116116        String library_url_string = fullLibraryURL(getParameter("gwcgi")); 
    117         String gliserver_url_string = library_url_string.substring(0, library_url_string.lastIndexOf('/') + 1) + "gliserver.pl"; 
     117 
     118        String gs3 = getParameter("gsdl3"); 
     119        boolean isGS3 = (gs3 == null || !gs3.equals("true")) ? false : true; 
     120 
     121        String gliserver_url_string; 
     122        if(!isGS3) { 
     123            gliserver_url_string = library_url_string.substring(0, library_url_string.lastIndexOf('/') + 1) + "gliserver.pl"; 
     124        } else { 
     125            gliserver_url_string = library_url_string + "/cgi-bin/gliserver.pl"; 
     126        } 
    118127 
    119128        // String debug_param = getParameter("debug"); 
     
    122131        // } 
    123132 
    124         String[] args = { "-use_remote_greenstone", 
    125                           "-gliserver_url", gliserver_url_string, 
    126                           "-library_url", library_url_string, 
    127                           // "-debug", 
    128                         }; 
    129  
     133        String[] args; 
     134        if(!isGS3) { 
     135            String[] gs2_args = {  
     136                "-use_remote_greenstone", 
     137                "-gliserver_url", gliserver_url_string, 
     138                "-library_url", library_url_string, 
     139                // "-debug", 
     140            }; 
     141            args = gs2_args; 
     142        } else { // >= GS3 
     143            String[] gs3_args = { 
     144                "-use_remote_greenstone", 
     145                "-gliserver_url", gliserver_url_string, 
     146                "-library_url", library_url_string, 
     147                "-gsdl3", 
     148                //"-debug", 
     149            }; 
     150            args = gs3_args; 
     151        } 
     152         
    130153        File collect_directory = new File(Gatherer.getCollectDirectoryPath()); 
    131154        if (!collect_directory.exists()) { 
     
    178201        System.err.println("Destroy called"); 
    179202        gatherer.exit(); 
     203        gatherer = null; 
    180204        System.err.println("Done gatherer exit."); 
    181205    }