Changeset 18131 for gli/trunk/src/org/greenstone/gatherer/Gatherer.java
- Timestamp:
- 2008-12-05T18:13:28+13:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/src/org/greenstone/gatherer/Gatherer.java
r17628 r18131 821 821 822 822 if (GS3) { 823 dialog = new WarningDialog("warning.MissingEXEC", Dictionary.get("MissingEXEC_GS3.Title"), Dictionary.get("MissingEXEC_GS3.Message"), configPropertyName, false); 823 // Warning dialog with no cancel button and no "turn off warning" checkbox 824 dialog = new WarningDialog("warning.MissingEXEC", Dictionary.get("MissingEXEC_GS3.Title"), Dictionary.get("MissingEXEC_GS3.Message"), configPropertyName, false, false); 824 825 } else { // local case 825 826 dialog = new WarningDialog("warning.MissingEXEC", Dictionary.get("MissingEXEC.Title"), Dictionary.get("MissingEXEC.Message"), configPropertyName, false); 826 827 } 827 828 828 dialog.setValueField(new URLField.Text(Configuration.getColor("coloring.editable_foreground", false), Configuration.getColor("coloring.editable_background", false))); 829 JTextField field = new URLField.Text(Configuration.getColor("coloring.editable_foreground", false), Configuration.getColor("coloring.editable_background", false)); 830 831 // Set the default library URL to the tomcat server and port number 832 // specified in the build.properties located in the gsdl3_src_path 833 if (GS3) { 834 String host = "localhost"; 835 String port = "8080"; 836 837 File buildPropsFile = new File(Configuration.gsdl3_src_path + File.separator + "build.properties"); 838 if(buildPropsFile.exists()) { 839 Properties props = new Properties(); 840 try{ 841 props.load(new FileInputStream(buildPropsFile)); 842 host = props.getProperty("tomcat.server", host); 843 port = props.getProperty("tomcat.port", port); 844 }catch(Exception e){ 845 DebugStream.println("Could not load build.properties file"); 846 System.err.println("Could not load build.properties file"); 847 } 848 props = null; 849 } 850 String defaultURL = "http://"+host+":"+port+"/"+"greenstone3/library"; 851 field.setText(defaultURL); 852 field.selectAll(); 853 } 854 dialog.setValueField(field); 829 855 dialog.display(); 830 856 dialog.dispose(); … … 834 860 if (!library_url_string.equals("")) { 835 861 try { 862 // WarningDialog does not allow invalid URLs, so the following is ignored: 863 // make sure the URL the user provided contains the http:// prefix 864 // and then save the corrected URL 865 if(!library_url_string.startsWith("http://") 866 && !library_url_string.startsWith("https://")) { 867 library_url_string = "http://"+library_url_string; 868 Configuration.setString(configPropertyName, true, configPropertyName); 869 } 836 870 Configuration.library_url = new URL(library_url_string); 837 871 } … … 864 898 865 899 boolean showLogin = true; 866 867 900 do { 868 901 if(!dialog.loginRequested()) { // user pressed cancel to exit the FedoraLogin dialog
Note:
See TracChangeset
for help on using the changeset viewer.