Changeset 19862 for gli


Ignore:
Timestamp:
06/18/09 15:09:49 (12 years ago)
Author:
ak19
Message:

Getting the preview button working again for GS3.

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

Legend:

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

    r19758 r19862  
    371371        // It is not necessary if an independent GSI was launched and the user hasn't pressed Enter Library yet
    372372        DebugStream.println("Configuration.library_url = " + Configuration.library_url);
    373         if (Configuration.library_url == null && (isLocalLibrary && !LocalLibraryServer.isURLPending())) {
    374         missingEXEC();
     373        if (Configuration.library_url == null) {
     374        if(isLocalLibrary) {
     375            if(!LocalLibraryServer.isURLPending()) {
     376            missingEXEC();
     377            }
     378            // else LocalLibraryServer is expecting a URL soon, so don't need to display the dialog
     379        } else { // GS2 webLibrary or GS3 or remote Greenstone
     380            missingEXEC();
     381        }
    375382        }
    376383
     
    772779    static public void configGS3Server(String site, String command) {
    773780    if (Configuration.library_url == null){
    774         System.out.println("Error: you have not provide the Greenstone Library address."); 
     781        System.out.println("Error: you have not provided the Greenstone Library address."); 
    775782           return;
    776783
     
    863870    /** Prints a warning message about a missing library path, which means the final collection cannot be previewed in the Gatherer.
    864871     */
    865     static private void missingEXEC() {
     872    static public void missingEXEC() {
    866873    WarningDialog dialog;
    867874    String configPropertyName = "general.library_url"+Configuration.gliPropertyNameSuffix();
     
    888895            props.load(new FileInputStream(buildPropsFile));
    889896            host = props.getProperty("tomcat.server", host);
    890             port = props.getProperty("tomcat.port", port); 
     897            port = props.getProperty("tomcat.port", port);
    891898        }catch(Exception e){
    892899            DebugStream.println("Could not load build.properties file");
     
    895902        props = null;
    896903        }
    897         String defaultURL = "http://"+host+":"+port+"/"+"greenstone3/library";
     904        String defaultURL = "http://"+host+":"+port+"/"+"greenstone3";
    898905        field.setText(defaultURL);
    899906        field.selectAll();
  • gli/trunk/src/org/greenstone/gatherer/gui/PreviewButton.java

    r19758 r19862  
    8282    // set up the home page for the current collection
    8383    if (Gatherer.GS3 && !Configuration.fedora_info.isActive()) { // GLI for GS3 case
    84         // don't do anything fancy here
    85         preview_address = Configuration.library_url.toString() + Configuration.getServletPath()
    86         + "?a=p&sa=about&c=" + collGroupWithName + "&l=" + Configuration.getLanguage();
     84        if(Configuration.library_url == null) {
     85        Gatherer.missingEXEC();
     86        } else {
     87        // don't do anything fancy here
     88        preview_address = Configuration.library_url.toString() + Configuration.getServletPath()
     89            + "?a=p&sa=about&c=" + collGroupWithName + "&l=" + Configuration.getLanguage();
     90        }
    8791        return;
    8892    }
Note: See TracChangeset for help on using the changeset viewer.