Changeset 12067
- Timestamp:
- 2006-07-07T11:23:28+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/CreatePane.java
r11318 r12067 49 49 import org.greenstone.gatherer.Gatherer; 50 50 import org.greenstone.gatherer.LocalLibraryServer; 51 import org.greenstone.gatherer.cdm. SearchTypeManager;51 import org.greenstone.gatherer.cdm.BuildTypeManager; 52 52 import org.greenstone.gatherer.cdm.CollectionDesignManager; 53 53 import org.greenstone.gatherer.collection.Collection; … … 148 148 private String args[] = null; 149 149 /** The homepage address of the current collection */ 150 p rivateString homepage = null;150 public String homepage = null; 151 151 152 152 … … 208 208 BuildButtonListener bbl = new BuildButtonListener(); 209 209 CancelButtonListener cbl = new CancelButtonListener(); 210 PreviewButtonListener pbl = new PreviewButtonListener(); 211 210 212 211 build_button = new GLIButton(); 213 212 build_button.addActionListener(bbl); … … 221 220 Dictionary.registerBoth(cancel_button, "CreatePane.Cancel_Build", "CreatePane.Cancel_Build_Tooltip"); 222 221 223 preview_button = new GLIButton();224 preview_button.addActionListener(pbl);222 preview_button = new PreviewButton(); 223 //preview_button.addActionListener(pbl); 225 224 if(Gatherer.c_man != null) { 226 225 preview_button.setEnabled(Gatherer.c_man.built()); … … 243 242 Dictionary.registerBoth(simple_cancel_button, "CreatePane.Cancel_Build", "CreatePane.Cancel_Build_Tooltip"); 244 243 245 simple_preview_button = new GLIButton();246 simple_preview_button.addActionListener(pbl);244 simple_preview_button = new PreviewButton(); 245 //simple_preview_button.addActionListener(pbl); 247 246 if(Gatherer.c_man != null) { 248 247 simple_preview_button.setEnabled(Gatherer.c_man.built()); … … 256 255 bbl = null; 257 256 cbl = null; 258 pbl = null;257 //pbl = null; 259 258 } 260 259 … … 630 629 } 631 630 } 632 633 634 private void configureHomeURL() {635 // set up the home page for the current collection636 Collection current_collection = Gatherer.c_man.getCollection();637 String site = Configuration.site_name; // for GS3 colls638 String extra_args = "";639 SearchTypeManager st_man = current_collection.cdm.searchtype_manager;640 if (!Gatherer.GS3 && st_man.isSearchTypeEnabled()) {641 if (st_man.isLucene()) {642 extra_args = "&ct=2";643 } else { // MGPP default644 extra_args = "&ct=1";645 }646 // we need some more args on the url647 String search_types = st_man.getSearchTypes();648 if (search_types.equals("")) {649 extra_args += "&qt=0&qto=3";650 } else if (search_types.equals("plain")) {651 extra_args += "&qt=0&qto=1";652 } else if (search_types.equals("form")) {653 extra_args += "&qt=1&qto=2";654 } else if (search_types.equals("plain,form")) {655 extra_args += "&qt=0&qto=3";656 } else if (search_types.equals("form,plain")) {657 extra_args += "&qt=1&qto=3";658 }659 }660 // Remember to add unique timestamp661 if (Gatherer.GS3) {662 homepage = Configuration.library_url.toString() + Configuration.getServletPath()+ "?a=p&sa=about&c=" + current_collection.getName()+"&l="+Configuration.getLanguage(); //+extra_args + StaticStrings.TIMESTAMP_ARGUMENT + System.currentTimeMillis();663 } else {664 homepage = Configuration.library_url.toString() + "?a=p&p=about&c=" + current_collection.getName()+"&l="+Configuration.getLanguage()+extra_args + StaticStrings.TIMESTAMP_ARGUMENT + System.currentTimeMillis();665 }666 }667 668 631 669 632 /** This class serves as the listener for actions on the build button. */ … … 793 756 } 794 757 795 private class PreviewButtonListener796 implements ActionListener {797 798 public void actionPerformed(ActionEvent event) {799 Gatherer.c_man.getCollection().cdm.save(); // save the config file just in case800 configureHomeURL();801 // check that the local library server is stil running - doesn't do anything if its not supposed to be running802 LocalLibraryServer.checkServerRunning();803 804 Gatherer.spawnBrowser(homepage);805 806 }807 }808 758 809 759 /** The OptionTree is simply a tree structure that has a root node labelled "Options" and then has a child node for each available options screen. These screens are either combinations of the available import and build arguments, or a message log detailing the shell processes progress. */ … … 900 850 } 901 851 } 902 852 //scroll_pane.setViewportView(previous_pane); 903 853 //previous_pane.validate(); 904 854 right.validate();
Note:
See TracChangeset
for help on using the changeset viewer.