Changeset 2270 for trunk/java-client
- Timestamp:
- 2001-04-03T17:08:23+12:00 (23 years ago)
- Location:
- trunk/java-client
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/java-client/ChangeLog
r2264 r2270 1 2001-04-03 15:45 say1 2 3 * org/nzdl/gsdl/: Makefile, Proxy.java, SimpleServer.java, 4 service/NzdlMultiWayWrapper.java, util/NzdlServiceFactory.java: 5 renamed SimpleServer.java Proxy.java. Fixed bug in 6 NzdlServiceFactory.java. Fixed NzdlMultiWayWrapper.java so i only 7 found a single instance of each collection 8 9 2001-04-03 13:08 daven 10 11 * org/nzdl/gsdl/SimpleGraphicalClient/ChangeLogDialog.java: tidied 12 up ChangeLogDialog appearance 13 14 2001-04-03 12:54 say1 15 16 * ChangeLog, 17 org/nzdl/gsdl/SimpleGraphicalClient/ChangeLogDialog.java: added the 18 ChangeLogDialog.java file 19 1 20 2001-04-03 02:31 say1 2 21 -
trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/Constants.java
r2260 r2270 51 51 52 52 53 /* Preference Strings */54 55 String DISPLAY_FIRST_DOC = "Automatically display the first document";56 String RAW_TEXT = "Always display raw text (don't interpret HTML)";57 String MULTIPLE_SERVERS = "Connect to multiple servers";58 String LOG_SERVICE = "Log at the NzdlService level";59 String CACHE_CORBA = "Cache corba requests";60 String SAVE_DOCS = "Save documents";61 53 62 54 /* Cursors */ -
trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/PreferencesDialog.java
r2222 r2270 37 37 package org.nzdl.gsdl.SimpleGraphicalClient; 38 38 39 import org.nzdl.gsdl.util.NzdlConstants; 39 40 import org.nzdl.gsdl.util.NzdlPreferences; 40 41 import javax.swing.*; … … 77 78 78 79 showFirstDocCheckBox = 79 new JCheckBox( Constants.DISPLAY_FIRST_DOC, NzdlPreferences.getBoolean(Constants.DISPLAY_FIRST_DOC));80 new JCheckBox( NzdlConstants.DISPLAY_FIRST_DOC, NzdlPreferences.getBoolean( NzdlConstants.DISPLAY_FIRST_DOC)); 80 81 showFirstDocCheckBox.setHorizontalAlignment(SwingConstants.LEFT); 81 82 82 83 showAsTextCheckBox = 83 new JCheckBox( Constants.RAW_TEXT, NzdlPreferences.getBoolean(Constants.RAW_TEXT));84 new JCheckBox( NzdlConstants.RAW_TEXT, NzdlPreferences.getBoolean(NzdlConstants.RAW_TEXT)); 84 85 showAsTextCheckBox.setHorizontalAlignment(SwingConstants.LEFT); 85 86 86 87 connectToMultipleCheckBox = 87 new JCheckBox( Constants.MULTIPLE_SERVERS, NzdlPreferences.getBoolean(Constants.MULTIPLE_SERVERS));88 new JCheckBox(NzdlConstants.MULTIPLE_SERVERS, NzdlPreferences.getBoolean(NzdlConstants.MULTIPLE_SERVERS)); 88 89 connectToMultipleCheckBox.setHorizontalAlignment(SwingConstants.LEFT); 89 90 90 91 logNetworkLevelCheckBox = 91 new JCheckBox( Constants.LOG_SERVICE, NzdlPreferences.getBoolean(Constants.LOG_SERVICE));92 new JCheckBox(NzdlConstants.LOG_SERVICE, NzdlPreferences.getBoolean(NzdlConstants.LOG_SERVICE)); 92 93 logNetworkLevelCheckBox.setHorizontalAlignment(SwingConstants.LEFT); 93 94 94 95 useCacheCheckBox = 95 new JCheckBox( Constants.CACHE_CORBA, NzdlPreferences.getBoolean(Constants.CACHE_CORBA));96 new JCheckBox(NzdlConstants.CACHE_CORBA, NzdlPreferences.getBoolean(NzdlConstants.CACHE_CORBA)); 96 97 useCacheCheckBox.setHorizontalAlignment(SwingConstants.LEFT); 97 98 98 99 saveDocsCheckBox = 99 new JCheckBox( Constants.SAVE_DOCS, NzdlPreferences.getBoolean(Constants.SAVE_DOCS));100 new JCheckBox(NzdlConstants.SAVE_DOCS, NzdlPreferences.getBoolean(NzdlConstants.SAVE_DOCS)); 100 101 saveDocsCheckBox.setHorizontalAlignment(SwingConstants.LEFT); 101 102 … … 140 141 //System.err.println("ok button pressed!"); 141 142 142 boolean oldRawText = NzdlPreferences.getBoolean( Constants.RAW_TEXT);143 boolean oldRawText = NzdlPreferences.getBoolean(NzdlConstants.RAW_TEXT); 143 144 144 NzdlPreferences.setBoolean( Constants.DISPLAY_FIRST_DOC,showFirstDocCheckBox.isSelected());145 NzdlPreferences.setBoolean( Constants.RAW_TEXT, showAsTextCheckBox.isSelected());146 NzdlPreferences.setBoolean( Constants.MULTIPLE_SERVERS, connectToMultipleCheckBox.isSelected());147 NzdlPreferences.setBoolean( Constants.LOG_SERVICE,logNetworkLevelCheckBox.isSelected());148 NzdlPreferences.setBoolean( Constants.CACHE_CORBA, useCacheCheckBox.isSelected());149 NzdlPreferences.setBoolean( Constants.SAVE_DOCS, saveDocsCheckBox.isSelected());145 NzdlPreferences.setBoolean(NzdlConstants.DISPLAY_FIRST_DOC,showFirstDocCheckBox.isSelected()); 146 NzdlPreferences.setBoolean(NzdlConstants.RAW_TEXT, showAsTextCheckBox.isSelected()); 147 NzdlPreferences.setBoolean(NzdlConstants.MULTIPLE_SERVERS, connectToMultipleCheckBox.isSelected()); 148 NzdlPreferences.setBoolean(NzdlConstants.LOG_SERVICE,logNetworkLevelCheckBox.isSelected()); 149 NzdlPreferences.setBoolean(NzdlConstants.CACHE_CORBA, useCacheCheckBox.isSelected()); 150 NzdlPreferences.setBoolean(NzdlConstants.SAVE_DOCS, saveDocsCheckBox.isSelected()); 150 151 NzdlPreferences.getInstance().save(); 151 152 152 153 // update the current display if raw text option has changed ? 153 154 154 boolean newRawText = NzdlPreferences.getBoolean( Constants.RAW_TEXT);155 boolean newRawText = NzdlPreferences.getBoolean(NzdlConstants.RAW_TEXT); 155 156 156 157 if (oldRawText != newRawText) { -
trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/SearchPanel.java
r2256 r2270 289 289 csModel.addResult(new Result((String)titleMap.get(resultDocID), resultDocID, collectionName )); 290 290 } //end while 291 if (NzdlPreferences.getInstance().getBoolean( Constants.DISPLAY_FIRST_DOC))291 if (NzdlPreferences.getInstance().getBoolean(NzdlConstants.DISPLAY_FIRST_DOC)) 292 292 resultsList.setSelectedIndex(0); 293 293 } // end else … … 337 337 StringReader sr = new StringReader(nzdl.getDocument(result.getCollectionName(), result.getDocID())); 338 338 339 if (NzdlPreferences.getInstance().getBoolean( Constants.RAW_TEXT))339 if (NzdlPreferences.getInstance().getBoolean(NzdlConstants.RAW_TEXT)) 340 340 // display the document as raw text 341 341 displayAsRawText(sr); -
trunk/java-client/org/nzdl/gsdl/service/NzdlMultiWayWrapper.java
r2269 r2270 38 38 39 39 /** 40 * A NzdlMultiWayWrapper multiple NzdlServices 40 * A NzdlMultiWayWrapper is a wrapper around multiple NzdlServices. 41 * It attempts to connect to as many servers as possible and present 42 * them to the user a single collection. 43 * 44 * When two collections are found to be the same, then only the 45 * collection with the fastest response time for a getCollectionInfo() 46 * call is added. 41 47 * 42 48 * @author Brett Sheeran ([email protected]) (comments) 43 49 * @author Stuart Yeates ([email protected]) 50 * @see org.nzdl.gsdl.service.NzdlCollectionInfo 44 51 * @version $Revision$ 45 52 */ … … 66 73 super(null); 67 74 services = new Hashtable(); 68 75 76 NzdlPreferences.saving = false; 77 69 78 Hashtable servers = NzdlServiceFactory.findIORs(_args,_props,_URL,_filename,_IOR); 70 79 … … 135 144 136 145 NzdlService oldServer = (NzdlService) services.get( "" + j ); 146 Date startOld = new Date(); 137 147 NzdlCollectionInfo oldColl = oldServer.getCollectionInfo(coll); 148 Date endOld = new Date(); 149 Date startNew = new Date(); 138 150 NzdlCollectionInfo newColl = server.getCollectionInfo(coll); 151 Date endNew = new Date(); 139 152 140 153 if (oldColl.getBuildDate() == newColl.getBuildDate() && … … 143 156 oldColl.getNumOfBytes() == newColl.getNumOfBytes() && 144 157 oldColl.isPublic() == newColl.isPublic() ) 145 hit = true; 158 { 159 if ((endOld.getTime() - startOld.getTime()) > 160 (endNew.getTime() - startNew.getTime())) 161 { 162 results.remove(oldcollname); 163 results.add(collname); 164 } 165 } 166 hit = true; 146 167 } 147 168 } -
trunk/java-client/org/nzdl/gsdl/util/NzdlConstants.java
r2259 r2270 42 42 int DEFAULT_MAX_DOCS = 200; 43 43 44 /* Preference Strings */ 45 46 String DISPLAY_FIRST_DOC = "Automatically display the first document"; 47 String RAW_TEXT = "Always display raw text (don't interpret HTML)"; 48 String MULTIPLE_SERVERS = "Connect to multiple servers"; 49 String LOG_SERVICE = "Log at the NzdlService level"; 50 String CACHE_CORBA = "Cache corba requests"; 51 String SAVE_DOCS = "Save documents"; 52 44 53 /* these appear to have been generated by 45 54 the idlj compiler but not any more - so -
trunk/java-client/org/nzdl/gsdl/util/NzdlPreferences.java
r2217 r2270 37 37 /** The hashtable we write to disk ... */ 38 38 protected Properties _preferences = null; 39 /** 40 * Should we save the preferences? Should normally be true for 41 * GUI work and false for commandline and/or server work. 42 */ 43 public static boolean saving = true; 44 /** The singleton instance */ 39 45 static NzdlPreferences instance = null; 40 46 static String preferencesFileName = "preferences"; … … 50 56 } 51 57 } 58 52 59 public void save() { 60 if (!saving) 61 return; 53 62 try { 54 63 File file = new File(preferencesFileName);
Note:
See TracChangeset
for help on using the changeset viewer.