Changeset 5929 for trunk


Ignore:
Timestamp:
2003-11-21T10:57:10+13:00 (21 years ago)
Author:
kjdon
Message:

fixed the url generation stuff for preview - wasn't updating changes to search types

File:
1 edited

Legend:

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

    r5892 r5929  
    4646import org.greenstone.gatherer.Dictionary;
    4747import org.greenstone.gatherer.Gatherer;
     48import org.greenstone.gatherer.cdm.SearchTypeManager;
    4849import org.greenstone.gatherer.collection.BuildOptions;
    4950import org.greenstone.gatherer.collection.Collection;
     
    246247        preview_button.setEnabled(false);
    247248    } else {
    248         // set up the home page for the current collection
    249         String extra_args = "";
    250         String build_type = current_collection.getCollectionType();
    251         if (build_type.equals("mgpp")) {
    252         // we need some more args on the url
    253         String search_types = current_collection.getSearchTypes();
    254         if (search_types.equals("")) {
    255             extra_args = "&ct=1&qt=0&qto=3";
    256         } else if (search_types.equals("plain")) {
    257             extra_args = "&ct=1&qt=0&qto=1";
    258         } else if (search_types.equals("form")) {
    259             extra_args = "&ct=1&qt=1&qto=2";
    260         } else if (search_types.equals("plain,form")) {
    261             extra_args = "&ct=1&qt=0&qto=3";
    262         } else if (search_types.equals("form,plain")) {
    263             extra_args = "&ct=1&qt=1&qto=3";
    264         }
    265         }
    266        
    267         homepage = Gatherer.config.exec_address.toString() + "?a=p&p=about&c=" + current_collection.getName()+extra_args;
    268249        preview_button.setEnabled(true);
    269250    }
    270251    }
     252   
    271253    /** This method is called to actually layout the components.
    272254     * @see org.greenstone.gatherer.Configuration
     
    426408    }
    427409    }
     410
     411    private void configureHomeURL() {
     412   
     413    // set up the home page for the current collection
     414    Collection current_collection = Gatherer.c_man.getCollection();
     415    String extra_args = "";
     416    SearchTypeManager st_man = current_collection.cdm.searchtype_manager;
     417    if (st_man.isMGPPEnabled()) {
     418        // we need some more args on the url
     419        String search_types = st_man.getSearchTypes();
     420        if (search_types.equals("")) {
     421        extra_args = "&ct=1&qt=0&qto=3";
     422        } else if (search_types.equals("plain")) {
     423        extra_args = "&ct=1&qt=0&qto=1";
     424        } else if (search_types.equals("form")) {
     425        extra_args = "&ct=1&qt=1&qto=2";
     426        } else if (search_types.equals("plain,form")) {
     427        extra_args = "&ct=1&qt=0&qto=3";
     428        } else if (search_types.equals("form,plain")) {
     429        extra_args = "&ct=1&qt=1&qto=3";
     430        }
     431    }
     432   
     433    homepage = Gatherer.config.exec_address.toString() + "?a=p&p=about&c=" + current_collection.getName()+extra_args;
     434   
     435    }
     436   
    428437
    429438    /** This class serves as the listener for actions on the build button. */
     
    495504   
    496505    public void actionPerformed(ActionEvent event) {
     506        configureHomeURL();
    497507        Gatherer.self.spawnBrowser(homepage);
    498508
Note: See TracChangeset for help on using the changeset viewer.